/* style.css - Base stylesheet for PHP JSON flat-file sites
   Design tokens are injected as CSS custom properties via site_tokens_css().
   Add site-specific overrides below the base layer. */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding-top: var(--header-height, 64px);
    background: var(--color-bg, #fff);
    color: var(--color-text, #1a1a1a);
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: 1rem;
    line-height: 1.65;
}

a {
    color: var(--color-accent, #2563eb);
    text-decoration: underline;
}

a:hover {
    color: var(--color-accent-strong, #1d4ed8);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Shared tool marker. A tool is an action, so it gets a distinct visual
   language instead of looking like another paragraph heading. */
.site-tool {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding-left: 1rem;
    border-left: 2px solid var(--color-tool-accent, #e9782b);
}

.site-tool__icon {
  display: block;
  width: 32px;
  height: 32px;
}

.site-tool__body {
  min-width: 0;
}

.site-tool__name {
    color: var(--color-tool-strong, #a64b1a);
    text-decoration-color: var(--color-tool-accent, #e9782b);
    text-underline-offset: 0.18em;
}

.site-tool__name:hover,
.site-tool__name:focus-visible {
    color: var(--color-tool-accent, #e9782b);
}

.site-tool__description {
    color: var(--color-text-muted, #4b5563);
}

/* ── Header ────────────────────────────────────────────────────────────────── */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height, 64px);
    background: var(--color-surface, #fff);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    z-index: 100;
}

.site-header__inner {
    max-width: var(--content-width, 1200px);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-logo a {
    font-family: var(--font-display, system-ui, sans-serif);
    font-weight: 300;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--color-text, #1a1a1a);
}

.site-logo span:last-child {
    color: var(--color-accent, #2563eb);
}

/* ── Navigation ────────────────────────────────────────────────────────────── */

.site-nav {
    margin-left: auto;
}

.site-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

.site-nav__list a {
    color: var(--color-text, #1a1a1a);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}

.site-nav__list a:hover,
.site-nav__list a.is-active {
    color: var(--color-accent, #2563eb);
}

.site-nav__item--has-dropdown {
    position: relative;
}

.nav-chevron::after {
    content: ' \25BE';
    font-size: 0.75em;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-small, 6px);
    padding: 0.5rem 0;
    min-width: 200px;
    list-style: none;
    margin: 0;
    box-shadow: var(--shadow-card);
    z-index: 200;
}

.site-nav__item--has-dropdown:hover .nav-dropdown {
    display: block;
}

.nav-dropdown li a {
    display: block;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    font-size: 0.875rem;
}

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text, #1a1a1a);
    border-radius: 2px;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */

.page-wrapper {
    max-width: var(--content-width, 1200px);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.content-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

.content-layout--single {
    grid-template-columns: 1fr;
    max-width: 760px;
}

.content-main {
    min-width: 0;
}

.content-sidebar {
    position: sticky;
    top: calc(var(--header-height, 64px) + 1.5rem);
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────────────── */

.breadcrumbs {
    margin-bottom: 1.5rem;
}

.breadcrumbs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--color-text-muted, #6b7280);
}

.breadcrumbs__item + .breadcrumbs__item::before {
    content: '/';
    margin-right: 0.5rem;
}

.breadcrumbs__item.is-current {
    color: var(--color-text, #1a1a1a);
}

/* ── Sidebar blocks ───────────────────────────────────────────────────────── */

.sidebar-block {
    background: var(--color-surface, #f8f9fa);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-medium, 10px);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.sidebar-block__title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #6b7280);
}

.sidebar-block__links {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-block__links a {
    font-size: 0.875rem;
}

.cta-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--color-accent, #2563eb);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-small, 6px);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */

.site-footer {
    border-top: 1px solid var(--color-border, #e5e7eb);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    background: var(--color-surface, #f8f9fa);
}

.site-footer__inner {
    max-width: var(--content-width, 1200px);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-footer__top {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.site-footer__brand-name {
    font-family: var(--font-display, system-ui, sans-serif);
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.site-footer__tagline {
    margin: 0 0 0.5rem;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.875rem;
}

.site-footer__contact a {
    color: var(--color-text-muted, #6b7280);
    font-size: 0.875rem;
}

.site-footer__col-heading {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #6b7280);
    margin-bottom: 0.75rem;
}

.site-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.site-footer__links a {
    color: var(--color-text, #1a1a1a);
    text-decoration: none;
    font-size: 0.875rem;
}

.site-footer__links a:hover {
    color: var(--color-accent, #2563eb);
}

.site-footer__bottom {
    border-top: 1px solid var(--color-border, #e5e7eb);
    padding-top: 1rem;
    font-size: 0.8rem;
    color: var(--color-text-muted, #6b7280);
}

/* ── Utility ─────────────────────────────────────────────────────────────────── */

.text-muted {
    color: var(--color-text-muted, #6b7280);
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-small, 6px);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.btn--primary {
    background: var(--color-accent, #2563eb);
    color: #fff;
}

.btn--primary:hover {
    background: var(--color-accent-strong, #1d4ed8);
    color: #fff;
}

.btn--outline {
    border: 1px solid var(--color-accent, #2563eb);
    color: var(--color-accent, #2563eb);
    background: transparent;
}

/* ── Error page ─────────────────────────────────────────────────────────────── */

.error-page {
    text-align: center;
    padding: 5rem 1rem;
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 200;
    margin: 0 0 0.5rem;
    color: var(--color-text-muted, #6b7280);
}

.error-page p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ── Mobile ─────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .nav-hamburger {
        display: flex;
    }

    /* The height is load-bearing, do not "clean it up".
       BUILD-STANDARDS section 7 asks for a fixed header and a fixed mobile
       panel nested inside it. The moment anyone adds backdrop-filter, filter
       or transform to .site-header (a common dark-theme move), the header
       becomes the containing block for this panel, and top + bottom then
       resolve against the header instead of the viewport. A 64px offset inside
       a 64px box leaves the content box at zero, so the menu opens showing only
       its own padding. Setting the height explicitly makes that impossible
       whether or not the blur is ever added. vh first, dvh second so dvh wins
       where supported and mobile browser chrome cannot clip the panel. */
    .site-nav {
        display: none;
        position: fixed;
        top: var(--header-height, 64px);
        left: 0;
        right: 0;
        height: calc(100vh - var(--header-height, 64px));
        height: calc(100dvh - var(--header-height, 64px));
        overflow-y: auto;
        background: var(--color-surface, #fff);
        border-bottom: 1px solid var(--color-border, #e5e7eb);
        padding: 1rem 1.5rem;
        z-index: 99;
    }

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

    .site-nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .nav-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0 0 0 1rem;
    }

    .site-nav__item--has-dropdown:hover .nav-dropdown {
        display: none;
    }

    .site-nav.is-open .nav-dropdown {
        display: block;
    }

    .content-layout {
        grid-template-columns: 1fr;
    }

    .content-sidebar {
        position: static;
    }

    .site-footer__top {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* ── Prose (marketing / FAQ / default page body) ─────────────────────────────── */

.prose h1 {
    font-family: var(--font-display);
    font-weight: 200;
    letter-spacing: -0.02em;
    line-height: 1.2;
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin: 0 0 1rem;
}

.prose h2 {
    font-family: var(--font-display);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.25;
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    margin: 2.5rem 0 1rem;
}

.prose h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.2rem;
    margin: 1.75rem 0 0.75rem;
}

.prose p {
    margin: 0 0 1.1rem;
}

.prose ul,
.prose ol {
    margin: 0 0 1.1rem;
    padding-left: 1.4rem;
}

.prose li {
    margin-bottom: 0.4rem;
}

.prose blockquote {
    margin: 1.5rem 0;
    padding-left: 1.25rem;
    border-left: 2px solid var(--color-accent);
    color: var(--color-text-muted);
    font-style: italic;
}

/* ── Hero (home page) ─────────────────────────────────────────────────────────── */

.hero {
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2.5rem;
}

.hero__eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-highlight);
    margin-bottom: 1rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 200;
    letter-spacing: -0.02em;
    line-height: 1.15;
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    margin: 0 0 1.25rem;
    max-width: 18ch;
}

.hero__lede {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    max-width: 58ch;
    margin: 0 0 2rem;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Sections ─────────────────────────────────────────────────────────────────── */

.section {
    margin: 3rem 0;
}

.section__heading {
    font-family: var(--font-display);
    font-weight: 300;
    letter-spacing: -0.02em;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0 0 1.5rem;
}

/* ── Numbered step cards ──────────────────────────────────────────────────────── */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
    list-style: none;
    padding: 0;
}

.step {
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    padding: 1.5rem;
}

.step__number {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 200;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.step__title {
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.step__body {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ── CTA / city cards ─────────────────────────────────────────────────────────── */

.cta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.cta-card {
    display: block;
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--color-text);
    transition: border-color 0.15s, transform 0.15s;
}

.cta-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    color: var(--color-text);
}

.cta-card__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.cta-card__meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ── Contact form ─────────────────────────────────────────────────────────────── */

.form-field {
    margin-bottom: 1.25rem;
}

.form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
}

.form-field textarea {
    min-height: 140px;
    resize: vertical;
}

.form-notice {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-small);
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--color-accent);
    background: var(--color-panel);
}

.form-notice--error {
    border-left-color: #ef4444;
}

@media (max-width: 768px) {
    .steps,
    .cta-row {
        grid-template-columns: 1fr;
    }
}

/* ── 404 "did you mean" suggestions (self-healing slug links, §8) ───────────── */

.error-suggestions {
    margin: 0 auto 2rem;
    max-width: 32rem;
    text-align: left;
}

.error-suggestions__label {
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
    color: var(--color-text-muted, #6b7280);
}

.error-suggestions ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.error-suggestions li + li {
    margin-top: 0.35rem;
}
