/*
Theme Name: The Kernow
Theme URI: https://cornwall.info
Author: 1Fix
Author URI: https://cornish.co.uk
Description: A considered guide to Cornwall — its towns, beaches, harbours, history, and the small things worth knowing. Custom theme for cornwall.info, sister site to cornish.co.uk. Pairs with the-kernow-engine plugin.
Version: 0.1.9
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-kernow
Tags: custom, cornwall, editorial, reference
*/

/* ============================================================
   Self-hosted variable fonts.
   Drop the .woff2 files into assets/fonts/ to activate.
   While they're missing, the system fallbacks below take over.
   ============================================================ */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 300 500;
    font-display: swap;
    src: url('assets/fonts/fraunces-variable.woff2') format('woff2-variations');
}
@font-face {
    font-family: 'Fraunces';
    font-style: italic;
    font-weight: 300 500;
    font-display: swap;
    src: url('assets/fonts/fraunces-italic-variable.woff2') format('woff2-variations');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('assets/fonts/inter-variable.woff2') format('woff2-variations');
}

/* ============================================================
   Design tokens — single source of truth.
   Mirror the relevant ones in the-duchy if you want shared DNA.
   ============================================================ */
:root {
    --slate: #1a2332;
    --slate-soft: #2a3445;
    --cream: #faf8f4;
    --cream-warm: #f4f0e8;
    --sea: #7a9b8e;
    --sea-deep: #4a6b5e;
    --ink: #1a2332;
    --ink-soft: #4a5568;
    --rule: rgba(26, 35, 50, 0.08);
    --cyan-ring: #00d4e8; /* The single cornish.co.uk family-rhyme accent */

    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --content-max: 1240px;
    --gutter: 40px;
    --gutter-mobile: 24px;
    --header-height: 72px;
    --header-offset: 0px;

    --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ============================================================
   Reset & baseline
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, picture, video { max-width: 100%; height: auto; display: block; }
button { font: inherit; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   Site header (overlays the hero on the homepage)
   ============================================================ */
.site-header {
    position: fixed;
    top: var(--header-offset, 0px);
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 28px var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

/* Spacer so inner-page content is not hidden under the fixed header */
.site-header-spacer {
    display: block;
    height: calc(var(--header-height) + var(--header-offset, 0px));
    pointer-events: none;
}

/* Subtle scrim so cream nav text reads on pale sky in the hero photo */
.site-header:not(.is-light)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(26, 35, 50, 0.72) 0%,
        rgba(26, 35, 50, 0.35) 55%,
        rgba(26, 35, 50, 0) 100%
    );
    pointer-events: none;
    z-index: -1;
}

/* WordPress admin bar — offset set via JS (--header-offset); do not double-up html margin */
html {
    margin-top: 0 !important;
}

@media screen and (max-width: 782px) {
    html #wpadminbar {
        position: fixed;
    }
}

/* After scrolling past the hero — switch to readable light header */
.site-header.is-scrolled {
    background: rgba(250, 248, 244, 0.97);
    border-bottom: 1px solid var(--rule);
    backdrop-filter: blur(8px);
}

.site-header.is-scrolled::before {
    display: none;
}

.site-header.is-scrolled .logo,
.site-header.is-scrolled .nav a {
    color: var(--ink);
}

.site-header.is-scrolled .nav a:not(.sister-link) {
    color: var(--ink-soft);
}

.site-header.is-scrolled .nav .sister-link {
    border-color: var(--rule);
    color: var(--ink-soft);
}

.site-header.is-scrolled .nav-toggle-bar {
    background: var(--ink);
}

/* Inner pages — always fixed, cream bar (same as homepage when scrolled) */
.site-header.is-light {
    background: rgba(250, 248, 244, 0.98);
    border-bottom: 1px solid var(--rule);
    backdrop-filter: blur(8px);
}

.site-header.is-light::before {
    display: none;
}

.site-header.is-light .logo,
.site-header.is-light .nav a {
    color: var(--ink);
}

.site-header.is-light .nav a {
    color: var(--ink-soft);
}

.site-header.is-light .nav .sister-link {
    border-color: var(--rule);
}

.site-header.is-light .nav-toggle-bar {
    background: var(--ink);
}

.logo {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 24px;
    color: var(--cream);
    letter-spacing: -0.01em;
}

.logo .dot {
    color: var(--sea);
}

.nav {
    display: flex;
    gap: 36px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.nav-list {
    display: flex;
    gap: 36px;
    align-items: center;
}

.nav a {
    font-size: 13px;
    color: rgba(250, 248, 244, 0.85);
    letter-spacing: 0.02em;
    transition: color 0.3s var(--ease-out-expo);
}

.nav a:hover {
    color: var(--cream);
}

.nav .sister-link {
    padding: 7px 14px;
    border: 1px solid rgba(250, 248, 244, 0.3);
    border-radius: 999px;
    font-size: 12px;
    transition: background 0.3s var(--ease-out-expo), border-color 0.3s var(--ease-out-expo);
}

.nav .sister-link:hover {
    background: rgba(250, 248, 244, 0.08);
    border-color: rgba(250, 248, 244, 0.5);
}

/* Mobile menu toggle — hidden on desktop */
.nav-toggle {
    display: none;
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    background: var(--cream);
    border-radius: 1px;
    transition: transform 0.3s var(--ease-out-expo), opacity 0.3s var(--ease-out-expo);
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    max-height: 920px;
    overflow: hidden;
    background: var(--slate); /* Solid colour shows immediately while photo loads */
}

.hero-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 60%;
    animation: hero-breathe 24s var(--ease-in-out) infinite alternate;
}

.hero-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(26, 35, 50, 0.35) 0%,
        rgba(26, 35, 50, 0.15) 30%,
        rgba(26, 35, 50, 0.55) 75%,
        rgba(26, 35, 50, 0.85) 100%
    );
}

@keyframes hero-breathe {
    from { transform: scale(1); }
    to { transform: scale(1.04); }
}

.hero-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0 var(--gutter) 64px;
    color: var(--cream);
    z-index: 2;
}

.hero-inner { max-width: 720px; }

.hero-eyebrow {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(250, 248, 244, 0.7);
    margin-bottom: 24px;
    font-weight: 500;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(48px, 7.5vw, 92px);
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    color: var(--cream);
}

.hero-title em { font-style: italic; font-weight: 300; }

.hero-sub {
    font-size: 17px;
    line-height: 1.6;
    color: rgba(250, 248, 244, 0.85);
    max-width: 480px;
    margin-bottom: 36px;
}

/* Search */
.search {
    max-width: 560px;
    position: relative;
}

.search input {
    width: 100%;
    height: 56px;
    padding: 0 60px 0 24px;
    background: rgba(250, 248, 244, 0.95);
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    transition: box-shadow 0.3s var(--ease-out-expo), background 0.3s var(--ease-out-expo);
    backdrop-filter: blur(8px);
}

.search input::placeholder {
    color: var(--ink-soft);
    opacity: 0.7;
}

.search input:focus {
    background: var(--cream);
    box-shadow: 0 0 0 2px var(--cyan-ring);
}

.search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    width: 40px;
    border: none;
    background: var(--slate);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s var(--ease-out-expo);
}

.search-submit:hover { background: var(--slate-soft); }
.search-submit svg { width: 16px; height: 16px; stroke: var(--cream); }

.scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(250, 248, 244, 0.5);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    z-index: 2;
}

/* Full-bleed coast strip — editorial rhythm break between hero and places */
.coast-band {
    position: relative;
    width: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--slate);
    line-height: 0;
}

.coast-band__img {
    width: 100%;
    height: clamp(260px, 44vh, 520px);
    object-fit: cover;
    object-position: center 42%;
    display: block;
}

.coast-band::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 35%;
    background: linear-gradient(to bottom, transparent, var(--cream));
    pointer-events: none;
}

/* ============================================================
   Sections
   ============================================================ */
.section {
    padding: 120px var(--gutter);
    max-width: var(--content-max);
    margin: 0 auto;
}

#places {
    padding-top: 72px;
}

.section-head {
    margin-bottom: 64px;
    max-width: 640px;
}

.section-eyebrow {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sea-deep);
    margin-bottom: 16px;
    font-weight: 500;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 20px;
}

.section-title em { font-style: italic; }

.section-lede {
    font-size: 18px;
    line-height: 1.75;
    color: var(--ink-soft);
    max-width: 540px;
}

/* ============================================================
   Asymmetrical editorial grid (12-col) — Idea C
   Use .grid-asymmetrical on any 12-column showcase; .places-grid is an alias.
   ============================================================ */
.grid-asymmetrical,
.places-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 32px;
    align-items: start;
}

/* Homepage featured rhythm: row 1 → 6+6, row 2 → 4+4+4 */
.grid-asymmetrical--featured .place-card:nth-child(1),
.grid-asymmetrical--featured .place-card.large { grid-column: span 6; }

.grid-asymmetrical--featured .place-card:nth-child(2),
.grid-asymmetrical--featured .place-card.medium { grid-column: span 6; }

.grid-asymmetrical--featured .place-card:nth-child(n+3),
.grid-asymmetrical--featured .place-card.small { grid-column: span 4; }

.grid-asymmetrical .place-card.large,
.places-grid .place-card.large { grid-column: span 6; }

.grid-asymmetrical .place-card.medium,
.places-grid .place-card.medium { grid-column: span 6; }

.grid-asymmetrical .place-card.small,
.places-grid .place-card.small { grid-column: span 4; }

.place-card {
    color: var(--ink);
    display: block;
    transition: opacity 0.3s var(--ease-out-expo);
}

.grid-asymmetrical .place-card:hover,
.places-grid .place-card:hover { opacity: 0.95; }

.place-image {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 0;
    overflow: hidden;
    background: var(--cream-warm);
    margin-bottom: 24px;
    position: relative;
}

.place-card.large .place-image { aspect-ratio: 16/10; }

.place-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-asymmetrical .place-card:hover .place-image img,
.places-grid .place-card:hover .place-image img {
    transform: none;
}

.place-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.place-region {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--sea-deep);
    font-weight: 500;
}

.place-cornish {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 13px;
    color: var(--ink-soft);
    opacity: 0.75;
}

.place-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 30px;
    line-height: 1.15;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.place-card.large .place-name { font-size: 42px; }

.place-blurb {
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-soft);
    max-width: 480px;
}

.places-empty {
    padding: 32px;
    background: var(--cream-warm);
    border-radius: 6px;
    border: 1px solid var(--rule);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-soft);
}

.places-empty p + p { margin-top: 12px; }

.places-empty code {
    font-size: 14px;
    background: var(--cream);
    padding: 2px 8px;
    border-radius: 4px;
}

.places-empty a {
    color: var(--sea-deep);
    border-bottom: 1px solid var(--rule);
}

/* ============================================================
   Dark divider section
   ============================================================ */
.divider-section {
    background: var(--slate);
    color: var(--cream);
    padding: 120px var(--gutter);
}

.divider-section .section { padding: 0; }
.divider-section .section-eyebrow { color: var(--sea); }
.divider-section .section-title { color: var(--cream); }
.divider-section .section-lede { color: rgba(250, 248, 244, 0.75); }

.topics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(250, 248, 244, 0.12);
    border: 1px solid rgba(250, 248, 244, 0.12);
    border-radius: 4px;
    overflow: hidden;
}

.topic {
    background: var(--slate);
    padding: 40px 36px;
    color: var(--cream);
    transition: background 0.4s var(--ease-out-expo);
    display: block;
}

.topic:hover { background: var(--slate-soft); }

.topic-number {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 14px;
    color: var(--sea);
    margin-bottom: 32px;
}

.topic-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 24px;
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.topic-blurb {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(250, 248, 244, 0.7);
}

/* ============================================================
   About preview
   ============================================================ */
.about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-prose {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 22px;
    line-height: 1.5;
    color: var(--ink);
    letter-spacing: -0.005em;
}

.about-prose p { margin-bottom: 24px; }
.about-prose p:last-child { margin-bottom: 0; }

.about-meta {
    border-left: 1px solid var(--rule);
    padding-left: 40px;
}

.stat { margin-bottom: 32px; }
.stat:last-child { margin-bottom: 0; }

.stat-number {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 44px;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 500;
}

/* ============================================================
   Sister site strip — the cornish.co.uk handoff
   ============================================================ */
.sister-strip {
    background: var(--cream-warm);
    padding: 80px var(--gutter);
}

.sister-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
}

.sister-text {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 28px;
    line-height: 1.3;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.sister-text em { font-style: italic; }

.sister-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: var(--slate);
    color: var(--cream);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: background 0.3s var(--ease-out-expo);
}

.sister-cta:hover { background: var(--slate-soft); }
.sister-cta svg { width: 14px; height: 14px; }

/* ============================================================
   Site footer
   ============================================================ */
.site-footer {
    background: var(--slate);
    color: rgba(250, 248, 244, 0.7);
    padding: 80px var(--gutter) 40px;
}

.footer-inner {
    max-width: var(--content-max);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(250, 248, 244, 0.12);
}

.footer-brand .logo { display: inline-block; margin-bottom: 16px; }

.footer-tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 18px;
    color: rgba(250, 248, 244, 0.85);
    max-width: 320px;
    line-height: 1.5;
}

.footer-col h4 {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sea);
    margin-bottom: 20px;
    font-weight: 500;
}

.footer-col li { margin-bottom: 12px; }

.footer-col a {
    color: rgba(250, 248, 244, 0.7);
    font-size: 14px;
    transition: color 0.3s var(--ease-out-expo);
}

.footer-col a:hover { color: var(--cream); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(250, 248, 244, 0.5);
}

.footer-bottom a {
    color: rgba(250, 248, 244, 0.5);
    margin-left: 24px;
}

/* ============================================================
   Single place / beach / attraction page (basic)
   ============================================================ */
.entry-hero {
    background: var(--slate);
    color: var(--cream);
    padding: 48px var(--gutter) 80px;
    text-align: left;
}

.entry-hero-inner {
    max-width: var(--content-max);
    margin: 0 auto;
}

.entry-region {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sea);
    font-weight: 500;
    margin-bottom: 16px;
}

.entry-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.entry-cornish {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 22px;
    color: rgba(250, 248, 244, 0.65);
}

/* Photo hero (Task 4.1) */
.entry-hero--photo {
    background: var(--slate);
    color: var(--cream);
    padding: 0;
}

.entry-hero-media {
    position: relative;
    max-height: 60vh;
    min-height: 360px;
    overflow: hidden;
}

.entry-hero-image {
    display: block;
    width: 100%;
    height: 60vh;
    min-height: 360px;
    max-height: 60vh;
    object-fit: cover;
    object-position: center 55%;
}

.entry-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(26, 35, 50, 0.25) 0%,
        rgba(26, 35, 50, 0.1) 35%,
        rgba(26, 35, 50, 0.55) 72%,
        rgba(26, 35, 50, 0.88) 100%
    );
    pointer-events: none;
}

.entry-hero-inner--overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 var(--gutter) 48px;
    z-index: 2;
}

.entry-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 80px var(--gutter);
    font-size: 18px;
    line-height: 1.7;
    color: var(--ink);
}

.entry-body h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 32px;
    line-height: 1.2;
    margin: 48px 0 16px;
    letter-spacing: -0.01em;
}

.entry-body h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 24px;
    line-height: 1.3;
    margin: 40px 0 12px;
}

.entry-body p { margin-bottom: 24px; }

.entry-body a {
    color: var(--sea-deep);
    border-bottom: 1px solid var(--rule);
    transition: border-color 0.3s var(--ease-out-expo);
}

.entry-body a:hover { border-bottom-color: var(--sea-deep); }

/* Cross-link to sister site, used inline on entry pages */
.cross-link {
    display: block;
    margin: 48px 0;
    padding: 24px 28px;
    background: var(--cream-warm);
    border-radius: 6px;
    border-left: 3px solid var(--cyan-ring);
}

.cross-link-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sea-deep);
    margin-bottom: 8px;
    font-weight: 500;
}

.cross-link-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 19px;
    color: var(--ink);
    line-height: 1.4;
}

.cross-link-text em { font-style: italic; }

/* ============================================================
   Archive (list of all places, beaches, etc.)
   ============================================================ */
.archive-header {
    padding: 48px var(--gutter) 60px;
    max-width: var(--content-max);
    margin: 0 auto;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 32px;
    padding: 0 var(--gutter) 120px;
    max-width: var(--content-max);
    margin: 0 auto;
}

/* Pagination — places archive, search */
.pagination,
.navigation.pagination {
    grid-column: 1 / -1;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gutter) 80px;
}

.pagination .nav-links,
.navigation.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
}

.pagination .page-numbers,
.navigation.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--ink-soft);
    border: 1px solid var(--rule);
    border-radius: 4px;
    transition: background 0.2s var(--ease-out-expo), color 0.2s var(--ease-out-expo);
}

.pagination .page-numbers:hover,
.navigation.pagination .page-numbers:hover {
    color: var(--ink);
    background: var(--cream-warm);
}

.pagination .page-numbers.current,
.navigation.pagination .page-numbers.current {
    background: var(--slate);
    color: var(--cream);
    border-color: var(--slate);
}

/* ============================================================
   Search results / 404
   ============================================================ */
.message-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px var(--gutter);
    text-align: center;
}

.message-page-inner { max-width: 480px; }

.message-page h1 {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 48px;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.message-page p {
    font-size: 17px;
    color: var(--ink-soft);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    :root {
        --header-height: 64px;
    }

    .site-header {
        padding-top: max(14px, env(safe-area-inset-top, 0px));
        padding-bottom: 14px;
        padding-left: var(--gutter-mobile);
        padding-right: var(--gutter-mobile);
    }

    .nav { gap: 20px; }

    .nav-toggle {
        display: block;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--gutter-mobile) 24px;
        background: rgba(26, 35, 50, 0.97);
        border-bottom: 1px solid rgba(250, 248, 244, 0.1);
    }

    .site-header.is-nav-open .nav {
        display: flex;
    }

    .site-header.is-scrolled .nav {
        background: var(--cream);
        border-bottom-color: var(--rule);
    }

    .site-header.is-light .nav {
        background: var(--cream);
        border-bottom-color: var(--rule);
    }

    .nav a,
    .nav-list a {
        display: block;
        padding: 14px 0;
        font-size: 15px;
        border-bottom: 1px solid rgba(250, 248, 244, 0.08);
    }

    .site-header.is-scrolled .nav a,
    .site-header.is-scrolled .nav-list a {
        border-bottom-color: var(--rule);
    }

    .nav .sister-link,
    .nav-list .sister-link {
        margin-top: 8px;
        text-align: center;
        border: 1px solid rgba(250, 248, 244, 0.3);
        border-radius: 999px;
        padding: 12px 16px;
    }

    .site-header.is-scrolled .nav .sister-link,
    .site-header.is-scrolled .nav-list .sister-link {
        border-color: var(--rule);
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    .nav-list li {
        width: 100%;
    }

    /* Wide hero photo — zoom out on narrow viewports so both figures stay in frame */
    .hero-image {
        background-size: 100% auto;
        background-position: center top;
        background-repeat: no-repeat;
        animation: none;
    }

    .hero-content { padding: 0 var(--gutter-mobile) 48px; }

    .hero-title {
        font-size: clamp(36px, 10vw, 56px);
    }

    .hero-sub {
        font-size: 16px;
        margin-bottom: 28px;
    }

    .search input {
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    .coast-band__img {
        height: clamp(200px, 36vh, 360px);
    }

    .section,
    .divider-section,
    .sister-strip,
    .site-footer { padding-left: var(--gutter-mobile); padding-right: var(--gutter-mobile); }

    .section,
    .divider-section { padding-top: 80px; padding-bottom: 80px; }

    #places { padding-top: 56px; }

    .section-head { margin-bottom: 48px; }

    .section-lede { font-size: 17px; }

    /* Featured + archive grids — single column (featured nth-child rules beat plain .place-card.small) */
    .grid-asymmetrical,
    .places-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .grid-asymmetrical--featured .place-card:nth-child(1),
    .grid-asymmetrical--featured .place-card:nth-child(2),
    .grid-asymmetrical--featured .place-card:nth-child(n+3),
    .grid-asymmetrical--featured .place-card.large,
    .grid-asymmetrical--featured .place-card.medium,
    .grid-asymmetrical--featured .place-card.small,
    .grid-asymmetrical .place-card,
    .places-grid .place-card,
    .place-card.large,
    .place-card.medium,
    .place-card.small {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .place-card.large .place-name,
    .place-name {
        font-size: clamp(26px, 7vw, 34px);
    }

    .place-blurb {
        max-width: none;
        font-size: 15px;
    }

    .place-meta {
        flex-wrap: wrap;
        gap: 4px 12px;
    }

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

    .topic { padding: 32px 24px; }

    .about { grid-template-columns: 1fr; gap: 40px; }

    .about-prose { font-size: 20px; }

    .about-meta { border-left: none; border-top: 1px solid var(--rule); padding-left: 0; padding-top: 32px; }

    .sister-inner { grid-template-columns: 1fr; }

    .sister-text { font-size: clamp(22px, 6vw, 28px); }

    .sister-cta { justify-content: center; white-space: normal; text-align: center; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }

    .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }

    .footer-bottom a { margin: 0 12px; }

    .archive-header {
        padding: 32px var(--gutter-mobile) 40px;
    }

    .archive-grid {
        grid-template-columns: 1fr;
        gap: 48px;
        padding: 0 var(--gutter-mobile) 80px;
    }

    .entry-hero-media,
    .entry-hero-image {
        min-height: 280px;
        height: 45vh;
        max-height: 45vh;
    }

    .entry-hero-inner--overlay {
        padding: 0 var(--gutter-mobile) 32px;
    }

    .entry-title { font-size: clamp(32px, 8vw, 48px); }

    .entry-body {
        padding: 56px var(--gutter-mobile);
        font-size: 17px;
    }

    .entry-hero:not(.entry-hero--photo) {
        padding: 32px var(--gutter-mobile) 48px;
    }

    .pagination,
    .navigation.pagination {
        padding-left: var(--gutter-mobile);
        padding-right: var(--gutter-mobile);
        padding-bottom: 64px;
    }

    .archive-header .section-title {
        font-size: clamp(32px, 8vw, 48px);
    }

    .page .entry-body,
    .page .archive-header {
        padding-left: var(--gutter-mobile);
        padding-right: var(--gutter-mobile);
    }
}

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

    .stat-number { font-size: 36px; }

    .hero {
        min-height: 480px;
        max-height: none;
    }

    .scroll-hint { display: none; }

    .divider-section { padding-top: 64px; padding-bottom: 64px; }

    .site-footer { padding-top: 56px; padding-bottom: 32px; }

    .footer-grid {
        gap: 28px;
        margin-bottom: 40px;
        padding-bottom: 40px;
    }

    .cross-link {
        margin: 32px 0;
        padding: 20px;
    }

    .message-page {
        padding: 80px var(--gutter-mobile);
        min-height: 50vh;
    }

    .message-page h1 { font-size: 36px; }
}

/* Tablet — two-column archives, tighter featured row */
@media (min-width: 601px) and (max-width: 900px) {
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px 28px;
    }

    .grid-asymmetrical,
    .places-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px;
    }

    .grid-asymmetrical--featured .place-card:nth-child(1),
    .grid-asymmetrical--featured .place-card:nth-child(2),
    .grid-asymmetrical--featured .place-card.large,
    .grid-asymmetrical--featured .place-card.medium {
        grid-column: 1 / -1;
    }

    .grid-asymmetrical--featured .place-card:nth-child(n+3),
    .grid-asymmetrical--featured .place-card.small,
    .grid-asymmetrical .place-card.small,
    .places-grid .place-card.small {
        grid-column: auto;
    }
}

/* Mobile nav open — solid bar, lock scroll */
body.is-nav-open {
    overflow: hidden;
}

.site-header.is-nav-open:not(.is-light) {
    background: rgba(26, 35, 50, 0.98);
}

.site-header.is-nav-open.is-scrolled {
    background: rgba(250, 248, 244, 0.98);
}

.site-header.is-nav-open:not(.is-scrolled):not(.is-light)::before {
    display: none;
}

.site-header.is-nav-open .logo,
.site-header.is-nav-open:not(.is-scrolled) .nav-toggle-bar {
    color: var(--cream);
}

.site-header.is-nav-open:not(.is-scrolled) .nav-toggle-bar {
    background: var(--cream);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .hero-image {
        animation: none !important;
    }

    .place-card,
    .topic,
    .nav a,
    .sister-cta,
    .search input,
    .search-submit {
        transition: none !important;
    }
}

/* Vibe preview — placeholder places when CPT empty */
.vibe-preview-note {
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 24px;
    max-width: 620px;
}

.place-card--preview {
    cursor: default;
    opacity: 0.98;
}

.place-card--preview:hover {
    opacity: 0.98;
}

/* ============================================================
   WordPress core classes (alignments, captions, screen-readers)
   ============================================================ */
.alignleft { float: left; margin: 0.5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1rem auto; }

.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0;
    position: absolute !important; width: 1px; word-wrap: normal !important;
}
