/*
Theme Name: World Instruments
Theme URI: https://worldinstruments.org/
Author: LHAS WEBWORKS
Description: Custom theme for worldinstruments.org. Wood-tone palette, MusicalInstrument schema, faceted browse.
Version: 0.2.5
License: Proprietary
Text Domain: wi
Template Version: 0.1.0 (site-factory-template)
*/

:root {
  --wi-bg: #f7f3ec;
  --wi-fg: #2a1f15;
  --wi-muted: #6b5b48;
  --wi-accent: #8b4513;
  --wi-accent-dark: #5b2d0a;
  --wi-card: #ffffff;
  --wi-border: #e3d8c6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--wi-fg);
  background: var(--wi-bg);
  line-height: 1.6;
}

a { color: var(--wi-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wi-container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

.wi-header {
  background: var(--wi-accent-dark);
  color: #f7f3ec;
  padding: 0.75rem 0;
  border-bottom: 3px solid var(--wi-accent);
}
.wi-header a { color: #f7f3ec; }
.wi-header .wi-brand { font-size: 1.4rem; font-weight: 700; letter-spacing: 0.02em; }
.wi-header .wi-tagline { font-size: 0.85rem; opacity: 0.85; }
.wi-nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.wi-nav a { font-size: 0.95rem; }

.wi-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  background: #2a1f15;
  color: #ccc;
  font-size: 0.85rem;
}
.wi-footer a { color: #f7f3ec; }

.wi-hero { padding: 2rem 0 1rem; }
.wi-hero h1 { font-size: 2rem; margin: 0 0 0.5rem; }

.wi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.wi-card {
  background: var(--wi-card);
  border: 1px solid var(--wi-border);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.wi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.wi-card a { display: block; color: var(--wi-fg); }
.wi-card .wi-card-img {
  width: 100%; aspect-ratio: 4 / 3; background: var(--wi-border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.wi-card .wi-card-img img { width: 100%; height: 100%; object-fit: cover; }
.wi-card .wi-card-body { padding: 0.75rem; }
.wi-card h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.wi-card .wi-meta { font-size: 0.8rem; color: var(--wi-muted); }

.wi-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: var(--wi-border); color: var(--wi-fg);
  font-size: 0.75rem; margin-right: 4px;
}
.wi-badge.wi-fam-strings { background: #c9a17a; color: #fff; }
.wi-badge.wi-fam-percussion { background: #8b4513; color: #fff; }
.wi-badge.wi-fam-wind { background: #6b8e23; color: #fff; }
.wi-badge.wi-fam-keyboard { background: #2f4f4f; color: #fff; }
.wi-badge.wi-fam-electronic { background: #4b0082; color: #fff; }
.wi-badge.wi-fam-voice { background: #a0522d; color: #fff; }
.wi-badge.wi-fam-other { background: #888; color: #fff; }

.wi-instrument {
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 2rem; margin: 1.5rem 0;
}
@media (max-width: 720px) { .wi-instrument { grid-template-columns: 1fr; } }
.wi-instrument .wi-img img { width: 100%; border-radius: 6px; }
.wi-instrument h1 { margin: 0 0 0.5rem; font-size: 2rem; }
.wi-instrument .wi-native { color: var(--wi-muted); font-style: italic; }

.wi-facts { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.wi-facts th, .wi-facts td {
  padding: 0.5rem; border-bottom: 1px solid var(--wi-border);
  text-align: left; font-size: 0.95rem;
}
.wi-facts th { color: var(--wi-muted); width: 35%; font-weight: 600; }

.wi-credits { font-size: 0.75rem; color: var(--wi-muted); margin-top: 0.5rem; }

.wi-section-title { margin-top: 2.5rem; border-bottom: 2px solid var(--wi-accent); padding-bottom: 0.25rem; }

.wi-filters {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin: 1rem 0; padding: 1rem; background: #fff;
  border: 1px solid var(--wi-border); border-radius: 6px;
}
.wi-filters select, .wi-filters input {
  padding: 0.4rem 0.6rem; border: 1px solid var(--wi-border);
  border-radius: 4px; font-size: 0.9rem;
}

.wi-breadcrumb { font-size: 0.85rem; color: var(--wi-muted); margin: 1rem 0; }
.wi-breadcrumb a { color: var(--wi-muted); }

.wi-pagination { margin: 2rem 0; text-align: center; }
.wi-pagination a, .wi-pagination span {
  padding: 0.4rem 0.8rem; margin: 0 2px;
  border: 1px solid var(--wi-border); border-radius: 4px;
  background: #fff; display: inline-block;
}
.wi-pagination .current { background: var(--wi-accent); color: #fff; }

/* === Credits page (Phase 2b) ============================================ */
.wi-credits-page { padding: 1rem 0 3rem; }
.wi-credits-hero { padding: 1.2rem 0 1rem; border-bottom: 1px solid var(--wi-border); margin-bottom: 1.5rem; }
.wi-credits-hero h1 { margin: 0 0 0.5rem; font-size: 2rem; }
.wi-credits-lede { color: var(--wi-muted); max-width: 70ch; margin: 0.5rem 0 1rem; }
.wi-credits-stats { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; margin: 0.8rem 0 0; padding: 0; }
.wi-credits-stats > div { background: #fff; border: 1px solid var(--wi-border); border-radius: 6px; padding: 0.45rem 0.8rem; min-width: 140px; }
.wi-credits-stats dt { color: var(--wi-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.wi-credits-stats dd { margin: 0; font-size: 1.4rem; font-weight: 700; color: var(--wi-accent-dark); }
.wi-credits-toc {
  position: sticky; top: 0; z-index: 5;
  background: var(--wi-bg); padding: 0.6rem 0; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--wi-border); font-size: 0.9rem;
}
.wi-credits-toc strong { margin-right: 0.6rem; color: var(--wi-muted); }
.wi-credits-toc a { margin-right: 1rem; }
.wi-credits-section { margin: 2.4rem 0 0; scroll-margin-top: 4rem; }
.wi-credits-section h2 { font-size: 1.5rem; border-bottom: 2px solid var(--wi-accent); padding-bottom: 0.3rem; }
.wi-credits-section .wi-count { color: var(--wi-muted); font-weight: 400; font-size: 0.9rem; }
.wi-credits-intro { color: var(--wi-muted); max-width: 75ch; }
.wi-credits-bucket { margin: 1.4rem 0 0; scroll-margin-top: 4rem; }
.wi-credits-bucket h3 { margin: 1rem 0 0.4rem; font-size: 1.1rem; color: var(--wi-accent-dark); }
.wi-credits-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--wi-border); border-radius: 6px; overflow: hidden;
  font-size: 0.9rem;
}
.wi-credits-table th, .wi-credits-table td {
  padding: 0.5rem 0.7rem; text-align: left; border-bottom: 1px solid var(--wi-border); vertical-align: top;
}
.wi-credits-table thead th { background: #f1ebde; color: var(--wi-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.wi-credits-table tbody tr:nth-child(even) { background: #fbf8f1; }
.wi-credits-table tbody tr:hover { background: #f5edd9; }
.wi-credits-sources { margin: 0.4rem 0 1.2rem; }
.wi-credits-pill { display: inline-block; background: #f1ebde; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; margin-right: 0.3rem; color: var(--wi-fg); }
.wi-credits-meta { color: var(--wi-muted); font-size: 0.8rem; margin-top: 1.5rem; }
.wi-muted { color: var(--wi-muted); }
.wi-footer-links { font-size: 0.85rem; opacity: 0.85; margin-top: 0.4rem; }
@media (max-width: 720px) {
  .wi-credits-table { font-size: 0.82rem; }
  .wi-credits-table th, .wi-credits-table td { padding: 0.4rem 0.5rem; }
}

/* ------- Phase 18-G: multi-image gallery (hybrid UI) ------- */
.wi-gallery { display: flex; flex-direction: column; gap: 0.6rem; }
.wi-gallery__main { margin: 0; }
.wi-gallery__main a { display: block; line-height: 0; background: #ede5d2; }
.wi-gallery__main img {
  width: 100%; height: auto; max-height: 540px; object-fit: contain;
  border-radius: 6px; cursor: zoom-in; transition: opacity 0.2s ease;
}
.wi-gallery__main a:hover img { opacity: 0.92; }
/* Phase 28: figcaption made tidy (v3 fix). Phase 25 used `white-space: normal`
   inside chunks, which let "via" detach from its sibling <a>Wikimedia Commons</a>
   and orphan onto the previous line. Now each chunk is fully nowrap so units
   like "via Wikimedia Commons" or "Original uploader was Andrewa..." stay
   together; wrapping only happens between chunks at the &middot; boundary.
   Long-token escape valve uses overflow-wrap *only* if a single chunk would
   otherwise overflow the figcaption width. */
.wi-gallery__credit {
  font-size: 0.78rem; color: var(--wi-muted);
  padding: 0.4rem 0.1rem 0;
  line-height: 1.6;
  text-align: left;
  word-spacing: 0.02em;
  hyphens: auto;
}
.wi-gallery__credit a {
  color: var(--wi-muted);
  text-decoration: underline;
}
.wi-gallery__credit-chunk {
  /* Phase 28: keep entire chunk on one line. Wrap happens only between
     chunks (flex-wrap above). If a single chunk is wider than the row,
     fall back to character-level break so it never overflows visually. */
  white-space: nowrap;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.wi-gallery__credit-chunk a { white-space: nowrap; }
@media (max-width: 720px) {
  .wi-gallery__credit { font-size: 0.72rem; line-height: 1.5; column-gap: 0.3em; }
}
.wi-gallery__thumbs { margin-top: 0.2rem; }
.wi-gallery__thumb a {
  display: block; line-height: 0;
  border: 2px solid transparent; border-radius: 4px;
  overflow: hidden; transition: border-color 0.15s ease;
}
.wi-gallery__thumb a img {
  width: 100%; height: 70px; object-fit: cover; display: block; cursor: pointer;
}
.wi-gallery__thumb.is-active a { border-color: var(--wi-accent, #c8a25a); }
.wi-gallery__thumb a:hover { border-color: #b89048; }
/* Splide arrow tweaks for the thumb strip */
.wi-gallery__thumbs .splide__arrow {
  background: rgba(255,255,255,0.85); width: 1.6rem; height: 1.6rem;
}
.wi-gallery__thumbs .splide__arrow svg { width: 0.9rem; height: 0.9rem; }
@media (max-width: 720px) {
  .wi-gallery__main img { max-height: 360px; }
  .wi-gallery__thumb a img { height: 56px; }
}
/* GLightbox: ensure caption (description) is visible */
.glightbox-clean .gslide-description { background: rgba(0,0,0,0.7); }
.glightbox-clean .gdesc-inner { padding: 0.7rem 1rem; }

/* ===== Phase 21: TOP redesign ============================================
   Adds: warm amber accent, Fraunces (Serif) for hero/section H, full-bleed
   hero, 3:2 image cards for category grid. Existing wood tones untouched.
   ----------------------------------------------------------------------- */
:root {
  --wi-amber: #e8a44a;
  --wi-amber-dark: #c8842a;
  --wi-paper: #fffbf4;
}

/* Headings on the homepage + credits hero use Fraunces. Body keeps system. */
.wi-hero-v2 h1,
.wi-section-title-v2,
.wi-credits-hero h1 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  letter-spacing: -0.005em;
}

/* ---- Hero ---- */
.wi-hero-v2 {
  position: relative;
  margin: 1.2rem 0 2.4rem;
  border-radius: 14px;
  overflow: hidden;
  background: #2a1f15;
  min-height: 360px;
}
.wi-hero-v2__media { position: absolute; inset: 0; }
.wi-hero-v2__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  display: block;
}
.wi-hero-v2__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(20,12,4,0.78) 0%, rgba(20,12,4,0.55) 45%, rgba(20,12,4,0.18) 100%);
}
.wi-hero-v2__inner {
  position: relative; z-index: 2;
  padding: 3rem 2rem 2.4rem;
  max-width: 720px; color: #fff7e8;
}
.wi-hero-v2__title {
  margin: 0 0 0.6rem; font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  font-weight: 600; line-height: 1.18;
}
.wi-hero-v2__lede {
  margin: 0 0 1.2rem; font-size: 1.02rem; line-height: 1.55;
  color: rgba(255, 247, 232, 0.92); max-width: 56ch;
}
.wi-hero-v2__ctas { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 1rem; }
.wi-cta {
  display: inline-block; padding: 0.7rem 1.15rem;
  border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wi-cta--warm {
  background: var(--wi-amber); color: #2a1f15;
  box-shadow: 0 4px 14px rgba(232, 164, 74, 0.35);
}
.wi-cta--warm:hover { background: var(--wi-amber-dark); color: #fff; transform: translateY(-1px); text-decoration: none; }
.wi-cta--ghost {
  background: rgba(255, 255, 255, 0.08); color: #fff7e8;
  border: 1px solid rgba(255, 247, 232, 0.45);
}
.wi-cta--ghost:hover { background: rgba(255, 255, 255, 0.16); color: #fff; text-decoration: none; }
.wi-hero-v2__credit {
  margin: 0.6rem 0 0; font-size: 0.72rem; opacity: 0.65;
}
.wi-hero-v2__credit a { color: inherit; text-decoration: underline; }

/* ---- Section header ---- */
.wi-section { margin: 2.4rem 0; }
.wi-section-title-v2 {
  margin: 0 0 0.25rem; font-size: 1.7rem; font-weight: 600;
  color: var(--wi-fg);
}
.wi-section-title-v2::after {
  content: ""; display: block; width: 56px; height: 3px;
  background: var(--wi-amber); margin-top: 0.4rem; border-radius: 2px;
}
.wi-section-lede {
  margin: 0.4rem 0 1.2rem; color: var(--wi-muted); max-width: 64ch;
}

/* ---- Category grid (6 cards, 3:2 image) ---- */
.wi-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}
.wi-cat-card {
  display: block; background: var(--wi-paper);
  border: 1px solid var(--wi-border); border-radius: 12px;
  overflow: hidden; color: var(--wi-fg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}
.wi-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(91, 45, 10, 0.14);
  text-decoration: none;
}
.wi-cat-card__media {
  aspect-ratio: 3 / 2; background: var(--wi-border); overflow: hidden;
}
.wi-cat-card__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.4s ease;
}
.wi-cat-card:hover .wi-cat-card__media img { transform: scale(1.04); }
.wi-cat-card__body { padding: 0.95rem 1rem 1.05rem; }
.wi-cat-card__title {
  margin: 0 0 0.25rem; font-size: 1.2rem; font-weight: 600;
  font-family: "Fraunces", Georgia, serif;
  color: var(--wi-accent-dark);
}
.wi-cat-card__blurb { margin: 0 0 0.5rem; color: var(--wi-muted); font-size: 0.9rem; line-height: 1.45; }
.wi-cat-card__meta { margin: 0; font-size: 0.85rem; color: var(--wi-accent); font-weight: 600; }

/* ---- Country list (compact) ---- */
.wi-country-list {
  list-style: none; padding: 0; margin: 0;
  columns: 3; column-gap: 1.2rem;
}
.wi-country-list li { margin: 0 0 0.25rem; break-inside: avoid; font-size: 0.95rem; }
.wi-cl-count { color: var(--wi-muted); font-size: 0.82rem; }
.wi-cl-more { text-align: center; margin-top: 1rem; }

/* ---- Featured wrap (no visual change, just a hook for GA4) ---- */
.wi-feat-wrap { display: contents; }

/* ---- Credits TOP-photography section ---- */
.wi-credits-section--photo .wi-credits-table td a { color: var(--wi-accent-dark); }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .wi-cat-card,
  .wi-cat-card__media img,
  .wi-cta--warm,
  .wi-cta--ghost { transition: none; }
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .wi-hero-v2 { min-height: 320px; border-radius: 10px; }
  .wi-hero-v2__inner { padding: 2rem 1.2rem 1.6rem; }
  .wi-hero-v2__title { font-size: 1.5rem; }
  .wi-hero-v2__lede { font-size: 0.95rem; }
  .wi-cat-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.9rem; }
  .wi-country-list { columns: 2; }
  .wi-section-title-v2 { font-size: 1.4rem; }
}
@media (max-width: 480px) {
  .wi-cat-grid { grid-template-columns: 1fr; }
  .wi-country-list { columns: 1; }
}

/* ===== Phase 22: header v2 =================================================
   Sticky compact-on-scroll, refined Fraunces brand, hover-underline nav,
   inline collapsible search, accessible hamburger.
   Overrides legacy .wi-header rules where the same selector appears.
   ----------------------------------------------------------------------- */

/* skip-link (a11y) */
.wi-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--wi-amber); color: #2a1f15;
  padding: 0.5rem 0.9rem; border-radius: 0 0 6px 6px;
  font-weight: 600;
}
.wi-skip-link:focus { left: 1rem; }

/* base */
.wi-header-v2 {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, #4a2306 0%, var(--wi-accent-dark) 100%);
  border-bottom: 1px solid rgba(232, 164, 74, 0.25);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
  padding: 0;
  transition: padding 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.wi-header-v2.is-scrolled {
  background: rgba(58, 28, 7, 0.94);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}
.wi-header-v2 .wi-header-v2__inner {
  display: flex; align-items: center; gap: 1.2rem;
  min-height: 64px;
  padding-top: 0.55rem; padding-bottom: 0.55rem;
  transition: min-height 0.18s ease;
}
.wi-header-v2.is-scrolled .wi-header-v2__inner { min-height: 52px; }

/* brand */
.wi-brand-v2 {
  display: inline-flex; align-items: baseline; gap: 0.55rem;
  color: #fff7e8 !important;
  text-decoration: none;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
  line-height: 1;
}
.wi-brand-v2:hover { text-decoration: none; }
.wi-brand-v2__mark {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--wi-amber);
  align-self: center;
  transition: transform 0.4s ease, color 0.2s ease;
}
.wi-brand-v2:hover .wi-brand-v2__mark { transform: rotate(-12deg); color: #ffc878; }
.wi-brand-v2__name { font-size: 1.2rem; font-weight: 600; }
.wi-brand-v2__dot { color: var(--wi-amber); font-weight: 700; margin-left: 1px; }

/* nav */
.wi-nav-v2 {
  display: flex; align-items: center; gap: 0.25rem;
  margin-left: auto;
  margin-top: 0;
  flex-wrap: nowrap;
}
.wi-nav-v2 a {
  position: relative;
  color: #f7f3ec !important;
  font-size: 0.92rem; font-weight: 500;
  padding: 0.55rem 0.75rem; border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.wi-nav-v2 a::after {
  content: ""; position: absolute;
  left: 0.75rem; right: 0.75rem; bottom: 0.32rem;
  height: 2px; background: var(--wi-amber);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.22s ease;
}
.wi-nav-v2 a:hover,
.wi-nav-v2 a:focus-visible {
  color: #fff !important; text-decoration: none;
  background: rgba(255, 247, 232, 0.06);
}
.wi-nav-v2 a:hover::after,
.wi-nav-v2 a:focus-visible::after { transform: scaleX(1); }
.wi-nav-v2 a:focus-visible {
  outline: 2px solid var(--wi-amber); outline-offset: 2px;
}

/* search toggle button (in nav row) */
.wi-search-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: #f7f3ec;
  border: 1px solid rgba(255, 247, 232, 0.25);
  border-radius: 999px;
  width: 36px; height: 36px;
  margin-left: 0.5rem; padding: 0; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.wi-search-toggle:hover,
.wi-search-toggle[aria-expanded="true"] {
  background: var(--wi-amber); color: #2a1f15;
  border-color: var(--wi-amber);
}
.wi-search-toggle:focus-visible {
  outline: 2px solid var(--wi-amber); outline-offset: 2px;
}

/* hamburger toggle (mobile only) */
.wi-header-v2__toggle {
  display: none;
  margin-left: auto;
  background: transparent; border: 1px solid rgba(255, 247, 232, 0.25);
  border-radius: 8px;
  width: 40px; height: 40px; padding: 0; cursor: pointer;
  color: #f7f3ec;
}
.wi-header-v2__toggle:focus-visible {
  outline: 2px solid var(--wi-amber); outline-offset: 2px;
}
.wi-burger {
  display: inline-flex; flex-direction: column; justify-content: center;
  align-items: center; gap: 4px; width: 100%; height: 100%;
}
.wi-burger span {
  display: block; width: 18px; height: 2px; background: currentColor;
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.18s ease;
}
.wi-header-v2__toggle[aria-expanded="true"] .wi-burger span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.wi-header-v2__toggle[aria-expanded="true"] .wi-burger span:nth-child(2) { opacity: 0; }
.wi-header-v2__toggle[aria-expanded="true"] .wi-burger span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* inline header search */
.wi-header-search {
  position: absolute;
  top: 100%; left: 0; right: 0;
  display: flex; align-items: center; gap: 0.5rem;
  background: #3a1c07;
  border-top: 1px solid rgba(232, 164, 74, 0.25);
  border-bottom: 1px solid rgba(0,0,0,0.18);
  padding: 0.7rem 1rem;
}
.wi-header-search[hidden] { display: none; }
.wi-header-search input[type="search"] {
  flex: 1 1 auto;
  background: rgba(255, 247, 232, 0.96);
  color: #2a1f15;
  border: 1px solid rgba(232, 164, 74, 0.4);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  outline: none;
  max-width: 640px; margin: 0 auto;
}
.wi-header-search input[type="search"]:focus {
  border-color: var(--wi-amber);
  box-shadow: 0 0 0 3px rgba(232, 164, 74, 0.3);
}
.wi-header-search button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wi-amber); color: #2a1f15;
  border: 0; border-radius: 999px;
  width: 38px; height: 38px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.wi-header-search button[type="submit"]:hover { background: var(--wi-amber-dark); color: #fff; }

/* relative anchor for absolute search panel */
.wi-header-v2 { /* sticky already */ }
.wi-header-v2 .wi-header-v2__inner { position: relative; }

/* legacy tagline removed in v2 markup; hide if present */
.wi-header-v2 .wi-tagline { display: none; }

/* ---- Mobile (<= 720px) ---- */
@media (max-width: 720px) {
  .wi-header-v2__toggle { display: inline-flex; }
  .wi-search-toggle { display: none; }       /* search lives below nav drawer */
  .wi-nav-v2 {
    position: absolute;
    top: 100%; left: 0; right: 0;
    margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #3a1c07;
    border-top: 1px solid rgba(232, 164, 74, 0.25);
    padding: 0.5rem 0;
    max-height: 0; overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .wi-nav-v2.is-open { max-height: 70vh; }
  .wi-nav-v2 a {
    padding: 0.85rem 1.2rem; border-radius: 0;
    font-size: 1rem;
  }
  .wi-nav-v2 a::after { display: none; }
  .wi-nav-v2 a:hover,
  .wi-nav-v2 a:focus-visible {
    background: rgba(232, 164, 74, 0.12);
  }
  .wi-brand-v2__name { font-size: 1.05rem; }

  /* mobile search: always shown inline below nav, full width */
  .wi-header-search {
    position: static;
    padding: 0.6rem 1rem 0.8rem;
  }
  .wi-header-search[hidden] { display: flex; } /* override: keep visible on mobile */
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .wi-header-v2,
  .wi-header-v2 .wi-header-v2__inner,
  .wi-brand-v2__mark,
  .wi-nav-v2 a::after,
  .wi-burger span,
  .wi-nav-v2 { transition: none; }
}

