/* Giacomo's Espresso & Deli: "Italian deli counter meets vintage car wash"
   Palette: racing green, crema cream, tomato red, mustard, chrome grey
   Fonts: DM Serif Display (display) + Figtree (body)
   Mobile-first: base styles target phones, min-width queries
   layer on large phones (641px+), tablet/desktop (861px+) and wide (981px+). */

:root {
  --green: #1d4a36;
  --green-deep: #133325;
  --cream: #f7f1e6;
  --cream-2: #efe5d3;
  --paper: #fffdf8;
  --red: #b3301c;
  --red-dark: #8f2414;
  --mustard: #e3a72f;
  --chrome: #c9ced1;
  --ink: #1f1a16;
  --muted: #5a5048;
  --line: #ddd1bd;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(19, 51, 37, 0.12);
  --display: "DM Serif Display", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 120px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  padding-bottom: 68px; /* room for the phone quick bar */
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-dark); text-underline-offset: 3px; }
a:hover { color: var(--red); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; color: var(--green-deep); margin: 0 0 0.5em; }
h1 { font-size: clamp(2.05rem, 8.6vw, 3.7rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 6.6vw, 2.6rem); }
h3 { font-size: 1.3rem; }
h1 em { font-style: italic; color: var(--red); }

/* Visible focus everywhere */
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
.section-dark :focus-visible, .site-footer :focus-visible, .top-bar :focus-visible { outline-color: var(--mustard); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--green-deep); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; color: #fff; }

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

.container { width: min(1140px, 100% - var(--gutter) * 2); margin-inline: auto; }
.narrow { width: min(760px, 100% - var(--gutter) * 2); }

/* ---------- Header ---------- */
.sticky-header { position: sticky; top: 0; z-index: 50; }

.top-bar { background: var(--green-deep); color: #f3ecdf; font-size: 0.82rem; }
.top-bar p { margin: 0; padding: 7px var(--gutter); text-align: center; }
.top-sep, .top-where { display: none; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--chrome); margin-right: 4px; vertical-align: 1px; }
.status-dot.open { background: #5fd38d; box-shadow: 0 0 0 3px rgba(95, 211, 141, 0.25); }
.status-dot.closed { background: #f08a7a; }

.site-header { position: relative; background: var(--paper); border-bottom: 1px solid var(--line); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green-deep); }
.brand img { width: 36px; height: 36px; }
.brand-text { font-family: var(--display); font-size: 1.3rem; line-height: 1; }
.brand-text small { display: block; font-family: var(--body); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-dark); margin-top: 4px; }

.nav-toggle { display: grid; place-items: center; width: 48px; height: 48px; background: none; border: 2px solid var(--green); color: var(--green); border-radius: 12px; cursor: pointer; }

/* Phone nav: full-width drop panel with large tap rows */
.main-nav {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  flex-direction: column; align-items: stretch; background: var(--paper);
  border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; box-shadow: var(--shadow);
}
.main-nav.open { display: flex; }
.main-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.main-nav a:not(.btn):hover { color: var(--red); }
.main-nav .btn { margin-top: 12px; }

/* Deli-paper gingham strip */
.deli-check {
  height: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(29, 74, 54, 0.85) 0 10px, transparent 10px 20px),
    repeating-linear-gradient(0deg, rgba(29, 74, 54, 0.45) 0 5px, transparent 5px 10px),
    var(--cream);
}

/* ---------- Buttons (48px min tap targets) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  background: var(--red); color: #fff; border: 2px solid var(--red);
  padding: 12px 22px; border-radius: 999px; font: 700 1rem/1.2 var(--body);
  text-decoration: none; cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--green-deep); border-color: var(--green); }
.btn-outline:hover { background: var(--green); border-color: var(--green); color: #fff; }
.btn-light { background: var(--mustard); border-color: var(--mustard); color: var(--green-deep); }
.btn-light:hover { background: #f0bb4f; border-color: #f0bb4f; color: var(--green-deep); }
.btn-outline-light { background: transparent; color: #fff; border-color: #f3ecdf; }
.btn-outline-light:hover { background: #fff; color: var(--green-deep); border-color: #fff; }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: 0.92rem; }
.btn-block { width: 100%; }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--red-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--red); }

/* ---------- Hero: phones get a full-bleed photo first ---------- */
.hero { padding: 0 0 40px; background: linear-gradient(180deg, var(--paper), var(--cream)); }
.hero-grid { display: flex; flex-direction: column; gap: 22px; }
.hero-media { order: -1; margin-inline: calc(var(--gutter) * -1); }
.hero-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 0 0 24px 24px; box-shadow: var(--shadow); }
.eyebrow { font-weight: 800; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-dark); margin: 0 0 10px; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 36em; margin: 0 0 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.hero-actions .btn { flex: 1 1 100%; }
.hero-copy .hero-actions { margin-top: 0; }

.proof { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0; margin: 18px 0 0; }
.proof li { display: flex; flex-direction: column; line-height: 1.25; }
.proof strong { font-family: var(--display); font-weight: 400; font-size: 1.25rem; color: var(--green-deep); }
.proof span { font-size: 0.8rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 54px 0; }
.section-alt { background: var(--cream-2); }
.section-dark { background: var(--green); color: #f3ecdf; }
.section-dark h2 { color: #fff; }
.section-dark .eyebrow { color: var(--mustard); }
.section-dark .section-lead { color: #e6dccb; }
.section-lead { color: var(--muted); max-width: 46em; margin: 0 0 26px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 2px 0 rgba(19, 51, 37, 0.05); }

/* Swipe rails: horizontal scroll-snap on phones, grids on bigger screens */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 80%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 18px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.swipe-hint { font-size: .85rem; font-weight: 700; color: var(--muted); margin: -8px 0 12px; }
.swipe-hint::after { content: " \2192"; }

.pillar { padding: 12px 12px 20px; }
.pillar h3, .pillar p { padding-inline: 6px; }
.pillar p { margin: 0; color: var(--muted); font-size: .95rem; }
.pillar-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; margin-bottom: 14px; background: var(--cream-2); }

/* ---------- Menu tabs (scrollable pill row on phones) ---------- */
.tab-list { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 calc(var(--gutter) * -1) 16px; padding: 0 var(--gutter) 4px; overflow-x: auto; scrollbar-width: none; }
.tab-list::-webkit-scrollbar { display: none; }
.tab-list [role="tab"] {
  font: 700 0.98rem var(--body); min-height: 44px; padding: 10px 18px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 2px solid var(--green); background: transparent; color: var(--green-deep);
}
.tab-list [role="tab"][aria-selected="true"] { background: var(--green); color: #fff; }
.tab-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.menu-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.menu-cols h3 { font-size: 1.2rem; border-bottom: 2px dotted var(--line); padding-bottom: 6px; }
.menu-cols ul { list-style: none; margin: 0; padding: 0; }
.menu-cols li { padding: 5px 0; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; background: #fbe6c0; color: #6b3f00; border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: 2px; }
.menu-note { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); }

/* ---------- Order ---------- */
.order-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.order-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink); text-align: left;
  font: inherit; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; position: relative;
}
.order-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.order-card p { color: var(--muted); margin: 0 0 14px; flex: 1; }
.order-card.featured { border: 2px solid var(--red); }
.order-cta { font-weight: 800; color: var(--red-dark); }
.badge { position: absolute; top: -12px; left: 18px; background: var(--red); color: #fff; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }

/* ---------- Catering ---------- */
.catering { display: grid; grid-template-columns: 1fr; gap: 26px; align-items: center; }
.catering-art { display: none; }
.catering-art img { width: 200px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25)); }

/* ---------- Reviews ---------- */
.review { margin: 0; border-top: 5px solid var(--mustard); display: flex; flex-direction: column; gap: 12px; }
.stars { color: #c98a12; font-size: 1.15rem; letter-spacing: 2px; line-height: 1; }
.review blockquote { margin: 0; flex: 1; }
.review blockquote p { margin: 0; font-family: var(--display); font-size: 1.3rem; line-height: 1.3; color: var(--green-deep); }
.review figcaption { font-size: .9rem; color: var(--muted); }
.review figcaption strong { color: var(--ink); }
.review-links { margin-top: 24px; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; gap: 10px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; background: var(--cream-2); }
.gallery .tall { grid-row: span 2; }
.gallery .wide { grid-column: span 2; }

/* ---------- Visit ---------- */
.visit-grid { display: grid; grid-template-columns: 1fr; gap: 26px; align-items: start; }
.visit-address { font-style: normal; margin-bottom: 18px; }
.hours { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.hours th, .hours td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.hours th { font-weight: 600; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours tr.today { background: #e3efe7; }
.hours tr.today th::after { content: " (today)"; font-weight: 400; color: var(--muted); }
.visit-facts { padding-left: 1.1em; margin: 18px 0 0; color: var(--muted); }
.visit-facts strong { color: var(--ink); }
.map-frame { min-height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--cream-2); display: grid; place-items: center; }
.map-frame iframe { width: 100%; height: 100%; min-height: 300px; border: 0; display: block; }

/* ---------- Sister locations ---------- */
.family-grid { display: grid; grid-template-columns: 1fr; gap: 18px; max-width: 760px; }
.family { text-decoration: none; color: var(--ink); }
.family p { color: var(--muted); }
.family:hover { box-shadow: var(--shadow); color: var(--ink); }

/* ---------- FAQ ---------- */
details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 0 18px; }
summary { cursor: pointer; font-weight: 700; padding: 16px 0; min-height: 56px; list-style-position: outside; }
details p { margin: 0 0 16px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-deep); color: #e6dccb; padding: 44px 0 24px; }
.site-footer a, .site-footer .link-btn { color: #fff; }
.site-footer a:hover, .site-footer .link-btn:hover { color: var(--mustard); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-brand { font-family: var(--display); font-size: 1.5rem; color: #fff; margin: 0 0 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 20px; align-content: flex-start; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, 0.15); margin-top: 26px; padding-top: 16px; font-size: 0.9rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.footer-legal p { margin: 0; }

/* ---------- Phone quick bar: thumb-reach actions ---------- */
.mobile-bar {
  display: grid; grid-template-columns: 1fr 1fr 1.3fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 8px;
}
.mobile-bar a {
  display: grid; place-items: center; min-height: 48px; border-radius: 12px; font-weight: 800;
  text-decoration: none; color: var(--green-deep); border: 2px solid var(--green);
}
.mobile-bar a.primary { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Modal: bottom sheet on phones, centered card on desktop ---------- */
dialog { border: 0; border-radius: 18px 18px 0 0; padding: 0; width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(19, 51, 37, 0.6); }
.order-form { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.modal-head h2 { font-size: 1.55rem; margin: 0; }
.modal-close { background: none; border: 0; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--ink); width: 44px; height: 44px; }
.form-note { color: var(--muted); margin: 6px 0 14px; }
.order-form label { display: block; font-weight: 700; margin: 12px 0 5px; font-size: 0.95rem; }
.optional { font-weight: 400; color: var(--muted); }
/* 16px+ inputs stop iOS from zooming on focus */
.order-form input, .order-form textarea, .order-form select {
  width: 100%; font: inherit; font-size: 1rem; min-height: 48px; padding: 10px 12px; border: 1.5px solid #9d917f; border-radius: 10px; background: #fff; color: var(--ink);
}
.order-form input:focus-visible, .order-form textarea:focus-visible, .order-form select:focus-visible { outline: 3px solid var(--red); outline-offset: 1px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.order-form .btn-block { margin-top: 18px; }
.form-fine { font-size: 0.85rem; color: var(--muted); margin: 12px 0 0; }

/* ---------- CA notice (sits above the phone quick bar) ---------- */
.notice {
  position: fixed; left: 10px; right: 10px; bottom: 76px; z-index: 60; max-width: 560px;
  background: var(--green-deep); color: #f3ecdf; border-radius: 14px; padding: 10px 12px;
  display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow);
}
.notice[hidden] { display: none; }
.notice p { margin: 0; font-size: 0.82rem; line-height: 1.4; }
.notice a { color: #fff; }
.notice .btn { white-space: nowrap; flex-shrink: 0; }

/* ---------- Simple pages ---------- */
.page { padding: 48px 0 64px; }
.page h2 { margin-top: 1.4em; font-size: 1.5rem; }

/* ---------- Large phones / small tablets (641px+) ---------- */
@media (min-width: 641px) {
  body { padding-bottom: 0; }
  .top-bar { font-size: 0.9rem; }
  .top-sep, .top-where { display: inline; }
  .brand img { width: 44px; height: 44px; }
  .brand-text { font-size: 1.55rem; }
  .brand-text small { font-size: 0.72rem; }
  h3 { font-size: 1.35rem; }
  .lead { font-size: 1.15rem; margin-bottom: 22px; }
  .hero-actions .btn { flex: 0 1 auto; }
  .proof { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 24px; }
  .proof strong { font-size: 1.5rem; }
  .proof span { font-size: 0.88rem; }
  .order-grid, .family-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .tab-panel { padding: 26px; }
  .card { padding: 22px; }

  .rail { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, 1fr); gap: 22px; overflow: visible; margin-inline: 0; padding: 0; }
  .swipe-hint { display: none; }

  .mobile-bar { display: none; }
  .notice { left: 16px; right: 16px; bottom: 16px; padding: 14px 16px; gap: 14px; }
  .notice p { font-size: 0.9rem; }

  dialog { width: min(560px, 100% - 24px); max-height: calc(100% - 24px); border-radius: 18px; margin: auto; }
  .order-form { padding: 24px; }
  .modal-head h2 { font-size: 1.7rem; }
}

/* ---------- Tablet / desktop (861px+) ---------- */
@media (min-width: 861px) {
  html { scroll-padding-top: 130px; }
  .nav-wrap { min-height: 68px; }
  .nav-toggle { display: none; }
  .main-nav, .main-nav.open { display: flex; position: static; flex-direction: row; align-items: center; gap: 22px; padding: 0; background: none; border: 0; box-shadow: none; }
  .main-nav a:not(.btn) { padding: 0; border: 0; }
  .main-nav .btn { margin-top: 0; }

  .hero { padding: 40px 0 56px; }
  .hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }
  .hero-media { order: 0; margin: 0; }
  .hero-media img { aspect-ratio: 8 / 7; border-radius: 24px; }

  .section { padding: 72px 0; }
  .section-lead { margin-bottom: 30px; }
  .rail { grid-template-columns: repeat(3, 1fr); }
  .review-rail { grid-template-columns: repeat(2, 1fr); max-width: 860px; }
  .catering { grid-template-columns: 220px 1fr; gap: 40px; }
  .catering-art { display: block; }
  .gallery { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 190px; gap: 14px; }
  .visit-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .map-frame, .map-frame iframe { min-height: 420px; }
  .page { padding: 56px 0 72px; }
}

/* ---------- Wide (981px+) ---------- */
@media (min-width: 981px) {
  .order-grid { grid-template-columns: repeat(4, 1fr); }
}
