/* Media — styles.css
   Cohesion pass:
   - Background + base tokens match other Dino News sections
   - Canonical nav + controls container (search+sort row, filters span full width)
   - Sort height matches search
   Layout: featured strip → 3-col grid
*/

:root {
  /* ✅ Cohesive section tokens (match Discoveries/Museums/Dinopedia) */
  --bg-main:        #11130E;
  --bg-card:        #1A1C15;
  --bg-card-hover:  #22251D;

  /* Media-only featured surface (still slightly distinct, but in-family) */
  --bg-featured:    #131508;

  --accentMain:     #379392;   /* teal — interactive / links */
  --accentGold:     #D8B67F;   /* amber — featured items */
  --accentOrange:   #FF5722;

  --textWhite:      rgba(255,255,255,0.90);
  --textMuted:      rgba(255,255,255,0.55);
  --textDim:        rgba(255,255,255,0.30);

  --borderDim:      rgba(255,255,255,0.08);
  --borderFeat:     rgba(216,182,127,0.30);
  --borderHighlight:#379392;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--bg-main);
  color: var(--textWhite);
  margin: 0;
}

/* ── Banner ──────────────────────────────────────────────────────────────── */
@keyframes pulse-border {
  0%,100% { border-color: rgba(55,147,146,0.6); }
  50%     { border-color: rgba(55,147,146,0.1); }
}
.construction-banner { animation: pulse-border 2s infinite; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container-max { max-width: 1200px; margin-left: auto; margin-right: auto; }
.accent-bar { width: 40px; height: 4px; background: var(--accentMain); margin-bottom: 8px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px;
           overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ── Nav (CANONICAL) ─────────────────────────────────────────────────────── */
.navlink {
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--textMuted);
  transition: color 140ms ease;
  text-decoration: none;
}
.navlink:hover   { color: var(--textWhite); }
.navlink--active { color: var(--textWhite); }

/* ── Controls (CANONICAL) ──────────────────────────────────────────────────
   Row 1: Search (left) + Sort (right)
   Row 2: Filters span combined width and wrap within it
   Sort height matches search height
--------------------------------------------------------------------------- */
.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 12px;
  align-items: start;

  border: 1px solid var(--borderDim);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px;
}

/* Search in col 1 row 1 */
.controls__left  {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Sort in col 2 row 1 */
.controls__right {
  grid-column: 2;
  grid-row: 1;

  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-shrink: 0;
}

/* Input/select (unified typography + sizing) */
.control-input,
.control-select {
  border: 1px solid rgba(255,255,255,0.15);
  background: var(--bg-main);
  color: var(--textWhite);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: all 140ms ease;

  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.control-input { width: 100%; }
.control-input::placeholder {
  color: var(--textMuted);
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
}

.control-input:focus,
.control-select:focus {
  border-color: var(--accentMain);
  background-color: var(--bg-card-hover);
  box-shadow: 0 0 15px rgba(55,147,146,0.15);
}

/* ✅ Sort height = search height */
.control-select {
  min-width: 220px;
  width: 220px;

  height: 42px;
  padding: 0 14px;
  line-height: 42px;

  white-space: nowrap;
}

/* Filters span both columns (combined width), row 2 */
.chip-row {
  grid-column: 1 / -1;
  grid-row: 2;

  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
}

/* Chips (canonical look — keep Media feel by staying subtle) */
.chip {
  border: 1px solid var(--borderDim);
  background: var(--bg-main);
  color: var(--textMuted);
  border-radius: 8px;
  padding: 9px 12px;

  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;

  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}
.chip:hover { color: var(--textWhite); border-color: rgba(255,255,255,0.22); }
.chip--active, .chip[aria-selected="true"] {
  background: rgba(55,147,146,0.12);
  border-color: var(--accentMain);
  color: var(--textWhite);
}

/* Meta row (canonical typography) */
.meta-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:10px;
}
.meta-row__left, .meta-row__right { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.meta-text {
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--textMuted);
}

/* Mobile: stack sort under search, filters under that */
@media (max-width: 720px) {
  .controls { grid-template-columns: 1fr; }
  .controls__right {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-end;
  }
  .chip-row {
    grid-column: 1;
    grid-row: 3;
  }
  .control-select { width: 100%; min-width: 0; }
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-family: "Roboto Mono", monospace; font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 4px; border: 1px solid var(--borderDim);
  white-space: nowrap; flex-shrink: 0; font-weight: 700;
}

/* mediaKind → color mapping */
.badge--documentary { background:rgba(55,147,146,0.12);  border-color:rgba(55,147,146,0.45);  color:#80CBC4; }
.badge--film        { background:rgba(156,39,176,0.10);  border-color:rgba(156,39,176,0.45);  color:#CE93D8; }
.badge--tv-series   { background:rgba(63,81,181,0.12);   border-color:rgba(63,81,181,0.45);   color:#9FA8DA; }
.badge--podcast     { background:rgba(216,182,127,0.12); border-color:rgba(216,182,127,0.45); color:#FFE0B2; }
.badge--youtube     { background:rgba(210,80,80,0.12);   border-color:rgba(210,80,80,0.45);   color:#EF9A9A; }
.badge--book        { background:rgba(93,156,89,0.12);   border-color:rgba(93,156,89,0.45);   color:#A5D6A7; }
.badge--other       { background:rgba(255,255,255,0.03); border-color:var(--borderDim);       color:var(--textMuted); }

/* Featured star badge */
.badge--featured {
  background: rgba(216,182,127,0.15);
  border-color: rgba(216,182,127,0.50);
  color: var(--accentGold);
}

/* ── Shared card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--borderDim);
  border-radius: 10px; overflow: hidden;
  transition: border-color 160ms, background 160ms, box-shadow 160ms, transform 160ms;
  display: flex; flex-direction: column;
}
.card:hover {
  border-color: var(--borderHighlight); background: var(--bg-card-hover);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35); transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════════════════
   FEATURED STRIP — horizontal scroll row of featured items
   ══════════════════════════════════════════════════════════════════════════ */

#featured-section { margin-bottom: 32px; }

.featured-label {
  font-family: "Roboto Mono", monospace; font-size: 10px;
  letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--accentGold); margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.featured-label::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to right, rgba(216,182,127,0.3), transparent);
}

.featured-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

/* Featured card — landscape with left accent */
.card--featured {
  border-color: var(--borderFeat);
  background: var(--bg-featured);
  flex-direction: row;
  min-height: 140px;
}
.card--featured:hover { border-color: var(--accentGold); }

.card--featured .card__accent { width: 4px; background: var(--accentGold); flex-shrink: 0; }

.card--featured .card__body {
  padding: 16px 18px; display: flex; flex-direction: column;
  flex: 1; min-width: 0;
}

.card--featured .card__kind-row {
  display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap;
}

.card--featured .card__title {
  font-family: "Montserrat", sans-serif; font-weight: 800;
  font-size: 15px; line-height: 1.25; color: var(--textWhite);
  margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card--featured .card__desc {
  font-size: 12px; line-height: 1.55; color: var(--textMuted);
  flex: 1; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.card--featured .card__links {
  display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════════
   3-COL GRID
   ══════════════════════════════════════════════════════════════════════════ */

#feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) { #feed-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px)  { #feed-grid { grid-template-columns: 1fr; } }

/* Grid card */
.card--grid { flex-direction: column; }

.card--grid .card__accent-bar { height: 3px; width: 100%; flex-shrink: 0; }
.card--grid .card__accent-bar--documentary { background: #379392; }
.card--grid .card__accent-bar--film        { background: #7E57C2; }
.card--grid .card__accent-bar--tv-series   { background: #3F51B5; }
.card--grid .card__accent-bar--podcast     { background: #D8B67F; }
.card--grid .card__accent-bar--youtube     { background: #D25050; }
.card--grid .card__accent-bar--book        { background: #5D9C59; }
.card--grid .card__accent-bar--other       { background: rgba(255,255,255,0.10); }

.card--grid .card__body {
  display: flex; flex-direction: column;
  padding: 14px 16px 14px; flex: 1;
}

.card--grid .card__kind-row {
  display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap;
}

.card--grid .card__title {
  font-family: "Montserrat", sans-serif; font-weight: 700;
  font-size: 14px; line-height: 1.25; color: var(--textWhite);
  margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.card--grid .card__desc {
  font-size: 12px; line-height: 1.55; color: var(--textMuted);
  margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.card--grid .card__links {
  display: flex; gap: 14px; align-items: center;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--borderDim); flex-wrap: wrap;
}

/* ── Shared link + date ──────────────────────────────────────────────────── */
.date {
  font-family: "Roboto Mono", monospace; font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accentMain);
}
.date--gold { color: var(--accentGold); }

.link {
  font-family: "Roboto Mono", monospace; font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accentMain); text-decoration: none; white-space: nowrap;
  transition: opacity 120ms;
}
.link:hover { opacity: 0.7; }
.link--muted { color: var(--textMuted); }
.link--muted:hover { color: var(--textWhite); opacity: 1; }
.link--gold { color: var(--accentGold); }
.link--gold:hover { opacity: 0.75; }

/* ── Metadata pill (runtime, year, etc.) ─────────────────────────────────── */
.meta-pill {
  font-family: "Roboto Mono", monospace; font-size: 9px;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--textDim); white-space: nowrap;
}

/* ── Load More ───────────────────────────────────────────────────────────── */
.load-more {
  border: 1px solid var(--borderDim); background: var(--bg-card);
  color: var(--textWhite); border-radius: 8px; padding: 11px 28px;
  font-family: "Roboto Mono", monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
  transition: border-color 140ms, background 140ms;
}
.load-more:hover:not(:disabled) {
  border-color: var(--accentMain); background: var(--bg-card-hover);
}
.load-more:disabled { cursor: not-allowed; opacity: 0.4; }

/* ── Empty / error states ────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1; text-align: center;
  padding: 48px 24px; color: var(--textMuted);
  font-family: "Roboto Mono", monospace; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════════════════════
   DETAIL PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.detail-wrap {
  border: 1px solid var(--borderDim); background: var(--bg-card);
  border-radius: 12px; padding: 36px 40px;
}
@media (max-width: 640px) { .detail-wrap { padding: 24px 20px; } }

.detail-header { margin-bottom: 28px; }

.detail-title {
  font-family: "Montserrat", sans-serif; font-weight: 900;
  font-size: clamp(24px, 4vw, 42px); line-height: 1.15;
  color: var(--textWhite); margin: 12px 0 0;
}

.detail-meta-bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 14px 18px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--borderDim); border-radius: 8px;
  margin-bottom: 28px;
}

.detail-section-label {
  font-family: "Roboto Mono", monospace; font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--textDim);
  margin-bottom: 6px;
}

.detail-body { font-size: 15px; line-height: 1.75; color: rgba(255,255,255,0.80); }

.detail-tags li {
  font-family: "Roboto Mono", monospace; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--textMuted); line-height: 2; list-style: none;
}
.detail-tags li::before { content: "> "; color: var(--accentMain); }

/* YT embed */
.yt-embed-wrap {
  position: relative; width: 100%; padding-top: 56.25%;
  border-radius: 8px; overflow: hidden; margin-bottom: 24px;
  border: 1px solid var(--borderDim);
}
.yt-embed-wrap iframe { position:absolute; top:0; left:0; width:100%; height:100%; border:0; }

/* Poster image */
.detail-poster {
  width: 100%; border-radius: 8px; overflow: hidden;
  margin-bottom: 20px; border: 1px solid var(--borderDim);
}
.detail-poster img { width:100%; display:block; object-fit:cover; max-height:360px; }

/* Audio player */
.audio-player {
  width: 100%; border-radius: 8px; margin-bottom: 20px;
  accent-color: var(--accentMain);
}

/* Attribution */
.attribution-note {
  font-size: 11px; color: var(--textDim);
  font-family: "Roboto Mono", monospace; margin-top: 24px;
  padding-top: 16px; border-top: 1px solid var(--borderDim);
  line-height: 1.6;
}
