/* ═══════════════════════════════════════════════════════════
   DivinePrinciple.Info — Shared Stylesheet
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Cinzel:wght@400;600;700&family=Lato:wght@300;400;700&display=swap');

/* ── TOKENS ── */
:root {
  --gold:       #c9a84c;
  --gold-light: #e8c97a;
  --gold-dim:   #a07c30;
  --deep:       #0d0d0d;
  --surface:    #111118;
  --surface2:   #1a1a24;
  --surface3:   #22222f;
  --text:       #e8e4d8;
  --text-muted: #9a9488;
  --border:     rgba(201, 168, 76, 0.2);
  --modal-bg:   rgba(5, 5, 10, 0.96);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--deep);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── AMBIENT BACKGROUND ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201,168,76,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(100,80,160,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════════
   NAV
══════════════════════════════════════════ */
nav {
  position: relative;
  z-index: 100;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

/* Hamburger toggle (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold-dim);
  text-transform: uppercase;
  display: none;
}

/* Desktop links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  width: 100%;
  justify-content: center;
}

.nav-links li a {
  display: block;
  padding: 0 18px;
  height: 52px;
  line-height: 52px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  border-right: 1px solid var(--border);
}

.nav-links li:first-child a { border-left: 1px solid var(--border); }

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--gold);
  background: rgba(201,168,76,0.06);
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
header {
  position: relative;
  text-align: center;
  padding: 64px 24px 48px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 200px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.header-ornament {
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--gold-light);
  text-transform: uppercase;
  margin-bottom: 20px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(255,255,255,0.55), 0 0 8px rgba(201,168,76,0.4);
}

h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(26px, 5vw, 50px);
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text);
  margin-bottom: 12px;
  text-shadow: 0 0 60px rgba(201,168,76,0.3);
}

h1 span { color: var(--gold); }

.subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 700;
  font-style: normal;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-top: 8px;
}

.divider {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 20px auto;
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 56px 24px 40px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.footer-divider {
  width: 80px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 28px;
}

.footer-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-style: italic;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 28px;
  line-height: 1.9;
}

.contact-btn {
  display: inline-block;
  padding: 12px 36px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.25s ease;
  text-decoration: none;
}

.contact-btn:hover {
  background: rgba(201,168,76,0.1);
  box-shadow: 0 0 20px rgba(201,168,76,0.15);
  color: var(--gold-light);
}

.footer-copy {
  margin-top: 36px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(232, 228, 216, 0.75);
  letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(255,255,255,0.35), 0 0 24px rgba(255,255,255,0.15);
}

/* ══════════════════════════════════════════
   HOMEPAGE — WELCOME TEXT
══════════════════════════════════════════ */
.welcome-section {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 72px auto 80px;
  padding: 0 32px;
  text-align: center;
}

.welcome-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 2;
  letter-spacing: 0.3px;
}

.welcome-text p { margin-bottom: 1.6em; }
.welcome-text p:last-child { margin-bottom: 0; }

.welcome-text strong {
  font-family: 'Cinzel', serif;
  font-size: 0.85em;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 600;
}

/* ══════════════════════════════════════════
   PLAYLIST PAGE — LOADING / GRID / CARDS
══════════════════════════════════════════ */
#loading-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  position: relative;
  z-index: 1;
}

.spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

#error-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 17px;
  display: none;
  position: relative;
  z-index: 1;
}

#playlist-grid {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

/* ── CARD ── */
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  animation: fadeUp 0.5s ease both;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 12px 40px rgba(201,168,76,0.12), 0 0 0 1px rgba(201,168,76,0.15);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface2);
  overflow: hidden;
}

.thumb-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: brightness(0.85);
}

.video-card:hover .thumb-wrap img {
  transform: scale(1.04);
  filter: brightness(1);
}

.play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  transition: background 0.25s ease;
}

.video-card:hover .play-btn { background: rgba(0,0,0,0.1); }

.play-icon {
  width: 54px; height: 54px;
  background: rgba(201,168,76,0.92);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s ease, background 0.25s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.video-card:hover .play-icon {
  transform: scale(1.08);
  background: var(--gold);
}

.play-icon svg {
  width: 22px; height: 22px;
  fill: #0d0d0d;
  margin-left: 3px;
}

.progress-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.3s;
  border-radius: 0 2px 0 0;
}

.progress-label {
  position: absolute;
  bottom: 6px; right: 8px;
  font-size: 11px;
  background: rgba(0,0,0,0.75);
  color: var(--gold-light);
  padding: 2px 6px;
  border-radius: 2px;
  font-family: 'Lato', sans-serif;
}

.card-body { padding: 16px 18px 20px; }

.card-num {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ══════════════════════════════════════════
   MODAL
══════════════════════════════════════════ */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-bg);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}

#modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#modal-container {
  position: relative;
  width: 100%;
  max-width: 960px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
  animation: scaleIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

#modal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

#modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-style: italic;
  color: var(--text-muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 16px;
}

.modal-controls { display: flex; gap: 8px; flex-shrink: 0; }

.modal-btn {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 34px; height: 34px;
  border-radius: 3px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.modal-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
}

.modal-btn svg { width: 16px; height: 16px; fill: currentColor; }

#video-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
}

#video-wrap iframe,
#video-wrap #ytplayer {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: none;
  display: block;
}

#modal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

.nav-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 20px;
  border-radius: 2px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) { color: var(--gold); border-color: var(--gold); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }

#modal-counter {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* Fullscreen modal */
#modal-container:fullscreen,
#modal-container:-webkit-full-screen,
#modal-container:-moz-full-screen {
  max-width: 100%;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  background: #000;
}

#modal-container:fullscreen #video-wrap { flex: 1; aspect-ratio: unset; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-label  { display: block; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    justify-content: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .nav-links.open { max-height: 500px; }

  .nav-links li a {
    height: auto;
    line-height: 1;
    padding: 16px 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    text-align: left;
  }

  .nav-links li:first-child a { border-left: none; }
}

@media (max-width: 600px) {
  #playlist-grid { grid-template-columns: 1fr; gap: 20px; padding: 32px 16px; }
  header { padding: 48px 16px 40px; }
  .welcome-section { margin: 48px auto 60px; }
}
