/* ──────────────────────────────────────────────────────────────────
   Cards — shared card/hero/stats primitives
   ──────────────────────────────────────────────────────────────────
   Extracted from distillery-profile.css in Phase 2 of the bottle-page
   redesign so the bottle profile and distillery profile can share the
   same visual language without duplicating CSS.

   Class names retained as `dsp-*` (originally "distillery profile")
   to avoid renaming risk during the refactor — they are used as
   generic primitives by every page that loads this stylesheet.

   Pages that load this file MUST wrap their content in an element
   with the `.dsp-page` class so the CSS custom properties (variables)
   defined in that block are scoped correctly.
   ────────────────────────────────────────────────────────────────── */

/* Variables + page wrapper */
.dsp-page {
  --dsp-radius-section: 4px;
  --dsp-radius-inner: 4px;
  --dsp-section-bg: var(--ds-dark-2, #13100B);
  --dsp-section-border: var(--ds-border, #2A1F14);
  --dsp-gap: 20px;
  --dsp-gold: var(--ds-gold, #F9AF36);
  --dsp-gold-light: var(--ds-gold-light, #FDE8C4);
  --dsp-gold-dim: rgba(249,175,54,0.12);
  --dsp-text: var(--ds-text, #F0E6D4);
  --dsp-muted: var(--ds-muted, #C8B8A0);
  --dsp-dark-1: var(--ds-dark-1, #0D0B08);
  --dsp-dark-3: var(--ds-dark-3, #1B1610);
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

/* Section card base */
.dsp-section {
  background: var(--dsp-section-bg);
  border: 1px solid var(--dsp-section-border);
  border-radius: var(--dsp-radius-section);
  padding: 28px;
  margin-bottom: var(--dsp-gap);
  position: relative;
  overflow: hidden;
}
.dsp-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 0%, rgba(249,175,54,0.04), transparent 60%);
  pointer-events: none;
}

/* Section label */
.dsp-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--dsp-gold);
  margin-bottom: 12px;
  position: relative;
}

/* Section heading */
.dsp-heading {
  font-family: Georgia, serif;
  font-size: clamp(20px, 4vw, 26px);
  color: var(--dsp-gold-light);
  margin: 0 0 16px;
  position: relative;
}

/* ── Skeleton Loading ── */
.dsp-skeleton {
  padding: 16px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.dsp-skel-card {
  background: var(--dsp-section-bg, #13100B);
  border: 1px solid var(--dsp-section-border, #2A1F14);
  border-radius: 4px;
  padding: 28px;
  margin-bottom: 20px;
  overflow: hidden;
}
.dsp-skel-bar {
  background: linear-gradient(90deg, #1B1610 25%, #252015 50%, #1B1610 75%);
  background-size: 200% 100%;
  animation: dsp-shimmer 1.5s infinite;
  border-radius: 4px;
  height: 16px;
  margin-bottom: 12px;
}
.dsp-skel-bar.tall { height: 32px; width: 60%; }
.dsp-skel-bar.medium { height: 14px; width: 45%; }
.dsp-skel-bar.short { height: 12px; width: 30%; }
.dsp-skel-bar.wide { height: 200px; width: 100%; border-radius: 4px; }
.dsp-skel-row { display: flex; gap: 12px; margin-bottom: 12px; }
.dsp-skel-stat { flex: 1; height: 72px; background: linear-gradient(90deg, #1B1610 25%, #252015 50%, #1B1610 75%); background-size: 200% 100%; animation: dsp-shimmer 1.5s infinite; border-radius: 4px; }

@keyframes dsp-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Hero Section ── */
.dsp-hero {
  position: relative;
  padding: 28px;
}
.dsp-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  pointer-events: none;
}
.dsp-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(19,16,11,0.5), rgba(19,16,11,0.95));
}
.dsp-hero-inner {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  position: relative;
}
.dsp-hero-content { position: relative; }

.dsp-back {
  font-size: 13px;
  color: var(--dsp-muted);
  text-decoration: none;
  display: block;
  padding: 12px 16px 0;
  margin-bottom: 4px;
}
.dsp-back:hover { color: var(--dsp-gold); }

.dsp-region-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--dsp-gold-light);
  background: rgba(249,175,54,0.1);
  border: 1px solid rgba(249,175,54,0.2);
  border-radius: 4px;
  padding: 4px 12px;
  margin-bottom: 12px;
}

.dsp-name {
  font-family: Georgia, serif;
  font-size: clamp(26px, 5vw, 40px);
  color: var(--dsp-gold-light);
  margin: 0 0 4px;
  line-height: 1.2;
  position: relative;
}

.dsp-location {
  font-size: 14px;
  color: var(--dsp-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 16px;
}

.dsp-quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.dsp-fact {
  font-size: 12px;
  color: var(--dsp-text);
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--dsp-section-border);
  border-radius: var(--dsp-radius-inner);
  padding: 6px 12px;
}

/* Sentinel callout in hero */
.dsp-sentinel-callout {
  font-size: 14px;
  color: var(--dsp-gold);
  margin-bottom: 16px;
  font-style: italic;
}

/* Trail buttons (prominent) */
.dsp-trail-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dsp-trail-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 4px;
  border: 1px solid rgba(249,175,54,0.3);
  background: rgba(249,175,54,0.08);
  color: var(--dsp-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.dsp-trail-btn:hover {
  border-color: var(--dsp-gold);
  background: rgba(249,175,54,0.15);
}
.dsp-trail-btn:focus-visible {
  outline: 2px solid var(--dsp-gold);
  outline-offset: 2px;
}
.dsp-trail-btn.ds-trail-active {
  background: rgba(249,175,54,0.15);
  border-color: var(--dsp-gold);
  color: var(--dsp-gold);
}
.dsp-trail-btn.ds-visited-active {
  background: rgba(39,174,96,0.15);
  border-color: #27ae60;
  color: #27ae60;
}

/* Actions row — generic flex row for inline action buttons */
.dsp-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Stats panel (right column) */
.dsp-hero-stats {
  position: relative;
}

/* Hero photo (Phase A — sits above .dsp-stats-grid in the right column).
   Locked 3:4 portrait frame; object-fit:contain absorbs whatever Square
   throws at us (square crops, transparent PNGs, low-res). Click → desktop
   lightbox via bottle-detail.js (mobile is a no-op). */
.dsp-hero-photo {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  margin: 0 0 12px;
  padding: 0;
  background: var(--dsp-dark-1);
  border: 1px solid var(--dsp-section-border);
  border-radius: var(--dsp-radius-inner);
  cursor: zoom-in;
  overflow: hidden;
  font: inherit;
  color: inherit;
  transition: border-color .15s;
}
.dsp-hero-photo:hover { border-color: rgba(249,175,54,0.3); }
.dsp-hero-photo:focus-visible { outline: 2px solid var(--dsp-gold); outline-offset: 2px; }
.dsp-hero-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Desktop-only lightbox. Built/torn down by bottle-detail.js. */
.dsp-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
  animation: dsp-lightbox-in .15s ease-out;
}
@keyframes dsp-lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dsp-lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: default;
}
.dsp-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: transparent;
  border: 0;
  color: var(--dsp-gold-light, #FDE8C4);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  font-family: Georgia, serif;
}
.dsp-lightbox-close:hover { color: var(--dsp-gold, #F9AF36); }

.dsp-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
/* When the stats grid is in the bottle hero's left content column (Phase B —
   moved out of the photo column on 2026-05-04), expand to a 4-col single
   row so the stat cards aren't cramped. Distillery pages keep 2x2. */
.dsp-hero-content .dsp-stats-grid { grid-template-columns: repeat(4, 1fr); }
.dsp-stat-card {
  background: rgba(13,11,8,0.6);
  border: 1px solid var(--dsp-section-border);
  border-radius: var(--dsp-radius-inner);
  padding: 14px;
  text-align: center;
}
.dsp-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--dsp-muted);
  margin-bottom: 6px;
}
.dsp-stat-value {
  font-family: Georgia, serif;
  font-size: 24px;
  color: var(--dsp-gold-light);
}
.dsp-stat-sub {
  font-size: 11px;
  color: var(--dsp-muted);
  margin-top: 2px;
}
.dsp-stat-stars {
  color: var(--dsp-gold);
  font-size: 14px;
  letter-spacing: 2px;
}

/* Small label-value info card (e.g. address row, website row) */
.dsp-info-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--dsp-section-border);
  border-radius: var(--dsp-radius-inner);
  padding: 12px 14px;
}
.dsp-info-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--dsp-muted);
  margin-bottom: 4px;
}
.dsp-info-value {
  font-size: 14px;
  color: var(--dsp-text);
  line-height: 1.5;
}
.dsp-info-value a {
  color: var(--dsp-gold);
  text-decoration: none;
}
.dsp-info-value a:hover { text-decoration: underline; }

/* ── Detail rows (label-left, value-right, hairline divider) ──
   OnlyDrams-style "Product Details" rows. Use inside a .dsp-section. */
.dsp-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--dsp-section-border);
  font-size: 14px;
}
.dsp-detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.dsp-detail-label {
  color: var(--dsp-muted);
  flex-shrink: 0;
}
.dsp-detail-value {
  color: var(--dsp-text);
  text-align: right;
  font-weight: 500;
}
.dsp-detail-value a {
  color: var(--dsp-gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .15s;
}
.dsp-detail-value a::after {
  content: '\2192'; /* → */
  display: inline-block;
  transition: transform .15s ease;
}
.dsp-detail-value a:hover { color: var(--dsp-gold-light); }
.dsp-detail-value a:hover::after { transform: translateX(2px); }

/* ── Size pill row (Available Sizes selector) ──
   Stacked size + price inside a soft bordered pill. The default size is
   highlighted with a gold-tinted border. Read-only — purchases happen
   inside the lounge, not on the web. */
.dsp-size-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.dsp-size-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 84px;
  padding: 10px 16px;
  border: 1px solid var(--dsp-section-border);
  border-radius: var(--dsp-radius-inner);
  background: rgba(0,0,0,0.2);
}
.dsp-size-pill-size {
  font-size: 13px;
  font-weight: 600;
  color: var(--dsp-text);
  letter-spacing: 0.04em;
}
.dsp-size-pill-price {
  font-size: 12px;
  color: var(--dsp-gold);
}
.dsp-size-pill.is-default {
  border-color: rgba(249,175,54,0.4);
  background: rgba(249,175,54,0.06);
}

/* ── Body text inside a .dsp-section ── */
.dsp-body-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--dsp-text);
  margin: 0;
}
.dsp-body-text + .dsp-body-text { margin-top: 12px; }

/* ── Staff hero actions (Phase B.2 — Sentinel manual photo upload) ── */
.dsp-hero-staff-actions {
  margin: 0 0 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dsp-hero-staff-actions[hidden] { display: none; }
.dsp-photo-upload-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: rgba(249,175,54,0.06);
  border: 1px dashed rgba(249,175,54,0.3);
  color: var(--dsp-gold);
  border-radius: var(--dsp-radius-inner);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.dsp-photo-upload-btn:hover {
  background: rgba(249,175,54,0.12);
  border-color: rgba(249,175,54,0.5);
  border-style: solid;
}
.dsp-photo-upload-btn:focus-visible {
  outline: 2px solid var(--dsp-gold);
  outline-offset: 2px;
}
.dsp-photo-upload-btn[disabled] { opacity: 0.5; cursor: wait; }

/* ── Member CTA + status badge (Phase B.3 — member photo submissions) ── */
.dsp-hero-member-cta {
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dsp-hero-member-cta[hidden] { display: none; }
.dsp-photo-submit-cta {
  flex: 1;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(176,160,140,0.06);
  border: 1px dashed rgba(176,160,140,0.3);
  color: var(--dsp-muted);
  border-radius: var(--dsp-radius-inner);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.dsp-photo-submit-cta:hover {
  background: rgba(249,175,54,0.08);
  border-color: rgba(249,175,54,0.4);
  border-style: solid;
  color: var(--dsp-gold);
}
.dsp-photo-submit-cta:focus-visible {
  outline: 2px solid var(--dsp-gold);
  outline-offset: 2px;
}
.dsp-photo-submit-cta[disabled] { opacity: 0.5; cursor: wait; }
.dsp-photo-status-badge {
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.05em;
  border-radius: var(--dsp-radius-inner);
  text-align: center;
  line-height: 1.4;
}
.dsp-photo-status-badge.is-pending {
  background: rgba(249,175,54,0.06);
  border: 1px solid rgba(249,175,54,0.25);
  color: var(--dsp-gold);
}
.dsp-photo-status-badge.is-approved {
  background: rgba(39,174,96,0.08);
  border: 1px solid rgba(39,174,96,0.3);
  color: #27ae60;
}
.dsp-photo-status-badge.is-rejected {
  background: rgba(224,80,64,0.08);
  border: 1px solid rgba(224,80,64,0.3);
  color: #E05040;
}
.dsp-photo-status-badge-detail {
  display: block;
  font-size: 10px;
  opacity: 0.85;
  margin-top: 2px;
}

/* ── Generic modal (Phase B.2 — used by photo upload; reusable later) ── */
.dsp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: dsp-lightbox-in .15s ease-out;
}
/* The modal is appended to <body>, OUTSIDE the .dsp-page var scope, so all
   var() calls below need fallbacks (otherwise they resolve to unset → invisible). */
.dsp-modal {
  background: var(--ds-dark-2, #13100B);
  border: 1px solid var(--ds-border, #2A1F14);
  border-radius: 8px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  color: var(--ds-text, #F0E6D4);
  box-shadow: 0 24px 48px rgba(0,0,0,0.6);
}
.dsp-modal-title {
  font-family: Georgia, serif;
  font-size: 20px;
  color: var(--ds-gold-light, #FDE8C4);
  margin: 0 0 16px;
  padding-right: 32px;
}
.dsp-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: 0;
  color: var(--ds-muted, #C8B8A0);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
}
.dsp-modal-close:hover { color: var(--ds-gold, #F9AF36); }
.dsp-dropzone {
  border: 2px dashed var(--ds-border, #2A1F14);
  border-radius: 4px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 16px;
}
.dsp-dropzone:hover, .dsp-dropzone.is-active {
  border-color: rgba(249,175,54,0.5);
  background: rgba(249,175,54,0.04);
}
.dsp-dropzone-text {
  color: var(--ds-text, #F0E6D4);
  font-size: 14px;
  margin: 0;
}
.dsp-dropzone-hint {
  color: var(--ds-muted, #C8B8A0);
  font-size: 11px;
  margin-top: 6px;
}
.dsp-preview-img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  margin: 0 auto 16px;
  border: 1px solid var(--ds-border, #2A1F14);
  border-radius: 4px;
}
.dsp-preview-img[hidden] { display: none; }
.dsp-modal-status {
  font-size: 13px;
  color: var(--ds-muted, #C8B8A0);
  margin-bottom: 12px;
  min-height: 18px;
}
.dsp-modal-status.is-error { color: #E05040; }
.dsp-modal-status.is-success { color: #27ae60; }
.dsp-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.dsp-modal-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.dsp-modal-btn.is-primary {
  background: rgba(249,175,54,0.12);
  border: 1px solid rgba(249,175,54,0.4);
  color: var(--ds-gold, #F9AF36);
}
.dsp-modal-btn.is-primary:hover {
  background: rgba(249,175,54,0.2);
  border-color: var(--ds-gold, #F9AF36);
}
.dsp-modal-btn.is-secondary {
  background: transparent;
  border: 1px solid var(--ds-border, #2A1F14);
  color: var(--ds-muted, #C8B8A0);
}
.dsp-modal-btn.is-secondary:hover {
  border-color: var(--ds-muted, #C8B8A0);
  color: var(--ds-text, #F0E6D4);
}
.dsp-modal-btn[disabled] { opacity: 0.5; cursor: wait; }

/* Caption textarea (Phase B.3 — member submission modal) */
.dsp-modal-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 60px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--ds-border, #2A1F14);
  border-radius: 4px;
  color: var(--ds-text, #F0E6D4);
  resize: vertical;
  margin-bottom: 4px;
}
.dsp-modal-textarea:focus {
  outline: none;
  border-color: rgba(249,175,54,0.5);
}
.dsp-modal-textarea::placeholder { color: var(--ds-muted, #C8B8A0); opacity: 0.6; }
.dsp-modal-char-count {
  font-size: 10px;
  color: var(--ds-muted, #C8B8A0);
  text-align: right;
  margin-bottom: 12px;
}
.dsp-modal-char-count.is-over { color: #E05040; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .dsp-page { padding: 12px 14px 32px; }
  .dsp-section { padding: 18px; }
  .dsp-hero-inner { grid-template-columns: 1fr; }
  .dsp-stats-grid { grid-template-columns: 1fr 1fr; }
  .dsp-hero-content .dsp-stats-grid { grid-template-columns: 1fr 1fr; }
  .dsp-trail-btn { padding: 10px 16px; font-size: 12px; }
  .dsp-name { font-size: clamp(22px, 5vw, 32px); }
}

@media (max-width: 480px) {
  .dsp-stats-grid { grid-template-columns: 1fr; }
}
