/* =========================================================================
   Pee-Pa's Garage, Shared global stylesheet
   Loaded on every page. Page-specific CSS lives inline in <style>.
   ========================================================================= */

/* ---- Self-hosted fonts (per CLAUDE.md performance rules) ---------------- */
@font-face {
    font-family: 'Bebas Neue';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/bebas-neue-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/inter-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/inter-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/playfair-display-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Playfair Display';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/playfair-display-italic-400.woff2') format('woff2');
}

/* Fallback metrics to prevent CLS while web fonts load */
@font-face {
    font-family: 'Inter Fallback';
    src: local('Arial');
    size-adjust: 107%;
    ascent-override: 90%;
    descent-override: 23%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Bebas Fallback';
    src: local('Impact');
    size-adjust: 90%;
    ascent-override: 95%;
    descent-override: 22%;
    line-gap-override: 0%;
}

/* ---- Reset / Base ------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --amber: #D4851F;
    --amber-light: #E9A54A;
    --amber-dark: #B36A10;
    --dark: #0F0F0F;
    --dark-surface: #1A1A1A;
    --dark-card: #222222;
    --cream: #F5F0E8;
    --cream-dark: #E8DFD0;
    --text-light: #F5F0E8;
    --text-muted: #A0998E;
    --rust: #8B3A1A;
    --steel: #4A5568;

    --font-display: 'Bebas Neue', 'Bebas Fallback', Impact, sans-serif;
    --font-body: 'Inter', 'Inter Fallback', Arial, sans-serif;
    --font-accent: 'Playfair Display', Georgia, serif;

    --max-width: 1200px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--dark);
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.5;
}

/* height: auto site-wide kills the stretched-photo class of bug: CSS
   that resizes an image's width can never leave the HTML height
   attribute in charge. Fixed-height images (logos, covers) all set an
   explicit CSS height, which still wins over this base rule. */
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }

/* ---- Nav (shared) ------------------------------------------------------- */
/* Three-column header: logo | centered links | Founders Club button.
   1fr side tracks shrink equally so the middle column stays truly
   centered on the page regardless of logo/button width. */
.site-nav {
    position: fixed;
    top: 38px; /* sits below the desktop address bar */
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.25rem;
    transition: background 0.4s, padding 0.4s, box-shadow 0.4s, top 0.4s;
}
.site-nav .nav-logo { grid-column: 1; justify-self: start; }
.site-nav .nav-links { grid-column: 2; justify-self: center; }
.site-nav .nav-cta-desktop { grid-column: 3; grid-row: 1; justify-self: end; }
.site-nav .mobile-toggle { grid-column: 3; grid-row: 1; justify-self: end; }
.site-nav.scrolled {
    top: 0; /* address bar retracts, nav slides flush to top */
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    padding: 0.5rem 2rem;
    box-shadow: 0 2px 30px rgba(0,0,0,0.5);
}

/* ---- Address utility bar ----------------------------------------------- */
/* Desktop: slim strip pinned to the very top; retracts on scroll.
   Mobile: sticky bar pinned to the bottom (see media query below).
   Injected by components.js so it appears on every page. */
.address-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    height: 38px;
    background: var(--amber);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: transform 0.4s ease, background 0.3s;
}
.address-bar:hover { background: var(--amber-light); }
.address-bar .pin {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
.address-bar .cta {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.68rem;
    font-weight: 700;
    border-bottom: 1.5px solid rgba(15, 15, 15, 0.45);
    padding-bottom: 1px;
}
.address-bar.retracted { transform: translateY(-100%); }
.nav-logo img {
    height: 70px;
    width: auto;
    display: block;
    transition: height 0.4s;
}
.site-nav.scrolled .nav-logo img { height: 50px; }
.nav-links {
    display: flex;
    gap: 1.8rem;
    list-style: none;
    align-items: center;
}
.nav-links a {
    color: var(--cream);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--amber);
    transition: width 0.3s;
}
.nav-links a:hover { color: var(--amber); }
.nav-links a:hover::after { width: 100%; }
.nav-links a[aria-current="page"] { color: var(--amber); }
.nav-links a[aria-current="page"]::after { width: 100%; }

/* ---- Nav dropdowns (Food, Events) -------------------------------------- */
.has-dropdown { position: relative; }
.drop-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: var(--font-body);
    color: var(--cream);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.3s;
}
.drop-toggle:hover,
.has-dropdown.open .drop-toggle,
.drop-toggle.current { color: var(--amber); }
.drop-toggle .caret {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    transition: transform 0.25s;
}
.has-dropdown.open .caret { transform: rotate(180deg); }
.dropdown {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 215px;
    background: var(--dark-surface);
    border-top: 2px solid var(--amber);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    list-style: none;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}
/* invisible bridge so the cursor can cross the gap without closing */
.dropdown::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown,
.has-dropdown.open .dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.dropdown a {
    display: block;
    padding: 0.6rem 1.4rem;
    white-space: nowrap;
}
.dropdown a::after { display: none; }
.dropdown a:hover { background: rgba(212, 133, 31, 0.08); }

/* Founders Club button: right header column on desktop, regular list
   item inside the slide-in panel on mobile. Never both at once. */
.nav-links .nav-cta-item { display: none; }
.nav-cta-desktop {
    font-size: 0.8rem;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}

.nav-cta {
    background: var(--amber) !important;
    color: var(--dark) !important;
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    transition: background 0.3s, transform 0.3s !important;
}
.nav-cta:hover {
    background: var(--amber-light) !important;
    transform: translateY(-1px);
}
.nav-cta::after { display: none !important; }

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 4px;
    z-index: 1001;
}
.mobile-toggle span {
    width: 28px;
    height: 2px;
    background: var(--cream);
    transition: 0.3s;
}

/* ---- Buttons ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: var(--amber);
    color: var(--dark);
}
.btn-primary:hover {
    background: var(--amber-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 133, 31, 0.3);
}
.btn-outline {
    background: transparent;
    color: var(--cream);
    border: 2px solid rgba(245, 240, 232, 0.3);
}
.btn-outline:hover {
    border-color: var(--amber);
    color: var(--amber);
    transform: translateY(-2px);
}
.btn-dark {
    background: var(--dark);
    color: var(--cream);
    padding: 1rem 2.5rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.3s;
    border: 0;
    cursor: pointer;
}
.btn-dark:hover {
    background: var(--dark-surface);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* ---- Marquee ------------------------------------------------------------ */
.marquee-section {
    background: var(--amber);
    padding: 0.9rem 0;
    overflow: hidden;
}
.marquee-track {
    display: flex;
    animation: marquee 30s linear infinite;
    width: max-content;
}
.marquee-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 2rem;
    white-space: nowrap;
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 3px;
    color: var(--dark);
}
.marquee-item .dot {
    width: 6px;
    height: 6px;
    background: var(--dark);
    border-radius: 50%;
    opacity: 0.4;
}

/* ---- Section header pattern -------------------------------------------- */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}
.section-header .tag {
    font-size: 0.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--amber);
    font-weight: 600;
    margin-bottom: 1rem;
    display: block;
}
.section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    letter-spacing: 2px;
    margin-bottom: 1rem;
    line-height: 1.05;
    min-height: 50px;
}
.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ---- Inline forms ------------------------------------------------------- */
/* Pattern A from FORMS-AND-THANK-YOU.md: .form-fields wraps inputs; .form-success
   replaces them on submit. JS hides .form-fields and adds .show to .form-success. */
.form-fields { display: block; }
.form-success {
    display: none;
    text-align: center;
    padding: 2rem 0;
}
.form-success.show { display: block; }
.form-success .success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(212, 133, 31, 0.15);
    color: var(--amber);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2rem;
    font-weight: 700;
}
.form-success h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    color: var(--cream);
}
.form-success p {
    color: var(--cream-dark);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto 0.5rem;
}
.form-success .next-cta {
    margin-top: 1.5rem;
    display: inline-flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-field {
    margin-bottom: 1rem;
}
.form-field label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cream-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--dark-card);
    border: 1px solid rgba(245, 240, 232, 0.1);
    border-radius: 4px;
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.3s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--amber);
}
.form-field textarea {
    min-height: 120px;
    resize: vertical;
}
.form-field .hint {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---- Page section spacing utilities ------------------------------------ */
.section-pad {
    padding: 6rem 2rem;
}
.section-pad-lg {
    padding: 8rem 2rem;
}
.container {
    max-width: var(--max-width);
    margin: 0 auto;
}
.container-wide {
    max-width: 1400px;
    margin: 0 auto;
}

/* ---- Hero scroll indicator -------------------------------------------- */
.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce 2s infinite;
}
.hero-scroll span {
    display: block;
    width: 24px;
    height: 38px;
    border: 2px solid rgba(245, 240, 232, 0.3);
    border-radius: 12px;
    position: relative;
}
.hero-scroll span::after {
    content: '';
    width: 4px;
    height: 8px;
    background: var(--amber);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollDot 2s infinite;
}

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
    background: var(--dark-surface);
    border-top: 1px solid rgba(245, 240, 232, 0.05);
}
.footer-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 4rem 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
}
.footer-brand img {
    height: 60px;
    margin-bottom: 1rem;
    width: auto;
}
.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}
.social-links {
    display: flex;
    gap: 0.75rem;
}
.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dark-card);
    color: var(--cream);
    text-decoration: none;
    font-size: 1.1rem;
    transition: background 0.3s, transform 0.3s;
}
.social-links a:hover {
    background: var(--amber);
    color: var(--dark);
    transform: translateY(-2px);
}
.social-links a svg { width: 18px; height: 18px; display: block; }
.footer-col h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    color: var(--cream);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.75rem; }
.footer-col a, .footer-col span {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    display: block;
}
.footer-col a:hover { color: var(--amber); }
.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(245, 240, 232, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer-bottom a { color: var(--text-muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--amber); }

/* ---- Hours list (used in contact, weddings, footer) -------------------- */
.hours-list {
    list-style: none;
}
.hours-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.hours-list .day { color: var(--cream); font-weight: 500; }
.hours-list .closed { color: var(--rust); }

/* ---- Animations --------------------------------------------------------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}
@keyframes scrollDot {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---- Inline SVG icons -------------------------------------------------- */
/* Icon containers set their size via font-size; the SVG inherits it (1em)
   and renders amber via currentColor. Replaces the old emoji icons. */
.icon svg,
.ic svg,
.contact-card-icon svg,
.tip-icon svg {
    width: 1em;
    height: 1em;
    display: block;
    margin: 0 auto;
    color: var(--amber);
    stroke-width: 1.7;
}

/* ---- reCAPTCHA v3 badge (hidden; attribution in footer instead) -------- */
.grecaptcha-badge { visibility: hidden; }

/* ---- A11y -------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

/* ---- Responsive nav + footer ------------------------------------------ */
/* Hamburger kicks in at 1200px: 8 links + logo + Founders button need
   the room; below that the slide-in panel takes over, with the Food and
   Events groups shown as amber section labels. */
@media (max-width: 1200px) {
    .site-nav { padding: 0.75rem 1.25rem; }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: var(--dark-surface);
        flex-direction: column;
        padding: 5rem 2rem;
        transition: right 0.4s;
        box-shadow: -10px 0 40px rgba(0,0,0,0.5);
        align-items: flex-start;
        overflow-y: auto;
    }
    .nav-links.open { right: 0; }
    .mobile-toggle { display: flex; }
    .nav-cta-desktop { display: none; }
    .nav-links .nav-cta-item { display: block; margin-top: 0.5rem; }

    /* Dropdown groups flatten into labeled sections in the panel */
    .nav-links .has-dropdown { width: 100%; }
    .nav-links .drop-toggle {
        pointer-events: none;
        color: var(--amber);
        font-size: 0.68rem;
        letter-spacing: 2.5px;
    }
    .drop-toggle .caret { display: none; }
    .dropdown {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        min-width: 0;
        background: transparent;
        border: 0;
        border-left: 2px solid rgba(212, 133, 31, 0.35);
        border-radius: 0;
        box-shadow: none;
        padding: 0.85rem 0 0.2rem 1rem;
        margin-top: 0.85rem;
        display: flex;
        flex-direction: column;
        gap: 0.95rem;
    }
    .dropdown::before { display: none; }
}
@media (max-width: 1024px) {
    .footer-main { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .site-nav { top: 0; }
    .site-nav.scrolled { top: 0; }

    /* Address bar: sticky to the BOTTOM (slides up on load) once the
       desktop top strip is gone, so there's no orphan address strip. */
    body { padding-bottom: 48px; }
    .address-bar {
        top: auto;
        bottom: 0;
        height: 48px;
        gap: 0.45rem;
        padding: 0 0.9rem;
        font-size: 0.78rem;
        box-shadow: 0 -4px 22px rgba(0, 0, 0, 0.45);
        transform: translateY(100%);
    }
    .address-bar .addr {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    /* the whole amber bar is the tap target, drop the redundant label */
    .address-bar .cta { display: none; }
    .address-bar.up { transform: translateY(0); }
    /* never use the desktop retract behavior on small screens */
    .address-bar.retracted { transform: translateY(0); }
    .address-bar.retracted.up { transform: translateY(0); }
}
@media (max-width: 768px) {
    .footer-main { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
    .form-row { grid-template-columns: 1fr; }
}
