/* ============================================================
   CARDS — the blocks the front page and a category page share:
   the page width, a section's head, the kicker, the lead with the
   three newest beside it, and the row of photo cards.
   Loaded on is_front_page() and is_category() (inc/enqueue.php),
   before front-page.css / category.css. Nothing here names a colour
   of its own; a card's dot reads --card-color.
   ============================================================ */

.home-wrap {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.home-section {
    padding: clamp(40px, 5vw, 72px) 0 0;
}

.home-section--tight {
    padding-top: clamp(32px, 4vw, 56px);
}

/* A section's head: H2 and a line on the left, "all" on the right. */
.home-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 24px;
    flex-wrap: wrap;
    margin-bottom: clamp(18px, 2.4vw, 28px);
}

.home-head h2 {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.08;
    color: var(--c-ink);
    margin: 0;
}

.home-head p {
    margin: 6px 0 0;
    max-width: 70ch;
    color: var(--c-ink-faint);
}

.home-more {
    font-weight: 600;
    white-space: nowrap;
    color: var(--c-ink);
    text-decoration: none;
    border-bottom: 2px solid var(--c-signal);
    padding-bottom: 1px;
}

.home-more:hover {
    color: var(--c-accent);
}

.home-label {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--c-ink-faint);
}

.home-kicker {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    color: var(--c-ink-faint);
}

.home-kicker i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--card-color, var(--c-accent));
    flex: none;
}

/* ------------------------------------------------------------
   The lead and the three newest beside it
   ------------------------------------------------------------ */
.home-top__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 28px;
}

.home-lead {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 520px;
    border-radius: 20px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    background: var(--c-night);
}

.home-lead img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.home-lead:hover img {
    transform: scale(1.03);
}

.home-lead::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, transparent 35%, rgba(10, 18, 32, 0.88));
}

.home-lead__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: clamp(20px, 3vw, 32px);
}

.home-lead__tag {
    align-self: flex-start;
    background: var(--card-color, var(--c-accent));
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 4px 9px;
}

.home-lead__title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.2vw, 2.8rem);
    font-weight: 700;
    line-height: 1.05;
    max-width: 22ch;
}

.home-lead:hover .home-lead__title {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
}

.home-lead__text {
    max-width: 56ch;
    color: rgba(255, 255, 255, 0.85);
}

.home-lead__meta {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.78);
}

.home-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.home-side__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.home-side__list li {
    flex: 1;
    display: flex;
}

.home-side__card {
    flex: 1;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    background: var(--c-surface);
    color: var(--c-ink);
    text-decoration: none;
    transition: box-shadow 0.25s, transform 0.25s;
}

.home-side__card:hover {
    box-shadow: 0 12px 26px var(--c-shadow);
    transform: translateY(-2px);
}

.home-side__photo {
    display: block;
    height: 100%;
    min-height: 96px;
    border-radius: 11px;
    overflow: hidden;
    background: var(--c-surface-tint);
}

.home-side__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-side__text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.home-side__title {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.18;
}

.home-side__card:hover .home-side__title {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.home-side .home-more {
    align-self: flex-start;
}

/* ------------------------------------------------------------
   The row of photo cards
   ------------------------------------------------------------ */
.home-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--c-ink);
    text-decoration: none;
}

.home-card__photo {
    display: block;
    aspect-ratio: 16 / 10;
    margin-bottom: 4px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--c-surface-tint);
}

.home-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.home-card:hover .home-card__photo img {
    transform: scale(1.05);
}

.home-card__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.15;
}

.home-card:hover .home-card__title {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* ------------------------------------------------------------
   Narrow screens
   ------------------------------------------------------------ */
@media (max-width: 1100px) {
    .home-top__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-lead {
        min-height: 420px;
    }

    .home-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .home-lead {
        min-height: 340px;
    }

    .home-lead::before {
        background: linear-gradient(180deg, rgba(10, 18, 32, 0.15) 10%, rgba(10, 18, 32, 0.92) 60%);
    }

    .home-lead__text {
        display: none;
    }

    .home-lead__title {
        font-size: 1.6rem;
    }

    .home-side__card {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .home-side__title {
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-lead img,
    .home-card__photo img {
        transition: none;
    }
}
