/*
  Bakes & Brews: shared styles for every page of bakesandbrews.shop.
  Tokens follow the bbantioch.com theme (community-shelf-app spec/design/design-system-tokens.json, v2).
  Gold and honey are for rules, frames and icons only, never text on light grounds.
*/
:root {
  --ink: #3a1d10;
  --cocoa: #5c3019;
  --cream: #fbf4e9;
  --paper: #fffdf8;
  --sand: #f4e8d6;
  --gold: #c98e43;
  --honey: #e5b974;
  --roast: #7b4423;
  --muted: #6a5346;
  --forest: #4f6b3a;
  --terracotta: #b5452b;
  --hairline: rgba(58, 29, 16, 0.14);
  --line-strong: rgba(58, 29, 16, 0.4);
  --cream-soft: rgba(251, 244, 233, 0.8);
  --cream-line: rgba(251, 244, 233, 0.16);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Figtree", "Segoe UI", system-ui, sans-serif;
  --brand: "Fredoka", "Figtree", sans-serif;
  --shadow: 0 1.15rem 2.6rem rgba(58, 29, 16, 0.16);
  --shadow-soft: 0 0.4rem 1.4rem rgba(58, 29, 16, 0.07);
  --radius-card: 1.15rem;
  --radius-panel: 1.5rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --page: 76rem;
  --header-h: 0px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--cream) url("../assets/brand/pattern.svg");
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

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

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  margin: 0.75rem 0;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--ink);
  color: var(--cream);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 100;
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
  outline-color: var(--gold);
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.icon {
  display: inline-block;
  flex: none;
  width: 1.15em;
  height: 1.15em;
}

/* Type helpers */
.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--roast);
}

.lede {
  max-width: 38rem;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--muted);
}

.fine {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.accent {
  color: var(--roast);
}

/* The lockup caption: Fredoka between gold hairlines, as on bbantioch.com */
.tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0;
  font-family: var(--brand);
  font-weight: 600;
  line-height: 1.3;
  color: var(--roast);
}

.tagline::before,
.tagline::after {
  content: "";
  flex: none;
  width: 2.5rem;
  height: 1px;
  background: var(--gold);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font: 600 0.95rem/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  border-color: var(--cocoa);
  background: var(--cocoa);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--cream);
}

.btn-gold {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.btn-gold:hover {
  border-color: var(--honey);
  background: var(--honey);
}

.btn-ghost-dark {
  border-color: rgba(251, 244, 233, 0.55);
  background: transparent;
  color: var(--cream);
}

.btn-ghost-dark:hover {
  border-color: var(--cream);
  background: var(--cream);
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Dark grounds: cream focus ring with an ink halo */
.on-dark :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--cream);
  box-shadow: 0 0 0 3px var(--ink);
}

.on-dark .eyebrow {
  color: var(--honey);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--hairline);
  background: rgba(251, 244, 233, 0.92);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
  backdrop-filter: saturate(1.1) blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.lockup {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  text-decoration: none;
}

.lockup-icon {
  width: 3.25rem;
}

.lockup-word {
  width: 9.75rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--ink);
  color: var(--cream);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem 2rem;
  padding-block: 3.5rem 2.5rem;
}

.footer-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.footer-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  background: var(--cream);
}

.footer-badge img {
  width: 3.2rem;
}

.footer-word {
  width: 10.5rem;
}

.footer-lockup .tagline {
  justify-content: flex-start;
  gap: 0.55rem;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--honey);
}

.footer-lockup .tagline::before,
.footer-lockup .tagline::after {
  width: 1.1rem;
  background: var(--honey);
}

.footer-about {
  max-width: 22rem;
  margin: 1rem 0 0;
  font-size: 0.95rem;
  color: var(--cream-soft);
}

.foot-title {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--honey);
}

.foot-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--cream);
  font-size: 0.95rem;
  text-decoration: none;
}

.foot-list a:hover,
.foot-list a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1rem;
  border-top: 1px solid var(--cream-line);
  font-size: 0.875rem;
  color: var(--cream-soft);
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom a {
  color: var(--cream);
}

.social {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(251, 244, 233, 0.3);
  border-radius: 50%;
  color: var(--cream);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.social a:hover {
  background: var(--cream);
  color: var(--ink);
}

/* Layout changes */
@media (max-width: 60rem) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 36rem) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 30rem) {
  .nav-cafes {
    display: none;
  }

  .lockup-icon {
    width: 2.75rem;
  }

  .lockup-word {
    width: 8rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .tagline {
    gap: 0.6rem;
  }

  .tagline::before,
  .tagline::after {
    width: 1.25rem;
  }

  .footer-lockup .tagline {
    font-size: 0.75rem;
  }

  .footer-lockup .tagline::before,
  .footer-lockup .tagline::after {
    display: none;
  }
}

@media (max-width: 22rem) {
  .header-inner {
    gap: 0.75rem;
  }

  .lockup {
    gap: 0.4rem;
  }

  .lockup-icon {
    width: 2.3rem;
  }

  .lockup-word {
    width: 6.5rem;
  }

  .site-nav a {
    font-size: 0.875rem;
  }
}

/* Never let the sticky header cover what you're reading on short or zoomed screens (WCAG 1.4.10, 2.4.11) */
@media (max-height: 30rem) {
  .site-header {
    position: static;
  }
}

.header-unpinned .site-header {
  position: static;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --hairline: rgba(58, 29, 16, 0.6);
    --muted: #4a3328;
    --cream-soft: var(--cream);
  }
}

@media (forced-colors: active) {
  .btn,
  .social a {
    border: 1px solid ButtonText;
  }

  .tagline::before,
  .tagline::after {
    background: CanvasText;
  }
}
