/* =====================================================================
   DailyFeedNow — front page
   ---------------------------------------------------------------------
   Homepage-only layout (loaded only on the front page, see
   dailyfeednow_assets in functions.php). Uses the same tokens as
   main.css, so colours and type always match the rest of the site.
   ===================================================================== */

.dfn {
    background: var(--dfn-surface);
    container-type: inline-size;
    container-name: dfn;
}

.dfn img {
    display: block;
    max-width: 100%;
    height: auto;
}

.dfn-shell {
    width: min(var(--dfn-container), calc(100% - (var(--dfn-gutter) * 2)));
    margin-inline: auto;
}


/* ---------------------------------------------------------------
   Page frame: intro across the top, then main column + rail
   --------------------------------------------------------------- */

.dfn-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 0 56px;
    padding: 0 0 80px;
}

.dfn-main {
    min-width: 0;
}

.dfn-rail {
    min-width: 0;
    padding-top: 4px;
}


/* ---------------------------------------------------------------
   Intro (the page H1)
   --------------------------------------------------------------- */

.dfn-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-column: 1 / -1;
    align-items: end;
    gap: 6px 24px;
    margin-bottom: 36px;
    padding: 40px 0 28px;
    border-bottom: 1px solid var(--dfn-line);
}

.dfn-intro-title {
    grid-column: 1;
    margin: 0;
    font-family: var(--dfn-serif);
    font-size: clamp(32px, 4.4vw, 50px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.dfn-intro-title span {
    color: var(--dfn-brand);
    font-style: italic;
}

.dfn-intro-sub {
    grid-column: 1;
    margin: 6px 0 0;
    color: var(--dfn-muted);
    font-size: 16px;
}

.dfn-intro-date {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: end;
    color: var(--dfn-subtle);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}


/* ---------------------------------------------------------------
   Shared bits
   --------------------------------------------------------------- */

.dfn-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--dfn-brand-ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dfn-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 0;
    color: var(--dfn-subtle);
    font-size: 13px;
}

.dfn-meta > * + *::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 3px;
    margin: 0 9px 3px;
    vertical-align: middle;
    background: currentColor;
    border-radius: 50%;
}

.dfn h2 a,
.dfn h3 a {
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0 1px;
    transition: background-size 0.3s var(--dfn-ease), color 0.2s;
}

.dfn h2 a:hover,
.dfn h3 a:hover {
    background-size: 100% 1px;
}


/* ---------------------------------------------------------------
   Lead story + two seconds
   --------------------------------------------------------------- */

.dfn-lead {
    padding-bottom: 40px;
    border-bottom: 1px solid var(--dfn-line);
}

.dfn-lead-figure {
    margin: 0 0 22px;
    overflow: hidden;
    background: var(--dfn-soft);
    border-radius: var(--dfn-radius-lg);
    aspect-ratio: 16 / 9;
}

.dfn-lead-figure a,
.dfn-lead-figure img {
    display: block;
    width: 100%;
    height: 100%;
}

.dfn-lead-figure img {
    object-fit: cover;
    transition: transform 0.6s var(--dfn-ease);
}

.dfn-lead-figure:hover img {
    transform: scale(1.025);
}

.dfn-lead > h2 {
    max-width: 24ch;
    margin: 0 0 12px;
    font-family: var(--dfn-serif);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.dfn-standfirst {
    max-width: 62ch;
    margin: 0 0 14px;
    color: var(--dfn-muted);
    font-size: 18px;
    line-height: 1.55;
}

.dfn-seconds {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--dfn-line);
}

.dfn-second {
    min-width: 0;
}

.dfn-second-thumb {
    display: block;
    margin-bottom: 14px;
    overflow: hidden;
    background: var(--dfn-soft);
    border-radius: var(--dfn-radius);
    aspect-ratio: 16 / 10;
}

.dfn-second-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--dfn-ease);
}

.dfn-second:hover .dfn-second-thumb img {
    transform: scale(1.035);
}

.dfn-second h3 {
    margin: 0 0 10px;
    font-family: var(--dfn-serif);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -0.015em;
}


/* ---------------------------------------------------------------
   Section blocks
   --------------------------------------------------------------- */

.dfn-block {
    padding-top: 44px;
}

.dfn-rule {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--dfn-ink);
}

.dfn-rule h2 {
    margin: 0;
    font-family: var(--dfn-serif);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.dfn-rule a {
    flex-shrink: 0;
    color: var(--dfn-brand-ink);
    font-size: 14px;
    font-weight: 600;
}

.dfn-rule a::after {
    content: " →";
    display: inline-block;
    transition: transform 0.2s var(--dfn-ease);
}

.dfn-rule a:hover::after {
    transform: translateX(3px);
}

/* Explainers: numbered two-column index */
.dfn-index {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 32px;
    counter-reset: dfn-index;
}

.dfn-index-item {
    position: relative;
    padding: 16px 0 16px 48px;
    border-bottom: 1px solid var(--dfn-line);
    counter-increment: dfn-index;
}

.dfn-index-item::before {
    content: counter(dfn-index, decimal-leading-zero);
    position: absolute;
    top: 14px;
    left: 0;
    color: var(--dfn-brand);
    font-family: var(--dfn-serif);
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
}

.dfn-index-item h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

/* Topic rows: thumbnail + text */
.dfn-rows {
    display: grid;
}

.dfn-row {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 22px;
    padding: 20px 0;
    border-bottom: 1px solid var(--dfn-line);
}

.dfn-row:first-child {
    padding-top: 4px;
}

.dfn-row:last-child {
    border-bottom: 0;
}

.dfn-row:not(:has(.dfn-row-thumb)) {
    grid-template-columns: minmax(0, 1fr);
}

.dfn-row-thumb {
    display: block;
    overflow: hidden;
    background: var(--dfn-soft);
    border-radius: var(--dfn-radius);
    aspect-ratio: 4 / 3;
}

.dfn-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--dfn-ease);
}

.dfn-row:hover .dfn-row-thumb img {
    transform: scale(1.04);
}

.dfn-row-body {
    min-width: 0;
}

.dfn-row-body h3 {
    margin: 0 0 8px;
    font-family: var(--dfn-serif);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -0.015em;
}

.dfn-row-body p {
    margin: 0 0 10px;
    color: var(--dfn-muted);
    font-size: 15px;
    line-height: 1.6;
}


/* ---------------------------------------------------------------
   Rail
   --------------------------------------------------------------- */

.dfn-rail-grid {
    display: grid;
    gap: 28px;
}

.dfn-module {
    min-width: 0;
}

.dfn-module-head {
    margin: 0 0 12px;
    padding-bottom: 10px;
    color: var(--dfn-ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--dfn-ink);
}

.dfn-tool {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    margin: 0 -10px;
    border-radius: var(--dfn-radius-sm);
    transition: background-color 0.2s;
}

.dfn-tool:hover {
    background: var(--dfn-soft);
}

.dfn-tool-glyph {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--dfn-brand-ink);
    font-size: 18px;
    font-weight: 700;
    background: var(--dfn-brand-soft);
    border-radius: 10px;
}

.dfn-tool-name {
    display: block;
    color: var(--dfn-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.dfn-tool-note {
    display: block;
    color: var(--dfn-muted);
    font-size: 13px;
    line-height: 1.4;
}

.dfn-signup {
    padding: 26px 24px;
    color: #fff;
    background:
        radial-gradient(320px 160px at 100% 0%, rgba(225, 29, 46, 0.4), transparent 65%),
        var(--dfn-ink);
    border-radius: var(--dfn-radius-lg);
    scroll-margin-top: 140px;
}

.dfn-signup h3 {
    margin: 0 0 8px;
    color: #fff;
    font-family: var(--dfn-serif);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.15;
}

.dfn-signup > p {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.55;
}

.dfn-signup .newsletter-form {
    flex-direction: column;
}

.dfn-signup .newsletter-form input[type="email"] {
    height: 46px;
    border-color: transparent;
}

.dfn-signup .newsletter-form button {
    width: 100%;
    height: 46px;
}

.dfn-signup small {
    display: block;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
}

.dfn-signup .newsletter-message.is-success {
    color: #75e0a7;
}

.dfn-signup .newsletter-message.is-error {
    color: #fda29b;
}

.dfn-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dfn-chips a {
    padding: 6px 12px;
    color: var(--dfn-text);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--dfn-line);
    border-radius: var(--dfn-pill);
    transition: border-color 0.2s, color 0.2s;
}

.dfn-chips a:hover {
    color: var(--dfn-brand-ink);
    border-color: var(--dfn-brand);
}


/* ---------------------------------------------------------------
   Responsive (container queries, with media-query fallback)
   --------------------------------------------------------------- */

@media (max-width: 1060px) {

    .dfn-page {
        grid-template-columns: minmax(0, 1fr);
    }

    .dfn-rail {
        margin-top: 48px;
        padding-top: 40px;
        border-top: 1px solid var(--dfn-line);
    }

    .dfn-rail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
    }

    .dfn-rail-grid > .dfn-module:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {

    .dfn-intro {
        grid-template-columns: minmax(0, 1fr);
        padding: 28px 0 22px;
        margin-bottom: 24px;
    }

    .dfn-intro-date {
        grid-column: 1;
        grid-row: auto;
        order: -1;
    }

    .dfn-lead-figure {
        margin-left: calc(var(--dfn-gutter) * -1);
        margin-right: calc(var(--dfn-gutter) * -1);
        border-radius: 0;
    }

    .dfn-standfirst {
        font-size: 16px;
    }

    .dfn-seconds,
    .dfn-index,
    .dfn-rail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dfn-row {
        grid-template-columns: minmax(0, 1fr) 112px;
        gap: 14px;
    }

    .dfn-row-thumb {
        grid-column: 2;
        grid-row: 1;
        aspect-ratio: 1 / 1;
    }

    .dfn-row-body {
        grid-column: 1;
        grid-row: 1;
    }

    .dfn-row-body h3 {
        font-size: 18px;
    }

    .dfn-row-body p {
        display: none;
    }

    .dfn-rule h2 {
        font-size: 24px;
    }
}
