/* ================================================================
   TNM Components — Tromboo design system
   Extends style.css. Uses --p-* and -- tokens from :root.
   ================================================================ */

/* ── Buttons ──────────────────────────────────────────────────── */
.tnm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 24px; height: 48px;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.tnm-btn--primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.tnm-btn--primary:hover { background: var(--primary); border-color: var(--primary); }
.tnm-btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.tnm-btn--ghost:hover { background: var(--ink); color: #fff; }
.tnm-btn--soft { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.tnm-btn--soft:hover { border-color: var(--ink); }
.tnm-btn--lg { height: 56px; padding: 0 32px; font-size: 14px; }
.tnm-btn--block { width: 100%; }

/* ── Link arrow ───────────────────────────────────────────────── */
.tnm-link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--rule); padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.tnm-link-arrow:hover { color: var(--primary); border-color: var(--primary); }
.tnm-link-arrow svg { transition: transform 0.2s; }
.tnm-link-arrow:hover svg { transform: translateX(3px); }

/* ── Eyebrow ──────────────────────────────────────────────────── */
.tnm-eyebrow {
  display: block;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mute);
}
.tnm-eyebrow--ink { color: var(--mute); }
.tnm-eyebrow--indigo { color: var(--primary); }

/* ── Badges ───────────────────────────────────────────────────── */
.tnm-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 4px 10px; border: 1px solid var(--rule); color: var(--mute);
}
.tnm-badge--gold {
  border-color: var(--primary);
  color: var(--primary);
}
.tnm-badge--indigo { border-color: var(--primary); color: var(--primary); }
.tnm-badge--filled { background: var(--ink); color: #fff; border-color: var(--ink); }
.tnm-badge--ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.tnm-badge svg { width: 10px; height: 10px; flex-shrink: 0; }

/* ── Form field ───────────────────────────────────────────────── */
.tnm-field { display: grid; gap: 6px; }
.tnm-field label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute);
}
.tnm-field input,
.tnm-field select,
.tnm-field textarea {
  width: 100%; padding: 11px 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule);
  font-family: var(--font-body); font-size: 14px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.tnm-field input:focus,
.tnm-field select:focus,
.tnm-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 10%, transparent);
}

/* ── Rail (horizontal scroll product row) ─────────────────────── */
.tnm-rail {
  overflow-x: auto; scrollbar-width: none;
  padding-inline: var(--gutter, clamp(1.25rem, 4vw, 2.5rem));
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.tnm-rail::-webkit-scrollbar { display: none; }
.tnm-rail__inner {
  display: flex; gap: clamp(14px, 1.5vw, 24px);
  min-width: max-content;
  padding-bottom: 4px;
}
.tnm-rail__inner > * {
  flex: 0 0 clamp(220px, 22vw, 300px);
  scroll-snap-align: start;
}

/* ── Rail card type ───────────────────────────────────────────────
 * custom-product-card.php is shared, but its typography lives in
 * tnm-loop.css — which assets.php enqueues only on shop/category pages.
 * The homepage rail therefore renders these cards with NO card type:
 * h3 and .card-desc both inherit body size. With a 12-word description
 * that's still a wall of 16px text in a 220–300px card, so the rail
 * sets its own scale here. Scoped to the rail; the archive keeps
 * tnm-loop.css's container-query sizing. */
.tnm-rail__inner .product-card .tromboo-eyebrow {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.tnm-rail__inner .product-card .card-body h3 {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 500;
  color: var(--ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.tnm-rail__inner .product-card .card-desc {
  font-size: 11px;
  line-height: 1.45;
  color: var(--mute);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ── Rail head (section title + controls row) ─────────────────── */
.tnm-rail-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.tnm-rail-head__nav { display: flex; gap: 6px; }
.tnm-icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--rule); color: var(--ink);
  background: var(--surface); transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.tnm-icon-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── Placeholder (striped image stand-in) ─────────────────────── */
.tnm-ph {
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklch, var(--p-ink) 6%, transparent) 0,
      color-mix(in oklch, var(--p-ink) 6%, transparent) 1px,
      transparent 1px, transparent 9px),
    color-mix(in oklch, var(--primary) 8%, var(--p-bg));
  display: flex; align-items: flex-end;
  padding: 12px 14px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute);
}
.tnm-ph--ink {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.06) 0, rgba(255,255,255,0.06) 1px,
      transparent 1px, transparent 9px),
    color-mix(in oklch, var(--primary) 65%, var(--ink));
  color: rgba(255,255,255,0.5);
}
.tnm-ph--gold {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.06) 0, rgba(255,255,255,0.06) 1px,
      transparent 1px, transparent 9px),
    color-mix(in oklch, var(--primary) 65%, var(--ink));
  color: rgba(255,255,255,0.5);
}

/* ── Section layout helpers ───────────────────────────────────── */
.tnm-section {
  padding-block: var(--section-pad, clamp(3rem, 7vw, 8rem));
}
.tnm-section--tight {
  padding-block: var(--section-tight, clamp(2rem, 5vw, 5rem));
}
.tnm-section--ink {
  background: var(--ink); color: var(--p-bg);
}
.tnm-section--soft {
  background: var(--surface-soft);
}
.tnm-container {
  max-width: 1320px; margin-inline: auto;
  padding-inline: var(--gutter, clamp(1.25rem, 4vw, 2.5rem));
}
.tnm-container--wide  { max-width: 1560px; }
.tnm-container--narrow { max-width: 880px; }

/* ── Marquee ──────────────────────────────────────────────────── */
/* Layout + animation only. Type lives in the markup as Tailwind utilities:
   this block is unlayered, so any font-size/font-family set here beats the
   layered utilities and silently pins the track — which is how `font-serif`
   and the inline clamp in the markup used to do nothing at all. */
.tnm-marquee { overflow: hidden; }
.tnm-marquee__track {
  display: flex; gap: clamp(24px, 3vw, 48px); width: max-content;
  animation: tnm-marquee 28s linear infinite;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--mute);
}
@keyframes tnm-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Community mosaic grid ────────────────────────────────────── */
.tnm-mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: clamp(180px, 22vw, 320px);
  gap: 4px;
}
.tnm-mosaic__tile { overflow: hidden; background: var(--surface-soft); }
.tnm-mosaic__tile:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.tnm-mosaic__tile:nth-child(4) { grid-column: span 2; }
/* Tiles 7–8 pin to row 2, cols 5–6 — filling the hole under @ishika (which
   spans cols 5–6 in row 1) and to the right of @anuva. Pinned rather than
   auto-placed because auto-flow would drop them into cols 3–4 instead.
   Desktop-only: an explicit grid-column above 768px would spawn implicit
   columns in the 3-col mobile grid. */
@media (min-width: 769px) {
  .tnm-mosaic__tile:nth-child(7) { grid-column: 5; }
  .tnm-mosaic__tile:nth-child(8) { grid-column: 6; }
}
@media (max-width: 768px) {
  /* Mobile album: full-width opener, two rows of paired portraits, then a
     full-width closer. Tiles 7–8 are desktop-only extras, hidden here so the
     pattern resolves cleanly instead of leaving an orphan row. */
  .tnm-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
    gap: 8px;
  }
  .tnm-mosaic__tile,
  .tnm-mosaic__tile:nth-child(1),
  .tnm-mosaic__tile:nth-child(4) {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 1 / 1;
  }
  .tnm-mosaic__tile:nth-child(1),
  .tnm-mosaic__tile:nth-child(6) {
    grid-column: span 2;
    aspect-ratio: 3 / 2;
  }
  .tnm-mosaic__tile:nth-child(n+7) { display: none; }
}

/* ── Stat grid (artisan band) ─────────────────────────────────── */
.tnm-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px;
}
.tnm-stat-grid dt {
  font-family: var(--font-display); font-size: var(--step-3);
  font-weight: 500; color: var(--primary); line-height: 1;
}
.tnm-stat-grid dd {
  margin: 4px 0 0; font-size: 13px; color: var(--mute); letter-spacing: 0.03em;
}

/* ── Mobile drawer menu ─────────────────────────────────────────
 * Top level is a serif rail with hairline rules.
 * Markup comes from Tromboo_Drawer_Walker (inc/nav/drawer-menu.php):
 * Shop is a full-width toggle button (.tnm-drawer-row--toggle, chevron
 * inline); every other parent is a plain <a> (.tnm-drawer-row) with a
 * sibling .tnm-drawer-toggle chevron positioned over its right padding,
 * so the label stays a working link. JS wires the toggles and injects a
 * chevron only for a parent that somehow lacks one.
 * The sub-list sets no `display`, so [hidden] from the accordion
 * still collapses it. */
.tnm-drawer-menu {
  list-style: none; margin: 0; padding: 0;
}
.tnm-drawer-menu > li {
  position: relative;
  border-bottom: 1px solid var(--rule);
}
/* Shared row look for both the <a> and the Shop toggle <button>. */
.tnm-drawer-menu > li > .tnm-drawer-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 56px; padding: 14px 24px;
  font-family: var(--font-display);
  font-size: 20px; font-weight: 400; line-height: 1.3;
  color: var(--ink); text-decoration: none;
  background: none; border: 0; text-align: left;
  transition: color .2s ease;
}
.tnm-drawer-menu > li > .tnm-drawer-row:hover { color: var(--primary); }
.tnm-drawer-menu > li > .tnm-drawer-row:focus-visible {
  outline: 2px solid var(--primary); outline-offset: -2px;
}
/* A plain parent link shares the row with an absolutely-placed chevron. */
.tnm-drawer-menu > li.menu-item-has-children > a.tnm-drawer-row { padding-right: 60px; }

/* Shop's own toggle is a full-width row; its mark sits inline. */
.tnm-drawer-menu > li > .tnm-drawer-row--toggle svg,
.tnm-drawer-toggle svg {
  width: 16px; height: 16px; flex-shrink: 0;
}
/* Plus/minus: both paths always drawn, the vertical one fades out on
   expand so only the horizontal bar remains. Pure CSS, no JS glyph swap. */
.tnm-plus-v { transition: opacity .2s ease; }
[aria-expanded="true"] .tnm-plus-v { opacity: 0; }

.tnm-drawer-toggle {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: none; border: 0; padding: 0;
  color: var(--mute); cursor: pointer;
}
.tnm-drawer-toggle:hover { color: var(--ink); }

.tnm-drawer-menu .tnm-drawer-sub {
  list-style: none; margin: 0;
  padding: 0 0 14px;
}
/* Category row: small square thumb + label, on one line. */
.tnm-drawer-menu .tnm-drawer-sub > li > .tnm-drawer-cat {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 24px 10px 40px;
  color: var(--mute); text-decoration: none;
  transition: color .2s ease;
}
.tnm-drawer-menu .tnm-drawer-sub > li > .tnm-drawer-cat:hover { color: var(--primary); }
.tnm-drawer-cat__thumb {
  flex-shrink: 0;
  width: 44px; height: 44px;
  overflow: hidden;
  background: var(--surface-soft);
}
.tnm-drawer-cat__thumb img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;   /* banners are authored 16:4 — crop to square */
}
.tnm-drawer-cat__name {
  font-size: 15px; line-height: 1.4;
}
/* ── Shop category list — dividers + zig-zag ───────────────────
 * Only .tnm-drawer-cats (the walker's category list) gets this. Plain
 * menu sub-items live in .tnm-drawer-sub without it and keep their
 * uniform indent. Border sits on the <li> so the row is one clean tap
 * target rather than an <a> that would double the line at the corners.
 * row-reverse flips the DOM order thumb→name, and space-between pushes
 * the pair to opposite edges — odd rows thumb-left/name-right, even rows
 * name-left/thumb-right. */
.tnm-drawer-cats > li {
  border-bottom: 1px solid var(--rule);
}
.tnm-drawer-cats > li:last-child { border-bottom: 0; }
.tnm-drawer-cats > li:nth-child(even) > .tnm-drawer-cat {
  flex-direction: row-reverse;
  padding: 10px 40px 10px 24px;
}
/* Sub-items from the menu itself (no image). Indent to line their text up
   with the category labels: 40 row pad + 44 thumb + 14 gap = 98. */
.tnm-drawer-menu .tnm-drawer-sub > li > a:not(.tnm-drawer-cat) {
  display: block;
  padding: 9px 24px 9px 98px;
  font-size: 15px; line-height: 1.4;
  color: var(--mute); text-decoration: none;
  transition: color .2s ease;
}
.tnm-drawer-menu .tnm-drawer-sub > li > a:not(.tnm-drawer-cat):hover { color: var(--primary); }

/* ── Story teaser quote ───────────────────────────────────────── */
.tnm-pull-quote {
  font-family: var(--font-display); font-size: var(--step-4);
  font-weight: 400; line-height: 1.15; text-wrap: balance;
  letter-spacing: -0.01em;
  /* Inherit, don't hardcode. This block is unlayered, so a `color:` here
     beats Tailwind's layered text-bg/text-ink utilities regardless of
     specificity — pinning --ink left this quote #000000 on a #000000
     section. Inheriting lets the section decide. */
  color: inherit;
}
.tnm-pull-quote em { font-style: italic; color: var(--primary); }

/* ── Header mega menu (Shop hover panel) ─────────────────────────
 * "Editorial rail" layout — a row of tall portrait tiles, index
 * numbers, italic serif names set into the image over a gradient.
 * Full-bleed background band, content aligned to the site's usual
 * container width. Flat, hairline-bordered — matches the site's
 * borderless-serif, no-shadow language (sort select, shop tabs,
 * layout switch).
 * ──────────────────────────────────────────────────────────────── */
.tnm-mega-panel {
  position: fixed; left: 0; right: 0; top: 64px; /* matches header's h-16 */
  width: 100%;
  background: var(--p-bg);
  border-top: 1px solid var(--p-line);
  border-bottom: 1px solid var(--p-line);
}
.tnm-mega-panel__inner {
  display: flex; align-items: flex-end; gap: clamp(20px, 2.4vw, 32px);
  max-width: 1280px; margin-inline: auto;
  padding: 32px clamp(24px, 4vw, 64px) 36px;
}
.tnm-mega-intro { flex: 0 0 180px; padding-bottom: 6px; }
.tnm-mega-eyebrow {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--p-inkMut);
  display: block; margin-bottom: 12px;
}
.tnm-mega-heading {
  font-family: var(--font-display); font-weight: 400; font-size: 22px;
  line-height: 1.2; color: var(--p-ink); margin: 0 0 14px;
}
.tnm-mega-viewall {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--p-ink); text-decoration: none;
  border-bottom: 1px solid var(--p-ink); padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.tnm-mega-viewall:hover { color: var(--p-primary); border-color: var(--p-primary); }

.tnm-mega-rail { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; }
.tnm-mega-tile { flex: 0 0 138px; }
.tnm-mega-tile__link { display: block; text-decoration: none; }
.tnm-mega-tile__frame {
  position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden;
  background: var(--p-surface-soft, var(--surface-soft));
}
.tnm-mega-tile__frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.tnm-mega-tile:hover .tnm-mega-tile__frame img { transform: scale(1.06); }
.tnm-mega-tile__index {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  color: #fff; mix-blend-mode: difference;
}
.tnm-mega-tile__overlay {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent 65%);
}
.tnm-mega-tile__name {
  font-family: var(--font-display); font-style: italic; font-size: 18px; color: #fff;
}

/* ── Scroll reveal ────────────────────────────────────────────── */
[data-reveal] {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-reveal].in { opacity: 1; transform: none; }
