/* =========================================
   Variables
   ========================================= */
:root {
    --color-primary: #1a3a5c;
    --color-accent:  #F55C0A;
    --color-accent-hover: #d24b00;
    --color-text:    #222222;
    --color-muted:   #666666;
    --color-bg:      #ffffff;
    --color-light:   #f5f5f5;
    --color-border:  #e0e0e0;

    --font-sans: 'Georgia', serif;
    --font-ui:   'Nunito', system-ui, -apple-system, sans-serif;

    --max-width: 1200px;
    --spacing:   1.5rem;
}

/* =========================================
   Reset
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-ui); color: var(--color-text); background: var(--color-bg); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
h1, h2, h3, h4, h5, h6 { color: #0056B3; }
h2 { font-size: 2.5rem; } /* 40px at the default 16px root */

/* Utility: add this class to a block (Image, Cover, Group…) for a soft
   4px rounding. Works on the wrapper and any nested <img>. */
.rounded,
.rounded img { border-radius: 4px; }

/* =========================================
   Layout
   ========================================= */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* =========================================
   Header / Nav
   ========================================= */
.site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
    color: var(--menu-fg, #fff);
    background: transparent;
}

/* Push the site header below the WP admin bar when logged in. */
body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar .site-header { top: 46px; }
}

/* Scrim: only applied when the header sits over the home-template video.
   Other templates paint their own top band via --page-main. */
.page-template-home .site-header::before,
.home .site-header::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 180%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.45), rgba(0,0,0,0));
    pointer-events: none;
    z-index: -1;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    color: inherit;
    flex-shrink: 0;
}

.site-logo svg,
.site-logo__img {
    display: block;
    height: 64px;
    width: auto;
}

.primary-nav > ul {
    display: flex;
    gap: 3.5rem;
    align-items: center;
}

.primary-nav a {
    color: currentColor;
    opacity: 0.85;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s, opacity 0.2s;
}

.primary-nav a:hover {
    color: var(--color-accent);
    opacity: 1;
}

/* Submenu (dropdown) */
.primary-nav .menu-item-has-children {
    position: relative;
}

.primary-nav .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    margin-left: 0.5rem;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
    transition: transform 0.2s;
}

.primary-nav .menu-item-has-children.is-open > a::after {
    transform: translateY(1px) rotate(-135deg);
}

.primary-nav .sub-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    min-width: 240px;
    background: #fff;
    color: var(--color-primary);
    border-top: 4px solid var(--color-accent);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 0.5rem 0;
    display: none;
    flex-direction: column;
    z-index: 10;
}

.primary-nav .menu-item-has-children.is-open > .sub-menu {
    display: flex;
}

.primary-nav .sub-menu a {
    display: block;
    padding: 0.6rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-primary);
    opacity: 1;
    white-space: nowrap;
}

.primary-nav .sub-menu a:hover {
    color: var(--color-accent);
    background: rgba(0,0,0,0.03);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: inherit;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Open-state rules for the mobile overlay. Scoped to the same breakpoint as the
   overlay itself so that resizing to desktop while it is open cannot leave the
   page stuck with a recoloured header and a locked scroll. */
@media (max-width: 768px) {
    /* The hamburger becomes the X that closes the overlay: the outer bars travel
       7px each (2px bar + 5px gap) to meet in the middle, so no extra close
       button is needed in the markup. */
    body.nav-open .nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.nav-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.nav-open .nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* The overlay is brand blue, but --menu-fg is set per page and is often
       dark, which would leave the logo and the X invisible on top of it. */
    body.nav-open .site-header {
        color: #fff;
    }

    /* Hold the page still behind the overlay. */
    body.nav-open {
        overflow: hidden;
    }
}

/* =========================================
   Buttons
   ========================================= */
/* Gutenberg core wp:button blocks tagged with the `btn-primary` className
   in the editor inherit the theme's `.btn.btn--primary` pill so they look
   identical to hero/section buttons emitted in PHP. */
.btn,
.wp-block-button.btn-primary > .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 122px;
    height: 48px;
    padding: 8px 24px;
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 32px;
    letter-spacing: 0;
    border-radius: 8px;
    border: 2px solid #0056B3;
    background: transparent;
    color: #0056B3;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn--primary,
.wp-block-button.btn-primary > .wp-block-button__link {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.btn--primary:hover,
.wp-block-button.btn-primary > .wp-block-button__link:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: #fff;
}

.btn--outline {
    background: transparent;
    color: #0056B3;
    border-color: #0056B3;
}

.btn--outline:hover {
    background: #0056B3;
    color: #fff;
}

/* =========================================
   Section Titles
   ========================================= */
.section-title {
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 2rem;
}

/* =========================================
   Video-backed sections
   ========================================= */
.section-video-host {
    position: relative;
    overflow: hidden;
    color: #fff;
    display: flex;
    align-items: center;
    background: var(--color-primary); /* fallback while video loads */
}

.section-video-host > .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.section-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.section-video__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1;
}

/* =========================================
   Hero
   ========================================= */
.hero {
    min-height: 780px;
    padding: 8rem 0 4rem;
    text-align: center;
}

.hero__title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    max-width: 800px;
    margin: 0 auto 1.5rem;
    color: inherit; /* stay white over the hero video */
}

.hero__tagline {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.85);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

/* =========================================
   AAMAS Intro
   ========================================= */
.aamas-intro {
    min-height: 480px;
    padding: 5rem 0;
}

.aamas-intro__text {
    color: rgba(255,255,255,0.9);
    line-height: 1.8;
    max-width: 860px;
    margin-bottom: 1.5rem;
}

.aamas-intro__sub {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2rem;
}

.btn--on-dark {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.btn--on-dark:hover {
    background: #fff;
    color: var(--color-primary);
}

/* =========================================
   Solid template — title band + page content
   ========================================= */
.page-hero-solid {
    min-height: 440px;
    padding: 16rem 0 3rem ; /* top padding clears the absolute header */
    background: var(--page-main, var(--color-primary));
    color: #fff;
    display: flex;
    align-items: flex-start;
}

.page-hero-solid__title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
    color: var(--menu-fg, #fff);
}

.page-hero-solid__teaser {
    margin: 2rem 0 0;
    max-width: 720px;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--menu-fg, #fff);
}

/* Proceedings listing: the shared solid hero reserves a 440px band with 16rem
   of top padding, which leaves a large empty area under the title here. Trim it
   to just clear the absolute header (~6rem) and hug the title. */
.page-template-proceedings .page-hero-solid {
    min-height: 0;
    padding: 8rem 0 2.5rem;
}

/* The hero is a flex row and the container shrinks to its text, so margin:0 auto
   centers the title. Make it fill the band so "Proceedings" left-aligns with the
   conference list below. */
.page-template-proceedings .page-hero-solid .container {
    width: 100%;
}

/* The hero band already provides the gap above the conference list. */
.page-template-proceedings .page-content {
    padding-top: 0;
}

.page-content {
    /* Top padding is overridable per-page via the "Skip margin default header"
       field, which sets --page-content-pt:0 on <body>. Defaults to 5rem. */
    padding: var(--page-content-pt, 5rem) 0 5rem;
}

.page-content > * {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing);
    padding-right: var(--spacing);
}

.page-content > .alignwide {
    max-width: 1400px;
}

.page-content > .alignfull,
.home-content > .alignfull {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* Inside a full-width Group/Cover, keep inner blocks in a centered column
   so the background spans full-width but the text stays aligned with the
   rest of the page. */
.alignfull > .wp-block-group__inner-container > *,
.alignfull.wp-block-cover > .wp-block-cover__inner-container > * {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing);
    padding-right: var(--spacing);
}

/* Default vertical breathing room for every Group block. */
.wp-block-group {
    padding-top: 40px;
    padding-bottom: 40px;
}

/* Cover blocks tagged with the "coverimage" CSS class display their
   background image fully visible (no cropping) instead of the default
   cover-crop. */
.coverimage .wp-block-cover__image-background,
.coverimage video.wp-block-cover__video-background {
    object-fit: contain;
}

/* Columns block tagged with the "sponsorcolumns" CSS class pads each
   inner column so its content breathes from the column edges. */
.sponsorcolumns.wp-block-columns,
.wp-block-columns.sponsorcolumns {
    gap: 6rem;
}

.sponsorcolumns h1 {
    font-size: 40px;
}

.sponsorcolumns p,
.sponsorcolumns li {
    font-size: 18px;
}

.page-content p {
    line-height: 1.8;
    margin-bottom: 1.25rem;
    color: var(--color-text);
}

.page-content h2,
.page-content h3 {
    /* `auto` (not 0) for the horizontal margins so the heading's max-width
       box stays centered like every other `.page-content > *`, keeping it
       aligned with the content rather than the page edge on wide screens. */
    margin: 2rem auto 1rem;
    line-height: 1.3;
}

.page-content ul,
.page-content ol,
.home-content ul,
.home-content ol {
    list-style: revert;
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.page-content li,
.home-content li {
    line-height: 1.8;
    color: var(--color-text);
}

/* In-flow text links inside paragraphs and list items: brand blue underline.
   Nav, buttons, cards, and accordion-title links keep their own colors. */
.page-content p a,
.page-content li a,
.home-content p a,
.home-content li a {
    color: #0015FF;
    text-decoration: underline;
}

.page-content p a:hover,
.page-content li a:hover,
.home-content p a:hover,
.home-content li a:hover {
    text-decoration: none;
}

/* =========================================
   Dots template — transparent band, side-by-side title/teaser,
   decorative top-right image that scrolls with the page.
   ========================================= */
.site-main--dots {
    position: relative;
    overflow: hidden;
}

.page-dots__bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.page-dots__bg-layer > .container {
    position: relative;
    height: 100%;
}

.page-dots__bg {
    position: absolute;
    top: 0;
    left: 0;
    height: auto;
}

.page-hero-dots {
    min-height: 350px;
    padding: 12rem 0 3rem;
    background: transparent;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
}

.page-hero-dots .container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    width: 100%;
}

.page-hero-dots__title {
    flex: 1;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
    color: #0056B3;
}

/* When there is no teaser, the title spans the full width and is centered. */
.page-hero-dots .container:not(:has(.page-hero-dots__teaser)) {
    justify-content: center;
}

.page-hero-dots .container:not(:has(.page-hero-dots__teaser)) .page-hero-dots__title {
    text-align: center;
}

.page-hero-dots__teaser {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    color: #000;
}

.page-content--dots {
    position: relative;
    z-index: 1;
}

/* =========================================
   Home page — Gutenberg content after the hero
   ========================================= */
.home-content {
    padding: 2rem 0;
}

.home-content > * {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing);
    padding-right: var(--spacing);
}

.home-content > .alignwide {
    max-width: 1400px;
}

.home-content > .alignfull {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 768px) {
    .page-hero-dots .container {
        flex-direction: column;
        gap: 1.5rem;
    }
    .page-dots__bg {
        max-width: 240px;
    }
}

/* =========================================
   News
   ========================================= */
.news {
    padding: 4rem 0;
    background: #f5f6f7;
}

.news__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.news__header .section-title {
    margin: 0;
    color: #0056b3;
}

.news__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.news-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.news-card__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.news-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.news-card__media:hover .news-card__image {
    transform: scale(1.03);
}

.news-card__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
}

.news-card__title,
.news-card__title a {
    color: #0056b3;
}

.news-card__title a {
    text-decoration: none;
}

.news-card__title a:hover {
    text-decoration: underline;
}

.news-card__excerpt {
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}


/* --- News archive and single item (archive-news.php / single-news.php) --- */
/* The archive lays its cards out inside .page-content, not the home page's
   tinted .news band, so the column count is restated. Qualified with
   .page-content so it outranks the .news__grid breakpoints further down the
   file regardless of order. */
.page-content .news__grid--archive {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 1.5rem;
}

.page-content .news__grid--archive .news-card__title {
    font-size: 1.125rem;
}

/* Cards carry the whole story, so the body needs the same measure as ordinary
   copy — the_content() emits its own paragraphs. */
.news-card__body p {
    margin: 0 0 0.75rem;
    line-height: 1.7;
    color: var(--color-text);
}

.news-card__body p:last-child {
    margin-bottom: 0;
}

.news-card__body a {
    color: #0015FF;
    text-decoration: underline;
}

.page-content .navigation.pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.page-content .navigation.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 2px solid #0056B3;
    border-radius: 6px;
    color: #0056B3;
    font-weight: 700;
    text-decoration: none;
}

.page-content .navigation.pagination .page-numbers.current,
.page-content .navigation.pagination .page-numbers:hover {
    background: #0056B3;
    color: #fff;
}

.page-content .navigation.pagination .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 900px) {
    .page-content .news__grid--archive { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .page-content .news__grid--archive { grid-template-columns: 1fr; }
}


/* =========================================
   Purpose
   ========================================= */
.purpose {
    padding: 5rem 0;
    background: #fff;
    color: #000;
}

.purpose .section-title {
    color: #0056B3;
}

.purpose__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.purpose__item {
    padding-left: 1.25rem;
    border-left: 3px solid var(--color-accent);
    color: rgba(255,255,255,0.85);
    line-height: 1.7;
    font-size: 0.9375rem;
}

/* =========================================
   Contact
   ========================================= */
.contact {
    padding: 5rem 0;
    background: var(--color-light);
}

.contact__intro {
    color: var(--color-muted);
    margin-bottom: 2.5rem;
    max-width: 480px;
}

.contact-form {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    font-size: 0.9375rem;
    font-family: var(--font-ui);
    background: #fff;
    transition: border-color 0.2s;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaa;
}

/* =========================================
   Contact CTA (bottom of Home + About)
   ========================================= */
.contact-cta {
    padding: 5rem 0;
}

.contact-cta__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-cta__heading {
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 800;
    color: #0056B3;
    margin: 0;
}

/* CF7 form field wrappers */
.contact-cta .wpcf7-form > p {
    margin: 0;
}

.contact-cta .cf7-field {
    margin-bottom: 0.75rem;
}

.contact-cta .cf7-field--consent {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.contact-cta .cf7-field--consent .wpcf7-list-item {
    margin: 0;
}

.contact-cta .cf7-field--consent .wpcf7-list-item-label {
    font-size: 0.875rem;
    color: #000;
    line-height: 1.5;
}

.contact-cta input[type="text"],
.contact-cta input[type="email"],
.contact-cta textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background-color: #ececec;
    background-image: none;
    border: 0;
    border-radius: 2px;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    color: #000;
    opacity: 1;
    transition: box-shadow 0.2s;
}

.contact-cta input[type="text"]:focus,
.contact-cta input[type="email"]:focus,
.contact-cta textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px #0056B3;
}

.contact-cta input[type="text"]::placeholder,
.contact-cta input[type="email"]::placeholder,
.contact-cta textarea::placeholder {
    color: #888;
}

.contact-cta textarea {
    resize: vertical;
    min-height: 6rem;
}

.contact-cta input[type="submit"],
.contact-cta .wpcf7-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    background-color: var(--color-accent);
    background-image: none;
    color: #fff;
    border: 0;
    border-radius: 4px;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 1;
    cursor: pointer;
    transition: background-color 0.2s;
}

.contact-cta input[type="submit"]:hover,
.contact-cta .wpcf7-submit:hover {
    background: var(--color-accent-hover);
}

.contact-cta .wpcf7-spinner {
    margin-left: 0.75rem;
}

.contact-cta .wpcf7 form .wpcf7-response-output {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border-width: 2px;
}

@media (max-width: 768px) {
    .contact-cta__inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .contact-cta__heading {
        font-size: 1.75rem;
    }
}

/* =========================================
   Footer
   ========================================= */
.pre-footer {
    width: 100%;
    overflow: hidden;
    /* Slide the decorative image up under the preceding section. The pull has to
       track the image's height, and the image is width-driven (100% up to a
       1280px cap, 584x350 source), so a fixed -600px only holds at full width:
       narrower than that the image shrinks, the pull does not, and everything
       after it — including the black footer bar — gets dragged up into the
       content. -47vw is the same proportion (600/1280); max() keeps it at
       -600px once the image stops growing. */
    margin-top: max(-600px, -47vw);
    position: relative;
    z-index: 0;
    pointer-events: none;
}

.pre-footer__bg {
    display: block;
    width: 100%;
    max-width: 1280px;
    height: auto;
    margin: 0 auto;
    opacity: 0.08;
}

/* Keep page content stacked above the pre-footer so its last 200px
   overlay the top of the decorative image. */
.page-content,
.home-content,
.contact,
.contact-cta,
.purpose,
.news {
    position: relative;
    z-index: 1;
}

.site-footer {
    background: #000;
    color: #fff;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.875rem;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
    /* Full-screen overlay rather than a dropdown: 19 menu items do not fit under
       the header, hence overflow-y too. */
    .primary-nav {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: var(--color-primary);
        /* Clear the header: 64px logo + 1rem padding above and below. */
        padding: 6.5rem var(--spacing) 2.5rem;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    /* The admin bar is fixed over the top of the viewport at this width. */
    body.admin-bar .primary-nav {
        top: 46px;
    }

    /* .primary-nav is inside .site-header, which is positioned and so opens its
       own stacking context — the overlay's z-index is resolved against its
       siblings, not the page. Without lifting these two the overlay paints over
       the logo and over the X that closes it. */
    .site-logo,
    .nav-toggle {
        position: relative;
        z-index: 100;
    }

    .primary-nav.is-open {
        display: block;
    }

    .primary-nav > ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .primary-nav .sub-menu {
        position: static;
        background: transparent;
        box-shadow: none;
        padding: 0.5rem 0 0 1rem;
        min-width: 0;
        border-top: 0;
        border-radius: 0;
    }

    .primary-nav .sub-menu a {
        color: rgba(255,255,255,0.85);
        padding: 0.4rem 0;
    }

    .primary-nav .sub-menu a:hover {
        background: transparent;
    }

    .nav-toggle {
        display: flex;
    }

    .hero {
        min-height: min(780px, 85vh);
        padding: 4rem 0;
    }

    .aamas-intro {
        min-height: min(480px, 60vh);
        padding: 4rem 0;
    }

    .news__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news__header {
        flex-wrap: wrap;
    }

    .purpose__list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .news__grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Generic accordion block (pages 40, 50, …)
   ========================================= */
/* Specificity note: `.page-content h2` (class+element) outranks the
   single-class `.ifaamas-accordion__heading`, so we qualify with `h2` here. */
h2.ifaamas-accordion__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto 1.5rem;
    color: #0056B3;
    font-weight: 800;
}

.ifaamas-accordion__toggle {
    appearance: none;
    background: #ffffff;
    color: #0056B3;
    border: 1px solid #0056B3;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font: 600 0.95rem var(--font-ui);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ifaamas-accordion__toggle::before {
    content: "⤢";
    margin-right: 0.4rem;
    display: inline-block;
}

.ifaamas-accordion__toggle:hover,
.ifaamas-accordion__toggle:focus-visible {
    background: #0056B3;
    color: #ffffff;
    outline: none;
}

/* Stack panes with vertical gaps, no Kadence default chrome. */
.ifaamas-accordion .kt-accordion-inner-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ifaamas-accordion .wp-block-kadence-pane {
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
}

/* Header bar — light blue, blue title, dark-blue chevron box on the right. */
.ifaamas-accordion .kt-blocks-accordion-header {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: #EEF3F8;
    color: #0056B3;
    border: 0;
    border-radius: 8px;
    padding: 1.25rem 4.75rem 1.25rem 1.5rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.ifaamas-accordion .kt-blocks-accordion-header:hover {
    background: #E4ECF3;
}

.ifaamas-accordion .kt-blocks-accordion-title {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 32px;
    line-height: 56px;
    letter-spacing: 0;
    color: #0056B3;
}

/* Square dark-blue icon box on the right with a white chevron. */
.ifaamas-accordion .kt-blocks-accordion-icon-trigger {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    background: #0056B3;
    border-radius: 6px;
    transition: background 0.15s ease, transform 0.2s ease;
}

/* Hide Kadence's default ::after bar; we draw a chevron with ::before only. */
.ifaamas-accordion .kt-blocks-accordion-icon-trigger::after {
    display: none !important;
}

.ifaamas-accordion .kt-blocks-accordion-icon-trigger::before {
    content: "" !important;
    position: absolute !important;
    top: 45% !important;
    left: 50% !important;
    width: 10px !important;
    height: 10px !important;
    background: transparent !important;
    border-right: 2px solid #ffffff !important;
    border-bottom: 2px solid #ffffff !important;
    border-radius: 0 !important;
    transform: translate(-50%, -50%) rotate(45deg) !important;
    transition: transform 0.2s ease, top 0.2s ease !important;
}

/* Active (open) state: icon box lightens, chevron flips to point up. */
.ifaamas-accordion .kt-blocks-accordion-header.kt-accordion-panel-active {
    background: #E4ECF3;
    color: #0056B3;
}

.ifaamas-accordion .kt-blocks-accordion-header.kt-accordion-panel-active
    .kt-blocks-accordion-icon-trigger {
    background: #4FB7E0;
}

.ifaamas-accordion .kt-blocks-accordion-header.kt-accordion-panel-active
    .kt-blocks-accordion-icon-trigger::before {
    top: 58% !important;
    transform: translate(-50%, -50%) rotate(-135deg) !important;
}

/* While "Expand all" batches clicks, neutralize Kadence's 450ms height
   transition so its internal toggling-lock clears in the next tick. */
.ifaamas-accordion .kt-accordion-inner-wrap.ifaamas-accordion--instant .kt-panel-is-collapsing,
.ifaamas-accordion .kt-accordion-inner-wrap.ifaamas-accordion--instant .kt-panel-is-expanding {
    transition: none !important;
}

/* Panel content — sits below the header inside the same rounded card. */
.ifaamas-accordion .kt-accordion-panel {
    background: #ffffff;
    border-radius: 0 0 8px 8px;
}

.ifaamas-accordion .kt-accordion-panel-inner {
    padding: 1.5rem;
}

.ifaamas-accordion__body p,
.ifaamas-accordion__body li {
    line-height: 1.7;
    color: var(--color-text);
}

.ifaamas-accordion__body p + p,
.ifaamas-accordion__body p + ol,
.ifaamas-accordion__body ol + p {
    margin-top: 1rem;
}

.ifaamas-accordion__body ol {
    list-style: decimal;
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.ifaamas-accordion__body ol ol {
    list-style: lower-alpha;
    margin: 0.5rem 0;
}

.ifaamas-accordion__body .ifaamas-accordion__section {
    color: #0056B3;
    font: 700 1.05rem var(--font-ui);
    margin: 1.5rem 0 0.5rem;
}

.ifaamas-accordion__body .ifaamas-accordion__section:first-child {
    margin-top: 0;
}

@media (max-width: 600px) {
    .ifaamas-accordion__heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .ifaamas-accordion .kt-blocks-accordion-header {
        padding: 1rem 4rem 1rem 1rem;
    }

    .ifaamas-accordion .kt-blocks-accordion-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .ifaamas-accordion .kt-blocks-accordion-icon-trigger {
        right: 0.6rem;
        width: 32px;
        height: 32px;
    }
}

/* Board page (48): the Emeritus accordion sits below the 2032 group, which
   uses #f4f7f6. Match that background and give it some breathing room. */
.page-id-48 .ifaamas-accordion {
    margin-top: 3rem;
}

.page-id-48 .ifaamas-accordion .kt-blocks-accordion-header,
.page-id-48 .ifaamas-accordion .kt-blocks-accordion-header:hover,
.page-id-48 .ifaamas-accordion .kt-blocks-accordion-header.kt-accordion-panel-active {
    background: #f4f7f6;
}

.page-id-48 .ifaamas-accordion .kt-accordion-panel {
    background: #f4f7f6;
}

/* =========================================
   Victor Lesser Distinguished Dissertation Award — winner entries (page 64).
   One row per winner: year | circular photo | name / dissertation / runners-up.
   Markup is a .vl-award Custom HTML block (see the page for the template).
   ========================================= */
.vl-award {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    /* `auto` horizontal margins so the card's max-width box stays centered
       like every other `.page-content > *` (its left edge then lines up with
       the intro and the "Previous winners" heading). */
    margin: 0 auto 2.25rem;
}

.vl-award__year {
    flex: 0 0 4.5rem;
    color: #0056B3;
    font-weight: 800;
    font-size: 2rem;
    line-height: 1;
}

.vl-award__photo {
    flex: 0 0 auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
}

.vl-award__body {
    flex: 1 1 auto;
}

/* Scoped under .page-content so these win over the generic
   `.page-content p` / `.page-content p a` rules (tighter spacing, and the
   name keeps the brand blue without the in-flow-link underline). */
.page-content .vl-award__name {
    margin: 0 0 0.35rem;
    font-weight: 700;
    color: #0056B3;
}

.page-content .vl-award__name a {
    color: inherit;
    text-decoration: none;
}

.page-content .vl-award__name a:hover {
    text-decoration: underline;
}

.page-content .vl-award__title {
    margin: 0 0 0.35rem;
    color: var(--color-text);
    line-height: 1.5;
}

.page-content .vl-award__runners {
    margin: 0;
    color: #6b7280;
}

@media (max-width: 600px) {
    .vl-award { flex-wrap: wrap; gap: 1rem 1.25rem; }
    .vl-award__year { flex-basis: auto; font-size: 1.5rem; }
    .vl-award__body { flex-basis: 100%; }
}

/* =========================================
   Influential Paper Award — winner entries (page 66). One row per year:
   year | stacked paper entries (authors / title link / venue). A year can
   hold several papers. Markup is an .ipa-award Custom HTML block.
   ========================================= */
.ipa-award {
    display: flex;
    align-items: flex-start;
    gap: 1.75rem;
    margin: 0 auto 2.5rem;
}

.ipa-award__year {
    flex: 0 0 4.5rem;
    color: #0056B3;
    font-weight: 800;
    font-size: 2rem;
    line-height: 1.1;
}

.ipa-award__entries {
    flex: 1 1 auto;
}

/* Scoped under .page-content to beat the generic `.page-content p`/`p a`. */
.page-content .ipa-entry {
    margin: 0 0 1.5rem;
}

.page-content .ipa-entry:last-child {
    margin-bottom: 0;
}

.page-content .ipa-entry__authors {
    margin: 0 0 0.25rem;
    font-weight: 700;
    color: #0056B3;
}

.page-content .ipa-entry__title,
.page-content .ipa-entry__title a {
    margin: 0 0 0.25rem;
    color: #0015FF;
    text-decoration: underline;
}

.page-content .ipa-entry__venue {
    margin: 0;
    color: var(--color-text);
    line-height: 1.5;
}

.page-content .ipa-entry__special {
    margin: 0 0 0.35rem;
    font-style: italic;
    color: var(--color-text);
}

@media (max-width: 600px) {
    .ipa-award { flex-wrap: wrap; gap: 0.5rem 1.25rem; }
    .ipa-award__year { flex-basis: auto; font-size: 1.5rem; }
    .ipa-award__entries { flex-basis: 100%; }
}

/* =========================================
   Previous AAMAS editions (page 57) — grid of host-city photo cards with
   "AAMAS YYYY" + location overlaid. Markup is an .aamas-grid Custom HTML block.
   ========================================= */
.aamas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin: 2rem auto 0;
}

.aamas-card {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
}

.aamas-card img {
    transition: transform 0.3s ease;
}

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

.aamas-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aamas-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem 1.1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.15) 45%, rgba(0,0,0,0) 70%);
}

.aamas-card__year {
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1.15;
}

.aamas-card__loc {
    color: #fff;
    font-size: 0.95rem;
    opacity: 0.92;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .aamas-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .aamas-grid { grid-template-columns: 1fr; }
}

/* =========================================
   Proceedings conference cards (page 9) — [aamas_conferences] shortcode,
   pulled live from the Directus proceedings API. Each row: host-city photo +
   title / ISBN / description / "View edition" button.
   ========================================= */
.proc-list {
    /* `auto` horizontal margins so the list's max-width box stays centered
       like every other `.page-content > *` and lines up with the heading. */
    margin: 1.5rem auto 0;
}

.proc-item {
    display: flex;
    gap: 1.75rem;
    align-items: flex-start;
    padding: 3.75rem 0;
}

/* Even rows get a full-viewport-width #F4F7F6 band (content stays centered).
   box-shadow + clip-path bleeds the background edge-to-edge without causing
   horizontal scroll. */
.proc-item:nth-child(even) {
    background: #F4F7F6;
    box-shadow: 0 0 0 100vw #F4F7F6;
    clip-path: inset(0 -100vw);
}

.proc-item__img {
    flex: 0 0 210px;
    width: 210px;
    height: 210px;
    border-radius: 8px;
    object-fit: cover;
}

.proc-item__body {
    flex: 1 1 auto;
}

.page-content .proc-item__title {
    margin: 0 0 0.35rem;
    font-size: 1.9rem;
    font-weight: 800;
    color: #0056B3;
    line-height: 1.2;
}

.page-content .proc-item__isbn {
    margin: 0 0 0.75rem;
    color: #0056B3;
    font-size: 0.85rem;
}

.page-content .proc-item__desc {
    margin: 0 0 1rem;
    color: var(--color-text);
    line-height: 1.6;
}

.proc-item__btn {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

@media (max-width: 600px) {
    .proc-item { flex-wrap: wrap; gap: 1rem; }
    .proc-item__img { flex-basis: 100px; width: 100px; height: 100px; }
    .proc-item__body { flex-basis: 100%; }
}

/* =========================================
   Proceedings — single-year detail (/proceedings/<year>/): city hero, heading +
   copyright, then the "Sections" accordion of tracks.
   ========================================= */
.proc-year {
    /* Clear the absolute site header, then leave room before the footer. */
    padding: 7rem 0 5rem;
}

.proc-breadcrumb {
    margin: 0 0 1.5rem;
    color: var(--color-muted);
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

.proc-breadcrumb a {
    color: var(--color-muted);
    text-decoration: none;
}

.proc-breadcrumb a:hover {
    text-decoration: underline;
}

.proc-year__banner {
    margin: 0 0 2rem;
}

.proc-year__img {
    display: block;
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 12px;
}

/* Title + intro on the left, Table of Contents card on the right. */
.proc-year__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2.5rem;
    align-items: start;
}

.proc-year__title {
    margin: 0 0 0.35rem;
    font-family: var(--font-ui);
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.15;
    color: #0056B3;
}

/* --- Table of Contents card --- */
.proc-toc {
    align-self: start;
    padding: 1.5rem 1.75rem;
    background: #F4F7F6;
    border-radius: 12px;
}

.proc-toc__title {
    margin: 0 0 1rem;
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 800;
    color: #0056B3;
}

.proc-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.proc-toc__item + .proc-toc__item {
    margin-top: 0.65rem;
}

.proc-toc__link {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    color: #0056B3;
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.proc-toc__link:hover .proc-toc__name {
    text-decoration: underline;
}

.proc-toc__name {
    flex: 1 1 auto;
}

.proc-toc__count {
    flex: 0 0 auto;
    color: var(--color-muted);
    font-weight: 700;
    font-size: 0.8rem;
}

.proc-year__isbn {
    margin: 0 0 1.5rem;
    color: #0056B3;
    font-family: var(--font-ui);
    font-size: 0.9rem;
}

.proc-year__intro {
    max-width: 72ch;
}

.proc-year__intro p {
    margin: 0 0 1rem;
    color: var(--color-text);
    line-height: 1.7;
}

/* --- Sections header (title + Expand all) --- */
.proc-sections {
    margin-top: 3rem;
}

.proc-sections__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.proc-sections__title {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 1.85rem;
    font-weight: 800;
    color: #0056B3;
}

.proc-expand-all {
    flex: 0 0 auto;
    padding: 0.55rem 1.1rem;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 700;
    color: #0056B3;
    background: transparent;
    border: 2px solid #0056B3;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.proc-expand-all:hover {
    background: #0056B3;
    color: #fff;
}

/* --- Track accordion --- */
.proc-acc__item {
    margin-bottom: 1rem;
    background: #F4F7F6;
    border-radius: 12px;
    overflow: hidden;
    /* Clear the absolute header when a ToC link jumps to this section. */
    scroll-margin-top: 6rem;
}

.proc-acc__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-ui);
}

.proc-acc__name {
    flex: 1 1 auto;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0056B3;
}

.proc-acc__count {
    flex: 0 0 auto;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.proc-acc__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #29A9E0;
}

.proc-acc__icon::before {
    content: '';
    width: 8px;
    height: 8px;
    margin-top: -3px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    transition: transform 0.2s;
}

.proc-acc__item.is-open .proc-acc__icon::before {
    margin-top: 3px;
    transform: rotate(-135deg);
}

.proc-acc__panel {
    display: none;
    padding: 0 1.5rem 0.5rem;
}

.proc-acc__item.is-open .proc-acc__panel {
    display: block;
}

.proc-acc__papers {
    list-style: none;
    margin: 0;
    padding: 0;
}

.proc-acc__paper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 0;
    border-top: 1px solid #dfe6e4;
}

.proc-acc__paper:first-child {
    border-top: 0;
}

.proc-acc__paper-main {
    flex: 1 1 auto;
}

.proc-acc__paper-title {
    display: block;
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.3;
    color: #0056B3;
    text-decoration: none;
}

a.proc-acc__paper-title:hover {
    text-decoration: underline;
}

.proc-acc__paper-authors {
    margin: 0.4rem 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.proc-acc__view {
    flex: 0 0 auto;
    min-width: auto;
    height: 40px;
    padding: 8px 26px;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Stack the Table of Contents under the intro before it gets too narrow. */
@media (max-width: 900px) {
    .proc-year__head { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 600px) {
    .proc-year__img { height: 200px; }
    .proc-year__title { font-size: 1.75rem; }
    .proc-acc__paper { flex-wrap: wrap; gap: 0.85rem; }
    .proc-acc__view { width: 100%; }
}

/* =========================================
   Proceedings — single-paper landing (/proceedings/<year>/<slug>/): two-column
   layout, abstract on the left, metadata card on the right.
   ========================================= */
.paper-page {
    /* Clear the absolute site header, then leave room before the footer. */
    padding: 7rem 0 5rem;
}

.paper-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 3rem;
    align-items: start;
}

.paper-main__title {
    margin: 0 0 0.85rem;
    font-family: var(--font-ui);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: #0056B3;
}

.paper-main__authors {
    margin: 0 0 2.25rem;
    color: var(--color-muted);
    font-size: 0.95rem;
    font-style: italic;
}

.paper-main__heading {
    margin: 0 0 1rem;
    font-family: var(--font-ui);
    font-size: 1.6rem;
    font-weight: 800;
    color: #0056B3;
}

.paper-main__abstract {
    color: var(--color-text);
    line-height: 1.75;
}

.paper-main__abstract p {
    margin: 0 0 1.1rem;
}

.paper-main__abstract--empty {
    color: var(--color-muted);
    font-style: italic;
}

/* --- Metadata sidebar card --- */
.paper-meta {
    position: sticky;
    top: 6rem;
    padding: 1.75rem;
    background: #F4F7F6;
    border-radius: 12px;
}

.paper-meta__row {
    margin-bottom: 1.4rem;
}

.paper-meta__label {
    display: block;
    margin-bottom: 0.3rem;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text);
}

.paper-meta__value {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    color: #0056B3;
    text-decoration: none;
    word-break: break-word;
}

a.paper-meta__value:hover {
    text-decoration: underline;
}

.paper-meta__pdf {
    width: 100%;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 860px) {
    .paper-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .paper-meta {
        position: static;
    }
    .paper-main__title {
        font-size: 1.6rem;
    }
}

/* =========================================
   No-title template — the menu shows but there's no title band, so clear the
   absolute header (~6rem: 64px logo + 1rem padding top/bottom) and leave a
   3rem gap before the content. First child's top margin is zeroed so the gap
   is exactly 3rem regardless of the leading block.
   ========================================= */
.page-template-no-title .page-content {
    padding-top: 9rem;
}

.page-template-no-title .page-content > :first-child {
    margin-top: 0;
}

/* =========================================
   Previous edition viewer (/previous-editions/<year>/)
   ========================================= */

/* Column that owns the viewport: bar on top, frame takes whatever is left.
   Sizing the frame with flex instead of a calc() keeps it correct however tall
   the bar wraps on narrow screens. */
.edition-viewer {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

/* The site header is absolute and transparent, so the bar paints the band it
   sits on and reserves its height: 64px logo + 1rem padding top and bottom. */
.edition-viewer__bar {
    flex: 0 0 auto;
    background: var(--page-main, #f4f7f6);
    padding-top: calc(6rem + 0.5rem);
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.admin-bar .edition-viewer__bar { padding-top: calc(6rem + 0.5rem + 32px); }
@media screen and (max-width: 782px) {
    body.admin-bar .edition-viewer__bar { padding-top: calc(6rem + 0.5rem + 46px); }
}

.edition-viewer__bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
}

.edition-viewer__crumbs {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.95rem;
    min-width: 0;
}

.edition-viewer__crumbs a {
    color: #0056b3;
    text-decoration: none;
}

.edition-viewer__crumbs a:hover,
.edition-viewer__crumbs a:focus-visible { text-decoration: underline; }

.edition-viewer__sep { color: rgba(0, 0, 0, 0.35); }
.edition-viewer__current { font-weight: 700; }
.edition-viewer__loc { font-weight: 400; opacity: 0.7; }

.edition-viewer__external {
    color: #0056b3;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.edition-viewer__external:hover,
.edition-viewer__external:focus-visible { text-decoration: underline; }

.edition-viewer__arrow { margin-left: 0.35em; }

/* min-height:0 lets the frame shrink inside the flex column instead of
   overflowing it, which is the default for flex items. */
.edition-viewer__frame {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border: 0;
    display: block;
    background: #fff;
}

/* Shown instead of the frame when the edition's site refuses to be embedded. */
.edition-viewer__notice {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem var(--spacing);
    text-align: center;
}

.edition-viewer__notice-inner { max-width: 34rem; }

.edition-viewer__notice-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0 0 0.75rem;
}

.edition-viewer__url {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9rem;
    word-break: break-all;
    opacity: 0.7;
    margin: 0 0 1.5rem;
}

.edition-viewer__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0;
}

.edition-viewer__back { color: #0056b3; }

/* The viewer claims the viewport, so the site's closing chrome would only add a
   stray scrollbar below it. */
body.edition-viewer-page .pre-footer,
body.edition-viewer-page .site-footer { display: none; }
