/* ==========================================================================
   Bespresso Machines: design tokens and shared components
   Loaded on every page. Page-specific layouts live in their own files
   (home.css). Source of truth: the approved homepage design (bespresso-home.html).

   1. Font
   2. Tokens
   3. Base (scoped resets for Bespresso markup; GeneratePress content keeps its own)
   4. Header, category menu, header search panel
   5. Search component
   6. Shared components (text link, eyebrow, icons)
   7. Footer
   8. Motion
   ========================================================================== */

/* 1. Font: DM Sans (SIL Open Font License, self-hosted, variable opsz + wght).
   DM Sans is first in the stack so every visitor sees the same font, even one
   with Airbnb Cereal or Circular installed locally. To switch to a licensed
   brand font later, add its @font-face here and change the first name in --font. */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url(../fonts/dm-sans-latin-opsz-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. Tokens --------------------------------------------------------------- */
:root {
  /* Brand palette (required, exact) */
  --brown: #6F4E37;          /* header + footer background, primary actions, links */
  --canvas: #F5F3F4;         /* site background */
  --ink: #000000;            /* main content text */
  --on-brown: #F5F3F4;       /* header + footer text and icons (6.7:1 on brown) */
  /* Tonal steps derived from the palette by opacity only, no new hues */
  --ink-2: rgba(0, 0, 0, .70);        /* supporting text, 6.6:1 on canvas */
  --ink-3: rgba(0, 0, 0, .60);        /* labels and counts, 5.5:1 on canvas */
  --rule: rgba(0, 0, 0, .12);         /* hairlines */
  --rule-2: rgba(0, 0, 0, .26);       /* control outlines (3:1+ against canvas) */
  --tint: rgba(111, 78, 55, .055);    /* directory band */
  --tint-2: rgba(111, 78, 55, .12);   /* hover and active fills */
  --on-brown-2: rgba(245, 243, 244, .80); /* secondary text on brown, 4.9:1 */
  --brown-press: #5d412e;             /* brown, 15% darker: pressed state only */

  --font: "DM Sans", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif;

  --space-2: 2px; --space-4: 4px; --space-8: 8px; --space-12: 12px; --space-16: 16px; --space-24: 24px;
  --space-32: 32px; --space-40: 40px; --space-48: 48px; --space-64: 64px;
  --radius-sm: 8px; --radius-md: 14px; --radius-full: 9999px;
  --shadow-float: rgba(0, 0, 0, .02) 0 0 0 1px, rgba(0, 0, 0, .04) 0 2px 6px 0, rgba(0, 0, 0, .1) 0 4px 8px 0;
  --wrap: 1240px;
  --gutter: 24px;
  --header-h: 68px;
  color-scheme: light;
  /* Breakpoints used below (media queries cannot read variables):
     phone <= 743px, small tablet <= 959px, tablet <= 1079px, desktop >= 1080px, wide >= 1200px */
}
@media (max-width: 743px) { :root { --gutter: 16px; --header-h: 60px; } }

/* 3. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5; font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* Resets apply to Bespresso markup only, so GeneratePress
   article content keeps its normal margins and list styles.
   Specificity is one element (0,0,1): enough to override GeneratePress's own
   element rules (it loads earlier), never enough to beat a component class. */
:where(.site-header, .site-footer, .bm-page) :is(h1, h2, h3, p, ul, ol, li) { margin: 0; }
:where(.site-header, .site-footer, .bm-page) :is(ul, ol) { padding: 0; list-style: none; }
:where(.site-header, .site-footer, .bm-page) a { color: inherit; }
:where(.site-header, .site-footer, .bm-page) button { font: inherit; color: inherit; line-height: inherit; text-transform: none; }
:where(.site-header, .site-footer, .bm-page) :is(img, svg) { display: block; max-width: 100%; }
:where(.site-header, .site-footer, .bm-page) :is(h1, h2, h3) { font-family: inherit; color: inherit; }
/* One font everywhere: GeneratePress gives form controls the system font
   (its search, 404 and comment forms), so they inherit the brand font instead. */
button, input, select, optgroup, textarea { font-family: inherit; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 100; background: var(--canvas); color: var(--ink); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; }
.skip:focus, .skip:hover { top: calc(env(safe-area-inset-top, 0px) + 10px); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.eyebrow { font-size: 13px; line-height: 1.3; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* GeneratePress containers on Bespresso templates: full width, no padding. */
.bm-template .site-content { display: block; padding: 0; overflow-wrap: normal; word-wrap: normal; }
.bm-template #page { max-width: none; }

/* 4. Header --------------------------------------------------------------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--brown); color: var(--on-brown); }
.admin-bar .site-header { top: calc(env(safe-area-inset-top, 0px) + var(--wp-admin--admin-bar--height, 32px)); }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.site-header :focus-visible { outline-color: var(--on-brown); }
.bar { display: flex; align-items: center; gap: var(--space-24); height: var(--header-h); }
.brand { display: flex; align-items: center; flex: none; border-radius: var(--radius-sm); text-decoration: none; color: var(--on-brown); font-weight: 700; }
.brand img { height: 30px; width: auto; }
.primary-nav { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); }
.nav-list { display: flex; gap: var(--space-4); }
.nav-list a, .nav-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 500; text-decoration: none; color: var(--on-brown); background: transparent; border: 0; cursor: pointer;
  transition: background-color .15s ease;
}
.nav-btn:focus { background: transparent; color: var(--on-brown); }
.nav-list a:hover, .nav-list a:focus, .nav-btn:hover { background: rgba(245, 243, 244, .12); color: var(--on-brown); }
.nav-btn[aria-expanded="true"] { background: rgba(245, 243, 244, .16); }
.nav-list a[aria-current="page"] { background: rgba(245, 243, 244, .16); }
.nav-btn .chev { width: 16px; height: 16px; transition: transform .2s ease; }
.nav-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.icon-btn { width: 44px; padding: 0; justify-content: center; }
.icon-btn .ico { width: 22px; height: 22px; }
.nav-divider { width: 1px; height: 24px; background: rgba(245, 243, 244, .28); margin-inline: var(--space-8); }
.nav-menu-toggle { display: none; }
.wide-only { display: none; }
@media (min-width: 1200px) { .wide-only { display: list-item; } }
@media (max-width: 959px) {
  .nav-list, .nav-divider, .cat-toggle { display: none; }
  .nav-btn.nav-menu-toggle { display: inline-flex; }
  .primary-nav { gap: 0; }
}
@media (max-width: 743px) { .brand img { height: 24px; } .bar { gap: var(--space-8); } }
@media (max-width: 359px) { .brand img { height: 20px; } }

/* Category menu panel (dropdown on desktop, menu on mobile) */
.menu-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--canvas); color: var(--ink); border-bottom: 1px solid var(--rule); box-shadow: var(--shadow-float);
  max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain;
}
.menu-panel :focus-visible { outline-color: var(--ink); }
.menu-inner { padding-block: var(--space-24) var(--space-32); display: grid; gap: var(--space-24); }
.menu-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-16); }
.menu-search { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--rule-2); border-radius: var(--radius-sm); background: transparent; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--ink); }
.menu-search:focus { background: transparent; color: var(--ink); }
.menu-search:hover { background: var(--tint-2); color: var(--ink); }
.menu-search .ico { width: 18px; height: 18px; }
.menu-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-4) var(--space-16); }
.menu-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-inline: -12px; border-radius: var(--radius-sm); text-decoration: none; min-height: 56px; color: var(--ink); }
.menu-link:hover, .menu-link:focus { background: var(--tint-2); color: var(--ink); }
.menu-link[aria-current="page"] { background: var(--tint-2); }
.menu-link .ico { color: var(--brown); }
.menu-text { display: grid; }
.menu-name { font-weight: 600; font-size: 16px; line-height: 1.25; }
.menu-desc { font-size: 13px; color: var(--ink-3); line-height: 1.3; }
@media (max-width: 1099px) { .menu-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 743px) {
  .menu-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-inner { padding-block: var(--space-16) var(--space-24); }
}
@media (max-width: 380px) { .menu-list { grid-template-columns: 1fr; } }

/* Header search panel (pages without a hero search) */
.search-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--canvas); color: var(--ink); border-bottom: 1px solid var(--rule); box-shadow: var(--shadow-float);
  max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain;
}
.search-panel :focus-visible { outline-color: var(--ink); }
.search-panel-inner { padding-block: var(--space-24) var(--space-32); display: grid; gap: var(--space-12); grid-template-columns: minmax(0, 1fr); }
.search-panel-inner > * { min-width: 0; }
.search-panel-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-16); max-width: 900px; width: 100%; margin-inline: auto; }
.search-panel .search-block { margin: 0 auto; }
.search-panel .popular-row { justify-content: flex-start; }
.search-panel .popular { justify-content: flex-start; }
.search-panel .suggest { position: static; margin-top: var(--space-8); max-height: none; }
.panel-close, .panel-close:hover, .panel-close:focus { background: none; border: 0; cursor: pointer; font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; color: var(--ink); }

/* 5. Search ---------------------------------------------------------------- */
.search-block { margin-top: var(--space-32); width: 100%; max-width: 900px; position: relative; text-align: left; }
.search-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: var(--space-8); }
.search-box {
  position: relative; display: flex; align-items: center; height: 64px; padding: 0 8px 0 22px;
  background: var(--canvas); border: 1px solid var(--rule-2); border-radius: var(--radius-full); box-shadow: var(--shadow-float);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-box:hover { border-color: rgba(0, 0, 0, .45); }
.search-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow-float); }
.search-box > .ico { width: 20px; height: 20px; color: var(--ink-3); }
.search-box input, .search-box input:focus {
  flex: 1; min-width: 0; height: 100%; border: 0; border-radius: 0; background: transparent; outline: none; box-shadow: none; margin: 0;
  padding: 0 12px; font: inherit; font-size: 16px; color: var(--ink); text-overflow: ellipsis; -webkit-appearance: none; appearance: none;
}
.search-box input::placeholder { color: var(--ink-3); opacity: 1; font-size: 15.5px; }
@media (max-width: 639px) { .search-box input::placeholder { font-size: 15px; } }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
.clear-btn, .clear-btn:focus { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); margin-right: 4px; }
.clear-btn:hover { background: var(--tint-2); color: var(--ink-2); }
.clear-btn .ico { width: 18px; height: 18px; }
.orb, .orb:focus {
  flex: none; width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brown); color: var(--on-brown); display: grid; place-items: center;
  transition: background-color .15s ease, transform .1s ease;
}
.orb:hover { background: var(--brown-press); color: var(--on-brown); }
.orb:active { transform: scale(.96); }
.orb:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.orb .ico { width: 20px; height: 20px; stroke-width: 2; }
@media (min-width: 900px) { .search-box input, .search-box input:focus { font-size: 16.5px; } }
@media (max-width: 639px) { .search-box { height: 56px; padding-left: 16px; } .orb, .orb:focus { width: 42px; height: 42px; } }

/* Suggestions */
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; margin: 0;
  background: var(--canvas); border: 1px solid var(--rule-2); border-radius: var(--radius-md); box-shadow: var(--shadow-float);
  padding: 6px; max-height: 340px; overflow-y: auto; list-style: none;
}
.opt { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 11px 14px; border-radius: var(--radius-sm); cursor: pointer; }
.opt[aria-selected="true"], .opt:hover { background: var(--tint-2); }
.opt-label { font-weight: 500; min-width: 0; }
.opt-kind { font-size: 13px; color: var(--ink-3); flex: none; }
.opt-empty { padding: 12px 14px; color: var(--ink-2); font-size: 15px; }
.search-block mark { background: transparent; color: inherit; font-weight: 700; padding: 0; }

.popular-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 12px; margin-top: var(--space-16); font-size: 14px; }
.popular-row .label { color: var(--ink-3); }
.popular { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; }
.popular li + li::before { content: "·"; color: var(--ink-3); margin-right: 4px; }
@media (max-width: 639px) { .popular { gap: 0 14px; } .popular li + li::before { content: none; } }
.pop, .pop:hover, .pop:focus { background: none; border: 0; padding: 6px 2px; cursor: pointer; font-size: 14px; font-weight: 500; line-height: inherit; color: var(--brown); text-decoration: underline; text-decoration-color: rgba(111, 78, 55, .35); text-underline-offset: 3px; }
.pop:hover { text-decoration-color: currentColor; }

/* Results */
.results { margin-top: var(--space-24); max-width: 900px; border-top: 2px solid var(--ink); padding-top: var(--space-16); }
.res-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.res-title { font-weight: 600; font-size: 17px; }
.res-clear, .res-clear:hover, .res-clear:focus { background: none; border: 0; padding: 6px 0; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.res-list { margin-top: var(--space-8); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-32); }
.res-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.res-list a:hover .res-label { text-decoration: underline; text-underline-offset: 3px; }
.res-label { font-weight: 500; min-width: 0; }
.res-kind { font-size: 13px; color: var(--ink-3); flex: none; }
.res-note, .res-help { margin-top: var(--space-12); font-size: 14px; color: var(--ink-2); }
.res-note a { color: var(--brown); font-weight: 500; text-underline-offset: 3px; }
.res-cats { margin-top: var(--space-12); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.res-cats a { font-weight: 500; color: var(--brown); text-underline-offset: 3px; padding-block: 4px; display: inline-block; }
@media (max-width: 639px) { .res-list { grid-template-columns: 1fr; } }

/* 6. Shared components ---------------------------------------------------- */
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brown); font-weight: 600; font-size: 15px; text-decoration: none; padding-block: 4px; }
.text-link:hover, .text-link:focus { color: var(--brown); }
.text-link span { text-decoration: underline; text-decoration-color: rgba(111, 78, 55, .35); text-underline-offset: 3px; }
.text-link:hover span { text-decoration-color: currentColor; }
.text-link .arrow { text-decoration: none; transition: transform .15s ease; }
.text-link:hover .arrow { transform: translateX(2px); }

/* 7. Footer ---------------------------------------------------------------- */
.site-footer { background: var(--brown); color: var(--on-brown); padding-block: var(--space-48) var(--space-32); }
.site-footer :focus-visible { outline-color: var(--on-brown); }
.foot-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-32); flex-wrap: wrap; }
.foot-brand img { height: 28px; width: auto; }
.foot-brand p { margin-top: var(--space-12); color: var(--on-brown-2); font-size: 15px; max-width: 30em; }
.foot-nav { display: grid; gap: var(--space-12); }
.foot-label { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--on-brown-2); }
.foot-pages { display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-24); font-size: 15px; font-weight: 500; }
.foot-pages a { text-underline-offset: 3px; }
.foot-pages a:hover, .foot-pages a:focus { color: var(--on-brown); }
.foot-social { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.social { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(245, 243, 244, .35); color: var(--on-brown); }
a.social:hover, a.social:focus { background: rgba(245, 243, 244, .14); color: var(--on-brown); }
.social svg { width: 18px; height: 18px; fill: currentColor; }
.foot-bottom { margin-top: var(--space-32); padding-top: var(--space-24); border-top: 1px solid rgba(245, 243, 244, .22); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-12); font-size: 13px; color: var(--on-brown-2); }
.foot-bottom a { color: var(--on-brown); text-underline-offset: 3px; }
.foot-bottom a:hover, .foot-bottom a:focus { color: var(--on-brown); }
@media (max-width: 743px) { .foot-top { flex-direction: column; } .foot-bottom { flex-direction: column; } }

/* 8. Motion ---------------------------------------------------------------- */
/* Scroll reveal (classes added by script; content stays visible without it) */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal [data-reveal] {
    opacity: 0; transform: translateY(20px);
    transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
    transition-delay: var(--d, 0ms);
  }
  .js-reveal [data-reveal].is-in { opacity: 1; transform: none; }
}

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

@media print {
  .site-header { position: static; }
  .menu-panel, .search-panel, .skip { display: none !important; }
}
