/*
 * Standard page presentation.
 *
 * The masthead and content frame reuse the homepage's chart-cut geometry,
 * navy water palette and orange signal colour without changing page content.
 */

.subpage-hero,
.subpage-page,
.subpage-breadcrumbs {
    --page-navy: #09283c;
    --page-navy-deep: #071e2f;
    --page-ink: #172536;
    --page-muted: #5d6876;
    --page-paper: #ffffff;
    --page-mist: #f8fafc;
    --page-line: #d7e0e6;
    --page-signal: #bd4b1d;
    --page-signal-bright: #ef7b45;
    --page-shell-max: 90rem;
    --page-hero-overlay-max: 52rem;
    --page-hero-photo-reveal: clamp(10rem, calc(20vw + 5rem), 28rem);
}

.subpage-shell {
    width: min(calc(100% - clamp(2.5rem, 8vw, 9rem)), var(--page-shell-max));
    margin-inline: auto;
}

/* Page masthead */
.subpage-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: clamp(290px, 29vw, 390px);
    align-items: flex-end;
    overflow: hidden;
    border-bottom: 3px solid var(--page-signal-bright);
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(118deg, var(--page-navy-deep) 0 57%, #0e354b 57% 69%, #15445b 69% 100%);
    background-size: 42px 42px, 42px 42px, auto;
    color: #fff;
}

/* Keep the graphic masthead compact without constraining its content. The
   photographic variant retains the more generous shared proportions below. */
.subpage-hero:not(.subpage-hero--image) {
    min-height: clamp(230px, 22vw, 300px);
}

/* A restrained chart trace gives pages without photography a deliberate
   graphic header. It is the static counterpart to the water moving through
   the homepage hero, not a second visual language. */
.subpage-hero:not(.subpage-hero--image)::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 78% 62%, transparent 0 92px, rgba(255, 255, 255, 0.13) 93px 94px, transparent 95px 138px, rgba(255, 255, 255, 0.08) 139px 140px, transparent 141px),
        linear-gradient(132deg, transparent 0 61%, rgba(239, 123, 69, 0.16) 61% 61.35%, transparent 61.35% 100%);
    content: "";
    pointer-events: none;
}

.subpage-hero::after {
    position: absolute;
    right: -8%;
    bottom: -52%;
    z-index: -1;
    width: min(52vw, 720px);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    content: "";
}

.subpage-hero__media {
    position: absolute;
    inset: 0;
    z-index: -3;
}

.subpage-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 46%;
}


.subpage-hero__shade {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(110deg, transparent 0 62%, rgba(64, 139, 157, 0.2) 62% 100%);
}

.subpage-hero--image .subpage-hero__shade {
    right: auto;
    width: min(var(--page-hero-overlay-max), calc(100% - var(--page-hero-photo-reveal)));
    background: rgba(7, 30, 47, 0.82);
    -webkit-mask-image: linear-gradient(110deg, #000 0%, #000 72%, transparent 84%);
    mask-image: linear-gradient(110deg, #000 0%, #000 72%, transparent 84%);
    pointer-events: none;
}

.subpage-hero__inner {
    padding-block: clamp(46px, 6vw, 78px);
}

/* Most of the reduction belongs above the heading; the larger trailing inset
   keeps a deliberate pause between the title and the breadcrumb rule. */
.subpage-hero:not(.subpage-hero--image) .subpage-hero__inner {
    padding-block: clamp(26px, 3vw, 42px) clamp(38px, 4vw, 52px);
}

.subpage-eyebrow {
    margin: 0 0 12px;
    color: #ffc3a4;
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.16em;
    line-height: 1.4;
    text-transform: uppercase;
}

.subpage-hero h1 {
    max-width: 18ch;
    margin: 0;
    color: #fff;
    font-size: clamp(2.55rem, 5.2vw, 4.8rem);
    font-weight: 720;
    letter-spacing: -0.055em;
    line-height: 0.98;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.subpage-hero--image h1 {
    max-width: min(14ch, 58vw);
    font-size: clamp(2.25rem, 4.7vw, 4.5rem);
}

/* Breadcrumb course line */
/* The wrapper must stick; the nav alone is constrained to its one-row parent. */
.subpage-breadcrumbs {
    position: sticky;
    top: var(--nav-bar-height);
    z-index: 500;
}

.subpage-breadcrumbs .breadcrumbs {
    position: static;
    margin: 0;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid var(--page-line);
    box-shadow: 0 1px 8px rgba(9, 40, 60, 0.04);
}

.subpage-breadcrumbs .breadcrumb-inner {
    width: min(calc(100% - clamp(2.5rem, 8vw, 9rem)), var(--page-shell-max));
    max-width: none;
    min-height: var(--breadcrumb-height);
    margin-inline: auto;
    padding: 0;
}

.subpage-breadcrumbs .breadcrumb-list {
    color: #697985;
    font-size: 0.78rem;
    font-weight: 550;
    letter-spacing: 0.01em;
}

.subpage-breadcrumbs .breadcrumb-item a {
    color: var(--page-signal);
}

.subpage-breadcrumbs .breadcrumb-item .current {
    color: #3f5361;
}

.subpage-breadcrumbs .breadcrumb-separator {
    color: #a4b1ba;
}

/* Content frame */
.subpage-page.site-main {
    min-height: 60vh;
    padding: clamp(28px, 3vw, 42px) 0 clamp(48px, 6vw, 76px);
    background: #fff;
}

.subpage-article {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.subpage-article__header {
    margin: 0 0 clamp(28px, 4vw, 46px);
    padding-bottom: 22px;
    border-bottom: 1px solid var(--page-line);
}

.subpage-article__header .entry-title {
    max-width: 18ch;
    margin: 0;
    color: var(--page-ink);
    font-size: clamp(2.1rem, 4vw, 3.6rem);
    letter-spacing: -0.045em;
    line-height: 1.02;
}

.subpage-page .post-thumbnail {
    margin: 0 0 clamp(28px, 4vw, 46px);
}

.subpage-page .post-thumbnail img,
.subpage-page .entry-content-body > figure img,
.subpage-page .entry-content-body > p > img {
    border-radius: 4px;
}

.subpage-page .entry-content {
    margin: 0;
}

.subpage-page .entry-content.page-content-with-sidebar {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 3rem;
}


.subpage-page .entry-content-body {
    min-width: 0;
    color: #333;
}

/* Lists and quotations retain a readable measure; paragraphs use the column. */
.subpage-page .entry-content-body > :is(ul, ol, blockquote) {
    max-width: 78ch;
}

.subpage-page .entry-content-body > :is(h2, h3, h4):first-child {
    margin-top: 0;
}

.subpage-page .entry-content-body > p:first-child {
    color: #354b59;
    font-size: clamp(1.04rem, 1.15vw, 1.14rem);
    line-height: 1.75;
    text-wrap: pretty;
}


.subpage-page .entry-content-body p,
.subpage-page .entry-content-body li {
    font-size: 1rem;
    line-height: 1.8;
}

.subpage-page .entry-content-body p {
    margin-block: 0 1.5rem;
}

.subpage-page .entry-content-body h2,
.subpage-page .entry-content-body h3,
.subpage-page .entry-content-body h4 {
    color: var(--page-ink);
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.subpage-page .entry-content-body h2 {
    margin: 2.2em 0 0.65em;
    font-size: clamp(1.55rem, 2.4vw, 2.15rem);
}

.subpage-page .entry-content-body h3 {
    margin: 1.8em 0 0.55em;
    font-size: clamp(1.22rem, 1.8vw, 1.55rem);
}

.subpage-page .entry-content-body a:not([class]) {
    color: #9f3f1a;
    text-decoration-color: rgba(159, 63, 26, 0.38);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

.subpage-page .entry-content-body a:not([class]):hover,
.subpage-page .entry-content-body a:not([class]):focus-visible {
    color: #742d12;
    text-decoration-color: currentColor;
}

.subpage-page .entry-content-body blockquote {
    margin: 2rem 0;
    padding: 1.1rem 1.35rem;
    background: #f3f7f9;
    border-left: 3px solid var(--page-signal);
    color: #354b59;
}

.subpage-page .entry-content-body table {
    width: 100%;
    border-collapse: collapse;
}

.subpage-page .entry-content-body th {
    background: var(--page-navy);
    color: #fff;
    text-align: left;
}

.subpage-page .entry-content-body th,
.subpage-page .entry-content-body td {
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--page-line);
}

/* Keep related links quiet and secondary, as in the original page layout. */
.subpage-page .page-see-also {
    top: calc(var(--nav-bar-height, 56px) + var(--breadcrumb-height, 49px) + 1.5rem);
    overflow: visible;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.subpage-page .see-also-heading {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin: 0 0 0.75rem;
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.subpage-page .see-also-heading::after {
    width: 28px;
    height: 1px;
    background: var(--page-line);
    content: "";
}

.subpage-page .see-also-list {
    border: 0;
    border-left: 2px solid #e5e7eb;
}

.subpage-page .see-also-list a {
    gap: 0.4rem;
    margin: 0 0 0 -2px;
    padding: 0.4rem 0.75rem;
    border: 0;
    border-left: 2px solid transparent;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.4;
}

.subpage-page .see-also-list a::after {
    content: none;
}

.subpage-page .see-also-list a:hover,
.subpage-page .see-also-list a:focus-visible {
    background: transparent;
    border-left-color: var(--page-signal-bright);
    color: var(--page-signal);
}

.subpage-page .see-also-description {
    color: #6b7280;
}

.subpage-page .entry-footer {
    margin-top: clamp(38px, 5vw, 60px);
    padding-top: 18px;
    border-top-color: var(--page-line);
}

.subpage-page .entry-last-modified {
    color: #798893;
    font-style: normal;
}

.subpage-page a:focus-visible,
.subpage-breadcrumbs a:focus-visible {
    outline: 3px solid #f29b75;
    outline-offset: 3px;
}

@media (max-width: 1180px) {
    .subpage-shell,
    .subpage-breadcrumbs .breadcrumb-inner {
        width: min(calc(100% - 3rem), var(--page-shell-max));
    }
}

@media (max-width: 899px) {
    .subpage-shell,
    .subpage-breadcrumbs .breadcrumb-inner {
        width: min(calc(100% - 2.5rem), var(--page-shell-max));
    }
}

@media (max-width: 900px) {
    .subpage-page .entry-content.page-content-with-sidebar {
        grid-template-columns: minmax(0, 1fr) 220px;
        gap: 34px;
    }
}

@media (max-width: 768px) {

    .subpage-hero {
        min-height: 250px;
        background-size: 34px 34px, 34px 34px, auto;
    }

    .subpage-hero:not(.subpage-hero--image) {
        min-height: 200px;
    }


    .subpage-hero__inner {
        padding-block: 38px;
    }

    .subpage-hero h1 {
        font-size: clamp(2.4rem, 13vw, 3.8rem);
    }

    .subpage-hero--image h1 {
        max-width: min(13ch, 58vw);
        font-size: clamp(2.25rem, 4.7vw, 3rem);
    }

    .subpage-breadcrumbs .breadcrumb-inner {
        min-height: 44px;
    }

    .subpage-breadcrumbs .breadcrumb-list {
        flex-wrap: nowrap;
        overflow: hidden;
        font-size: 0.74rem;
        white-space: nowrap;
    }

    .subpage-breadcrumbs .breadcrumb-item:last-child {
        min-width: 0;
        overflow: hidden;
    }

    .subpage-breadcrumbs .breadcrumb-item .current {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .subpage-page.site-main {
        padding: 24px 0 50px;
    }

    .subpage-page .entry-content.page-content-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 34px;
    }

    .subpage-page .page-see-also {
        position: static;
    }
}

@media (max-width: 600px) {
    .subpage-hero--image {
        min-height: clamp(310px, 82vw, 340px);
    }

    /* On a phone the photograph owns the whole masthead. Crossing bottom and
       left fades put opaque navy only behind the title, then release the image
       smoothly towards the top-right without reusing the desktop diagonal. */
    .subpage-hero--image .subpage-hero__shade {
        inset: 0;
        width: auto;
        height: auto;
        background:
            linear-gradient(0deg, rgba(7, 30, 47, 0.98) 0%, rgba(7, 30, 47, 0.78) 24%, rgba(7, 30, 47, 0.18) 54%, transparent 74%),
            linear-gradient(90deg, rgba(7, 30, 47, 0.9) 0%, rgba(7, 30, 47, 0.58) 42%, rgba(7, 30, 47, 0.12) 68%, transparent 88%);
        -webkit-mask-image: none;
        mask-image: none;
    }

    .subpage-hero--image .subpage-hero__inner {
        padding-block: clamp(30px, 7vw, 42px);
    }

    .subpage-hero--image h1 {
        max-width: min(16ch, 100%);
        font-size: clamp(2rem, 5.6vw, 2.25rem);
        line-height: 1;
    }
}

@media (max-width: 420px) {
    .subpage-shell,
    .subpage-breadcrumbs .breadcrumb-inner {
        width: min(calc(100% - 1.7rem), var(--page-shell-max));
    }

    .subpage-hero {
        min-height: 224px;
    }

    .subpage-hero:not(.subpage-hero--image) {
        min-height: 180px;
    }

    .subpage-hero--image {
        min-height: clamp(310px, 82vw, 340px);
    }

    .subpage-hero h1 {
        font-size: clamp(2.15rem, 9.4vw, 3.2rem);
    }

    .subpage-hero--image h1 {
        font-size: clamp(2rem, 5.6vw, 2.25rem);
    }


    .subpage-hero__inner {
        padding-block: 32px;
    }
}
