/* =====================================================================
   DailyFeedNow — front page
   ---------------------------------------------------------------------
   Self-contained. Uses a dfn- prefix so nothing here collides with
   main.css, which still styles the rest of the site. Loaded only on
   the front page (see dailyfeednow_assets in functions.php).
   ===================================================================== */

.dfn {
    --ink: #171b26;
    --paper: #ffffff;
    --band: #eef1f5;
    --rule: #e3e7ee;
    --muted: #5a6472;
    --red: #e11d2e;

    --shell: 1240px;
    --gap: 32px;

    --serif: "Newsreader", Georgia, "Times New Roman", serif;
    --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

    font-family: var(--sans);
    color: var(--ink);
    background: var(--paper);

    /* The grid below sizes off this element's own width, so a narrow
       wrapper collapses the rail instead of crushing the main column. */
    container-type: inline-size;
    container-name: dfn;
}

.dfn *,
.dfn *::before,
.dfn *::after {
    box-sizing: border-box;
}

.dfn a {
    color: inherit;
    text-decoration: none;
}

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

.dfn-shell {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 24px;
}

.dfn :focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
}


/* ---------------------------------------------------------------
   Page frame: main column + rail
   --------------------------------------------------------------- */

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

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

.dfn-rail {
    border-left: 1px solid var(--rule);
    padding-left: 32px;
}


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

.dfn-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--red);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

.dfn-meta {
    display: flex;
    gap: 14px;
    color: var(--muted);
    font-size: 13px;
}

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

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

.dfn-rule a {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.dfn-rule a:hover {
    color: var(--red);
}


/* ---------------------------------------------------------------
   Lead block
   --------------------------------------------------------------- */

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

.dfn-lead-figure {
    margin-bottom: 18px;
    background: var(--band);
}

.dfn-lead-figure img {
    width: 100%;
    aspect-ratio: 16 / 8;
    object-fit: cover;
}

.dfn-lead h1 {
    max-width: 20ch;
    margin: 0 0 12px;
    font-family: var(--serif);
    font-size: clamp(30px, 3.4vw, 49px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -1px;
    text-wrap: balance;
}

.dfn-lead h1 a:hover {
    color: var(--red);
}

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

.dfn-seconds {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 30px;
    padding-top: 26px;
    border-top: 1px solid var(--rule);
}

.dfn-second img {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 12px;
    object-fit: cover;
    border-radius: 3px;
}

.dfn-second h3 {
    margin: 0 0 8px;
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -0.3px;
}

.dfn-second h3 a:hover {
    color: var(--red);
}


/* ---------------------------------------------------------------
   Category sections — list rows
   --------------------------------------------------------------- */

.dfn-block {
    margin-top: 40px;
}

.dfn-rows {
    display: grid;
    gap: 0;
}

.dfn-row {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--rule);
}

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

.dfn-row img {
    width: 128px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 3px;
}

.dfn-row-body {
    align-self: center;
}

.dfn-row h3 {
    margin: 0 0 6px;
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.26;
    letter-spacing: -0.2px;
}

.dfn-row h3 a:hover {
    color: var(--red);
}

.dfn-row p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Explainers read as a text index — no images, tighter */

.dfn-index {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 36px;
}

.dfn-index-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
}

.dfn-index-item h3 {
    margin: 0 0 5px;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.28;
}

.dfn-index-item h3 a:hover {
    color: var(--red);
}


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

.dfn-module {
    margin-bottom: 28px;
}

.dfn-module-head {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ink);
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 600;
}

.dfn-tool {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--rule);
}

.dfn-tool-glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--band);
    font-size: 14px;
}

.dfn-tool-name {
    font-size: 15px;
    font-weight: 500;
}

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

.dfn-tool:hover .dfn-tool-name {
    color: var(--red);
}

.dfn-signup {
    padding: 22px;
    background: var(--ink);
    color: var(--paper);
    border-radius: 4px;
}

.dfn-signup h3 {
    margin: 0 0 8px;
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
}

.dfn-signup p {
    margin: 0 0 16px;
    color: #b9c0cc;
    font-size: 14px;
    line-height: 1.5;
}

/* main.css lays .newsletter-form out as a flex row. The rail version
   stacks instead, so reset the display here. The class has to stay —
   the subscribe script and the AJAX handler both expect it. */

.dfn-signup .newsletter-form {
    display: block;
}

.dfn-signup input {
    width: 100%;
    margin-bottom: 9px;
    padding: 11px 13px;
    border: 1px solid #39404f;
    border-radius: 3px;
    background: #20252f;
    color: var(--paper);
    font-family: inherit;
    font-size: 14px;
    flex: none;
}

.dfn-signup input::placeholder {
    color: #7b8493;
}

.dfn-signup input:focus {
    outline: none;
    border-color: var(--red);
}

.dfn-signup button {
    width: 100%;
    padding: 11px;
    border: 0;
    border-radius: 3px;
    background: var(--red);
    color: var(--paper);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex: none;
}

.dfn-signup small {
    display: block;
    margin-top: 10px;
    color: #7b8493;
    font-size: 12px;
}

.dfn-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

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

.dfn-chips a {
    padding: 6px 12px;
    border: 1px solid var(--rule);
    border-radius: 3px;
    color: var(--muted);
    font-size: 13px;
}

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


/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */

@media (max-width: 1100px) {

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

    .dfn-rail {
        margin-top: 44px;
        padding-top: 32px;
        padding-left: 0;
        border-left: 0;
        border-top: 2px solid var(--ink);
    }

    .dfn-rail-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 28px;
        align-items: start;
    }
}

@media (max-width: 720px) {

    .dfn-shell {
        padding: 0 16px;
    }

    .dfn-page {
        padding: 22px 0 48px;
    }

    .dfn-lead h1 {
        font-size: 31px;
        letter-spacing: -0.8px;
    }

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

    .dfn-seconds,
    .dfn-index,
    .dfn-rail-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

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

    .dfn-row img {
        width: 96px;
    }

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

    .dfn-row p {
        display: none;
    }

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

@media (prefers-reduced-motion: reduce) {

    .dfn * {
        transition: none !important;
    }
}

/* ---------------------------------------------------------------
   Container-width fallbacks
   Mirrors the media queries above, but keyed to .dfn's own width.
   If a wrapper, plugin or theme setting constrains the page, the
   rail drops below instead of squeezing the article column.
   --------------------------------------------------------------- */

@container dfn (max-width: 1100px) {

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

    .dfn-rail {
        margin-top: 44px;
        padding-top: 32px;
        padding-left: 0;
        border-left: 0;
        border-top: 2px solid var(--ink);
    }

    .dfn-rail-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 28px;
        align-items: start;
    }
}

@container dfn (max-width: 760px) {

    .dfn-seconds,
    .dfn-index,
    .dfn-rail-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

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

    .dfn-row img {
        width: 96px;
    }

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