/* ==========================================================================
   The Olive Branch Restaurant — 2026 redesign
   Warm editorial Mediterranean: deep olive, cream, brick.
   Photography leads; type does the rest.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */
@font-face {
    font-family: 'Fraunces';
    src: url('../fonts/fraunces-latin-var.woff2') format('woff2-variations');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Karla';
    src: url('../fonts/karla-latin-var.woff2') format('woff2-variations');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */
:root {
    --ink: #1c211c;
    --olive-900: #2b342a;
    --olive-700: #414d3e;
    --olive: #5d6b60;
    --sage: #93a291;
    --sage-pale: #c9d2c6;
    --cream: #f2efe3;
    --paper: #fbfaf5;
    --brick: #a13041;
    --brick-dark: #7d2432;
    --gold: #b8964a;

    --display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --body: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

    --measure: 62ch;
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --page: 1240px;
    --radius: 2px;

    --step-6: clamp(2.75rem, 1.2rem + 6.6vw, 6rem);
    --step-5: clamp(2.1rem, 1.2rem + 4vw, 4rem);
    --step-4: clamp(1.7rem, 1.2rem + 2.2vw, 2.6rem);
    --step-3: clamp(1.35rem, 1.1rem + 1.1vw, 1.8rem);
    --step-2: 1.125rem;
    --step-1: 1rem;
    --step-0: 0.9375rem;
    --micro: 0.75rem;
}

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

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: var(--step-1);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a { color: inherit; }

h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 500;
    line-height: 1.06;
    letter-spacing: -0.015em;
    margin: 0;
    font-variation-settings: 'SOFT' 0, 'WONK' 1;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

:focus-visible {
    outline: 2px solid var(--brick);
    outline-offset: 3px;
}

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

.section { padding-block: clamp(3.5rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

.section-label {
    font-family: var(--body);
    font-size: var(--micro);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brick);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 0 0 1.4rem;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.3;
}

.lede {
    font-size: var(--step-3);
    line-height: 1.45;
    max-width: 34ch;
    font-family: var(--display);
    font-weight: 400;
}

.prose { max-width: var(--measure); }
.prose a { color: var(--brick); text-underline-offset: 3px; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
    --btn-bg: var(--brick);
    --btn-fg: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    background: var(--btn-bg);
    color: var(--btn-fg) !important;
    border: 1px solid var(--btn-bg);
    border-radius: 999px;
    padding: 0.85em 1.7em;
    font-family: var(--body);
    font-size: var(--step-0);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .25s ease, border-color .25s ease, color .25s ease, transform .18s ease;
}

.btn:hover { background: var(--brick-dark); border-color: var(--brick-dark); transform: translateY(-1px); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: currentColor; }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper) !important; transform: translateY(-1px); }

.btn--onDark { --btn-bg: transparent; --btn-fg: #fff; border-color: rgba(255,255,255,.55); }
.btn--onDark:hover { background: #fff; color: var(--ink) !important; border-color: #fff; }

.btn svg { width: 1.05em; height: 1.05em; flex: none; }

/* --- Status strip (injected by the SIPO layer) ---------------------------- */
.status-strip {
    position: relative;
    z-index: 60;
    background: var(--olive-900);
    color: var(--cream);
    font-size: var(--micro);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    padding: 0.7rem var(--gutter);
}

.status-strip.open { background: #2f5d3f; }
.status-strip.closed { background: var(--brick-dark); }
.status-strip.error { background: #4a4a4a; }

.status-strip-inner { display: flex; align-items: center; justify-content: center; gap: 0.65rem; }

.status-strip-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--sage-pale); flex: none;
}

.status-strip.open .status-strip-dot { background: #7fe0a4; }
.status-strip.closed .status-strip-dot { background: #f0a0ac; }

/* --- Header --------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--paper);
    border-bottom: 1px solid rgba(28,33,28,.1);
    transition: box-shadow .3s ease;
}

.site-header.is-stuck { box-shadow: 0 6px 28px rgba(28,33,28,.09); }

.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 76px;
}

.brand { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; flex: none; }
.brand img { width: clamp(112px, 13vw, 148px); }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.1rem); }

.nav a {
    font-size: var(--step-0);
    font-weight: 500;
    text-decoration: none;
    color: var(--ink);
    padding-block: 0.35rem;
    position: relative;
    white-space: nowrap;
}

.nav a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1.5px;
    background: var(--brick);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}

.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--brick); }

.nav-tel { font-variant-numeric: tabular-nums; }

.nav-cta { display: flex; align-items: center; gap: 0.9rem; flex: none; }

/* The nav carries its own Order button for the mobile drawer; on desktop the
   one in .nav-cta is the visible call to action, so only ever show one. */
@media (min-width: 901px) {
    .nav > .btn { display: none; }
}

.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    background: none; border: 0; cursor: pointer; padding: 0;
    color: var(--ink);
}

.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: '';
    display: block;
    width: 22px; height: 2px;
    background: currentColor;
    transition: transform .3s ease, opacity .2s ease;
}

.nav-toggle span { position: relative; }
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }

.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .masthead { min-height: 64px; }

    .nav {
        position: fixed;
        inset: 0 0 0 auto;
        width: min(88vw, 340px);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        background: var(--olive-900);
        color: var(--cream);
        padding: 5.5rem 2rem 2rem;
        transform: translateX(100%);
        transition: transform .38s cubic-bezier(.4,0,.2,1);
        overflow-y: auto;
        z-index: 55;
    }

    .nav.is-open { transform: translateX(0); }
    .nav a { color: var(--cream); font-size: 1.2rem; padding-block: 0.95rem; border-bottom: 1px solid rgba(255,255,255,.12); }
    .nav a::after { display: none; }
    .nav a[aria-current="page"] { color: #fff; }
    .nav .btn { margin-top: 1.5rem; }

    .nav-backdrop {
        position: fixed; inset: 0;
        background: rgba(20,24,20,.55);
        opacity: 0; visibility: hidden;
        transition: opacity .3s ease, visibility .3s ease;
        z-index: 54;
    }
    .nav-backdrop.is-visible { opacity: 1; visibility: visible; }
    .nav-cta .btn { display: none; }
}

/* --- Hero ----------------------------------------------------------------- */
.hero { position: relative; background: var(--olive-900); color: #fff; overflow: hidden; }

.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

.hero-media::after {
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(to right, rgba(24,29,23,.92) 0%, rgba(24,29,23,.72) 45%, rgba(24,29,23,.25) 100%),
        linear-gradient(to top, rgba(24,29,23,.75), transparent 55%);
}

.hero-inner {
    position: relative;
    display: grid;
    align-content: end;
    gap: 1.6rem;
    min-height: clamp(30rem, 78vh, 46rem);
    padding-block: clamp(3.5rem, 9vw, 6rem);
}

.hero-sign { width: clamp(150px, 20vw, 236px); margin-bottom: -0.4rem; }

.hero h1 {
    font-size: var(--step-6);
    max-width: 15ch;
    color: #fff;
    font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 144;
}

.hero h1 em { font-style: italic; color: var(--sage-pale); }

.hero p {
    max-width: 46ch;
    font-size: var(--step-2);
    color: rgba(255,255,255,.88);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.6rem;
    font-size: var(--micro);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
    font-weight: 700;
}

.hero-meta span { display: flex; align-items: center; gap: 0.5rem; }
.hero-meta span::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

/* --- Intro / split -------------------------------------------------------- */
.split {
    display: grid;
    gap: clamp(2rem, 5vw, 4.5rem);
    grid-template-columns: 1fr;
    align-items: center;
}

@media (min-width: 860px) {
    .split { grid-template-columns: 1.05fr 0.95fr; }
    .split--flip > :first-child { order: 2; }
}

.split-figure { position: relative; }

.split-figure img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius);
}

.halal-badge {
    position: absolute;
    right: clamp(-14px, -1vw, -8px);
    bottom: clamp(-18px, -2vw, -12px);
    width: clamp(84px, 11vw, 118px);
    aspect-ratio: 1;
    background: #fff;
    border-radius: 50%;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(28,33,28,.16);
}

.halal-badge img { width: 100%; height: 100%; object-fit: contain; aspect-ratio: auto; border-radius: 0; }

/* --- Notice --------------------------------------------------------------- */
.notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    padding: 1rem 1.4rem;
    background: var(--cream);
    border-left: 3px solid var(--gold);
    font-size: var(--step-0);
}

.notice strong { font-family: var(--display); font-size: 1.05em; }

/* --- Dish rail ------------------------------------------------------------ */
.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 1fr);
    gap: 1.1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.75rem;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: thin;
}

.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--sage-pale); border-radius: 3px; }

.dish { scroll-snap-align: start; }

.dish img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius);
    transition: transform .5s cubic-bezier(.2,.8,.2,1);
}

.dish:hover img { transform: scale(1.03); }
.dish figcaption { margin-top: 0.7rem; font-size: var(--step-0); font-weight: 600; }
.dish figcaption span { display: block; font-weight: 400; color: var(--olive); font-size: var(--micro); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.15rem; }

/* --- Hours ---------------------------------------------------------------- */
.panel {
    background: var(--olive-900);
    color: var(--cream);
    padding: clamp(1.75rem, 4vw, 2.75rem);
    border-radius: var(--radius);
}

.panel h2, .panel h3 { color: #fff; }

.sipo-hours-table { margin: 0; }

.sipo-hours-table .hours-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.62rem 0;
    border-bottom: 1px solid rgba(255,255,255,.13);
    font-size: var(--step-0);
}

.sipo-hours-table .hours-row:last-child { border-bottom: 0; }

.sipo-hours-table .day {
    flex: none;
    font-weight: 600;
    min-width: 5.5rem;
}

/* dotted leader — an editorial touch that also aids scanning */
.sipo-hours-table .hours-row::after {
    content: '';
    order: 1;
    flex: 1;
    height: 0;
    border-bottom: 1px dotted rgba(255,255,255,.22);
    transform: translateY(-0.28em);
}

.sipo-hours-table .time {
    order: 2;
    flex: none;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sipo-hours-table .closed-day { opacity: 0.55; }

/* Today's row. The base styling must stay readable on a light background —
   only the dark .panel variant may go white, otherwise the highlighted row
   renders white-on-cream and disappears. */
.sipo-hours-table .hours-row.today { font-weight: 600; }
.sipo-hours-table .hours-row.today .day { color: var(--brick); }

.panel .sipo-hours-table .hours-row.today { color: #fff; }
.panel .sipo-hours-table .hours-row.today .day { color: var(--gold); }

/* light variant */
.hours-light .sipo-hours-table .hours-row { border-bottom-color: rgba(28,33,28,.12); }
.hours-light .sipo-hours-table .hours-row::after { border-bottom-color: rgba(28,33,28,.25); }

/* --- Contact list --------------------------------------------------------- */
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.35rem; }

.contact-list dt, .contact-list .label {
    font-size: var(--micro);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--olive);
    margin-bottom: 0.2rem;
}

.contact-list a, .contact-list .value {
    font-family: var(--display);
    font-size: var(--step-3);
    text-decoration: none;
    line-height: 1.25;
    display: inline-block;
}

.contact-list a:hover { color: var(--brick); }

.panel .contact-list dt, .panel .contact-list .label { color: var(--sage-pale); }

/* --- Gallery -------------------------------------------------------------- */
.gallery { columns: 4 220px; column-gap: 0.85rem; }
.gallery figure { break-inside: avoid; margin: 0 0 0.85rem; }

.gallery img {
    width: 100%;
    border-radius: var(--radius);
    background: var(--cream);
    transition: transform .5s cubic-bezier(.2,.8,.2,1), filter .4s ease;
}

.gallery figure:hover img { transform: scale(1.02); filter: saturate(1.06); }

/* --- Menu page cards ------------------------------------------------------ */
.menu-cards { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

.menu-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    min-height: 220px;
    padding: clamp(1.5rem, 3vw, 2.1rem);
    background: var(--cream);
    border: 1px solid rgba(28,33,28,.09);
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform .3s ease, box-shadow .3s ease, background .3s ease;
}

.menu-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(28,33,28,.11); background: #fff; }
.menu-card h3 { font-size: var(--step-4); }
.menu-card .kicker { font-size: var(--micro); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--brick); }
.menu-card .go { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: var(--step-0); }
.menu-card .go svg { width: 1.1em; height: 1.1em; transition: transform .3s ease; }
.menu-card:hover .go svg { transform: translateX(4px); }

.info-grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.info-grid h3 { font-size: var(--step-3); margin-bottom: 0.6rem; }
.info-grid p { font-size: var(--step-0); }

/* --- Map ------------------------------------------------------------------ */
.map-link { display: block; border-radius: var(--radius); overflow: hidden; }
.map-link img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; transition: transform .5s ease; }
.map-link:hover img { transform: scale(1.03); }

/* --- Footer --------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--sage-pale); padding-block: clamp(3rem, 7vw, 5rem) 2rem; }
.site-footer h2, .site-footer h3 { color: #fff; font-size: var(--step-3); margin-bottom: 0.9rem; }
.site-footer a { color: var(--cream); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.footer-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.footer-grid p, .footer-grid li { font-size: var(--step-0); }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

.footer-bottom {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    padding-top: 1.6rem;
    border-top: 1px solid rgba(255,255,255,.12);
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 2rem;
    justify-content: space-between;
    align-items: center;
    font-size: var(--micro);
    letter-spacing: 0.04em;
}

.footer-bottom a { color: var(--gold); }

.footer-halal { width: 76px; }
.footer-halal img { width: 100%; background: #fff; border-radius: 50%; padding: 8px; }

/* --- Floating order ------------------------------------------------------- */
.floating-order {
    position: fixed;
    right: clamp(0.9rem, 2.5vw, 1.75rem);
    bottom: clamp(0.9rem, 2.5vw, 1.75rem);
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--brick);
    color: #fff !important;
    border-radius: 999px;
    padding: 0.9rem 1.5rem;
    font-weight: 700;
    font-size: var(--step-0);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(28,33,28,.28);
    transform: translateY(140%);
    transition: transform .45s cubic-bezier(.2,.8,.2,1), background .25s ease;
}

.floating-order.is-visible { transform: translateY(0); }
.floating-order:hover { background: var(--brick-dark); }
.floating-order svg { width: 1.15em; height: 1.15em; flex: none; }

@media (max-width: 900px) {
    .floating-order { padding: 0.85rem 1.25rem; }
}

/* --- Reveal ---------------------------------------------------------------
   Content is visible by default and only hidden once the `js` class confirms
   scripting is alive. Hiding it in the base stylesheet would mean a failed or
   throttled IntersectionObserver leaves the page permanently blank — a failure
   mode this site has already been bitten by once. site.js also runs a timed
   failsafe that reveals everything regardless. */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}

.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .dish img, .gallery img, .map-link img, .btn, .menu-card { transition: none; }
}

/* --- Page head (inner pages) ---------------------------------------------- */
.page-head { background: var(--olive-900); color: #fff; padding-block: clamp(3rem, 8vw, 5.5rem); }
.page-head h1 { font-size: var(--step-5); max-width: 18ch; }
.page-head p { color: rgba(255,255,255,.8); max-width: 52ch; margin-top: 1rem; }
.page-head .section-label { color: var(--gold); }

/* --- Utilities ------------------------------------------------------------ */
.skip-link {
    position: absolute; left: -9999px;
    background: var(--ink); color: #fff; padding: 0.8rem 1.2rem; z-index: 200;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.bg-cream { background: var(--cream); }
.stack > * + * { margin-top: 1.15rem; }
.stack-lg > * + * { margin-top: 2rem; }
