/*
Theme Name: Gamburg
Theme URI: https://gamburg.de
Description: Klares, mobiles, modernes Theme für die Webseite des Ortes Gamburg im Lieblichen Taubertal. Hervorhebung großflächiger Hintergrundbilder pro Seite, drei Sektionsfarben, integriertes Lightbox.
Author: gamburg.de
Author URI: https://gamburg.de
Version: 2.0.0
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gamburg
Update URI: false
*/

/* =========================================================================
   Fonts — self-hosted (no requests to Google), SIL OFL, see assets/fonts/OFL.txt
   ========================================================================= */
@font-face {
    font-family: "IM Fell Great Primer";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("assets/fonts/im-fell-great-primer-regular.woff2") format("woff2");
}
@font-face {
    font-family: "IM Fell Great Primer";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("assets/fonts/im-fell-great-primer-italic.woff2") format("woff2");
}

/* =========================================================================
   Tokens
   ========================================================================= */
:root {
    --color-cyan:  #96d3d4;
    --color-green: #8ec447;
    --color-gray:  #889599;

    --color-bg:        #f6f6f4;
    --color-surface:   #ffffff;
    --color-text:      #1f1f1f;
    --color-muted:     #666666;
    --color-border:    #e2e2de;
    --color-accent:    var(--section-color, var(--color-gray));
    --color-on-accent: #ffffff;

    --font-serif:   Garamond, "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --font-display: "IM Fell Great Primer","UnifrakturMaguntia", "Lucida Blackletter", Garamond, "Palatino Linotype", Georgia, serif;
    --font-sans:    "Century Gothic", "URW Gothic", "Avenir Next", Avenir, "Trebuchet MS", sans-serif;

    --container:  1218px;
    --content:    72ch;
    --header-h:   48px; /* = logo height */
    --gutter:     clamp(1rem, 2vw, 2rem);

    --radius-sm: 4px;
    --radius:    8px;
    --radius-lg: 16px;
    --shadow:    0 2px 12px rgba(0,0,0,.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.18);

    --t-fast: 150ms ease-out;
    --t-med:  300ms ease-out;
    --t-slow: 600ms ease-out;
}

/* Section accents — both per-body and globally fallback to gray. */
.section--cyan    { --section-color: var(--color-cyan); }
.section--green   { --section-color: var(--color-green); }
.section--gray    { --section-color: var(--color-gray); }
.section--neutral { --section-color: var(--color-gray); }

/* =========================================================================
   Reset & base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font: 1.0625rem/1.7 var(--font-serif);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, svg, video, picture {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
    transition: color var(--t-fast);
}
a:hover, a:focus-visible { color: var(--color-text); }

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

button {
    font: inherit;
    background: none;
    color: inherit;
    border: 0;
    padding: 0;
    cursor: pointer;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0.005em;
    color: var(--color-text);
    margin: 1.5em 0 0.5em;
}
h1 { font-size: clamp(2rem,   1.2rem + 2.4vw, 3rem);     font-variant: small-caps; letter-spacing: 0.04em; font-weight: 500; }
h2 { font-size: clamp(1.5rem, 1rem + 1.4vw,   2.125rem); }
h3 { font-size: clamp(1.25rem,1rem + 0.8vw,   1.5rem);   }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

::selection { background: var(--color-accent); color: var(--color-on-accent); }

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px; height: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--color-text);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    z-index: 1000;
}
.skip-link:focus { top: 1rem; }

/* =========================================================================
   Layout primitives
   ========================================================================= */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.site-main {
    min-height: 50vh;
}
/* Front page hero already fills the viewport — no extra height or gap needed. */
.site-main:has(.front-hero) {
    min-height: 0;
}
.site-main:has(.front-hero) + .site-footer {
    margin-top: 0;
}

/* =========================================================================
   Site header
   ========================================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-surface);
    box-shadow: var(--shadow);
}
/* Breadcrumb bar is stuck directly under the header — no shadow between them (class set in main.js). */
.site-header.is-joined { box-shadow: none; }

.site-header__inner {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--header-h);
}

.site-header__brand img,
.site-header__brand .custom-logo {
    height: var(--header-h);
    width: auto;
    display: block;
}

.site-header__accent {
    height: 4px;
    background: var(--color-accent);
    transition: background var(--t-med);
}

/* Mobile hamburger */
.nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    gap: 5px;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast);
}
.nav-toggle:hover { background: var(--color-bg); }
.nav-toggle__bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: transform var(--t-fast), opacity var(--t-fast);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Primary nav — drawer on mobile, inline on desktop */
.primary-navigation {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--color-surface);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--t-med);
    z-index: 49;
}
.primary-navigation.is-open { transform: translateX(0); }

.primary-navigation__menu,
.primary-navigation .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-navigation__menu > li {
    border-bottom: 1px solid var(--color-border);
}

.primary-navigation__menu > li > a,
.primary-navigation .sub-menu a {
    display: block;
    padding: 1rem var(--gutter);
    font-family: var(--font-sans);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}

.primary-navigation .sub-menu a {
    padding-left: calc(var(--gutter) + 1.25rem);
    font-weight: 400;
    text-transform: none;
    font-size: 1rem;
    color: var(--color-muted);
}

/* Mobile: sub-menus start collapsed, tap on the parent opens them (main.js). */
@media (max-width: 1023px) {
    .primary-navigation .sub-menu { display: none; }
    .primary-navigation li.is-open > .sub-menu { display: block; }
}

.primary-navigation__menu > li:nth-child(3n+1) > a { color: var(--color-cyan); }
.primary-navigation__menu > li:nth-child(3n+2) > a { color: var(--color-green); }
.primary-navigation__menu > li:nth-child(3n)   > a { color: var(--color-gray); }

.primary-navigation__menu > li > a:hover,
.primary-navigation__menu > li.current-menu-item > a,
.primary-navigation__menu > li.current-page-ancestor > a,
.primary-navigation__menu > li.current_page_ancestor > a {
    background: var(--color-bg);
}

@media (min-width: 1024px) {
    .nav-toggle { display: none; }

    .primary-navigation {
        position: static;
        inset: auto;
        background: transparent;
        overflow: visible;
        transform: none;
    }

    .primary-navigation__menu {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .primary-navigation__menu > li {
        position: relative;
        border-bottom: 0;
    }

    .primary-navigation__menu > li > a,
    .primary-navigation .sub-menu a {
        padding: 0 1rem;
        line-height: var(--header-h);
    }

    .primary-navigation .sub-menu {
        position: absolute;
        top: 100%;
        right: 0;
        min-width: 240px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
    }
    .primary-navigation .sub-menu a {
        padding: 0.75rem 1rem;
        line-height: 1.4;
        white-space: nowrap;
        color: #fff;
        font-weight: 400;
        text-transform: none;
        font-size: 1rem;
    }
    .primary-navigation .sub-menu a:hover,
    .primary-navigation .sub-menu a:focus-visible {
        background: #fff;
    }

    /* Per-section dropdown panel colors — preserves the original look */
    .primary-navigation__menu > li:nth-child(3n+1) > .sub-menu { background: var(--color-cyan); }
    .primary-navigation__menu > li:nth-child(3n+2) > .sub-menu { background: var(--color-green); }
    .primary-navigation__menu > li:nth-child(3n)   > .sub-menu { background: var(--color-gray); }

    .primary-navigation__menu > li:nth-child(3n+1) > .sub-menu a:hover { color: var(--color-cyan); }
    .primary-navigation__menu > li:nth-child(3n+2) > .sub-menu a:hover { color: var(--color-green); }
    .primary-navigation__menu > li:nth-child(3n)   > .sub-menu a:hover { color: var(--color-gray); }

    /* Top-level item gets the section background on hover */
    .primary-navigation__menu > li:nth-child(3n+1):hover > a,
    .primary-navigation__menu > li:nth-child(3n+1):focus-within > a { background: var(--color-cyan);  color: #fff; }
    .primary-navigation__menu > li:nth-child(3n+2):hover > a,
    .primary-navigation__menu > li:nth-child(3n+2):focus-within > a { background: var(--color-green); color: #fff; }
    .primary-navigation__menu > li:nth-child(3n):hover   > a,
    .primary-navigation__menu > li:nth-child(3n):focus-within   > a { background: var(--color-gray);  color: #fff; }

    .primary-navigation__menu > li:hover > .sub-menu,
    .primary-navigation__menu > li:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
    position: relative;
    min-height: clamp(216px, 36vh, 432px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    isolation: isolate;
}

.hero--home {
    min-height: clamp(500px, 88vh, 1000px);
}

.hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

.hero__title {
    text-align: center;
    padding: var(--gutter);
    max-width: 90%;
    text-shadow: 0 1px 2px rgba(0,0,0,0.45), 0 0 22px rgba(0,0,0,0.55);
}
.hero__title h1 {
    font-family: var(--font-display);
    color: #fff;
    margin: 0;
    font-size: clamp(2rem, 1rem + 4vw, 4rem);
    font-variant: small-caps;
    letter-spacing: 0.04em;
    font-weight: 700;
}
.hero__title h1 a { color: inherit; text-decoration: none; }
.hero__title h1 a:hover { text-decoration: underline; }

.hero__scroll {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    font-size: 1.25rem;
    transition: background var(--t-fast), transform var(--t-fast);
}
.hero__scroll:hover { background: rgba(0, 0, 0, 0.75); transform: translateX(-50%) translateY(-2px); }

.hero__fullscreen {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 4px;
    font-size: 1rem;
    transition: background var(--t-fast);
    z-index: 2;
}
.hero__fullscreen:hover { background: rgba(0, 0, 0, 0.75); }

/* Expanded hero — covers the whole viewport (incl. header), image only. */
.hero.is-expanded {
    position: fixed;
    inset: 0;
    min-height: 0;
    z-index: 100;
    background: #000;
}
.hero.is-expanded .hero__bg {
    background-size: contain;
    background-attachment: scroll;
}
.hero.is-expanded .hero__title,
.hero.is-expanded .hero__scroll { display: none; }

@media (min-width: 1024px) {
    .hero__bg {
        background-attachment: fixed;
    }
}
@media (prefers-reduced-motion: reduce) {
    .hero__bg { background-attachment: scroll; }
}

/* Front-page hero — full viewport, image is the focus */
.front-hero {
    position: relative;
    /* Full visual viewport minus the sticky header so the image is unobstructed. */
    min-height: 100vh;
    min-height: 100dvh;
    margin-top: calc(var(--header-h) * -1);
    padding-top: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    isolation: isolate;
}
.front-hero__bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    z-index: -1;
}
.front-hero__content {
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    max-width: min(820px, 92vw);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 1.5rem);
}

/* --- Wappen above title --- */
.front-hero__wappen {
    display: block;
    height: clamp(70px, 9vw, 110px);
    width: auto;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
    opacity: 0.9;
}

/* --- Title --- white text, no frame --- */
.front-hero__title {
    font-family: var(--font-display);
    color: #fff;
    font-size: clamp(2.75rem, 1rem + 7vw, 5.5rem);
    line-height: 1.05;
    letter-spacing: 0.01em;
    font-weight: 400;
    margin: 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55), 0 0 28px rgba(0, 0, 0, 0.35);
}
.front-hero__title > span {
    display: inline;
    color: #fff;
    text-shadow: inherit;
}

/* --- Body & lede --- single frosted panel --- */
.front-hero__lede,
.front-hero__body {
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 0.9rem + 0.4vw, 1.2rem);
    line-height: 1.55;
    color: #111;

    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    backdrop-filter: blur(14px) saturate(1.1);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 4vw, 2.5rem);
    max-width: min(640px, 92vw);
    margin: 0;
}

.front-hero__body > * + * { margin-top: 0.6em; }
.front-hero__body p { margin: 0; }
.front-hero__body a {
    color: #111;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}
.front-hero__body a:hover,
.front-hero__body a:focus-visible { text-decoration-thickness: 2px; }
.front-hero__body strong {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.85em;
}

/* Trailing single-link paragraph reads as an "All events →" CTA. */
.front-hero__body p:last-child:has(> a:only-child) {
    margin-top: 0.9em;
    padding-top: 0.7em;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    font-family: var(--font-display);
    font-size: 1.15em;
    letter-spacing: 0.03em;
}

@media (prefers-reduced-transparency: reduce) {
    .front-hero__lede,
    .front-hero__body {
        background: rgba(255, 255, 255, 0.85);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* =========================================================================
   Breadcrumb
   ========================================================================= */
.breadcrumb {
    position: sticky;
    top: calc(var(--header-h) + 4px); /* header + accent bar */
    z-index: 45;
    background: var(--color-accent);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: 0.03em;
    padding: 0.4rem var(--gutter);
}
.breadcrumb a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
.breadcrumb a:hover { text-decoration: none; }
.breadcrumb__sep { margin: 0 0.4rem; opacity: 0.7; }

/* =========================================================================
   Layout: page + sidebar grid
   ========================================================================= */
.layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 3vw, 3rem);
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
    padding: 0 var(--gutter) clamp(2rem, 5vw, 4rem);
}

@media (min-width: 1024px) {
    .layout--with-sidebar {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        align-items: start;
    }
}

.layout__main {
    min-width: 0;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.layout__main--bare {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

/* =========================================================================
   Posts & content
   ========================================================================= */
.post + .post {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}

.entry-header { margin-bottom: 1.25rem; }
.entry-title { margin: 0 0 0.25rem; }
.entry-title a { color: var(--color-text); text-decoration: none; }
.entry-title a:hover { color: var(--color-accent); }

.entry-meta {
    color: var(--color-muted);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.entry-content > * + * { margin-top: 1em; }
.entry-content h1,
.entry-content h2 {
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 0.25em;
    scroll-margin-top: calc(var(--header-h) + 1rem);
}
.entry-content a {
    color: var(--color-accent);
    text-decoration: underline;
}
.entry-content img,
.entry-content figure img {
    border-radius: var(--radius);
    box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}

.entry-content blockquote {
    border-left: 4px solid var(--color-accent);
    margin: 1.5rem 0;
    padding: 0.5rem 0 0.5rem 1.25rem;
    color: var(--color-muted);
    font-style: italic;
}

/* WP gallery + image blocks */
.wp-block-gallery,
.wp-block-image { margin: 1.5rem 0; }
.wp-block-image img { border-radius: var(--radius); }

/* Old content with fixed widths (captions, embeds, tables) must not
   overflow on small screens. Wide tables scroll horizontally instead. */
.wp-caption { max-width: 100%; }
.entry-content iframe { max-width: 100%; }
.entry-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

/* Posts navigation */
.posts-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.posts-navigation a {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-accent);
    border-radius: 999px;
    text-decoration: none;
    color: var(--color-accent);
    transition: background var(--t-fast), color var(--t-fast);
}
.posts-navigation a:hover { background: var(--color-accent); color: var(--color-on-accent); }

/* =========================================================================
   Sidebar / Widgets
   ========================================================================= */
.sidebar {
    display: grid;
    gap: 1.25rem;
    align-self: start;
    position: sticky;
    top: calc(var(--header-h) + 1rem);
}
@media (max-width: 1023px) {
    .sidebar { position: static; }
}

.widget {
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 2px solid var(--color-accent);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}
.widget__title {
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
    color: var(--color-text);
}
.widget__hint {
    color: var(--color-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.5rem;
}
.widget__list { list-style: none; padding: 0; margin: 0; }
.widget__list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}
.widget__list li:last-child { border-bottom: 0; }
.widget__list a {
    display: block;
    text-decoration: none;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.95rem;
}
.widget__list a:hover { color: var(--color-accent); }
.widget__date {
    display: block;
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 0.15rem;
}

/* Search form */
.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-form label { flex: 1; }
.search-form .search-field {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--color-bg);
}
.search-form .search-field:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-accent) 25%, transparent);
}
.search-form .search-submit {
    padding: 0.6rem 1rem;
    background: var(--color-accent);
    color: var(--color-on-accent);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: filter var(--t-fast);
}
.search-form .search-submit:hover { filter: brightness(0.92); }

/* =========================================================================
   Jumplist (chapter drawer)
   ========================================================================= */
.jumplist__toggle {
    position: fixed;
    top: calc(var(--header-h) + var(--breadcrumb-h, 0px) + 10px);
    left: 0;
    transform: translateX(-8px);
    background: var(--color-accent);
    color: #fff;
    padding: 0.45rem 1.1rem 0.45rem 1.5rem;
    border-radius: 0 999px 999px 0;
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow);
    z-index: 40;
    transition: transform var(--t-fast);
}
.jumplist__toggle:hover { transform: translateX(0); }

.jumplist {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    width: min(85vw, 360px);
    background: var(--color-accent);
    color: #fff;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    transform: translateX(-100%);
    transition: transform var(--t-med);
    z-index: 41;
    box-shadow: var(--shadow-lg);
}
.jumplist[hidden] { display: block; } /* drawer pattern uses transform, not display */
.jumplist.is-open { transform: translateX(0); }

.jumplist ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.jumplist__link {
    display: block;
    padding: 0.6rem 0.75rem;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.05rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast), padding-left var(--t-fast);
}
.jumplist__link:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding-left: 1.25rem;
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
    margin-top: 4rem;
    background: var(--color-text);
    color: #fff;
}
.site-footer__accent {
    height: 4px;
    background: var(--color-accent);
}
.site-footer__inner {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding: 2rem var(--gutter);
    text-align: center;
}
.site-footer__menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: center;
}
.site-footer__menu a {
    color: #fff;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.5rem 0;
}
.site-footer__menu a:hover { text-decoration: underline; }

/* =========================================================================
   404 / archive
   ========================================================================= */
.error-404, .archive-intro {
    text-align: center;
    padding: clamp(3rem, 8vw, 6rem) var(--gutter);
}
.error-404 h1 { margin-bottom: 1rem; }

/* =========================================================================
   Cards (used on archive/blog index)
   ========================================================================= */
.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .layout--with-sidebar .cards { grid-template-columns: 1fr; }
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.10); }

.card__media { aspect-ratio: 16/9; overflow: hidden; background: var(--color-bg); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }

.card__body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.card__title { font-family: var(--font-sans); font-size: 1.2rem; margin: 0 0 0.5rem; }
.card__title a { color: var(--color-text); text-decoration: none; }
.card__title a:hover { color: var(--color-accent); }
.card__meta { font-family: var(--font-sans); font-size: 0.8rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.5rem; }
.card__excerpt { color: var(--color-muted); margin: 0 0 1rem; }
.card__more {
    align-self: flex-start;
    margin-top: auto;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    text-decoration: none;
}
.card__more:hover { text-decoration: underline; }

/* =========================================================================
   Sub-page grid (top-level section pages)
   ========================================================================= */
.subpages {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 1.5rem;
}
.subpages__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--color-text);
    text-decoration: none;
}
.subpages__link .card__media { background: var(--color-accent); }
.subpages__title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin: 0;
    padding: 0.9rem 1.1rem 1rem;
}
.subpages__link:hover .subpages__title,
.subpages__link:focus-visible .subpages__title { color: var(--color-accent); }

/* =========================================================================
   [gallery] shortcode grid
   ========================================================================= */
.gallery {
    --cols: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}
.gallery-columns-2 { --cols: 2; }
.gallery-columns-4 { --cols: 4; }
.gallery-columns-5 { --cols: 5; }
.gallery-columns-6 { --cols: 6; }
.gallery-columns-7 { --cols: 7; }
.gallery-columns-8 { --cols: 8; }
.gallery-columns-9 { --cols: 9; }
.gallery-columns-1 { --cols: 1; grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .gallery { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
}

.gallery-item { margin: 0; }
.gallery-icon a { display: block; }
.entry-content .gallery-icon img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.gallery-icon a:hover img { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.gallery-caption {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    line-height: 1.35;
    color: var(--color-muted);
    text-align: center;
}

/* =========================================================================
   Click-to-load placeholder for external embeds (inc/embed-consent.php)
   ========================================================================= */
.embed-consent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 100%;
    padding: 1.5rem;
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    text-align: center;
}
.embed-consent__text {
    margin: 0;
    max-width: 48ch;
    font-size: 0.95rem;
    color: var(--color-muted);
}
.embed-consent__btn {
    padding: 0.6rem 1.2rem;
    background: var(--color-accent);
    color: var(--color-on-accent);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: filter var(--t-fast);
}
.embed-consent__btn:hover { filter: brightness(0.92); }

/* =========================================================================
   Contact form (inc/contact-form.php)
   ========================================================================= */
.contact-form { max-width: 40rem; }
.contact-form__field label {
    display: block;
    margin-bottom: 0.3rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.contact-form__field input,
.contact-form__field textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    font: inherit;
}
.contact-form__field input:focus,
.contact-form__field textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-accent) 25%, transparent);
}
.contact-form__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.contact-form__privacy { font-size: 0.9rem; color: var(--color-muted); }
.contact-form__submit {
    padding: 0.7rem 1.4rem;
    background: var(--color-accent);
    color: var(--color-on-accent);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: filter var(--t-fast);
}
.contact-form__submit:hover { filter: brightness(0.92); }
.contact-form__notice {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--color-accent);
    background: var(--color-bg);
}
.contact-form__notice--error { border-left-color: #b3261e; }
.contact-form__notice ul { margin: 0; padding-left: 1.1rem; }

/* =========================================================================
   Lightbox (main.js) — opens linked images in content
   ========================================================================= */
.lightbox {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.92);
    color: #fff;
}
.lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox::backdrop { background: transparent; }

.lightbox__figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox__img {
    width: auto;
    height: auto;
    max-width: calc(100vw - 2rem);
    max-height: calc(100dvh - 6rem);
    object-fit: contain;
}
.lightbox__caption {
    margin-top: 0.75rem;
    padding-inline: 1rem;
    text-align: center;
    font-size: 1rem;
}
.lightbox__caption:empty { display: none; }

.lightbox__btn {
    position: absolute;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    transition: background var(--t-fast);
}
.lightbox__btn:hover { background: rgba(0, 0, 0, 0.75); }
.lightbox__btn[hidden] { display: none; }
.lightbox__close { top: 1rem; right: 1rem; font-size: 1.1rem; }
.lightbox__prev  { left: 1rem;  top: 50%; transform: translateY(-50%); }
.lightbox__next  { right: 1rem; top: 50%; transform: translateY(-50%); }

/* =========================================================================
   Utility
   ========================================================================= */
.no-scroll { overflow: hidden; }

/* WP-injected alignment classes */
.alignleft   { float: left;  margin: 0 1.5rem 1rem 0; max-width: 50%; }
.alignright  { float: right; margin: 0 0 1rem 1.5rem; max-width: 50%; }
.aligncenter { display: block; margin-inline: auto; }
.alignwide   { width: 100%; max-width: 1100px; margin-inline: auto; }
.alignfull   { width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); }

@media (max-width: 640px) {
    .alignleft, .alignright { float: none; margin: 1rem auto; max-width: 100%; }
}

/* Honors WP 6.4+ behaviour: native lightbox renders as a dialog overlay */
.wp-lightbox-overlay { background: rgba(0,0,0,0.92); }
