/* ─────────────────────────────────────────────
   NUESA Video Library — Front-end Styles v2
   UI matches screenshot: big cover-image album
   cards with stacked paper effect, title +
   count overlay, then video grid inside.
───────────────────────────────────────────── */

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

:root {
  --nvl-green:      #2d8a3e;
  --nvl-green-dark: #1e6b2e;
  --nvl-gold:       #d4920a;
  --nvl-blue:       #1a4ea6;
  --nvl-bg:         #f5f6f8;
  --nvl-white:      #ffffff;
  --nvl-text:       #1c2333;
  --nvl-muted:      #6c7a8d;
  --nvl-border:     #dde2e9;
  --nvl-radius:     16px;
  --nvl-shadow:     0 6px 28px rgba(0,0,0,.13);
  --ff-head:        'Montserrat', sans-serif;
  --ff-body:        'Inter', sans-serif;
}

/* ── Scoped reset ─────────────────────────── */
.nvl-wrap *, .nvl-modal * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.nvl-wrap {
  font-family: var(--ff-body);
  color: var(--nvl-text);
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════
   PROGRAM TABS — pill style
══════════════════════════════════════════ */
.nvl-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.nvl-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--nvl-white);
  border: 2px solid var(--nvl-border);
  border-radius: 50px;
  font-family: var(--ff-body);
  font-size: .88rem;
  font-weight: 600;
  color: var(--nvl-muted);
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.nvl-tab:hover {
  border-color: var(--nvl-green);
  color: var(--nvl-green);
  background: #f0faf2;
}
.nvl-tab--active {
  background: var(--nvl-green);
  border-color: var(--nvl-green);
  color: #fff;
  box-shadow: 0 4px 16px rgba(45,138,62,.3);
}
.nvl-tab__count {
  background: rgba(255,255,255,.25);
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.nvl-tab--active .nvl-tab__count { background: rgba(255,255,255,.28); color: #fff; }
.nvl-tab:not(.nvl-tab--active) .nvl-tab__count { background: var(--nvl-bg); color: var(--nvl-muted); }

/* ══════════════════════════════════════════
   PROGRAM PANELS
══════════════════════════════════════════ */
.nvl-panel { display: none; }
.nvl-panel--active { display: block; }

.nvl-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--nvl-muted);
  font-size: .95rem;
  background: var(--nvl-white);
  border-radius: var(--nvl-radius);
  border: 2px dashed var(--nvl-border);
}

/* ══════════════════════════════════════════
   ALBUM GRID — masonry-style
   Big cards like the screenshot
══════════════════════════════════════════ */
.nvl-albums {
  columns: 3;
  column-gap: 22px;
}

/* Each album is a card that breaks inside the column */
.nvl-album {
  break-inside: avoid;
  margin-bottom: 22px;
  display: block;
}

/* ── Album card — cover image + stacked paper ── */
.nvl-album__card {
  position: relative;
  border-radius: var(--nvl-radius);
  cursor: pointer;
  transition: transform .22s, box-shadow .22s;
}
.nvl-album__card:hover { transform: translateY(-4px) scale(1.01); }

/* Stacked paper layers behind (like the screenshot) */
.nvl-album__card::before,
.nvl-album__card::after {
  content: '';
  position: absolute;
  border-radius: var(--nvl-radius);
  background: var(--nvl-white);
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
  z-index: 0;
}
/* Back layer — rotated more */
.nvl-album__card::before {
  inset: 8px -6px -8px -2px;
  transform: rotate(2.5deg);
  opacity: .7;
}
/* Middle layer — rotated less */
.nvl-album__card::after {
  inset: 4px -3px -4px -1px;
  transform: rotate(1.2deg);
  opacity: .85;
}

/* Cover image container */
.nvl-album__cover {
  position: relative;
  z-index: 1;
  border-radius: var(--nvl-radius);
  overflow: hidden;
  background: linear-gradient(135deg, #1e6b2e 0%, #1a4ea6 100%);
  box-shadow: var(--nvl-shadow);
  aspect-ratio: 4/3;
}

/* The actual cover image */
.nvl-album__cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s;
}
.nvl-album__card:hover .nvl-album__cover-img { transform: scale(1.05); }

/* Fallback gradient when no image */
.nvl-album__cover--no-img {
  display: flex;
  align-items: center;
  justify-content: center;
}
.nvl-album__cover--no-img svg { width: 52px; height: 52px; stroke: rgba(255,255,255,.5); }

/* Gradient overlay at bottom of cover */
.nvl-album__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.18) 55%, transparent 100%);
}

/* Text overlay at bottom */
.nvl-album__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 18px 16px 16px;
  color: #fff;
}
.nvl-album__name {
  font-family: var(--ff-head);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 5px;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.nvl-album__count-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.nvl-album__count-badge svg { width: 11px; height: 11px; stroke: #fff; }

/* ── Album "open" state: show video grid below ── */
.nvl-album--open .nvl-album__card { transform: none; }

.nvl-album__videos {
  display: none;
  margin-top: 14px;
  background: var(--nvl-white);
  border-radius: var(--nvl-radius);
  border: 1px solid var(--nvl-border);
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  position: relative;
  z-index: 2;
}
.nvl-album--open .nvl-album__videos { display: block; }

/* Album back-button */
.nvl-album__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--nvl-green);
  font-family: var(--ff-body);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
  transition: color .15s;
}
.nvl-album__back svg { width: 14px; height: 14px; }
.nvl-album__back:hover { color: var(--nvl-green-dark); }

/* ══════════════════════════════════════════
   VIDEO GRID inside album
══════════════════════════════════════════ */
.nvl-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.nvl-video-card {
  background: var(--nvl-bg);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--nvl-border);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.nvl-video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  border-color: #a8d8b0;
}

/* Thumb */
.nvl-video-card__thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--nvl-green-dark);
  background-size: cover;
  background-position: center;
}
.nvl-video-card__thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 60%);
}
.nvl-video-card__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: transform .18s, background .18s;
}
.nvl-video-card__play svg { width: 13px; height: 13px; color: var(--nvl-green); margin-left: 2px; }
.nvl-video-card:hover .nvl-video-card__play { transform: translate(-50%,-50%) scale(1.12); background: #fff; }
.nvl-video-card__dur {
  position: absolute;
  bottom: 6px; right: 6px;
  z-index: 2;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Info */
.nvl-video-card__info { padding: 8px 10px 10px; }
.nvl-video-card__title {
  font-family: var(--ff-head);
  font-size: .78rem;
  font-weight: 700;
  color: var(--nvl-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nvl-video-card__desc {
  font-size: .7rem;
  color: var(--nvl-muted);
  margin-top: 3px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ══════════════════════════════════════════
   VIDEO MODAL
══════════════════════════════════════════ */
.nvl-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.nvl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(5px);
  cursor: pointer;
}
.nvl-modal__box {
  position: relative;
  z-index: 1;
  background: #111;
  border-radius: 18px;
  width: 100%;
  max-width: 900px;
  box-shadow: 0 28px 90px rgba(0,0,0,.6);
  overflow: hidden;
  animation: nvl-pop .22s ease;
}
@keyframes nvl-pop {
  from { transform: scale(.93); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.nvl-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 14px;
  background: #1a1a1a;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nvl-modal__title {
  font-family: var(--ff-head);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}
.nvl-modal__meta {
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  margin-top: 3px;
}
.nvl-modal__close {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.nvl-modal__close svg { width: 16px; height: 16px; stroke: #fff; }
.nvl-modal__close:hover { background: rgba(220,50,50,.7); }

.nvl-modal__player { background: #000; line-height: 0; }
#nvl-player { width: 100%; max-height: 500px; display: block; outline: none; }

.nvl-modal__desc {
  padding: 12px 22px 18px;
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  line-height: 1.6;
  background: #1a1a1a;
}
.nvl-modal__desc:empty { display: none; }

/* ══════════════════════════════════════════
   SECTION HEADINGS (program title above grid)
══════════════════════════════════════════ */
.nvl-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.nvl-section-head__line {
  flex: 1;
  height: 2px;
  background: var(--nvl-border);
  border-radius: 2px;
}
.nvl-section-head__title {
  font-family: var(--ff-head);
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--nvl-text);
  white-space: nowrap;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

/* Tablet landscape (≤1100px) */
@media (max-width: 1100px) {
  .nvl-albums { columns: 2; column-gap: 18px; }
}

/* Tablet portrait (≤768px) */
@media (max-width: 768px) {
  .nvl-albums { columns: 2; column-gap: 16px; }
  .nvl-tabs   { gap: 7px; }
  .nvl-tab    { padding: 9px 16px; font-size: .84rem; }
  .nvl-album__name { font-size: .92rem; }
  .nvl-video-grid { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 8px; }
}

/* Phone (≤600px) */
@media (max-width: 600px) {
  .nvl-albums { columns: 1; }
  .nvl-album  { margin-bottom: 28px; }

  .nvl-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    gap: 7px;
  }
  .nvl-tabs::-webkit-scrollbar { display: none; }
  .nvl-tab { flex-shrink: 0; white-space: nowrap; padding: 8px 15px; font-size: .82rem; }

  .nvl-album__card::before,
  .nvl-album__card::after { display: none; } /* hide stacked paper on phone */

  .nvl-video-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Modal: sheet from bottom */
  .nvl-modal { padding: 0; align-items: flex-end; }
  .nvl-modal__box { border-radius: 18px 18px 0 0; max-height: 94svh; overflow-y: auto; }
  #nvl-player { max-height: 240px; }
}

/* Small phone (≤400px) */
@media (max-width: 400px) {
  .nvl-video-grid { grid-template-columns: 1fr; }
  .nvl-tab { padding: 7px 12px; font-size: .78rem; }
  .nvl-album__name { font-size: .85rem; }
}
