@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;900&display=swap');

:root {
  /* These defaults are overridden dynamically by theme.js */
  --bg:           #F8F4EF;
  --bg-secondary: #EDE8E0;
  --card-bg:      #FFFFFF;
  --border:       #E5DDD4;
  --red:          #E04848;
  --red-dark:     #C03030;
  --text:         #1A1410;
  --text-muted:   #8A7E74;
  --font: 'Montserrat', sans-serif;

  /* Fixed values — not customizable */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09);
  --radius: 6px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }

/* ── NAV ──────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248,244,239,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; gap: 0.5rem; }
.nav-logo .site-logo { height: 30px; }
.nav-logo-text { font-size: 1.05rem; font-weight: 900; letter-spacing: -0.02em; color: var(--text); }
.nav-logo-text span { color: var(--red); }

.nav-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-back:hover { color: var(--red); }
.nav-back svg { width: 15px; height: 15px; }

/* ── HERO ──────────────────────────────────────── */
.hero {
  padding: 5rem 2rem 4.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.hero-logo { height: 52px; margin: 0 auto 2rem; }

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-title span { color: var(--red); }

.hero-sub {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── PAGE HEADER ──────────────────────────────── */
.page-header {
  padding: 2.5rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.breadcrumb a:hover { color: var(--red); }
.breadcrumb-sep { opacity: 0.4; }

.page-title {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--text);
}
.page-title span { color: var(--red); }

.page-desc {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ── SECTIONS ──────────────────────────────────── */
.section { padding: 2.5rem 2rem; }

.section-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.25rem;
}

/* ── CATEGORY GRID ──────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}

@media (max-width: 640px) { .categories-grid { grid-template-columns: 1fr; } }

.category-card {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-secondary);
  cursor: pointer;
}

.category-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
  background-color: var(--bg-secondary);
}

.category-card:hover .category-card-bg { transform: scale(1.04); }

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10,8,6,0.88) 0%,
    rgba(10,8,6,0.3) 55%,
    rgba(10,8,6,0.05) 100%
  );
  transition: background 0.3s;
}

.category-card:hover .category-card-overlay {
  background: linear-gradient(
    to top,
    rgba(10,8,6,0.94) 0%,
    rgba(10,8,6,0.5) 65%,
    rgba(224,72,72,0.08) 100%
  );
}

.category-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  color: #fff;
}

.category-card-name {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.category-card-desc { font-size: 0.78rem; opacity: 0.65; }

.category-card-meta { margin-top: 0.65rem; display: flex; gap: 1rem; }

.category-card-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}

.category-card-arrow {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 34px;
  height: 34px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.25s, transform 0.25s;
}
.category-card:hover .category-card-arrow { opacity: 1; transform: translateY(0) scale(1); }
.category-card-arrow svg { width: 15px; height: 15px; color: #fff; }

/* No-image placeholder for categories */
.category-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.category-card-placeholder svg { width: 40px; height: 40px; opacity: 0.15; }

/* ── FOLDER GRID ──────────────────────────────────── */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.folder-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
}

.folder-card:hover {
  border-color: var(--red);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.folder-card-cover {
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-card-cover svg { opacity: 0.2; width: 36px; height: 36px; color: var(--text-muted); }

.folder-card-body { padding: 0.85rem 1rem; }
.folder-card-name { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 0.2rem; }
.folder-card-count { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

/* ── MEDIA GRID (masonry) ──────────────────────────── */
.media-grid { columns: 3; column-gap: 8px; }
@media (max-width: 900px) { .media-grid { columns: 2; } }
@media (max-width: 500px) { .media-grid { columns: 1; } }

.media-item {
  break-inside: avoid;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  cursor: pointer;
  border-radius: 3px;
  box-shadow: var(--shadow-sm);
}

.media-item img {
  width: 100%;
  display: block;
  transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
}

.media-item:hover img { transform: scale(1.03); }

.media-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s;
}
.media-item:hover .media-item-overlay { background: rgba(0,0,0,0.3); }

.media-item-play {
  width: 48px;
  height: 48px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s, transform 0.25s;
  color: #fff;
}
.media-item:hover .media-item-play { opacity: 1; transform: scale(1); }
.media-item-play svg { width: 18px; height: 18px; margin-left: 3px; }

.media-item-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s;
}
.media-item:hover .media-item-label { opacity: 1; }

/* ── VIDEO CARDS ──────────────────────────────────── */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.video-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.video-card:hover { border-color: var(--red); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.video-card-thumb {
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.video-card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.video-play-btn {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  color: #fff;
}
.video-card:hover .video-play-btn { transform: scale(1.1); background: var(--red-dark); }
.video-play-btn svg { width: 20px; height: 20px; margin-left: 4px; }

.video-card-info { padding: 0.85rem 1rem; }
.video-card-title { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.video-card-desc { font-size: 0.73rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ── AUDIO CARDS ──────────────────────────────────── */
.audios-list { display: flex; flex-direction: column; gap: 0.6rem; }

.audio-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}
.audio-card:hover { border-color: var(--red); }

.audio-play-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.15s;
  color: #fff;
}
.audio-play-btn:hover { background: var(--red-dark); transform: scale(1.07); }
.audio-play-btn svg { width: 14px; height: 14px; }
.audio-play-btn.playing .icon-play { display: none; }
.audio-play-btn.playing .icon-pause { display: block !important; }

.audio-info { flex: 0 0 auto; min-width: 120px; max-width: 200px; }
.audio-title { font-size: 0.85rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-desc { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }

.audio-controls { flex: 1; display: flex; align-items: center; gap: 0.6rem; min-width: 0; }

.audio-progress {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.audio-progress-fill { height: 100%; background: var(--red); border-radius: 2px; width: 0%; transition: width 0.1s linear; pointer-events: none; }
.audio-time { font-size: 0.68rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── LIGHTBOX ──────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10,8,6,0.97);
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }

.lightbox-inner { position: relative; max-width: 95vw; max-height: 95vh; display: flex; flex-direction: column; align-items: center; }
.lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; }
.lightbox-caption { margin-top: 0.6rem; font-size: 0.8rem; color: rgba(255,255,255,0.45); }

.lightbox-close, .lightbox-nav {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.2s, color 0.2s;
}
.lightbox-close:hover, .lightbox-nav:hover { background: var(--red); border-color: var(--red); color: #fff; }
.lightbox-close { top: 1.5rem; right: 1.5rem; }
.lightbox-close svg, .lightbox-nav svg { width: 17px; height: 17px; }
.lightbox-prev { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.5rem; top: 50%; transform: translateY(-50%); }

/* ── VIDEO MODAL ──────────────────────────────────── */
.video-modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(10,8,6,0.97); align-items: center; justify-content: center; }
.video-modal.active { display: flex; }
.video-modal-inner { position: relative; width: min(92vw, 960px); }
.video-modal-frame { aspect-ratio: 16/9; width: 100%; }
.video-modal-frame iframe { width: 100%; height: 100%; border: none; }
.video-modal-close {
  position: fixed; top: 1.5rem; right: 1.5rem;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 1001; color: rgba(255,255,255,0.7);
  transition: background 0.2s;
}
.video-modal-close:hover { background: var(--red); border-color: var(--red); color: #fff; }
.video-modal-close svg { width: 17px; height: 17px; }

/* ── EMPTY STATE ──────────────────────────────────── */
.empty { padding: 4rem 2rem; text-align: center; color: var(--text-muted); }
.empty svg { width: 44px; height: 44px; opacity: 0.2; margin: 0 auto 1rem; color: var(--text-muted); }
.empty p { font-size: 0.875rem; }

/* ── FOOTER ──────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg);
}
.footer-logo img { height: 22px; opacity: 0.45; }
.footer-copy { font-size: 0.72rem; color: var(--text-muted); }

/* ── LOADING ──────────────────────────────────────── */
.loading { display: flex; justify-content: center; padding: 4rem 2rem; }
.spinner {
  width: 32px; height: 32px;
  border: 2.5px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 1rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .page-header { padding: 1.75rem 1rem 1.5rem; }
  .section { padding: 1.75rem 1rem; }
  .footer { padding: 1.25rem 1rem; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .audio-card { flex-wrap: wrap; }
  .audio-info { max-width: 100%; width: 100%; }
  .audio-controls { width: 100%; }
}

/* Prevent downloads */
.media-item img, .lightbox-img, .folder-card-cover img { pointer-events: none; }
