/* ==========================================================================
   Crumb & Crust — shared stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Karla:wght@400;500;600;700&display=swap');

:root {
  --forest: #2c4a3e;
  --forest-deep: #1d332a;
  --cream: #f6f1e3;
  --cream-dim: #e9e1c9;
  --teal: #1b6e5c;
  --teal-deep: #124d40;
  --crust: #94622e;
  --charcoal: #23231f;
  --paper: #fffdf8;
  --line: #8c7847;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", "Segoe UI", Arial, sans-serif;

  --container: 1160px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-soft: 0 12px 30px -12px rgba(35, 35, 31, 0.18);
  --shadow-lift: 0 20px 40px -14px rgba(35, 35, 31, 0.28);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 1rem; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.1; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}
.theme-dark a:focus-visible,
.theme-dark button:focus-visible,
.theme-dark input:focus-visible,
.theme-dark textarea:focus-visible,
.theme-dark select:focus-visible {
  outline-color: var(--cream);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Crumb texture (signature motif) ---------- */
/* A field of soft irregular circles standing in for bread's crumb — used sparingly
   as a background texture on dark sections and as a divider ornament. */
.crumb-field {
  position: relative;
  isolation: isolate;
}
.crumb-field::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Ccircle cx='24' cy='34' r='7' fill='%23f6f1e3' fill-opacity='0.05'/%3E%3Ccircle cx='96' cy='18' r='3.5' fill='%23f6f1e3' fill-opacity='0.045'/%3E%3Ccircle cx='176' cy='58' r='10' fill='%23f6f1e3' fill-opacity='0.045'/%3E%3Ccircle cx='48' cy='104' r='4.5' fill='%23f6f1e3' fill-opacity='0.05'/%3E%3Ccircle cx='132' cy='128' r='8' fill='%23f6f1e3' fill-opacity='0.04'/%3E%3Ccircle cx='204' cy='150' r='5.5' fill='%23f6f1e3' fill-opacity='0.045'/%3E%3Ccircle cx='72' cy='182' r='11' fill='%23f6f1e3' fill-opacity='0.04'/%3E%3Ccircle cx='20' cy='214' r='3.5' fill='%23f6f1e3' fill-opacity='0.05'/%3E%3Ccircle cx='158' cy='210' r='6' fill='%23f6f1e3' fill-opacity='0.045'/%3E%3Ccircle cx='224' cy='96' r='3' fill='%23f6f1e3' fill-opacity='0.05'/%3E%3C/svg%3E");
}
.crumb-field > * { position: relative; z-index: 1; }

.crumb-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto;
}
.crumb-divider span {
  display: block;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
.crumb-divider span:nth-child(1) { width: 5px; height: 5px; }
.crumb-divider span:nth-child(2) { width: 9px; height: 9px; }
.crumb-divider span:nth-child(3) { width: 5px; height: 5px; }

/* ---------- Type helpers ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--teal);
}
.theme-dark .eyebrow { color: var(--cream-dim); }

h1.display {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 600;
}
h2.display {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 600;
}
h3.display {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 600;
}
.lede {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--teal-deep);
}
.theme-dark .lede { color: var(--cream); }

.prose { font-size: 1.05rem; line-height: 1.75; color: #3c3c34; }
.theme-dark .prose { color: var(--cream); }
.prose + .prose { margin-top: 1.25em; }
.prose-narrow { max-width: 62ch; margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--forest);
  color: var(--cream);
}
.btn-primary:hover { background: var(--forest-deep); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
/* On dark-green pages (about/contact) the header itself is forest green, so the
   default button would vanish into it. Invert it there so it always pops. */
.theme-dark .btn-primary {
  background: var(--cream);
  color: var(--forest-deep);
}
.theme-dark .btn-primary:hover {
  background: var(--paper);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.btn-outline {
  background: transparent;
  border-color: currentColor;
  color: var(--forest);
}
.btn-outline:hover { background: var(--forest); color: var(--cream); transform: translateY(-2px); }
.theme-dark .btn-outline { color: var(--cream); }
.theme-dark .btn-outline:hover { background: var(--cream); color: var(--forest-deep); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.theme-dark .site-header {
  background: var(--forest);
  border-bottom-color: rgba(246, 241, 227, 0.14);
}
.site-header.is-scrolled { box-shadow: 0 6px 20px -12px rgba(0,0,0,0.25); }

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--charcoal);
  letter-spacing: 0.01em;
}
.theme-dark .logo { color: var(--cream); }

.nav-links {
  display: none;
  align-items: center;
  gap: 2.1rem;
}
.nav-links a, .nav-links button.nav-link {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--charcoal);
  background: none;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.theme-dark .nav-links a, .theme-dark .nav-links button.nav-link { color: var(--cream-dim); }
.nav-links a.active, .theme-dark .nav-links a.active { color: var(--teal); }
.theme-dark .nav-links a.active { color: var(--cream); }
.nav-links a:hover { color: var(--teal); }
.theme-dark .nav-links a:hover { color: var(--cream); }

.dropdown { position: relative; }
.dropdown-caret { font-size: 0.7em; transition: transform 0.16s ease; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 190px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}
.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown-menu a {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--charcoal);
}
.dropdown-menu a:hover { background: var(--cream); color: var(--teal-deep); }

.hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  padding: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  width: 24px;
  margin: 0 auto;
  background: var(--charcoal);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.theme-dark .hamburger span { background: var(--cream); }
.hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 76px 0 0 0;
  background: var(--paper);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  overflow-y: auto;
  z-index: 49;
  padding: 1rem 0 2.5rem;
}
.theme-dark .mobile-nav { background: var(--forest); }
.mobile-nav.open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-nav .container { display: flex; flex-direction: column; gap: 0.1rem; }
.mobile-nav a, .mobile-nav .mobile-toggle {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--charcoal);
  background: none;
  border-left: none; border-right: none; border-top: none;
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.theme-dark .mobile-nav a, .theme-dark .mobile-nav .mobile-toggle { color: var(--cream); border-bottom-color: rgba(246,241,227,0.16); }
.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease;
}
.mobile-submenu.open { max-height: 200px; }
.mobile-submenu a {
  font-size: 1.05rem;
  padding-left: 1.25rem;
  font-weight: 500;
  border-bottom: 1px dashed var(--line);
}
.mobile-nav .btn { margin-top: 1.25rem; }

@media (min-width: 900px) {
  .nav-links { display: flex; }
  .hamburger, .mobile-nav { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.theme-dark { background: var(--forest); color: var(--cream); }
.theme-light { background: var(--paper); }
.text-center { text-align: center; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Home hero gallery ---------- */
.hero {
  padding-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
  text-align: center;
}
.hero-tagline { margin-top: 0.85rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; margin-top: 2.25rem; flex-wrap: wrap; }

.hero-gallery {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(0.9rem, 2.4vw, 1.6rem);
}
.hero-gallery .stack { display: grid; gap: inherit; }
.hero-gallery figure { margin: 0; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.hero-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hero-gallery .main-photo { aspect-ratio: 4 / 5; }
.hero-gallery .stack figure { aspect-ratio: 16 / 10; }
.hero-gallery figure:hover img { transform: scale(1.045); }

@media (max-width: 760px) {
  .hero-gallery { grid-template-columns: 1fr; }
  .hero-gallery .main-photo { aspect-ratio: 5 / 4; }
}

/* ---------- Signature bread cards (menu landing) ---------- */
.bread-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  margin-top: 2.5rem;
}
.bread-card {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.bread-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.bread-card figure { margin: 0; aspect-ratio: 4/3; }
.bread-card img { width: 100%; height: 100%; object-fit: cover; }
.bread-card figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.2rem 1.5rem 1.25rem;
  background: linear-gradient(to top, rgba(29,51,42,0.92) 0%, rgba(29,51,42,0.88) 62%, rgba(29,51,42,0) 100%);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}
@media (max-width: 620px) {
  .bread-cards { grid-template-columns: 1fr; }
}

/* ---------- Product rows (sourdough / focaccia pages) ---------- */
.product-list { display: flex; flex-direction: column; gap: clamp(2.25rem, 5vw, 3.5rem); margin-top: 2.75rem; }
.product-row {
  display: grid;
  grid-template-columns: minmax(0, 380px) 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.product-row figure {
  margin: 0;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.product-row img { width: 100%; height: 100%; object-fit: cover; }
.product-row .placeholder-photo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 0.6rem;
  background: repeating-linear-gradient(135deg, #f2ede0, #f2ede0 12px, #ece5d2 12px, #ece5d2 24px);
  border: 2px dashed var(--line);
  color: #5f5236;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem;
}
.product-row h3 { margin-bottom: 0.6rem; }
@media (max-width: 700px) {
  .product-row { grid-template-columns: 1fr; }
}

/* ---------- Ordering info block ---------- */
.order-info {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(3, 1fr);
}
.order-info .step .num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--teal);
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
}
.order-info .step p { font-size: 0.95rem; line-height: 1.55; }
@media (max-width: 760px) {
  .order-info { grid-template-columns: 1fr; }
}

/* ---------- About page ---------- */
.bio-block { max-width: 68ch; margin: 0 auto; }
.bio-block + .bio-block { margin-top: 3rem; }
.bio-name {
  font-family: var(--font-display);
  color: var(--cream);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: block;
}

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 4rem);
  text-align: center;
}
.contact-grid a.email {
  font-size: 1.15rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.contact-grid h2 { margin-bottom: 1.5rem; }
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.feedback-btn {
  display: block;
  margin: 3rem auto 0;
  max-width: 640px;
  background: var(--paper);
  color: var(--teal-deep);
  text-align: center;
  padding: 1.1rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease;
}
.feedback-btn:hover { transform: translateY(-2px); }

/* ---------- Order form ---------- */
.order-shell {
  max-width: 760px;
  margin: 0 auto;
}
.status-banner {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.status-banner.open { background: #e6efe4; color: var(--teal-deep); }
.status-banner.closed { background: #f3e6df; color: #8a4b32; }

.form-section { margin-bottom: 2.5rem; }
.form-section h2 { margin-bottom: 1.1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.1rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 0.9rem; }
.field .hint { font-weight: 400; font-size: 0.82rem; color: #71705f; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  background: var(--paper);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 90px; }

.radio-pills { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.radio-pill {
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill:has(input:checked) { background: var(--forest); border-color: var(--forest); color: var(--cream); }

#deliveryFields { display: none; margin-top: 1rem; }
#deliveryFields.show { display: block; }

.order-items { display: flex; flex-direction: column; gap: 0.9rem; }
.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
}
.order-item-info h4 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 0.2rem; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.order-item-info p { font-size: 0.85rem; color: #666;}
.item-price { font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; color: var(--teal-deep); }
.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-btn:disabled:hover { background: var(--paper); color: var(--forest); }

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.section-heading-row h2 { margin-bottom: 0; }
.item-counter {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-deep);
  background: var(--cream);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}
.item-counter.at-max { color: #9c3b23; background: #f6e3e0; }

.order-total {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--charcoal);
  margin: 1.5rem 0 1rem;
}
.qty-stepper { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.qty-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--forest);
  background: var(--paper);
  color: var(--forest);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.qty-btn:hover { background: var(--forest); color: var(--cream); }
.qty-input {
  width: 32px;
  text-align: center;
  border: none;
  font-weight: 700;
  font-size: 1.05rem;
  background: none;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.form-message {
  margin-top: 1.25rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  display: none;
}
.form-message.show { display: block; }
.form-message.success { background: #e6efe4; color: var(--teal-deep); }
.form-message.error { background: #f6e3e0; color: #9c3b23; }
.form-message.warning { background: #faf1dc; color: #8a6415; }

.setup-note {
  margin-top: 3rem;
  border: 1.5px dashed var(--crust);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  font-size: 0.88rem;
  color: #6b5a3d;
  background: #fdf8ee;
}
.setup-note strong { color: var(--charcoal); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--forest-deep);
  color: var(--cream-dim);
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.9rem;
}
.site-footer a { text-decoration: underline; text-underline-offset: 3px; }
.site-footer .logo { color: var(--cream); display: block; margin-bottom: 0.6rem; }
