/* =============================================================================
   Preferred Sonoma Caterers — Site CSS (cleaned & annotated)
   Notes:
   - Behavior/layout preserved. No value changes.
   - Later sections include page-scoped and explicit overrides by design.
   - Edit "Variables" or the per-section notes, not the structure, to keep parity.
   ============================================================================= */


/* ========== Variables ======================================================= */
/* Brand palette + layout knobs */
:root {
  /* Colors */
  --brand: #145A32;       /* primary accent (e.g., big H1 in intro) */
  --brand-600: #8a2a2a;   /* link color; set --link below to use something else */
  --ink: #6a1a1a;         /* default text color */
  --muted: #5b5b5b;       /* secondary text in cards/footer */
  --bg: #ffffff;          /* page background */
  --paper: #faf7f5;       /* warm beige panels (top bar, intro, footer) */
  --link: var(--brand-600);

  /* Layout knobs */
  --maxw: 1120px;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0,0,0,.08);
  --topbar-h: 75px;       /* header height and brand-logo height */
  --nav-icon-size: 22px;  /* mobile menu.gif height */
}

/* Small phones: reduce header bar height */
@media (max-width: 480px){
  :root { --topbar-h: 44px; }
}


/* ========== Base / Reset ==================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { filter: brightness(1.06); }
.container { max-width: var(--maxw); margin-inline: auto; padding: clamp(12px, 2vw, 24px); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* Accessiblity helper */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}


/* ========== Header / Topbar ================================================= */
.site-header { border-bottom: 1px solid #eee; background: #fff; }

.topbar { background: var(--paper); padding-block: 0; }
.topbar .container { min-height: var(--topbar-h); display: flex; align-items: center; }
.topbar-contacts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.topbar-contacts img { height: 18px; width: auto; display: inline-block; }
.topbar-address { color: #333; font-size: .9rem; }

/* Brand logo fills bar height */
.brand-link.brand-logo { display: inline-flex; align-items: center; height: var(--topbar-h); }
.brand-logo img { height: 100%; width: auto; display: block; }


/* ========== Primary Navigation ============================================= */
/* Desktop baseline */
.nav-wrap { border-top: 1px solid #f0ecea; background: #fff; }
.nav-inner { display: flex; align-items: center; }
.primary-nav { width: 100%; }
.primary-nav ul { list-style: none; padding: 6px 0; margin: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.primary-nav a { color: #000; text-decoration: none; padding: 0; } /* plain text row */
.primary-nav a:hover { text-decoration: underline; }

/* Keep the toggle pushed right when visible */
.nav-toggle { margin-left: auto; }

/* Mobile nav (Option A: dropdown under header) */
.nav-toggle { display: none; }
@media (max-width: 860px){
  .nav-toggle {
    display: inline-flex;
    align-items: center; justify-content: center;
    padding: 6px 10px;
    border: 1px solid #e5dad6; background: #fff; border-radius: 10px;
    cursor: pointer;
  }
  .nav-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
  .nav-toggle:hover { filter: brightness(0.98); }

  .nav-wrap { position: relative; }
  .primary-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff;
    border-bottom: 1px solid #eee;
    z-index: 20;

    /* slide-down via max-height */
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
  }
  .primary-nav.open { max-height: 90vh; }

  /* vertical list / touch targets */
  .primary-nav ul { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
  .primary-nav li + li { border-top: 1px solid #f2f2f2; }
  .primary-nav a {
    padding: 8px 12px;
    line-height: 1.4;
    color: #000;
  }
  .primary-nav a:hover { background: #f7f3f1; }
}

/* Toggle icon size */
.nav-toggle-icon { height: var(--nav-icon-size); width: auto; display: block; }


/* ========== Hero ============================================================ */
.hero { margin: 0; }
.hero img { width: 100%; height: auto; object-fit: cover; aspect-ratio: 16/4; }
@media (max-width: 640px){ .hero img { aspect-ratio: 16/10; } }


/* ========== Intro (with optional image) ===================================== */
.intro .lead { background: var(--paper); padding: clamp(16px, 2.5vw, 28px); border-radius: var(--radius); box-shadow: var(--shadow); }
.intro-with-image { display: grid; gap: clamp(14px, 2vw, 20px); }
.intro-media { margin: 0; }
.intro-media img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; }
.intro-copy h1 { margin: 0 0 6px; font-size: clamp(1.35rem, 1.2rem + 1vw, 2rem); color: var(--brand); }

@media (min-width: 960px){
  .intro-with-image { grid-template-columns: 1.3fr 1fr; align-items: center; }
}


/* ========== Cards / Grids =================================================== */
.cards { padding-top: 8px; }

/* Base grid: 1 → 2 → 3 columns by breakpoints */
.card-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: clamp(12px, 2vw, 20px);
  grid-template-columns: repeat(1, minmax(0,1fr));
}
@media (min-width: 600px){ .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 980px){ .card-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }

/* Pack items densely if heights differ (kept from original) */
.card-grid { grid-auto-flow: dense; }

/* Card base */
.card {
  background: #fff; border: 1px solid #eee; border-radius: var(--radius);
  padding: clamp(14px, 2vw, 20px); box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 4px; font-size: 1.1rem; color: #6a1a1a; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { text-decoration: underline; }
.card p { margin: 4px 0 0; color: var(--muted); }

/* Image cards */
.image-card { padding: 0; }
.image-card .card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.image-card .card-media { margin: 0; line-height: 0; overflow: hidden; border-bottom: 1px solid #eee; }
.image-card .card-media img {
  width: auto; height: 100%;
  aspect-ratio: 3/2; object-fit: cover;
  transition: transform .3s ease;
}
.image-card .card-body { padding: clamp(14px, 2vw, 20px); }
.image-card:hover .card-media img { transform: scale(1.02); }


/* ========== Quick Links ===================================================== */
.quicklinks { padding-top: 4px; }
.ql-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 720px){ .ql-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 980px){ .ql-grid { grid-template-columns: repeat(6, minmax(0,1fr)); } }
.ql {
  display: block; text-align: center; padding: 12px 10px;
  border: 1px solid #eee; border-radius: 12px; background: #fff;
  color: var(--brand); font-weight: 600; text-decoration: none;
}
.ql:hover { background: var(--paper); }


/* ========== Footer ========================================================== */
.site-footer { margin-top: 24px; background: var(--paper); border-top: 1px solid #eee; }
.site-footer address { font-style: normal; color: #333; }
.site-footer .container { display: flex; flex-direction: column; gap: 8px; }
.copyright { color: var(--muted); font-size: .9375rem; }


/* ========== Accessibility: Reduced Motion ================================== */
@media (prefers-reduced-motion: reduce){
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ========== List Cards (scrollable text blocks) ============================= */
/* Variant used for “More …” lists — two-column list on larger screens */
.card--list .card-body{
  position: relative;
  max-height: clamp(180px, 28vh, 240px);
  overflow: auto;
  padding-right: 6px; /* room for scrollbar */
}
.card--list .list{ columns: 2; column-gap: 16px; margin: 0; padding-left: 1rem; }
@media (max-width: 600px){ .card--list .list{ columns: 1; } }
.card--list .list li{ break-inside: avoid; padding: 2px 0; }
.card--list .card-body::after{
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 20px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
}

/* OVERRIDE: Single-column, smaller-text list cards (alternate look) */
/* (Placed later to win specificity; same selectors, different values) */
.card--list .card-body{
  position: relative;
  max-height: clamp(170px, 24vh, 220px);
  overflow: auto;
  padding-right: 6px;
}
.card--list .list{
  columns: 1;
  column-gap: 0;
  margin: 0;
  padding-left: 1rem;
}
.card--list .list li{
  font-size: 0.80rem;
  line-height: 1.35;
  padding: 1px 0;
  break-inside: avoid;
}
.card--list .card-body::after{
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 20px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
}

/* Minor list helpers */
.card--list .card-title { margin-top: .5rem; }
.card--list .list { margin: 0; }


/* ========== Photo Gallery (page-scoped) ==================================== */
/* Grid density: 2 cols ≥600px, 3 cols ≥900px, 4 cols ≥1200px */
.card-grid--gallery { /* inherits base grid rules */ }
@media (min-width: 600px){ .card-grid.card-grid--gallery { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 900px){ .card-grid.card-grid--gallery { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1200px){ .card-grid.card-grid--gallery { grid-template-columns: repeat(4, minmax(0,1fr)); } }

/* Option A (no-crop, variable heights): let images size naturally */
.card-grid--gallery .image-card .card-media{
  aspect-ratio: auto !important;
  height: auto !important;
  overflow: visible;
}
.card-grid--gallery .image-card .card-media img{
  position: static !important;
  display: block;
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}
/* Tighten spacing under tall images */
.card-grid--gallery .image-card .card-body{ padding-top: 0.5rem; }

/* Widen just the gallery page container for taller rows */
.page-gallery .container{ max-width: min(96vw, 1520px); }
@media (min-width: 1440px){
  .page-gallery .container{ max-width: 1600px; }
}
/* (Grid columns remain the same; wider container makes cards taller) */


/* ========== Global Image-Card Ratio Tweak (kept) ============================ */
/* Taller default crop for image cards (4:3). Comment out if not needed. */
.image-card .card-media{
  aspect-ratio: 4 / 3;
  /* Optional min-height was commented in original */
  /* min-height: clamp(220px, 28vw, 360px); */
}


/* ========== Testimonials (page-scoped) ===================================== */
/* 2×2 layout at wide screens */
@media (min-width: 1100px) {
  .page-testimonials .card-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6, 1.25rem);
  }
  .page-testimonials .card-media { aspect-ratio: 4 / 3; }
}

/* Full-width images inside testimonial cards */
.page-testimonials .card-media img{
  width: 100%;
  height: auto;
  /* object-fit: cover; */       /* (comment present in original) */
  object-position: center;
  display: block;
}

/* Explicit two-column helper used elsewhere (kept) */
@media (min-width: 1100px){
  .card-grid.card-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
