/* ==========================================================================
   Hops & Herbs 2.0 - design system
   Brand: forest ink #25362d - herb green #589175 - sage neutrals - warm paper
   Fonts: Amatic SC (display) - Comfortaa (body) - Caveat (script wordmark)
          Annie Use Your Telescope (handwritten notes)
   ========================================================================== */

:root {
  --paper: #faf7f0;
  --surface: #ffffff;
  --surface-2: #f1f4ee;
  --surface-3: #e8f0ec;
  --ink: #25362d;
  --text: #39483f;
  --muted: #66736d;
  --line: #dfe7e2;
  --line-strong: #b9c8bf;
  --brand: #589175;
  --brand-deep: #3d6e55;
  --brand-soft: #e5f3eb;
  --gold: #f5c518;
  --stem: #8b6b4a;
  --leaf-1: #8fb08a;
  --leaf-2: #6c8f5a;
  --danger: #b0563f;
  --shadow-sm: 0 1px 2px rgba(37, 54, 45, 0.06), 0 2px 8px rgba(37, 54, 45, 0.06);
  --shadow-md: 0 2px 6px rgba(37, 54, 45, 0.08), 0 12px 32px rgba(37, 54, 45, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --font-body: 'Comfortaa', sans-serif;
  --font-display: 'Amatic SC', cursive;
  --font-script: 'Caveat', cursive;
  --font-note: 'Annie Use Your Telescope', cursive;
  --header-h: 72px;
}

[data-theme="dark"] {
  --paper: #131a15;
  --surface: #1b241e;
  --surface-2: #212c24;
  --surface-3: #27342b;
  --ink: #edf3ec;
  --text: #cbd8cd;
  --muted: #92a397;
  --line: #2c3a30;
  --line-strong: #3d4f42;
  --brand: #7ab393;
  --brand-deep: #9ccbb1;
  --brand-soft: #23342a;
  --stem: #b08d68;
  --leaf-1: #6f8f6a;
  --leaf-2: #86a877;
  --danger: #d68a74;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* ---- Base ------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 85% -100px, var(--brand-soft), transparent 60%),
    var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 1rem 3rem;
}

h1, h2, h3, .h1, .h2, .h3 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: 0.02em;
}

h1 { font-size: clamp(2.6rem, 5.5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 700; }
h3 { font-size: clamp(1.6rem, 3vw, 2rem); }

a { color: var(--brand-deep); }
a:hover { color: var(--brand); text-decoration: none; }

::selection { background: var(--brand); color: #fff; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 2000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

.eyebrow,
.collection-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand-deep);
}

.text-muted { color: var(--muted) !important; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 65%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

.draft-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-sm);
  background: #fff1d6;
  border: 1px dashed #d9a94e;
  color: #8a6116;
  font-size: 0.84rem;
}
[data-theme="dark"] .draft-banner { background: #3a2f18; border-color: #8a6116; color: #e8c987; }
.draft-banner a { margin-left: auto; font-weight: 700; color: inherit; text-decoration: underline; }

/* ---- Buttons & forms (Bootstrap overrides) ---------------------------- */

.btn {
  font-family: var(--font-body);
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus, .btn.focus { box-shadow: 0 0 0 0.2rem rgba(88, 145, 117, 0.3); }

.btn-primary,
.btn-primary:not(:disabled):not(.disabled):active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
[data-theme="dark"] .btn-primary { color: #10201a; }
[data-theme="dark"] .btn-primary:hover { color: #10201a; }

.btn-secondary,
.btn-outline-secondary {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-secondary:hover,
.btn-outline-secondary:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-outline-primary { border-color: var(--brand); color: var(--brand-deep); background: transparent; }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-outline-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-outline-info, .btn-outline-info:hover { border-color: var(--line-strong); }

.btn-link { color: var(--brand-deep); font-weight: 600; text-decoration: none; }
.btn-link:hover { color: var(--brand); text-decoration: none; }

.form-control {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.form-control:focus {
  background: var(--surface);
  border-color: var(--brand);
  color: var(--ink);
  box-shadow: 0 0 0 0.18rem rgba(88, 145, 117, 0.22);
}
.form-control::placeholder { color: var(--muted); opacity: 0.8; }
label { color: var(--ink); font-size: 0.82rem; font-weight: 600; }

.alert-danger {
  background: rgba(176, 86, 63, 0.1);
  border: 1px solid rgba(176, 86, 63, 0.4);
  color: var(--danger);
  border-radius: var(--radius-sm);
}
.alert-success {
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  color: var(--brand-deep);
  border-radius: var(--radius-sm);
}

/* ---- Header / navbar --------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  position: relative;
}

/* Brand lockup: hop sprig - script wordmark - herb sprig */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  padding: 0.35rem 0;
}
.site-brand:hover { text-decoration: none; }

.brand-word {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  transform: rotate(-1.5deg);
}
.brand-word em {
  font-style: normal;
  color: var(--brand);
  font-size: 1.15em;
}
.site-brand:hover .brand-word { color: var(--brand-deep); }

.brand-art { display: inline-flex; }
.brand-art svg { display: block; overflow: visible; }
.brand-art-hop svg { width: 46px; height: 38px; }
.brand-art-herb svg { width: 62px; height: 22px; margin-top: 10px; }

.brand-stem {
  fill: none;
  stroke: var(--stem);
  stroke-width: 2.6;
  stroke-linecap: round;
}
.brand-stem-thin { stroke-width: 1.8; opacity: 0.85; }
.brand-tendril {
  fill: none;
  stroke: var(--stem);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.9;
}
.brand-leaf {
  fill: var(--leaf-2);
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.brand-leaf-vein {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.1;
  opacity: 0.55;
  stroke-linecap: round;
}
.brand-cone {
  fill: var(--leaf-1);
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.brand-cone-small { fill: var(--leaf-2); }
.brand-cone-scales path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.3;
  opacity: 0.7;
}
.brand-herb-leaves path {
  fill: var(--leaf-1);
  stroke: var(--ink);
  stroke-width: 1.1;
  stroke-linejoin: round;
}
.brand-herb-leaves path:nth-child(even) { fill: var(--leaf-2); }

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.site-nav-list,
.site-nav-utils {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.2rem;
}

.site-nav-link {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.site-nav-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.site-nav-link.is-active { background: var(--ink); color: var(--paper); }
[data-theme="dark"] .site-nav-link.is-active { background: var(--brand); color: #10201a; }

.site-nav-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 38px;
  height: 38px;
  padding: 0 0.55rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.site-nav-icon:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.site-nav-icon.is-active { color: var(--brand-deep); }

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
[data-theme="dark"] .cart-count { color: #10201a; }

.site-lang { position: relative; }
.site-lang-code { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; }
.site-lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  z-index: 1100;
}
.site-lang-menu a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
}
.site-lang-menu a:hover { background: var(--surface-2); color: var(--ink); }
.site-lang-menu a.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }

.site-nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
}

/* ---- Cards ------------------------------------------------------------- */

.content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  height: 100%;
}
.content-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--type-accent, var(--brand)) 45%, var(--line));
}
.content-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.content-card-media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--surface-2);
}
.content-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.content-card:hover .content-card-media img { transform: scale(1.045); }

.content-card-type {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--type-accent, var(--brand)) 88%, #000);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.content-card.is-featured .content-card-media::after {
  content: '\2605';
  position: absolute;
  right: 10px;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--gold);
  color: #4c3b00;
  font-size: 0.85rem;
  line-height: 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.content-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.95rem 1.05rem 1.05rem;
  flex: 1;
}
.content-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.content-card-meta span {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--type-accent, var(--brand-deep));
}
.content-card-meta span + span::before { content: '\00B7'; margin-right: 0.35rem; color: var(--muted); }
.content-card-body h2 {
  font-size: 1.65rem;
  margin: 0;
  line-height: 1.05;
}
.content-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.content-card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--line);
}
.content-card-facts span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
}
.content-card-facts .fa { color: var(--type-accent, var(--brand)); }

.content-card.is-compact .content-card-media { aspect-ratio: 16 / 7; }
.content-card.is-compact .content-card-body h2 { font-size: 1.4rem; }
.content-card.is-compact .content-card-body p { -webkit-line-clamp: 2; }

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
}

/* ---- Homepage ----------------------------------------------------------- */

.home-hero {
  position: relative;
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  color: #f4f8f4;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}
.home-hero-inner {
  position: relative;
  max-width: 640px;
  padding: clamp(2.2rem, 6vw, 4rem) clamp(1.4rem, 5vw, 3.5rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
.home-hero .eyebrow,
.home-hero .collection-eyebrow { color: #cfe4d4; }
.home-hero h1 {
  color: #fff;
  font-size: clamp(3.2rem, 8vw, 5rem);
  margin: 0;
  line-height: 0.95;
}
.home-hero-question {
  font-family: var(--font-note);
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  color: var(--gold);
  margin: 0;
  transform: rotate(-1deg);
}
.home-hero-copy {
  margin: 0;
  font-size: 0.95rem;
  color: #dbe7dd;
  max-width: 46ch;
}

.home-search-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 0.6rem;
}
.home-search-panel .form-control {
  flex: 1 1 200px;
  background: rgba(255, 255, 255, 0.94);
  border: none;
  color: #25362d;
}
.home-search-panel select.form-control { flex: 0 1 170px; }
.home-search-panel .btn { flex: 0 0 auto; }

.home-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
}
.home-chip-row > span { color: #cfe4d4; font-weight: 700; margin-right: 0.2rem; }
.home-chip-row a {
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.12s ease;
}
.home-chip-row a:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }

.home-hero-pick {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(20, 32, 25, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
  transition: background 0.12s ease, transform 0.12s ease;
}
.home-hero-pick:hover { background: rgba(20, 32, 25, 0.75); color: #fff; transform: translateY(-2px); }
.home-hero-pick span {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 700;
}
.home-hero-pick strong { font-size: 1rem; }
.home-hero-pick small { color: #c8d8cc; }

.home-section { margin-bottom: 2.75rem; }
.home-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.home-section-heading h2 { margin: 0; }
.home-section-link { font-size: 0.84rem; font-weight: 700; white-space: nowrap; }

.home-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1rem;
}
.home-type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.2rem 1.25rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--type-accent, var(--brand));
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.home-type-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: var(--text);
  text-decoration: none;
}
.home-type-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--type-accent, var(--brand)) 16%, var(--surface));
  color: var(--type-accent, var(--brand));
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}
.home-type-card strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); line-height: 1; }
.home-type-card small { color: var(--muted); font-size: 0.74rem; }
.home-type-card em {
  font-style: normal;
  font-family: var(--font-note);
  color: var(--type-accent, var(--brand-deep));
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Collection pages ---------------------------------------------------- */

.collection-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--type-accent, var(--brand)) 14%, var(--surface)), var(--surface) 65%);
  border: 1px solid var(--line);
  border-left: 6px solid var(--type-accent, var(--brand));
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.collection-hero h1 { margin: 0.2rem 0 0.4rem; }
.collection-hero p { margin: 0; max-width: 62ch; color: var(--muted); font-size: 0.9rem; }

.collection-search {
  display: flex;
  gap: 0.5rem;
  flex: 0 1 380px;
}
.collection-search .form-control { flex: 1; }

.collection-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.collection-count { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.collection-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.collection-filters a {
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.12s ease;
}
.collection-filters a:hover { border-color: var(--brand); color: var(--brand-deep); }
.collection-filters a.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
[data-theme="dark"] .collection-filters a.active { background: var(--brand); border-color: var(--brand); color: #10201a; }

.collection-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.collection-sort select { width: auto; padding: 0.25rem 1.8rem 0.25rem 0.7rem; font-size: 0.8rem; }

/* Travel map with article pins */
.travel-map-section { margin-bottom: 1.5rem; }
.travel-map {
  height: clamp(280px, 45vw, 420px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
[data-theme="dark"] .travel-map .leaflet-tile { filter: brightness(0.7) contrast(1.05) saturate(0.85); }
[data-theme="dark"] .travel-map .leaflet-container { background: #1b241e; }
.travel-map .leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}
.travel-map .leaflet-popup-tip { background: var(--surface); }
.travel-map .leaflet-popup-content { margin: 0.6rem 0.7rem; font-family: var(--font-body); }
.travel-pin-popup {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  color: var(--text);
  max-width: 200px;
}
.travel-pin-popup:hover { text-decoration: none; color: var(--text); }
.travel-pin-popup img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 7px;
}
.travel-pin-popup strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.1;
  color: var(--ink);
}
.travel-pin-popup small { color: var(--muted); font-size: 0.72rem; }

.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 1.5rem;
}
.empty-state h2 { color: var(--muted); }
.empty-state .fa { font-size: 2rem; color: var(--brand); margin-bottom: 0.5rem; }

/* ---- Search page ---------------------------------------------------------- */

.search-page-head {
  max-width: 720px;
  margin: 0 auto 2rem;
  text-align: center;
}
.search-page-head h1 { margin-bottom: 0.25rem; }
.search-page-head p { color: var(--muted); font-size: 0.9rem; }

.search-form-large {
  display: flex;
  gap: 0.5rem;
  max-width: 640px;
  margin: 1.25rem auto 0.9rem;
}
.search-form-large .form-control { flex: 1; padding: 0.7rem 1.1rem; font-size: 1rem; border-radius: 999px; }
.search-form-large .btn { padding: 0.55rem 1.5rem; }

.search-type-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}
.search-type-row a {
  padding: 0.3rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}
.search-type-row a:hover { border-color: var(--brand); color: var(--brand-deep); }
.search-type-row a.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
[data-theme="dark"] .search-type-row a.active { background: var(--brand); border-color: var(--brand); color: #10201a; }

.search-meta { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 1.5rem; }

/* ---- Content detail pages -------------------------------------------------- */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.breadcrumbs a:hover { color: var(--brand-deep); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs .current { color: var(--ink); font-weight: 600; }

.content-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  margin-bottom: 1.5rem;
}
.content-detail-copy h1 { margin: 0.35rem 0 0.6rem; line-height: 0.98; }
.content-lede { font-size: 0.98rem; color: var(--muted); max-width: 58ch; }

.content-detail-media {
  position: relative;
}
.content-detail-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 4px solid var(--surface);
}
.content-detail-media::after {
  content: '';
  position: absolute;
  inset: 12px -12px -12px 12px;
  border: 2px dashed color-mix(in srgb, var(--type-accent, var(--brand)) 45%, transparent);
  border-radius: var(--radius);
  z-index: -1;
}

.content-fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.9rem 0 0.4rem;
}
.content-fact-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--text);
}
.content-fact-row .fa { color: var(--type-accent, var(--brand)); }

.content-byline {
  font-family: var(--font-note);
  color: var(--muted);
  font-size: 1rem;
  margin-top: 0.5rem;
}

.content-action-bar {
  position: sticky;
  top: calc(var(--header-h) + 4px);
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
}
.content-action-primary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem; }
.content-action-bar .btn-link {
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}
.content-action-bar .btn-link:hover { background: var(--surface-2); }
.content-action-meta { display: flex; flex-wrap: wrap; gap: 0.8rem; padding-right: 0.6rem; }
.content-action-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.content-rating {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}
.star-rating .fa {
  color: var(--gold);
  font-size: 1.05rem;
  margin-right: 2px;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.star-rating .fa:hover { transform: scale(1.2); }

.content-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.content-body.has-recipe {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  align-items: start;
}
.content-body.single-column > .content-panel { max-width: 760px; }

.content-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.content-panel h2 {
  font-size: 1.9rem;
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid color-mix(in srgb, var(--type-accent, var(--brand)) 30%, var(--line));
}
.content-panel > p { font-size: 0.92rem; }

.recipe-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 992px) {
  .recipe-side {
    position: sticky;
    top: calc(var(--header-h) + 70px);
  }
}

.article-body-panel,
.content-sections,
.content-map { grid-column: 1 / -1; }
.content-body.single-column .article-body-panel,
.content-body.single-column .content-sections,
.content-body.single-column .content-map { grid-column: auto; }

/* Servings stepper */
.servings-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.82rem;
}
.servings-row strong { margin-right: auto; color: var(--ink); }
.servings-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s ease;
}
.servings-btn:hover { border-color: var(--brand); color: var(--brand-deep); }
.servings-value { min-width: 2ch; text-align: center; font-weight: 700; color: var(--brand-deep); }
.servings-reset {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
  text-decoration: underline;
}

/* Ingredient checklist */
.ingredient-progress {
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.ingredient-progress b { color: var(--brand-deep); }

.content-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.content-check-list li + li { border-top: 1px dashed var(--line); }
.content-check-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.15rem;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
.content-check-list input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 3px;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.content-check-list input:checked ~ span {
  text-decoration: line-through;
  color: var(--muted);
}
.content-check-list li.plain { padding: 0.5rem 0.15rem; font-size: 0.88rem; }
.content-check-list li.plain + li.plain { border-top: 1px dashed var(--line); }

/* Instruction steps */
.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.step-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0.9rem;
  padding: 0.9rem 0.35rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease;
}
.step-item:hover { background: var(--surface-2); }
.step-item + .step-item { border-top: 1px dashed var(--line); }
.step-marker {
  counter-increment: step;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--type-accent, var(--brand)) 14%, var(--surface));
  border: 2px solid color-mix(in srgb, var(--type-accent, var(--brand)) 55%, var(--line));
  color: var(--type-accent, var(--brand-deep));
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  transition: all 0.15s ease;
}
.step-marker::before { content: counter(step); }
.step-content h3 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0.35rem 0 0.3rem;
}
.step-content p { margin: 0; font-size: 0.9rem; }
.step-item.is-done .step-marker {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.step-item.is-done .step-marker::before { content: '\2713'; font-family: var(--font-body); font-size: 1rem; }
.step-item.is-done .step-content { opacity: 0.55; }
.step-item.is-done .step-content p { text-decoration: line-through; }
.steps-hint {
  font-family: var(--font-note);
  color: var(--muted);
  font-size: 0.95rem;
  margin: -0.4rem 0 0.8rem;
}

.content-section-block + .content-section-block { margin-top: 1.25rem; }
.content-section-block p { font-size: 0.92rem; }

.legacy-article-panel { max-width: 860px !important; }
.legacy-article-panel > :first-child { margin-top: 0; }
.legacy-article-panel > :last-child { margin-bottom: 0; }
.legacy-article-panel p,
.legacy-article-panel li { font-size: 0.95rem; line-height: 1.75; }
.legacy-article-panel h2 { margin-top: 2rem; }
.legacy-article-panel h3 { margin-top: 1.5rem; }
.legacy-article-panel ul,
.legacy-article-panel ol { padding-left: 1.4rem; margin-bottom: 1.35rem; }
.legacy-article-image { margin: 1.75rem 0; }
.legacy-article-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 760px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.legacy-article-image figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}
.legacy-article-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin: 1.75rem 0;
}
.legacy-article-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-sm);
}

.content-map iframe { border-radius: var(--radius-sm); }

.content-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.content-footer p { margin: 0; font-size: 0.8rem; color: var(--muted); }

/* Share */
.share-panel { margin-bottom: 2.25rem; }
.share-panel h2 { font-size: 1.8rem; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share-buttons .btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
}
.share-buttons .btn:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-soft); }

/* Related */
.related-content { margin-bottom: 2.5rem; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.related-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding-bottom: 0.9rem;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.related-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--text); }
.related-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 0.5rem; }
.related-item span {
  padding: 0 0.9rem;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-deep);
}
.related-item strong { padding: 0 0.9rem; font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); line-height: 1.1; }

/* Comments */
.comment-panel {
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}
.comment-panel h2 { font-size: 1.9rem; }
.comment { padding: 0.8rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.comment + .comment { margin-top: 0.6rem; }
.comment-header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.25rem; }
.comment-header strong { color: var(--ink); font-size: 0.86rem; }
.comment-header time { color: var(--muted); font-size: 0.72rem; }
.comment p { margin: 0; font-size: 0.88rem; }
.comment-honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.comment-challenge { display: flex; align-items: center; gap: 0.6rem; }
.comment-challenge span { font-weight: 700; color: var(--ink); white-space: nowrap; }
.comment-challenge .form-control { max-width: 90px; }
.comment-status { min-height: 1.3rem; font-size: 0.82rem; margin-bottom: 0.6rem; }

/* ---- Shopping list ---------------------------------------------------------- */

.shopping-page { max-width: 820px; margin: 0 auto; }
.shopping-head { text-align: center; margin-bottom: 1.5rem; }
.shopping-head h1 { margin-bottom: 0.2rem; }
.shopping-progress { color: var(--muted); font-size: 0.85rem; }
.shopping-progress b { color: var(--brand-deep); }

.shopping-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.shopping-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.shopping-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.shopping-group-head h2 {
  font-size: 1.5rem;
  margin: 0;
}
.shopping-group-head a { font-size: 0.76rem; font-weight: 700; }
.shopping-group ul { list-style: none; margin: 0; padding: 0.4rem 0.6rem; }

.shopping-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
}
.shopping-item:hover { background: var(--surface-2); }
.shopping-item label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
}
.shopping-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.shopping-item.is-checked label span { text-decoration: line-through; color: var(--muted); }
.shopping-item-actions { display: flex; align-items: center; gap: 0.15rem; }
.shopping-item-actions a,
.shopping-item-actions button {
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  padding: 0 6px;
  transition: all 0.1s ease;
}
.shopping-item-actions a:hover { background: var(--brand-soft); color: var(--brand-deep); }
.shopping-item-actions button:hover { background: rgba(176, 86, 63, 0.12); color: var(--danger); }
.shop-logo { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.02em; }

.shopping-empty {
  text-align: center;
  padding: 3.5rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.shopping-empty .fa { font-size: 2.2rem; color: var(--brand); margin-bottom: 0.75rem; }
.shopping-empty p { color: var(--muted); margin-bottom: 1rem; }

/* ---- 404 ------------------------------------------------------------------- */

.notfound-page { text-align: center; padding: 3rem 1rem; }
.notfound-code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 18vw, 10rem);
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
  opacity: 0.85;
}
.notfound-page h1 { margin: 0.25rem 0 0.75rem; }
.notfound-page p { color: var(--muted); max-width: 46ch; margin: 0 auto 1.5rem; }

/* ---- CMS / Content Studio ---------------------------------------------------- */

.cms-login {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
}
.cms-login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}
.cms-kicker {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand-deep);
}

.cms-studio {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.cms-rail {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.cms-rail h1 { font-size: 2.4rem; margin: 0; }
.cms-stat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.cms-stat-list div {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
}
.cms-stat-list strong { font-size: 1.15rem; color: var(--ink); }
.cms-stat-list span { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.cms-type-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.cms-type-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.cms-type-nav a:hover { background: var(--surface-2); color: var(--ink); }
.cms-type-nav a.active { background: var(--brand-soft); color: var(--brand-deep); }
.cms-type-nav .fa { width: 18px; text-align: center; }

.cms-workspace { display: flex; flex-direction: column; gap: 1.25rem; }
.cms-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cms-topbar h2 { margin: 0; }
.cms-actions { display: flex; gap: 0.5rem; }

.cms-command-center {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.9rem;
}
.cms-command-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cms-command-card > span { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.cms-command-card strong { font-size: 1.3rem; color: var(--ink); }
.cms-command-card small { color: var(--muted); font-size: 0.72rem; }
.cms-meter {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 0.4rem;
}
.cms-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-deep));
  transition: width 0.4s ease;
}

.cms-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 1.25rem;
  align-items: start;
}
.cms-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.cms-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.4rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--line);
}
.cms-section-heading:first-child { margin-top: 0; }
.cms-section-heading h3 { margin: 0; font-size: 1.55rem; }
.cms-section-heading span { font-size: 0.72rem; color: var(--muted); }

.cms-mono { font-family: Consolas, Monaco, monospace; font-size: 0.82rem; }
.cms-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.cms-image-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cms-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.cms-image-preview img:not([src]), .cms-image-preview img[src=""] { display: none; }
.cms-image-preview span { color: var(--muted); font-size: 0.78rem; }

.cms-preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--paper);
}
.cms-preview-media {
  position: relative;
  aspect-ratio: 16 / 8;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cms-preview-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.cms-preview-media img:not([src]), .cms-preview-media img[src=""] { display: none; }
.cms-preview-media span { color: var(--muted); font-size: 0.75rem; z-index: 1; }
.cms-preview-body { padding: 0.8rem 1rem 1rem; }
.cms-preview-body span { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--brand-deep); }
.cms-preview-body h4 { font-family: var(--font-display); font-size: 1.5rem; margin: 0.2rem 0; color: var(--ink); }
.cms-preview-body p { margin: 0; font-size: 0.78rem; color: var(--muted); }

.cms-seo-snippet {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.cms-seo-snippet > span { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; margin-bottom: 0.2rem; }
.cms-seo-snippet strong { color: #1a0dab; font-size: 0.95rem; font-weight: 500; }
[data-theme="dark"] .cms-seo-snippet strong { color: #8ab4f8; }
.cms-seo-snippet em { color: #006621; font-style: normal; font-size: 0.74rem; }
[data-theme="dark"] .cms-seo-snippet em { color: #81c995; }
.cms-seo-snippet p { margin: 0; font-size: 0.78rem; color: var(--muted); }

.cms-checklist { list-style: none; margin: 0 0 1rem; padding: 0; }
.cms-checklist li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.cms-checklist li .fa { color: var(--line-strong); }
.cms-checklist li.is-done { color: var(--text); }
.cms-checklist li.is-done .fa { color: var(--brand); }

.cms-library-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 640px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.cms-library-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.cms-library-item:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.cms-library-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--surface-2);
}
.cms-library-item h4 { font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; margin: 0.15rem 0; color: var(--ink); }
.cms-library-item p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cms-item-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.cms-item-meta > span { font-size: 0.62rem; color: var(--muted); font-weight: 600; }
.cms-status {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.58rem !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cms-status-published { background: var(--brand-soft); color: var(--brand-deep); }
.cms-status-draft { background: #fff1d6; color: #8a6116; }
[data-theme="dark"] .cms-status-draft { background: #3a2f18; color: #e8c987; }
.cms-item-actions { display: flex; flex-direction: column; gap: 0.3rem; }
.cms-item-actions .btn { padding: 0.2rem 0.55rem; font-size: 0.72rem; }

/* CMS account & user management */
.cms-account { display: flex; flex-direction: column; gap: 1.25rem; }
.cms-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.mfa-setup { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.mfa-qr {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px;
}
.mfa-secret {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.backup-codes-panel { border: 2px dashed var(--brand); }
.backup-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}
.backup-codes code {
  padding: 0.45rem 0.6rem;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: center;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
}

.users-table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.users-table th {
  text-align: left;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.4rem 0.6rem;
  border-bottom: 2px solid var(--line);
}
.users-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.users-table-date { color: var(--muted); font-size: 0.76rem; white-space: nowrap; }
.users-table-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.users-table-actions details { position: relative; }
.users-table-actions summary { list-style: none; cursor: pointer; }
.users-table-actions summary::-webkit-details-marker { display: none; }
.users-inline-form {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
  min-width: 220px;
}

.auth-events { list-style: none; margin: 0; padding: 0; font-size: 0.78rem; }
.auth-events li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
}
.auth-events time { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.auth-event-name {
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 700;
  font-size: 0.68rem;
}
.auth-event-name.is-bad { background: rgba(176, 86, 63, 0.14); color: var(--danger); }
.auth-events .auth-event-ip { color: var(--muted); font-size: 0.72rem; }
.auth-events em { color: var(--muted); font-style: normal; font-size: 0.72rem; }

/* ---- Footer ------------------------------------------------------------------ */

.site-footer {
  background: var(--ink);
  color: #c9d6cc;
  padding: 2.75rem 0 1.5rem;
  margin-top: 2rem;
}
[data-theme="dark"] .site-footer { background: #0e1410; }
.site-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 3fr);
  gap: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.site-footer .brand-word { color: #fff; font-size: 1.7rem; display: inline-block; margin-bottom: 0.5rem; }
.site-footer .brand-word em { color: #9ccbb1; }
.site-footer-brand p { font-size: 0.82rem; max-width: 40ch; color: #a7b8ab; }
.site-footer-social { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.site-footer-social a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e6efe8;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.12s ease;
}
.site-footer-social a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.site-footer-col { display: flex; flex-direction: column; gap: 0.35rem; }
.site-footer-col h3 {
  color: #fff;
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}
.site-footer-col a { color: #a7b8ab; font-size: 0.84rem; text-decoration: none; }
.site-footer-col a:hover { color: #fff; }

.site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1.25rem;
  font-size: 0.74rem;
  color: #8ba191;
}
.site-footer-note { font-family: var(--font-note); font-size: 0.95rem; }

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.3rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 900;
  transition: transform 0.12s ease;
}
.back-to-top:hover { transform: translateY(-3px); color: var(--brand-deep); }

/* ---- Responsive ---------------------------------------------------------------- */

@media (max-width: 991.98px) {
  .site-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.9rem;
  }
  .site-nav.is-open { display: flex; }
  .site-nav-list { flex-direction: column; align-items: stretch; }
  .site-nav-link { display: block; }
  .site-nav-utils { justify-content: flex-start; border-top: 1px solid var(--line); padding-top: 0.6rem; }
  .brand-art-herb { display: none; }
  .content-detail-hero { grid-template-columns: 1fr; }
  .content-detail-media { order: -1; }
  .content-body.has-recipe { grid-template-columns: 1fr; }
  .cms-studio { grid-template-columns: 1fr; }
  .cms-rail { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cms-rail .mt-auto { margin-top: 0 !important; }
  .cms-grid { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
  .brand-word { font-size: 1.55rem; }
  .brand-art-hop svg { width: 36px; height: 30px; }
  .home-search-panel select.form-control { flex: 1 1 100%; }
  .content-action-bar { border-radius: var(--radius); position: static; }
  .site-footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* ---- Print ---------------------------------------------------------------------- */

@media print {
  .site-header,
  .site-footer,
  .content-action-bar,
  .content-rating,
  .share-panel,
  .related-content,
  .comment-panel,
  .breadcrumbs,
  .back-to-top,
  .shopping-actions,
  .shopping-item-actions,
  .servings-btn,
  .servings-reset,
  .content-footer .btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .content-panel, .shopping-group { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .content-body.has-recipe { grid-template-columns: 1fr; }
  .content-detail-media img { max-width: 60%; border: none; box-shadow: none; }
  a { color: #000; text-decoration: none; }
}

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