/* Barista profile page — magazine layout + the seven editorial themes.
   Component rules read from --bp-* custom properties; each
   [data-theme="..."] block only remaps those (plus site tokens they
   compose with), so adding an eighth theme later is a values-only change.
   See FUNCTIONAL_SPEC_WEB.md §6b.4. */

.barista-page {
  --bp-bg: var(--parchment);
  --bp-ink: var(--espresso);
  --bp-ink2: var(--roast);
  --bp-ink3: #786855;
  --bp-accent: var(--terracotta);
  --bp-rule: var(--border-hairline);
  --bp-band-bg: var(--espresso);
  --bp-band-ink: var(--parchment);
  --bp-cta-bg: var(--crema);
  --bp-radius: 0px;
  --bp-name-weight: 300;
  background: var(--bp-bg);
  color: var(--bp-ink);
}

.barista-page[data-theme="nocturne"] {
  --bp-bg: var(--espresso);
  --bp-ink: var(--parchment);
  --bp-ink2: rgba(245, 237, 224, 0.74);
  --bp-ink3: rgba(245, 237, 224, 0.62);
  --bp-accent: var(--ochre);
  --bp-rule: rgba(245, 237, 224, 0.18);
  --bp-band-bg: var(--crema);
  --bp-band-ink: var(--espresso);
  --bp-cta-bg: var(--roast);
}

.barista-page[data-theme="grove"] {
  --bp-bg: var(--linen);
  --bp-ink3: #786e5f;
  --bp-accent: var(--plum);
  --bp-band-bg: #241c22;
  --bp-cta-bg: #e9e4da;
  --bp-name-weight: 400;
}

.barista-page[data-theme="bulletin"] {
  --bp-rule: rgba(31, 20, 14, 0.9);
  --bp-radius: 6px;
  --bp-name-weight: 700;
}

.barista-page[data-theme="cortado"] {
  --bp-bg: #fbf1e9;
  --bp-ink: #2a1710;
  --bp-ink2: #5a3a28;
  --bp-ink3: #846758;
  --bp-accent: #c2542f;
  --bp-rule: rgba(42, 23, 16, 0.12);
  --bp-band-bg: #7a2e14;
  --bp-band-ink: #fcefe4;
  --bp-cta-bg: #f6dfce;
  --bp-radius: 20px;
}

.barista-page[data-theme="verdant"] {
  --bp-bg: #f1f4ea;
  --bp-ink: #1e2618;
  --bp-ink2: #42513a;
  --bp-ink3: #65705b;
  --bp-accent: #5a6b4a;
  --bp-rule: rgba(30, 38, 24, 0.13);
  --bp-band-bg: #26301e;
  --bp-band-ink: #edf2e4;
  --bp-cta-bg: #dde5d0;
  --bp-radius: 24px;
}

.barista-page[data-theme="ember"] {
  --bp-bg: #fff6e7;
  --bp-ink: #33200c;
  --bp-ink2: #63451f;
  --bp-ink3: #896a43;
  --bp-accent: #c98a2e;
  --bp-rule: rgba(51, 32, 12, 0.13);
  --bp-band-bg: #4a2e12;
  --bp-band-ink: #fff1d9;
  --bp-cta-bg: #f7e3be;
  --bp-radius: 28px;
}

.barista-hero { position: relative; min-height: 62vh; overflow: hidden; background: var(--espresso); border-radius: 0 0 var(--bp-radius) var(--bp-radius); }
.barista-hero-img { position: absolute; inset: 0; }
.barista-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.barista-hero-scrim { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(31,20,14,0.5) 0%, rgba(31,20,14,0.05) 32%, rgba(31,20,14,0.55) 68%, rgba(31,20,14,0.9) 100%); }
.barista-hero-body { position: absolute; inset: auto 0 0 0; padding-bottom: var(--s-7); color: var(--parchment); }
.barista-hero-name { font-family: var(--font-display); font-weight: var(--bp-name-weight); font-size: clamp(48px, 10vw, 128px); line-height: 0.86; letter-spacing: -0.03em; margin: 12px 0 0; }
.barista-hero-dek { font-family: var(--font-display); font-size: clamp(17px, 2vw, 22px); font-weight: 300; max-width: 620px; margin-top: 18px; color: rgba(245,237,224,0.9); }
.barista-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 13.5px; font-weight: 600; color: var(--moss); }
.barista-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--moss); flex: none; }

.barista-headshot { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid rgba(245,237,224,0.85); box-shadow: 0 4px 18px rgba(31,20,14,0.35); }

.barista-standfirst { font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 27px); font-weight: 300; line-height: 1.45; color: var(--bp-ink); max-width: 720px; }
.barista-standfirst::first-letter { float: left; font-size: 84px; line-height: 0.78; padding: 6px 12px 0 0; font-weight: 400; color: var(--bp-accent); }

.barista-facts { border-top: 2px solid var(--bp-ink); padding-top: var(--s-4); margin: 0; }
.barista-facts dt { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--bp-ink3); margin-top: var(--s-3); }
.barista-facts dd { margin: 4px 0 0; font-size: 14.5px; font-weight: 600; color: var(--bp-ink); }

.barista-award { display: grid; grid-template-columns: 90px 1fr; gap: var(--s-5); align-items: baseline; padding: var(--s-4) 0; border-top: 1px solid var(--bp-rule); }
.barista-award-year { font-family: var(--font-display); font-size: 32px; font-weight: 300; color: var(--bp-ink3); }
.barista-award.is-gold .barista-award-year { color: var(--bp-accent); }

.barista-job { display: grid; grid-template-columns: 180px 1fr; gap: var(--s-6); padding: var(--s-5) 0; border-top: 1px solid var(--bp-rule); }
.barista-job-when { font-family: var(--font-mono); font-size: 11px; color: var(--bp-ink3); }

.barista-plates { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.barista-plate { position: relative; aspect-ratio: 1; border-radius: var(--bp-radius); overflow: hidden; background: var(--crema); }
.barista-plate img { width: 100%; height: 100%; object-fit: cover; }

.barista-portrait { display: grid; grid-template-columns: 1.1fr 1fr; margin-top: var(--s-8); border-radius: var(--bp-radius); overflow: hidden; }
.barista-portrait-img { position: relative; aspect-ratio: 4/5; background: var(--roast); }
.barista-portrait-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.barista-portrait-side { background: var(--bp-band-bg); color: var(--bp-band-ink); padding: var(--s-7) var(--s-6); display: flex; flex-direction: column; justify-content: center; }
.barista-portrait-q { font-family: var(--font-display); font-size: clamp(21px, 2.6vw, 30px); font-style: italic; font-weight: 300; line-height: 1.32; margin-top: var(--s-4); }

.barista-dark { background: var(--bp-band-bg); color: var(--bp-band-ink); padding: var(--s-8) 0; border-radius: var(--bp-radius); margin-top: var(--s-8); }
.barista-recipes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); margin-top: 24px; }
.barista-spec-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(245,237,224,0.16); font-size: 13px; }
.barista-spec-row b { font-family: var(--font-mono); }

.barista-qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); margin-top: 24px; }
.barista-qa-item { border-top: 2px solid var(--bp-ink); padding-top: var(--s-3); }
.barista-qa-q { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bp-accent); }
.barista-qa-a { font-family: var(--font-display); font-size: 19px; font-weight: 300; margin-top: var(--s-3); }

.barista-skill-run { font-family: var(--font-display); font-size: clamp(18px, 2.2vw, 26px); font-weight: 300; line-height: 1.6; }
.barista-skill-run span { border-bottom: 1px solid var(--bp-rule); padding-bottom: 1px; }

.barista-cert-row { display: flex; justify-content: space-between; gap: var(--s-5); padding: var(--s-3) 0; border-top: 1px solid var(--bp-rule); }

.barista-colophon { background: var(--bp-cta-bg); border-radius: var(--bp-radius); padding: var(--s-7) 0; margin-top: var(--s-8); }
.barista-cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }
.barista-btn-disabled { opacity: 0.5; cursor: not-allowed; }

.barista-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-5); }
.barista-card { display: block; text-decoration: none; color: inherit; }
.barista-card-cover { aspect-ratio: 4/5; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-3); }
.barista-card-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ── Mobile (container-driven, matches site.css) ────── */
@container (max-width: 880px) {
  .barista-job { grid-template-columns: 1fr; gap: var(--s-3); }
  .barista-plates { grid-template-columns: 1fr; }
  .barista-portrait { grid-template-columns: 1fr; }
  .barista-award { grid-template-columns: 1fr; gap: var(--s-2); }
  .barista-recipes-grid { grid-template-columns: 1fr; }
  .barista-qa-grid { grid-template-columns: 1fr; }
}

/* ── The profile builder (/barista/edit) ─────────────
   Split screen: an any-order list of collapsible sections on the left, a
   live preview iframe on the right. Below 880px the preview becomes a
   toggle rather than a second pane (§6h.2) — driven by data-pane on
   .builder-split, which the mobile toggle button flips. Container queries,
   not media queries, to match the rest of this codebase. */

.builder-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.builder-editor-inner { max-width: 720px; padding: 40px var(--site-pad) 96px; }
.builder-preview {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px 20px 20px 0;
}
.builder-preview-head { display: flex; align-items: center; gap: 10px; }
.builder-preview-frame {
  flex: 1; width: 100%; border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); background: var(--bg-2);
}

.builder-section { border-top: 1px solid var(--border-hairline); }
.builder-section > summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 16px 0; list-style: none;
  font-family: var(--font-display); font-size: 20px; font-weight: 400;
}
.builder-section > summary::-webkit-details-marker { display: none; }
.builder-section > summary::before { content: "+"; font-family: var(--font-mono); font-size: 15px; color: var(--fg-3); width: 14px; }
.builder-section[open] > summary::before { content: "–"; }
.builder-body { display: grid; gap: 18px; padding: 2px 0 26px; }
.builder-subsection { display: grid; gap: 8px; }

.builder-status {
  margin-left: auto; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3);
  opacity: 0; transition: opacity 200ms var(--ease-steam);
}
.builder-status.is-visible { opacity: 1; }
.builder-status.is-error { color: var(--featured); }

.builder-empty { color: var(--fg-3); font-size: var(--fs-sm); margin: 0; }
.builder-rows { display: grid; gap: 12px; }

.barista-cafe-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
  background: var(--bg-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-sm); box-shadow: var(--shadow-e2);
  max-height: 220px; overflow-y: auto;
}
.barista-cafe-suggest button { display: block; width: 100%; text-align: left; padding: 8px 12px; background: none; border: none; cursor: pointer; font-size: 13px; }
.barista-cafe-suggest button:hover { background: var(--bg-3); }

@container (max-width: 880px) {
  .builder-split { grid-template-columns: 1fr; }
  .builder-preview { position: static; height: 72vh; padding: 0 var(--site-pad) 40px; }
  .builder-split[data-pane="edit"] .builder-preview { display: none; }
  .builder-split[data-pane="preview"] .builder-editor { display: none; }
}
