/* ==========================================================================
   videos.css — Videos listing page
   White base matching site design system. Dark filter bar for YouTube feel.
   Full-width, no centering box.
   ========================================================================== */

/* ── Body override when videos page is active ─────────────────────────────── */
body.has-videos-page {
  background: #fff;
}

/* ── Page wrapper — full width, no centering box ──────────────────────────── */
.videos-page {
  width: 100%;
  min-height: 100vh;
  background: #fff;
  color: var(--color-text, #1a1a2e);
  /* Filter bar is now sticky (in-flow), no extra top padding needed */
  padding: 0 0 var(--space-16, 4rem);
  margin-top: 0;
}

/* ── Filter / chip bar ────────────────────────────────────────────────────── */
.videos-filter-bar {
  position: sticky;
  top: var(--header-height, 72px); /* sticks just below the fixed site header */
  z-index: 90;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 8px 24px 10px;
  box-sizing: border-box;
  /* No left/right needed — sticky stays in normal flow */
}

/* When sidebar is fully expanded the bar naturally stays in its column */
.page-body.sidebar-open .videos-filter-bar {
  /* nothing needed — sticky is in-flow */
}

/* On mobile */
@media (max-width: 768px) {
  .videos-filter-bar {
    padding: 8px 16px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Spacer between filter bar and grid (sticky — no spacer needed) ── */
.videos-filter-bar + .ad-slot {
  margin-top: 0;
}

.videos-filter-bar__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: none;
}

/* ── Filter chips ─────────────────────────────────────────────────────────── */
.videos-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  background: #e5e5e5;
  border: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.videos-chip:hover {
  background: #d0d0d0;
  color: var(--color-text, #1a1a2e);
}

.videos-chip--active {
  background: var(--color-text, #1a1a2e);
  color: #fff;
  border-color: var(--color-text, #1a1a2e);
}

.videos-chip--active:hover {
  background: #16213e;
  color: #fff;
}

/* ── Artist dropdown as chip-style select ─────────────────────────────────── */
.videos-artist-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.videos-artist-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 28px 6px 14px;
  border-radius: 9999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  background: #e5e5e5;
  border: 1.5px solid transparent;
  cursor: pointer;
  outline: none;
  transition: background .15s ease;
}

.videos-artist-select:hover,
.videos-artist-select:focus {
  background: #d0d0d0;
}

.videos-artist-select option {
  background: #fff;
  color: var(--color-text, #1a1a2e);
}

.videos-artist-chevron {
  position: absolute;
  right: 9px;
  pointer-events: none;
  color: #666;
}

/* ── Page header ──────────────────────────────────────────────────────────── */
.videos-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 24px 4px;
}

.videos-header__title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: var(--color-text, #1a1a2e);
  margin: 0;
}

.videos-header__count {
  font-size: .875rem;
  color: var(--color-text-muted, #666);
  font-weight: 500;
}

/* ── Section labels inside the grid ──────────────────────────────────────── */
.videos-section-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 10px;
  font-size: .85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text, #1a1a2e);
  border-bottom: 2px solid var(--color-border, #e0e0e0);
  margin-bottom: 4px;
}

/* ── Video grid ───────────────────────────────────────────────────────────── */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 20px;
  padding: 16px 32px 40px;
  scroll-margin-top: 130px;
}

@media (max-width: 1100px) {
  .videos-grid { grid-template-columns: repeat(3, 1fr); gap: 24px 16px; padding: 16px 24px 40px; }
}

@media (max-width: 720px) {
  .videos-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
}

@media (max-width: 480px) {
  .videos-grid { grid-template-columns: 1fr; }
}

/* ── Video card ───────────────────────────────────────────────────────────── */
.videos-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.videos-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

/* Vidz modifier */
.videos-card--vidz {
  border-left: 3px solid var(--color-highlight, #e94560);
}

.videos-card--vidz .videos-card__play {
  opacity: .5;
}

.videos-card--vidz:hover .videos-card__play {
  opacity: 1;
}

/* Thumbnail link wrapper */
.videos-card__thumb-link {
  display: block;
  text-decoration: none;
}

.videos-card__thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border-radius: 8px 8px 0 0;
}

.videos-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.videos-card:hover .videos-card__thumb {
  transform: scale(1.05);
}

/* Vidz placeholder when no thumbnail */
.videos-card__thumb-placeholder {
  width: 100%;
  height: 100%;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
}

/* Play overlay */
.videos-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  transition: opacity .15s ease;
  color: #fff;
  pointer-events: none; /* NEVER intercept clicks — let the <a> underneath handle them */
}

.videos-card:hover .videos-card__play {
  opacity: 1;
}

.videos-card__play svg {
  width: 64px;
  height: 64px;
  color: #fff;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .7));
}

/* Duration badge — bottom right */
.videos-card__duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, .85);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .03em;
}

/* Platform badge — bottom left */
.videos-card__platform {
  position: absolute;
  bottom: 8px;
  left: 8px;
  color: #ff0000;
  line-height: 1;
  opacity: .9;
}

/* Vidz platform badge — white small-caps text */
.videos-card__platform--vidz {
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: .06em;
  background: color-mix(in srgb, var(--color-highlight) 85%, transparent);
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 1;
}

/* ── Card body ────────────────────────────────────────────────────────────── */
.videos-card__body {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.videos-card__title-link {
  text-decoration: none;
  color: inherit;
}

.videos-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s ease;
}

.videos-card__title-link:hover .videos-card__title {
  color: var(--color-highlight, #e94560);
}

.videos-card__artist {
  font-size: .875rem;
  color: var(--color-text-muted, #666);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.videos-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .8rem;
  color: var(--color-text-light, #999);
  margin-top: 4px;
}

.videos-card__views {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ── Watch CTA strip ──────────────────────────────────────────────────────── */
.videos-card__cta-row {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--color-border, #e0e0e0);
}

.videos-card__cta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px 12px;
  text-decoration: none;
  color: var(--color-highlight, #e94560);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background .15s ease;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.videos-card__cta:hover {
  background: color-mix(in srgb, var(--color-highlight) 6%, transparent);
  color: var(--color-highlight, #e94560);
}

.videos-card__cta svg {
  flex-shrink: 0;
}

/* Share button group — sits to the right of the CTA */
.videos-card__share-group {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--color-border, #e0e0e0);
  flex-shrink: 0;
}

.videos-card__share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
  border-left: 1px solid var(--color-border, #e0e0e0);
}

.videos-card__share-btn:first-child {
  border-left: none;
}

/* WhatsApp */
.videos-card__share-btn--wa { color: #25d366; }
.videos-card__share-btn--wa:hover { background: rgba(37,211,102,.1); color: #128c7e; }

/* Facebook */
.videos-card__share-btn--fb { color: #1877f2; }
.videos-card__share-btn--fb:hover { background: rgba(24,119,242,.1); color: #0d5db8; }

/* Twitter / X */
.videos-card__share-btn--tw { color: #000; }
.videos-card__share-btn--tw:hover { background: rgba(0,0,0,.06); color: #333; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.videos-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--color-text-muted, #666);
  text-align: center;
}

.videos-empty svg {
  color: var(--color-border, #e0e0e0);
}

.videos-empty p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-muted, #666);
}

.videos-empty__reset {
  display: inline-flex;
  align-items: center;
  padding: 8px 22px;
  border-radius: 9999px;
  background: var(--color-text, #1a1a2e);
  color: #fff;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  transition: opacity .15s ease;
}

.videos-empty__reset:hover {
  opacity: .85;
  color: #fff;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.videos-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
  padding: 0 32px;
}

.videos-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  background: #f0f0f0;
  border: 1.5px solid var(--color-border, #e0e0e0);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.videos-page-btn:hover {
  background: var(--color-text, #1a1a2e);
  color: #fff;
  border-color: var(--color-text, #1a1a2e);
}

.videos-page-btn--active {
  background: var(--color-text, #1a1a2e);
  color: #fff;
  border-color: var(--color-text, #1a1a2e);
  font-weight: 700;
  pointer-events: none;
}

.videos-page-ellipsis {
  color: var(--color-text-muted, #666);
  font-size: .875rem;
  padding: 0 4px;
}

/* ── Self-hosted video modal ──────────────────────────────────────────────── */
.videos-modal {
  max-width: 880px;
  width: 94vw;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.videos-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}

.videos-modal__close:hover {
  background: rgba(255, 255, 255, .3);
}

.videos-modal__player {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.videos-modal__player iframe,
.videos-modal__player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* filter-bar mobile rules handled in the filter-bar block above */

  .videos-filter-bar__inner {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .videos-header {
    padding: 16px 16px 8px;
  }

  /* ── Mobile video grid: single column, full-width cards like YouTube mobile ── */
  .videos-grid {
    grid-template-columns: 1fr;   /* one card per row */
    padding: 0 0 20px;            /* edge-to-edge */
    gap: 0;                       /* no gap — cards separated by bottom padding */
  }

  /* Full-width card on mobile — with side padding and rounded thumbnails */
  .videos-card {
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 0 12px 12px;         /* breathing room on sides */
    background: #fff;
  }
  .videos-card:hover {
    transform: none;
    box-shadow: none;
  }

  /* Thumbnail: rounded corners, with side margin breathing room */
  .videos-card__thumb-wrap {
    aspect-ratio: 16 / 9;
    border-radius: 12px;           /* rounded like the screenshot */
    overflow: hidden;
    margin-bottom: 10px;
  }

  /* Slightly larger play icon on mobile */
  .videos-card__play svg {
    width: 48px;
    height: 48px;
  }

  /* Card body padding */
  .videos-card__body {
    padding: 10px 14px 6px;
  }

  .videos-card__title {
    font-size: .95rem;
    font-weight: 700;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .videos-card__artist {
    font-size: .82rem;
    color: #666;
  }

  .videos-card__meta {
    font-size: .78rem;
  }

  /* CTA row on mobile — smaller, no border-radius */
  .videos-card__cta-row {
    padding: 0 14px 10px;
    border-top: none;
  }

  .videos-card__cta {
    font-size: .7rem;
    padding: 6px 0 4px;
  }

  .videos-card__share-btn {
    width: 32px;
  }

  .videos-pagination {
    padding: 0 16px;
  }
}

/* ==========================================================================
   Vidz Shorts-style layout — YouTube Shorts row
   Portrait cards (9:16) in a horizontal scrolling row
   ========================================================================== */

/* ── Shorts section header (outside the grid) ─────────────────────────────── */
.videos-shorts-header {
  padding: 24px 0 0;
}

/* Section label with icon */
.vidz-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 4px 0 10px;
  font-size: .85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text, #1a1a2e);
  border-bottom: 2px solid var(--color-border, #e0e0e0);
  margin-bottom: 4px;
}

/* ── Horizontal scroll row ── */
.vidz-shorts-row {
  grid-column: 1 / -1;           /* spans full grid width */
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 24px 32px;
}

/* ── Individual short card ── */
.vidz-short-card {
  width: 100%;                    /* fills grid column */
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  position: relative;
}

/* ── Thumbnail link ── */
.vidz-short-card__thumb-link {
  display: block;
  text-decoration: none;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

/* ── Portrait thumbnail wrap — 9:16 ratio ── */
.vidz-short-card__thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #1a1a2e;
  border-radius: 12px;
  overflow: hidden;
}

.vidz-short-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.vidz-short-card:hover .vidz-short-card__thumb {
  transform: scale(1.04);
}

/* Empty state when no thumbnail */
.vidz-short-card__thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  background: #1a1a2e;
}

/* Play overlay — hidden by default, shows on hover */
.vidz-short-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity .15s ease;
  color: #fff;
  pointer-events: none;
  border-radius: 12px;
}

.vidz-short-card:hover .vidz-short-card__play {
  opacity: 1;
}

.vidz-short-card__play svg {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}

/* Duration badge — bottom right of thumbnail */
.vidz-short-card__duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, .8);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: .03em;
  pointer-events: none;
}

/* ── Info row below thumbnail ── */
.vidz-short-card__info {
  padding: 0 4px;
  padding-right: 22px; /* make room for 3-dot button */
}

.vidz-short-card__title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  margin: 0 0 3px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vidz-short-card__meta {
  font-size: .72rem;
  color: var(--color-text-muted, #888);
}

/* ── 3-dot options button ── */
.vidz-short-card__more {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0,0,0,.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .15s;
  padding: 0;
}
.vidz-short-card__more:hover {
  background: rgba(0, 0, 0, .7);
  color: #fff;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  /* On mobile: Vidz stays 2-column portrait grid like YouTube Shorts mobile */
  .vidz-shorts-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 12px 24px;
  }

  .vidz-short-card__title {
    font-size: .8rem;
  }
}

@media (max-width: 480px) {
  .vidz-short-card { width: auto; }
}
