/* Wide layout and typography for NewsReader pages with the school news archive. */
body.page #main:has(#dize-school-news) {
    --dsn-school-sans: "DM Sans", system-ui, sans-serif;
    --dsn-school-display: "Barlow Semi Condensed", "DM Sans", system-ui, sans-serif;
    --dsn-school-title-size: clamp(2.375rem, 4.25vw, 3.75rem);
    --dsn-school-logo-size: clamp(8rem, 16vw, 13rem);
}

/* NewsReader uses this width for both its page-title row and page body. */
@media (min-width: 992px) {
    body.page #main:has(#dize-school-news) {
        --cs-entry-content-large-width: min(100%, max(calc(86vw - 120px), calc(100vw - 500px)));
    }

    body.page #main:has(#dize-school-news) .cs-entry__header-standard {
        margin-block-start: clamp(2rem, 3vw, 3.25rem);
    }

    body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__grid {
        gap: 1.75rem clamp(.75rem, 1.2vw, 1.25rem);
    }
}

body.page #main:has(#dize-school-news) h1.cs-entry__title {
    font-family: var(--dsn-school-display);
    font-size: var(--dsn-school-title-size);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -.025em;
    text-align: start;
    text-wrap: balance;
}

body.page #main:has(#dize-school-news) .entry-content {
    font-family: var(--dsn-school-sans);
    font-size: clamp(1rem, .96rem + .24vw, 1.125rem);
    font-weight: 400;
    line-height: 1.68;
    letter-spacing: normal;
}

body.page #main:has(#dize-school-news) .entry-content > p {
    max-inline-size: 88ch;
    margin-block: .85rem;
}

body.page #main:has(#dize-school-news) .entry-content > p:first-of-type {
    margin-block-start: 0;
    color: var(--cs-color-secondary, currentColor);
    font-size: 1rem;
    line-height: 1.55;
}

body.page #main:has(#dize-school-news) .entry-content > p:first-of-type a {
    color: var(--cs-color-title, currentColor);
    background-image: none;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: .18em;
}

body.page #main:has(#dize-school-news) .entry-content > h2 {
    margin-block: 1.6rem .65rem;
    font-family: var(--dsn-school-sans);
    font-size: clamp(1.35rem, 1.18rem + .55vw, 1.7rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
}

body.page #main:has(#dize-school-news) #dize-school-news {
    margin-block-start: clamp(1.75rem, 3.25vw, 3.25rem);
    padding-block-start: clamp(1rem, 2vw, 1.65rem);
    border-block-start: 1px solid var(--cs-color-border, currentColor);
    font-family: var(--dsn-school-sans, "DM Sans", system-ui, sans-serif);
}

@media (min-width: 768px) {
    body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__layout {
        grid-template-columns: clamp(10rem, 18%, 15rem) minmax(0, 1fr);
        column-gap: clamp(1.125rem, 2.25vw, 2rem);
    }

    body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__filters li {
        margin-block-end: .15rem;
        border-block-end: 0;
    }
}

/* NewsReader's inline link underline can span an entire filter or card. */
body.page #main:has(#dize-school-news) #dize-school-news a {
    background-image: none;
}

body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__filters a {
    border-radius: .5rem;
    font-size: .9375rem;
    font-weight: 700;
}

body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__filters a:hover:not([aria-current]) {
    background-color: var(--cs-layout-background, transparent);
}

body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__image {
    margin-block-end: .75rem;
    border-radius: .55rem;
}

body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__title {
    font-family: var(--dsn-school-sans, "DM Sans", system-ui, sans-serif);
    font-size: clamp(1rem, .91rem + .27vw, 1.14rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.02em;
}

body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__date {
    font-size: .8125rem;
    line-height: 1.45;
}

body.page #main:has(#dize-school-news) .entry-content > .dize-school-page-logo {
    inline-size: min(30vw, 8rem);
    margin: 0 0 1rem;
}

body.page #main:has(#dize-school-news) .dize-school-page-logo .dize-school-logo {
    display: block;
    inline-size: 100%;
    block-size: auto;
    aspect-ratio: 1;
    object-fit: contain;
    margin: 0;
}

@media (min-width: 992px) {
    body.page #main:has(#dize-school-news):has(.entry-content > .dize-school-page-logo) h1.cs-entry__title {
        padding-inline-end: calc(var(--dsn-school-logo-size) + 3rem);
    }

    body.page #main:has(#dize-school-news) .entry-content > .dize-school-page-logo {
        float: inline-end;
        inline-size: var(--dsn-school-logo-size);
        margin-block-start: calc(-1.12 * var(--dsn-school-title-size));
        margin-inline: 2rem clamp(0rem, 3vw, 3rem);
    }

    body.page #main:has(#dize-school-news) .entry-content > .dize-school-page-logo ~ :is(h2, #dize-school-news) {
        clear: both;
    }
}

body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__filters {
    border: 1px solid var(--cs-color-border, #d9d9d9);
    border-radius: .65rem;
    padding: .375rem;
}

body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__filters a[aria-current="true"] {
    color: #10241b;
    background-color: var(--cs-color-button, #00bd6e);
    text-decoration: none;
}

/* Large desktop: target 250px gutters; smaller desktops retain usable width. */
@media (min-width: 1600px) {
    body.page #main:has(#dize-school-news) {
        --cs-entry-content-large-width: min(100%, calc(100vw - 500px));
    }
}

/* Keep thumbnails comfortably sized when the desktop content area is narrower. */
@media (min-width: 992px) and (max-width: 1799px) {
    body.page #main:has(#dize-school-news) #dize-school-news .dize-school-news__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* A shortcode inside a paragraph must not inherit the 88ch prose limit. */
body.page #main:has(#dize-school-news) .entry-content > p:has(.dize-school-about),
body.page #main:has(#dize-school-news) .entry-content > .wp-block-shortcode:has(.dize-school-about) {
    width: 100%;
    max-width: none;
    max-inline-size: none;
    clear: both;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}
