/* Java Jill's Cafe & Bakery: "neighborhood bakery case with a drive-thru window"
   Palette: espresso brown, ube lavender, matcha green, buttercream, logo gold
   Fonts: Gloock (display) + Karla (body)
   Mobile-first: base styles target phones, min-width queries
   layer on large phones (641px+), tablet/desktop (861px+) and wide (981px+). */

:root {
  --espresso: #2e1c16;
  --espresso-2: #4a2e24;
  --butter: #fbf5ec;
  --butter-2: #f3e8d8;
  --paper: #fffdf9;
  --ube: #5f4391;
  --ube-deep: #4a3274;
  --ube-soft: #ece4f6;
  --matcha: #4b6833;
  --matcha-soft: #e4ecd6;
  --gold: #d6a84a;
  --ink: #2a1d18;
  --muted: #5e4f47;
  --line: #e3d5c1;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(46, 28, 22, 0.13);
  --display: "Gloock", Georgia, "Times New Roman", serif;
  --body: "Karla", 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(--butter);
  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(--ube-deep); text-underline-offset: 3px; }
a:hover { color: var(--ube); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; color: var(--espresso); margin: 0 0 0.5em; }
h1 { font-size: clamp(2.05rem, 8.6vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 6.6vw, 2.55rem); }
h3 { font-size: 1.25rem; }
h1 em { font-style: normal; color: var(--ube); box-shadow: inset 0 -0.28em 0 var(--ube-soft); }

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--espresso); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 800;
}
.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(--espresso); color: #f4ebdd; 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: #b9aca2; margin-right: 4px; vertical-align: 1px; }
.status-dot.open { background: #8fd27a; box-shadow: 0 0 0 3px rgba(143, 210, 122, 0.25); }
.status-dot.closed { background: #f0957f; }

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

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--espresso); }
.brand img { width: 38px; height: 38px; }
.brand-text { font-family: var(--display); font-size: 1.35rem; line-height: 1; }
.brand-text small { display: block; font-family: var(--body); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ube-deep); margin-top: 5px; }

.nav-toggle { display: grid; place-items: center; width: 48px; height: 48px; background: none; border: 2px solid var(--espresso); color: var(--espresso); 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%; z-index: 2;
  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(--ube); }
.main-nav .btn { margin-top: 12px; }

/* Cake-box scallop edge under the header */
.scallop {
  height: 12px;
  background: radial-gradient(circle at 12px 0, var(--paper) 11px, transparent 11.5px) 0 0 / 24px 12px repeat-x;
  filter: drop-shadow(0 2px 0 var(--line));
}

/* ---------- Buttons (48px min tap targets) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  background: var(--ube); color: #fff; border: 2px solid var(--ube);
  padding: 12px 22px; border-radius: 12px; font: 800 1rem/1.2 var(--body);
  text-decoration: none; cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--ube-deep); border-color: var(--ube-deep); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--espresso); border-color: var(--espresso); }
.btn-outline:hover { background: var(--espresso); border-color: var(--espresso); color: #fff; }
.btn-light { background: var(--gold); border-color: var(--gold); color: var(--espresso); }
.btn-light:hover { background: #e7bd64; border-color: #e7bd64; color: var(--espresso); }
.btn-outline-light { background: transparent; color: #fff; border-color: #f4ebdd; }
.btn-outline-light:hover { background: #fff; color: var(--espresso); 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(--ube-deep); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ube); }

/* ---------- Hero: phones get a full-bleed photo first ---------- */
.hero { padding: 0 0 40px; background: linear-gradient(180deg, var(--paper), var(--butter)); }
.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 70px 24px; box-shadow: var(--shadow); }
.eyebrow { font-weight: 800; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--matcha); 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(--espresso); }
.proof span { font-size: 0.8rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 54px 0; }
.section-alt { background: var(--butter-2); }
.section-dark { background: var(--espresso); color: #f4ebdd; }
.section-dark h2 { color: #fff; }
.section-dark .eyebrow { color: var(--gold); }
.section-dark .section-lead { color: #e9ddcc; }
.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(46, 28, 22, 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: 800; 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(--ube-soft); }

/* ---------- 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: 800 0.98rem var(--body); min-height: 44px; padding: 10px 18px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 2px solid var(--espresso); background: transparent; color: var(--espresso);
}
.tab-list [role="tab"][aria-selected="true"] { background: var(--espresso); 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(220px, 1fr)); gap: 26px; }
.menu-cols h3 { font-size: 1.2rem; border-bottom: 2px dashed var(--line); padding-bottom: 6px; }
.menu-cols h3:not(:first-child) { margin-top: 18px; }
.menu-cols ul { list-style: none; margin: 0; padding: 0; }
.menu-cols li { padding: 5px 0; }
.menu-items li { padding: 7px 0; }
.menu-items .item { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; }
.menu-items .price { font-weight: 600; color: var(--ube-deep); white-space: nowrap; }
.menu-items .desc { display: block; font-size: 0.93rem; color: var(--muted); }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; background: var(--matcha-soft); color: #3b5325; 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(--ube); background: linear-gradient(180deg, var(--ube-soft), var(--paper) 60%); }
.order-cta { font-weight: 800; color: var(--ube-deep); }
.badge { position: absolute; top: -12px; left: 18px; background: var(--ube); color: #fff; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }

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

/* ---------- Reviews ---------- */
.review { margin: 0; border-top: 5px solid var(--matcha); display: flex; flex-direction: column; gap: 12px; }
.review:nth-child(even) { border-top-color: var(--ube); }
.stars { color: var(--gold); 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.25rem; line-height: 1.32; color: var(--espresso); }
.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(--ube-soft); }
.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: var(--ube-soft); }
.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(--butter-2); display: grid; place-items: center; }
.map-frame iframe { width: 100%; height: 100%; min-height: 300px; border: 0; display: block; }

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

/* ---------- Footer ---------- */
.site-footer { background: var(--espresso); color: #e9ddcc; padding: 44px 0 24px; }
.site-footer a, .site-footer .link-btn { color: #fff; }
.site-footer a:hover, .site-footer .link-btn:hover { color: var(--gold); }
.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(--espresso); border: 2px solid var(--espresso);
}
.mobile-bar a.primary { background: var(--ube); border-color: var(--ube); 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(46, 28, 22, 0.62); }
.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: 800; 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 #9a8b7e; 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(--ube); 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(--espresso); color: #f4ebdd; 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; background: var(--gold); border-color: var(--gold); color: var(--espresso); }

/* ---------- 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.6rem; }
  .brand-text small { font-size: 0.72rem; }
  h3 { font-size: 1.32rem; }
  .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 { 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: 70px; }
  .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: 36px 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: 28px 28px 120px 28px; }

  .section { padding: 72px 0; }
  .section-lead { margin-bottom: 30px; }
  .rail { grid-template-columns: repeat(3, 1fr); }
  .catering { grid-template-columns: 240px 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); }
}
