/* Front public layout — story 024. Same design tokens as the backoffice
   (story 036), self-hosted here since this pipeline is AssetMapper, not Vite. */

@font-face {
    font-family: "Atkinson Hyperlegible";
    src: url("../fonts/atkinson-hyperlegible-latin-400-normal-2tcpIt-.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Atkinson Hyperlegible";
    src: url("../fonts/atkinson-hyperlegible-latin-700-normal--Us-gGc.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Heading font (RGAA/dys recommendation) and the only other choice offered by
   the Text block editor — see TextFormattingToolbar.vue's FONT_FAMILIES. */
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-600-normal-keCwlca.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-700-normal-_eucScQ.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-accent: #b7f787;
    --color-accent-dark: #93e066;
    --color-accent-text: #3f6b1f;
    --color-text: oklch(20% 0.02 260);
    --color-text-secondary: oklch(30% 0.02 260);
    --color-text-muted: oklch(50% 0.02 260);
    --color-border: oklch(90% 0.012 260);
    --color-footer-bg: oklch(20% 0.02 260);
    --color-footer-text: oklch(85% 0.008 260);
    --color-footer-border: oklch(35% 0.01 260);
    --color-footer-text-muted: oklch(65% 0.008 260);
    --shadow-menu: 0 10px 30px oklch(20% 0.02 260 / 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    background: var(--color-accent);
    color: black;
    padding: 10px 16px;
    border-radius: 0 0 6px 0;
    text-decoration: none;
    font-weight: 700;
}

.skip-link:focus {
    left: 0;
}

.site-header {
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.site-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    max-width: 1160px;
    margin: 0 auto;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.site-header__badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-accent);
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.site-header__badge--logo {
    width: auto;
    max-width: 120px;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    padding: 0;
}

.site-header__town {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.main-nav__link {
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--color-text-secondary);
}

.main-nav__link--cta {
    padding: 9px 16px;
    background: var(--color-accent);
    color: black;
    border-radius: 7px;
}

.main-nav__group {
    position: relative;
}

.main-nav__trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 8px 0;
}

.main-nav__panel {
    position: absolute;
    top: 100%;
    left: -12px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: var(--shadow-menu);
    min-width: 200px;
    padding: 8px;
    display: none;
}

.main-nav__group[data-open="true"] .main-nav__panel {
    display: block;
}

.main-nav__panel-link {
    display: block;
    padding: 9px 14px;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-text-secondary);
    border-radius: 6px;
}

.main-nav__panel-link:hover,
.main-nav__panel-link:focus-visible {
    background: oklch(98% 0.004 260);
}

.mobile-nav-toggle {
    display: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px;
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-toggle:focus-visible,
.mobile-nav__link:focus-visible,
.mobile-nav__trigger:focus-visible,
.mobile-nav__panel-link:focus-visible {
    outline: 3px solid var(--color-accent-text);
    outline-offset: 2px;
    border-radius: 6px;
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--color-border);
    padding: 10px 20px 16px;
    flex-direction: column;
}

.mobile-nav[data-open="true"] {
    display: flex;
}

.mobile-nav__link {
    padding: 10px 4px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    color: var(--color-text-secondary);
}

.mobile-nav__link--cta {
    margin-top: 8px;
    padding: 12px;
    text-align: center;
    background: var(--color-accent);
    color: black;
    border-radius: 8px;
}

.mobile-nav__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 4px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    background: none;
    border: none;
    text-align: left;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.mobile-nav__panel {
    display: none;
    flex-direction: column;
    padding-left: 14px;
}

.mobile-nav__group[data-open="true"] .mobile-nav__panel {
    display: flex;
}

.mobile-nav__panel-link {
    padding: 8px 4px;
    font-size: 14px;
    text-decoration: none;
    color: var(--color-text-muted);
}

.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 44px 24px 24px;
}

.site-footer__inner {
    max-width: 1160px;
    margin: 0 auto;
}

.site-footer__columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 32px;
}

.site-footer__heading {
    color: white;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.site-footer__title {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    color: white;
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 12px;
}

.site-footer__text {
    font-size: 13.5px;
    line-height: 1.7;
}

.site-footer__links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13.5px;
}

.site-footer__links a {
    color: var(--color-footer-text);
    text-decoration: none;
}

.site-footer__bottom {
    border-top: 1px solid var(--color-footer-border);
    padding-top: 18px;
    font-size: 12px;
    color: var(--color-footer-text-muted);
}

@media (max-width: 760px) {
    .main-nav {
        display: none;
    }

    .mobile-nav-toggle {
        display: block;
    }

    .site-footer__columns {
        grid-template-columns: 1fr;
    }

    .site-header__town {
        font-size: 12px;
    }
}

/* ---- Blocks (story 025) ---- */

[hidden] {
    display: none !important;
}

.blocks-scope {
    container-type: inline-size;
}

.blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 0 16px;
    /* Blocks sharing a row are centered vertically rather than top-aligned. */
    align-items: center;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

.block {
    box-sizing: border-box;
    min-width: 0;
    padding: 20px 0;
}

.block--w-full { flex: 0 0 100%; }
.block--w-half { flex: 0 0 calc(50% - 8px); }
.block--w-third { flex: 0 0 calc(33.333% - 11px); }
.block--w-quarter { flex: 0 0 calc(25% - 12px); }

/* Full-bleed hero: 100% of the scope, whatever the centered column width. */
.block--hero {
    flex: 0 0 100cqw;
    margin-inline: calc(50% - 50cqw);
    padding: 0;
}

.block--carousel,
.block--news {
    /* Keep the tinted background filling the row when not centered. */
    align-self: stretch;
    padding: 64px 0;
    background: oklch(98% 0.004 260);
}

/* Tinted full-width sections extend their background to the viewport edges.
   Only for the full-width variant: at a reduced width (half/third/quarter),
   the 100vmax box-shadow spread isn't clipped horizontally by clip-path and
   paints over the neighbouring block sharing the same flex row. */
.block--carousel.block--w-full,
.block--news.block--w-full {
    box-shadow: 0 0 0 100vmax oklch(98% 0.004 260);
    clip-path: inset(0 -100vmax);
}

.media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media--placeholder {
    background: repeating-linear-gradient(135deg, oklch(93% 0.008 260) 0 10px, oklch(89% 0.01 260) 10px 20px);
}

/* Hero */
.hero {
    position: relative;
    height: 560px;
    overflow: hidden;
}

.hero > .media {
    position: absolute;
    inset: 0;
}

.hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero__slide.is-active { opacity: 1; }

.hero__slide > .media {
    position: absolute;
    inset: 0;
}

/* Over the poster (which is what shows until the video plays), under the veil. */
.hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero__video.is-ready { opacity: 1; }

.hero__pause {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid oklch(100% 0 0 / 0.6);
    border-radius: 999px;
    background: oklch(20% 0.02 260 / 0.7);
    color: white;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.hero__pause:hover { background: oklch(20% 0.02 260 / 0.9); }
.hero__pause[hidden] { display: none; }

/* Pause icon (two bars), turned into a play triangle once paused. */
.hero__pause-icon {
    width: 10px;
    height: 12px;
    border-left: 3px solid currentColor;
    border-right: 3px solid currentColor;
    box-sizing: border-box;
}

.hero__pause--paused .hero__pause-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent currentColor;
}

@media (prefers-reduced-motion: reduce) {
    .hero__slide, .hero__video { transition: none; }
}

.hero__overlay {
    position: absolute;
    inset: 0;
    /* Dark enough for white text to keep 4.5:1 (RGAA) even on a white photo. */
    background: oklch(20% 0.02 260 / 0.6);
}

.hero__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 24px 40px;
    text-align: center;
    color: white;
}

.hero__badge {
    background: oklch(100% 0 0 / 0.16);
    border: 1px solid oklch(100% 0 0 / 0.5);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.hero__title {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 12px;
    text-shadow: 0 2px 12px oklch(20% 0.02 260 / 0.4);
}

.hero__subtitle {
    font-size: 16px;
    margin: 0 0 26px;
    opacity: 0.94;
}

.button {
    display: inline-block;
    padding: 12px 22px;
    background: var(--color-accent);
    color: black;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
}

.button:focus-visible,
.carousel__arrow:focus-visible,
.carousel__dot:focus-visible,
.news-card:focus-visible {
    outline: 3px solid var(--color-accent-text);
    outline-offset: 2px;
}

/* Title */
.block-title {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    margin: 0;
    color: var(--color-text);
}

h1.block-title { font-size: 38px; }
h2.block-title { font-size: 30px; }
h3.block-title { font-size: 22px; }
h4.block-title { font-size: 19px; }
h5.block-title { font-size: 17px; }
h6.block-title { font-size: 16px; }

/* Text */
.block-text {
    font-size: 15.5px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.block-text > :first-child { margin-top: 0; }
.block-text > :last-child { margin-bottom: 0; }
.block-text p { margin: 0 0 14px; }
.block-text a { color: var(--color-accent-text); }
.block-text ul, .block-text ol { margin: 0 0 14px; padding-left: 1.4em; }
.block-text table { border-collapse: collapse; width: 100%; margin: 0 0 14px; }
.block-text th, .block-text td { border: 1px solid var(--color-border); padding: 8px 10px; text-align: left; }

/* Image */
.block-image { margin: 0; }

/* The whole image, at its own aspect ratio: the height follows the block's width. */
.block-image__frame {
    border-radius: 10px;
    overflow: hidden;
}

.block-image__frame > .media {
    height: auto;
}

.block-image__frame > .media--placeholder {
    aspect-ratio: 4 / 3;
}

.block-image__caption {
    font-size: 12.5px;
    color: var(--color-text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

/* Carousel */
.carousel__title,
.news__title {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--color-text);
}

.carousel {
    /* Shared by every slide (story 019); the arrows sit at half the image height. */
    --carousel-ratio: 2.1;
}

.carousel__viewport {
    container-type: inline-size;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.carousel__slide { margin: 0; }

.carousel__image {
    position: relative;
    aspect-ratio: var(--carousel-ratio);
    overflow: hidden;
}

.carousel__caption {
    background: white;
    padding: 18px 24px;
}

.carousel__caption-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.carousel__caption-text { font-size: 13.5px; color: var(--color-text-muted); line-height: 1.5; }

.carousel__arrow {
    position: absolute;
    top: calc(100cqw / var(--carousel-ratio) / 2);
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--color-text);
    box-shadow: 0 2px 8px oklch(20% 0.02 260 / 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel__arrow--prev { left: 12px; }
.carousel__arrow--next { right: 12px; }

.carousel__dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 14px;
}

.carousel__dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: var(--color-border);
}

.carousel__dot[aria-current="true"] { background: var(--color-accent); }

/* Visually hidden live region, read out by screen readers only. */
.carousel__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Without JS the slides are stacked; give them air. */
.carousel:not(.carousel--enhanced) .carousel__slide + .carousel__slide { margin-top: 16px; }

/* News */
.news__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.news__title { margin: 0; }

.news__all {
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--color-accent-text);
}

.news__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.news-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}

.news-card__media { position: relative; aspect-ratio: 16 / 9; }

.news-card__category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: oklch(100% 0 0 / 0.9);
    color: var(--color-text-secondary);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 999px;
}

.news-card__body { padding: 16px; }
.news-card__date { font-size: 12px; color: var(--color-accent-text); font-weight: 700; margin-bottom: 6px; }
.news-card__title { font-weight: 700; font-size: 15.5px; margin-bottom: 6px; line-height: 1.35; color: var(--color-text); }
.news-card__excerpt { font-size: 13.5px; color: var(--color-text-muted); line-height: 1.5; margin-bottom: 8px; }
.news-card__more { font-size: 13px; font-weight: 700; color: var(--color-text); }

/* Public news list and article (stories 020, 021) */
.news--page,
.news-article {
    max-width: 1160px;
    margin: 0 auto;
    padding: 48px 24px;
}

.news--page .news__title { margin-bottom: 28px; }

.news-article__meta { font-size: 13px; font-weight: 700; color: var(--color-accent-text); margin: 0 0 8px; }

.news-article__title {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 36px;
    line-height: 1.2;
    margin: 0 0 24px;
    color: var(--color-text);
}

.news-article .blocks { padding: 0; }

@media (max-width: 760px) {
    .blocks { padding: 0 20px; }
    .news--page, .news-article { padding: 32px 20px; }
    .news-article__title { font-size: 28px; }
    .block { padding: 12px 0; }
    .block--w-half, .block--w-third, .block--w-quarter { flex: 0 0 100%; }
    .block--carousel, .block--news { padding: 40px 0; }
    .hero { height: 440px; }
    .hero__title { font-size: 26px; }
    h1.block-title { font-size: 30px; }
    h2.block-title, .carousel__title, .news__title { font-size: 24px; }
    .news__grid { grid-template-columns: 1fr; }
}

/* 404 page (story 026) */
.not-found {
    max-width: 640px;
    margin: 0 auto;
    padding: 72px 20px;
    text-align: center;
}
.not-found__code {
    margin: 0 0 8px;
    font-weight: 700;
    color: var(--color-accent-text);
}
.not-found__title {
    margin: 0 0 16px;
}
.not-found__link {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--color-accent);
    color: black;
    font-weight: 700;
    text-decoration: none;
}
