/* ═══════════════════════════════════════════════════════════════════════════
   TSCAPE TV — Architectural Cinema Media Network Styles
   Matches The Flowscape Design Tokens (Obsidian, Pine, Linen, Lotus Crimson)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --tv-bg: #111613;
  --tv-surface: #1b221e;
  --tv-surface-elevated: #232c27;
  --tv-border: rgba(247, 244, 238, 0.12);
  --tv-text: #f7f4ee;
  --tv-text-muted: #b0bab0;
  --tv-crimson: #b42d32;
  --tv-crimson-bright: #cf3b3b;
  --tv-ochre: #d4a373;
}

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

html {
  scroll-behavior: smooth;
}

body.tv-body {
  margin: 0;
  background-color: var(--tv-bg);
  color: var(--tv-text);
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Accessibility Skip Link & Focus Outlines */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--tv-crimson);
  color: #fff;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  border-radius: 4px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--tv-ochre);
  outline-offset: 3px;
}

.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;
}

/* Header & Navigation */
.tv-announcement {
  background: #0c0f0d;
  border-bottom: 1px solid var(--tv-border);
  padding: 7px 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--tv-text-muted);
  flex-wrap: wrap;
  gap: 8px;
}
.tv-announcement a {
  color: var(--tv-ochre);
  text-decoration: none;
  font-weight: 600;
}
.tv-announcement a:hover {
  text-decoration: underline;
}

.tv-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 22, 19, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tv-border);
  padding: 14px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.tv-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--tv-text);
}
.tv-brand-text {
  display: flex;
  flex-direction: column;
}
.tv-brand-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.16em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tv-live-pill {
  background: var(--tv-crimson);
  color: #fff;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.tv-brand-sub {
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--tv-ochre);
  text-transform: uppercase;
  margin-top: 2px;
}

.tv-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.tv-nav a {
  color: var(--tv-text-muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}
.tv-nav a:hover {
  color: var(--tv-text);
}
.tv-nav-cta {
  padding: 9px 18px;
  border: 1px solid rgba(212, 163, 115, 0.45);
  color: var(--tv-ochre) !important;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.2s;
}
.tv-nav-cta:hover {
  background: var(--tv-ochre);
  color: #111613 !important;
}

/* Cinema Hero Spotlight */
.tv-hero {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  padding: 80px 6% 56px;
  overflow: hidden;
  border-bottom: 1px solid var(--tv-border);
}
.tv-hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.45) contrast(1.05);
  transform: scale(1.02);
  transition: background-image 0.5s ease;
}
.tv-hero-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--tv-bg) 4%,
    rgba(17, 22, 19, 0.72) 48%,
    rgba(17, 22, 19, 0.35) 100%
  );
}
.tv-hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}
.tv-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tv-ochre);
  font-weight: 600;
  margin-bottom: 16px;
}
.tv-hero h1 {
  font-family: "Playfair Display", serif;
  font-weight: 400;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}
.tv-hero h1 em {
  color: var(--tv-ochre);
  font-style: italic;
}
.tv-hero-desc {
  color: #d7dfd7;
  font-size: 15px;
  max-width: 580px;
  margin: 0 0 28px;
}
.tv-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.tv-play-hero-btn {
  background: var(--tv-crimson);
  color: #fff;
  border: none;
  padding: 15px 28px;
  border-radius: 4px;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s, transform 0.2s;
}
.tv-play-hero-btn:hover {
  background: var(--tv-crimson-bright);
  transform: translateY(-2px);
}
.tv-hero-meta {
  font-size: 12px;
  color: var(--tv-text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Broadcast Controls & Channel Bar */
.tv-controls-section {
  padding: 40px 6% 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--tv-border);
}
.tv-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tv-filter-btn {
  background: transparent;
  border: 1px solid var(--tv-border);
  color: var(--tv-text-muted);
  padding: 8px 16px;
  border-radius: 24px;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.tv-filter-btn:hover {
  border-color: var(--tv-ochre);
  color: var(--tv-text);
}
.tv-filter-btn.active {
  background: var(--tv-text);
  color: var(--tv-bg);
  border-color: var(--tv-text);
  font-weight: 600;
}

.tv-search-wrap {
  position: relative;
  min-width: 260px;
}
.tv-search-input {
  width: 100%;
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  color: var(--tv-text);
  padding: 10px 16px;
  border-radius: 24px;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
}
.tv-search-input::placeholder {
  color: #7c877c;
}

/* Source Mode Info Bar */
.tv-source-banner {
  padding: 12px 6%;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--tv-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--tv-text-muted);
  flex-wrap: wrap;
  gap: 10px;
}
.tv-source-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #48b878;
}

/* Video Catalog Grid */
.tv-catalog-section {
  padding: 48px 6% 80px;
}
.tv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.tv-card {
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.tv-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 163, 115, 0.45);
}

.tv-thumb-btn {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  padding: 0;
  background: #0c0f0d;
  cursor: pointer;
  overflow: hidden;
  display: block;
}
.tv-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.3s ease;
}
.tv-card:hover .tv-thumb-img {
  transform: scale(1.04);
  filter: brightness(0.82);
}
.tv-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 22, 19, 0.25);
  transition: background 0.2s;
}
.tv-play-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(180, 45, 50, 0.92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding-left: 3px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s, background 0.2s;
}
.tv-thumb-btn:hover .tv-play-circle {
  transform: scale(1.1);
  background: var(--tv-crimson-bright);
}
.tv-badge-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(12, 16, 14, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.tv-badge-source {
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(12, 16, 14, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--tv-ochre);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.tv-card-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tv-card-meta {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tv-ochre);
  font-weight: 600;
  margin-bottom: 8px;
}
.tv-card-title {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--tv-text);
}
.tv-card-desc {
  font-size: 13px;
  color: var(--tv-text-muted);
  margin: 0 0 18px;
  flex: 1;
}
.tv-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--tv-border);
  font-size: 12px;
}
.tv-watch-link {
  background: none;
  border: none;
  color: var(--tv-text);
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}
.tv-watch-link:hover {
  color: var(--tv-ochre);
}
.tv-sanctuary-link {
  color: var(--tv-text-muted);
  text-decoration: none;
  font-size: 11.5px;
}
.tv-sanctuary-link:hover {
  color: var(--tv-ochre);
  text-decoration: underline;
}

/* Loading & Empty States */
.tv-skeleton {
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  border-radius: 8px;
  height: 360px;
  animation: pulse 1.6s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.35; }
}

.tv-empty-state {
  text-align: center;
  padding: 64px 24px;
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  border-radius: 8px;
  max-width: 560px;
  margin: 24px auto;
}
.tv-empty-state h3 {
  font-family: "Playfair Display", serif;
  font-size: 26px;
  margin: 0 0 10px;
}
.tv-empty-state p {
  color: var(--tv-text-muted);
  font-size: 14px;
  margin: 0 0 20px;
}

/* Cinema Theater Modal */
.tv-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 13, 11, 0.94);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tv-modal.open {
  display: flex;
}
.tv-modal-dialog {
  width: 100%;
  max-width: 1020px;
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}
.tv-modal-header {
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--tv-border);
}
.tv-modal-title {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  margin: 0;
}
.tv-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--tv-border);
  color: var(--tv-text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.tv-modal-close:hover {
  background: var(--tv-crimson);
  border-color: var(--tv-crimson);
}
.tv-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.tv-stage iframe,
.tv-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.tv-modal-footer {
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #141916;
}
.tv-modal-desc {
  font-size: 13px;
  color: var(--tv-text-muted);
  margin: 0;
  max-width: 680px;
}

/* Footer */
.tv-footer {
  border-top: 1px solid var(--tv-border);
  padding: 48px 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 12px;
  color: var(--tv-text-muted);
}
.tv-footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.tv-footer-links a {
  color: var(--tv-text-muted);
  text-decoration: none;
}
.tv-footer-links a:hover {
  color: var(--tv-ochre);
}

@media (max-width: 720px) {
  .tv-nav {
    display: none;
  }
  .tv-hero {
    min-height: 440px;
    padding: 50px 6% 40px;
  }
}
