/* =========================================================================
   Mientjie's Bakery — shared stylesheet
   Palette & type from research/design-language.md (raspberry + cream + cocoa,
   Fraunces + Mulish). Light is default; dark via [data-theme="dark"] on <html>.
   ========================================================================= */

/* ----- Colour tokens ---------------------------------------------------- */
:root {
  --ground: #FFF8F5;        /* page background (cream)            */
  --surface: #FFFFFF;       /* cards / panels                    */
  --ink: #2E1B22;           /* body text                         */
  --muted: #6A4F59;         /* secondary text                    */
  --brand: #B0155A;         /* raspberry: CTA fill, rules        */
  --brand-text: #9A1050;    /* raspberry text under ~20px        */
  --blush: #FCE4EC;         /* soft tinted panels (text: --ink)  */
  --on-brand: #FFFFFF;      /* text on brand/dark bands (fixed)  */
  --accent-on-dark: #FFB3CD;/* pink text on always-dark (fixed)  */
  --band: #35121F;          /* always-dark header/footer/hero    */

  --border: rgba(46, 27, 34, 0.12);
  --shadow: 0 6px 24px rgba(46, 27, 34, 0.10);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1120px;

  --font-head: 'Fraunces', Georgia, serif;
  --font-body: 'Mulish', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

[data-theme="dark"] {
  --ground: #1B1014;
  --surface: #3F2E35;       /* ≈1.46:1 vs ground — measured       */
  --ink: #FBEFF2;
  --muted: #CDB6BE;
  --brand: #B0155A;
  --brand-text: #FF9DC1;
  --blush: #4A3039;
  --on-brand: #FFFFFF;      /* fixed */
  --accent-on-dark: #FFB3CD;/* fixed */
  --band: #12080C;

  --border: rgba(251, 239, 242, 0.16);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* ----- Reset / base ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

img { max-width: 100%; display: block; }

/* Default links (unclassed) */
a:not([class]) {
  color: var(--brand-text);
  text-decoration-color: rgba(176, 21, 90, .4);
  text-underline-offset: 2px;
}
a:not([class]):hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-tight { padding: clamp(1.75rem, 4vw, 2.75rem) 0; }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }
.center .lead { margin-left: auto; margin-right: auto; }
.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--brand-text);
  margin: 0 0 .5rem;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--brand); color: var(--on-brand);
  padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ----- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  line-height: 1; padding: .8rem 1.25rem; border-radius: 999px;
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 1.1em; height: 1.1em; flex: 0 0 auto; }

.btn-primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn-primary:hover { background: #950f4c; border-color: #950f4c; }

.btn-ghost {
  background: transparent; color: var(--brand-text); border-color: var(--brand);
}
.btn-ghost:hover { background: var(--brand); color: var(--on-brand); }

/* Ghost buttons sitting on always-dark surfaces: fixed light tokens, both themes.
   (Guard #8 — hero, CTA band, drawer, call bar, footer, page-intro.) */
.band-dark .btn-ghost,
.site-header .btn-ghost,
.drawer .btn-ghost,
.mobile-bar .btn-ghost,
.site-footer .btn-ghost,
.page-intro .btn-ghost {
  color: var(--on-brand);
  border-color: rgba(255, 255, 255, .65);
}
.band-dark .btn-ghost:hover,
.site-header .btn-ghost:hover,
.drawer .btn-ghost:hover,
.mobile-bar .btn-ghost:hover,
.site-footer .btn-ghost:hover,
.page-intro .btn-ghost:hover {
  background: rgba(255, 255, 255, .14);
  color: var(--on-brand);
  border-color: var(--on-brand);
}

.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 1rem 1.6rem; font-size: 1.05rem; }

/* ----- Header / nav ----------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--band); color: var(--on-brand);
}
.site-header .container {
  display: flex; align-items: center; gap: 1rem;
  min-height: 68px; padding-top: .5rem; padding-bottom: .5rem;
}
.brand {
  display: inline-flex; align-items: baseline; gap: .5rem;
  text-decoration: none; color: var(--on-brand);
  flex: 0 1 auto; min-width: 0;
}
.brand .wordmark {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--on-brand);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand .sub {
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-on-dark); white-space: nowrap;
}

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.main-nav a:not([class]) {
  color: var(--on-brand); text-decoration: none; font-weight: 600;
  white-space: nowrap; padding: .3rem 0; position: relative;
}
.main-nav a:not([class]):hover { color: var(--accent-on-dark); }
.main-nav a[aria-current="page"] { color: var(--accent-on-dark); }
.main-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent-on-dark); border-radius: 2px;
}

.header-actions { display: flex; gap: .6rem; align-items: center; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 999px;
  background: rgba(255,255,255,.12); color: var(--on-brand);
  border: 1px solid rgba(255,255,255,.3); cursor: pointer;
}
.theme-toggle:hover { background: rgba(255,255,255,.22); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 999px;
  background: rgba(255,255,255,.12); color: var(--on-brand);
  border: 1px solid rgba(255,255,255,.3); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* ----- Off-canvas drawer ------------------------------------------------ */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; transition: opacity .25s ease; z-index: 150;
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; right: 0; height: 100%;
  width: min(86vw, 340px); background: var(--band); color: var(--on-brand);
  transform: translateX(100%); transition: transform .28s ease;
  z-index: 160; padding: 1.25rem; display: flex; flex-direction: column;
  gap: 1rem; overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head .wordmark { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--on-brand); }
.drawer-close {
  width: 42px; height: 42px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.12); color: var(--on-brand);
  border: 1px solid rgba(255,255,255,.3);
  display: inline-flex; align-items: center; justify-content: center;
}
.drawer-close svg { width: 20px; height: 20px; }
.drawer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.drawer-nav a:not([class]) {
  color: var(--on-brand); text-decoration: none; font-weight: 600;
  font-size: 1.15rem; display: block; padding: .7rem .25rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.drawer-nav a[aria-current="page"] { color: var(--accent-on-dark); }
.drawer-cta { display: flex; flex-direction: column; gap: .6rem; margin-top: auto; }

/* ----- Hero ------------------------------------------------------------- */
.hero { position: relative; color: var(--on-brand); background: var(--band); }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(53,18,31,.78), rgba(53,18,31,.70));
}
.hero .container { position: relative; z-index: 1; padding-top: clamp(3rem, 8vw, 5.5rem); padding-bottom: clamp(3rem, 8vw, 5.5rem); }
.hero h1 { color: var(--on-brand); max-width: 18ch; }
.hero p { color: rgba(255,255,255,.92); font-size: 1.2rem; max-width: 50ch; }
.hero .btn-row { margin-top: 1.6rem; }
.band-dark .btn-ghost, .hero .btn-ghost { color: var(--on-brand); border-color: rgba(255,255,255,.65); }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.center .btn-row { justify-content: center; }

/* ----- Generic bands ---------------------------------------------------- */
.band-dark { background: var(--band); color: var(--on-brand); }
.band-dark h1, .band-dark h2, .band-dark h3 { color: var(--on-brand); }
.band-dark p { color: rgba(255,255,255,.9); }
.band-dark .eyebrow { color: var(--accent-on-dark); }
.band-dark a:not([class]) { color: var(--accent-on-dark); }

.band-blush { background: var(--blush); }
.band-blush * { /* keep ink text on blush */ }

/* page intro (small dark band under header on inner pages) */
.page-intro { background: var(--band); color: var(--on-brand); padding: clamp(2.25rem,5vw,3.25rem) 0; }
.page-intro h1 { color: var(--on-brand); }
.page-intro p { color: rgba(255,255,255,.9); max-width: 60ch; }
.page-intro .eyebrow { color: var(--accent-on-dark); }

/* ----- Trust strip ------------------------------------------------------ */
.trust {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: center;
  align-items: center; list-style: none; margin: 0; padding: 0;
}
.trust li {
  display: flex; align-items: center; gap: .55rem;
  white-space: normal; color: var(--muted); font-weight: 600;
}
.trust .icon { color: var(--brand-text); }

/* ----- Cards / grids ---------------------------------------------------- */
.grid { display: grid; gap: 1.25rem; }
.grid > * { min-width: 0; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem; min-width: 0;
}
.card h3 { color: var(--ink); }
.card p { color: var(--muted); margin-bottom: 0; }
.card .icon-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; flex: 0 0 auto; border-radius: 14px;
  background: var(--blush); color: var(--brand-text); margin-bottom: 1rem;
}
.card .icon-wrap svg { width: 26px; height: 26px; }

.card-cat h3 { margin-bottom: .35rem; }

/* steps */
.steps { counter-reset: step; }
.step .num {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 999px;
  background: var(--brand); color: var(--on-brand);
  font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; margin-bottom: .9rem;
}

/* media figure */
.feature-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.feature-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }

/* gallery placeholders */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gallery > * { min-width: 0; }
.ph-tile {
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--blush); color: var(--muted);
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 1rem; font-size: .85rem; font-weight: 600;
}

/* ----- Chips / flags ---------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: .2rem .55rem; border-radius: 999px;
  background: var(--blush); color: var(--brand-text);
  border: 1px solid rgba(176,21,90,.3); white-space: normal; vertical-align: middle;
}
.band-dark .chip, .page-intro .chip {
  background: rgba(255,179,205,.16); color: var(--accent-on-dark);
  border-color: rgba(255,179,205,.45);
}

/* ----- Split feature ---------------------------------------------------- */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.split > * { min-width: 0; }

/* ----- Contact / info list --------------------------------------------- */
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.info-list li { display: flex; gap: .85rem; align-items: flex-start; }
.info-list .icon-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px;
  background: var(--blush); color: var(--brand-text);
}
.info-list .icon-wrap svg { width: 22px; height: 22px; }
.info-list .lbl { font-weight: 700; color: var(--ink); display: block; }
.info-list a:not([class]) { font-weight: 600; }

/* band-dark info list keeps fixed light colours (guard #10) */
.band-dark .info-list .lbl { color: var(--on-brand); }
.band-dark .info-list .icon-wrap { background: rgba(255,179,205,.16); color: var(--accent-on-dark); }
.band-dark .info-list a:not([class]) { color: var(--accent-on-dark); }
.band-dark .info-list { color: rgba(255,255,255,.9); }

/* ----- Map -------------------------------------------------------------- */
.map-embed {
  width: 100%; aspect-ratio: 16 / 9; min-height: 300px;
  border: 0; border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--surface);
}

/* ----- Form ------------------------------------------------------------- */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(1.5rem, 3vw, 2rem);
}
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--font-body); font-size: 1rem;
  padding: .75rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--ground); color: var(--ink);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(176,21,90,.18); }
.form-note { font-size: .9rem; color: var(--muted); margin-top: .5rem; }

/* ----- Social links ----------------------------------------------------- */
.social-row { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.social-link {
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none; font-weight: 700; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: .6rem 1.1rem; box-shadow: var(--shadow);
}
.social-link:hover { border-color: var(--brand); color: var(--brand-text); }
.social-link svg { width: 20px; height: 20px; flex: 0 0 auto; }
.band-dark .social-link { background: rgba(255,255,255,.08); color: var(--on-brand); border-color: rgba(255,255,255,.25); }
.band-dark .social-link:hover { color: var(--accent-on-dark); border-color: var(--accent-on-dark); }

/* ----- Mobile sticky bar ------------------------------------------------ */
.mobile-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  display: none; gap: .6rem; padding: .6rem;
  background: var(--band); border-top: 1px solid rgba(255,255,255,.15);
}
.mobile-bar .btn { flex: 1 1 0; min-width: 0; }

/* ----- Footer ----------------------------------------------------------- */
.site-footer { background: var(--band); color: var(--on-brand); padding: clamp(2.5rem,5vw,3.5rem) 0 2rem; }
.site-footer h3 { color: var(--on-brand); }
.site-footer p { color: rgba(255,255,255,.82); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid > * { min-width: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.site-footer a:not([class]) { color: var(--on-brand); text-decoration: none; }
.site-footer a:not([class]):hover { color: var(--accent-on-dark); text-decoration: underline; }
.footer-wordmark { font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; color: var(--on-brand); }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.18);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  font-size: .85rem; color: rgba(255,255,255,.7);
}
.demo-note {
  background: rgba(255,179,205,.1); border: 1px solid rgba(255,179,205,.3);
  border-radius: var(--radius-sm); padding: .9rem 1.1rem; font-size: .85rem;
  color: rgba(255,255,255,.85); margin-top: 1.25rem;
}

/* =========================================================================
   Responsive — verify no h-scroll 320 / 360 / 375 / 414 / 768 / 1024 / 1280
   ========================================================================= */
/* QA fix: the inline nav only fits beside the full wordmark from ~1200px up (it clipped the brand at 900–1100px) */
@media (max-width: 1200px) {
  .main-nav, .header-actions { display: none; }      /* guard #2 */
  .nav-toggle { display: inline-flex; }
  .mobile-bar { display: flex; }
  body { padding-bottom: 70px; }                      /* room for sticky bar */
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .brand .sub { display: none; }                      /* guard #2 */
}

@media (max-width: 480px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }    /* guard #2 */
  .gallery { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
