/* ==========================================================================
   media-hub.css — Media Hub page (hero+search, filter toolbar, bento grid)
   ========================================================================== */

/* ── Hero ─────────────────────────────────────────────────────────────── */
.mh-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fdfcfa 0%, #f3f0e9 100%);
  padding: clamp(6.5rem, 12vw, 9rem) var(--section-pad-x) clamp(4rem, 7vw, 5.5rem);
}

.mh-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 60% 50% at 18% 0%, rgba(0, 153, 64, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 88% 15%, rgba(37, 99, 235, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(236, 72, 153, 0.07) 0%, transparent 60%);
}

/* Scattered "press clippings" photo collage behind the hero copy —
   gives the page an editorial/blog-wall feel instead of a flat panel. */
.mh-hero__collage {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.mh-hero__collage-img {
  position: absolute;
  width: 11.875rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
  opacity: 0.95;
  /* tilt.js overrides this transform inline on hover (per-image bento
     tilt) and clears the override on mouseleave, reverting here. */
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.mh-hero__collage-img--1 { top: 6%;  left: 3%;  width: 10.625rem; transform: rotate(-9deg); }
.mh-hero__collage-img--2 { top: 10%; right: 4%; width: 13.125rem; transform: rotate(7deg); }
.mh-hero__collage-img--3 { bottom: 8%; left: 7%; width: 11.25rem; transform: rotate(6deg); }
.mh-hero__collage-img--4 { bottom: 4%; right: 8%; width: 12.5rem; transform: rotate(-6deg); }
.mh-hero__collage-img--5 { top: 42%; left: -2%; width: 9.375rem; transform: rotate(-4deg); }
.mh-hero__collage-img--6 { top: 46%; right: -2%; width: 9.375rem; transform: rotate(5deg); }

.mh-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 62% 60% at 50% 46%, #fdfcfa 0%, rgba(253, 252, 250, 0.94) 45%, rgba(253, 252, 250, 0.65) 72%, rgba(253, 252, 250, 0.2) 100%),
    linear-gradient(180deg, rgba(253, 252, 250, 0.5) 0%, rgba(243, 240, 233, 0.7) 100%);
}

.mh-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.mh-hero__eyebrow {
  color: var(--accent);
}

.mh-hero__title {
  color: var(--text);
  font-weight: 900;
  font-size: clamp(1.9rem, 7vw, 4rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.1rem;
}

.mh-hero__subtitle {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto 2.25rem;
}

.mh-hero__kinds {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 2.5rem;
}

.mh-hero__kind {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: var(--badge-pad);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.1);
  white-space: nowrap;
}

.mh-hero__stats {
  display: flex;
  gap: 1.5rem 2.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.mh-hero__stat {
  text-align: center;
}

.mh-hero__stat-num {
  color: var(--text);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.mh-hero__stat-label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

/* ── Toolbar ──────────────────────────────────────────────────────────── */
.mh-toolbar {
  background: var(--bg);
  padding: 1.1rem var(--section-pad-x);
}

.mh-toolbar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1.25rem;
}

.mh-toolbar__pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mh-toolbar__pills::-webkit-scrollbar {
  display: none;
}

.mh-toolbar__utility {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.mh-toolbar__search {
  position: relative;
  width: 13.75rem;
  max-width: 100%;
}

.mh-toolbar__search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.mh-toolbar__search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background: #fff;
  color: var(--text);
  font-size: var(--fs-sm);
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mh-toolbar__search-input::placeholder {
  color: var(--text-faint);
}

.mh-toolbar__search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 153, 64, 0.1);
}

.mh-pill {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.mh-pill:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
}

.mh-pill.is-active {
  background: var(--text);
  color: #fff;
  border-color: transparent;
}

.mh-pill[data-accent="violet"].is-active { background: #7c3aed; }
.mh-pill[data-accent="blue"].is-active { background: #2563eb; }
.mh-pill[data-accent="amber"].is-active { background: #d97706; }
.mh-pill[data-accent="pink"].is-active { background: #db2777; }
.mh-pill[data-accent="green"].is-active { background: var(--accent); }

.mh-toolbar__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex-shrink: 0;
}

.mh-select-wrap {
  display: block;
}

.mh-select {
  padding: 0.55rem 2.25rem 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" fill="none" stroke="%2364748b" stroke-width="1.5"/></svg>') no-repeat right 0.85rem center;
  color: #374151;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease;
}

.mh-select:hover,
.mh-select:focus {
  border-color: #94a3b8;
  outline: none;
}

.mh-toolbar__count {
  max-width: var(--max-width);
  margin: 0.75rem auto 0;
  font-size: var(--fs-sm);
  color: var(--text-faint);
}

/* ── Grid section ─────────────────────────────────────────────────────── */
.mh-grid-section {
  padding: clamp(2.5rem, 5vw, 3.5rem) var(--section-pad-x) clamp(4rem, 7vw, 5.5rem);
}

.mh-grid-section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Fixed column counts per breakpoint (not auto-fill) so a page of
   cards always fills complete rows — no dangling half-empty last row
   while a "Load More" button is still offering more content. */
.mh-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1100px) {
  .mh-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 780px) {
  .mh-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.mh-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border-card);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Bento variety — the "every 5th card" rule in media-hub.js pairs with
   PAGE_SIZE so a wide (2-col) card + 2 normal cards = 4 units, always
   completing evenly at the 4-column desktop grid. Reset to a normal
   1-column card below that, where the row math no longer applies. */
.mh-card--wide {
  grid-column: span 2;
}

@media (max-width: 1100px) {
  .mh-card--wide {
    grid-column: auto;
  }
}

.mh-card:hover {
  transform: translateY(-0.375rem);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.10);
  border-color: var(--border-hover);
}

.mh-card--featured {
  grid-column: 1 / -1;
  position: relative;
  height: clamp(21.25rem, 40vw, 30rem);
  background: #0a0e14;
  border-color: #1e2530;
}

.mh-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f172a;
}

.mh-card--featured .mh-card__media {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

/* Bottom gradient scrim — the featured card's title/excerpt sit on a
   dark backdrop banked along the bottom edge, dissolving into the full
   -bleed image above instead of a solid text panel. */
.mh-card__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(6, 9, 14, 0.96) 0%,
    rgba(6, 9, 14, 0.85) 24%,
    rgba(6, 9, 14, 0.5) 46%,
    rgba(6, 9, 14, 0.12) 68%,
    transparent 84%
  );
}

.mh-card__media img,
.mh-card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mh-card:hover .mh-card__media img,
.mh-card:hover .mh-card__media video {
  transform: scale(1.06);
}

.mh-card__type-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.mh-card__duration {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-xs);
  color: #fff;
  font-size: var(--fs-2xs);
  font-family: ui-monospace, monospace;
  background: rgba(0, 0, 0, 0.6);
}

.mh-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--fs-sm);
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.mh-card:hover .mh-card__play {
  background: rgba(0, 153, 64, 0.5);
  border-color: rgba(0, 201, 87, 0.7);
  transform: translate(-50%, -50%) scale(1.1);
}

.mh-card__body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.mh-card--featured .mh-card__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  justify-content: flex-end;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
}

.mh-card__tag {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: var(--tag-pad);
  border-radius: var(--radius-sm);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border-card);
  margin-bottom: 0.85rem;
  width: fit-content;
}

.mh-card__tag[data-accent="violet"] { color: #7c3aed; background: #f3ecfe; border-color: #e4d4fd; }
.mh-card__tag[data-accent="blue"] { color: var(--accent-blue); background: #eaf1fe; border-color: #d6e4fc; }
.mh-card__tag[data-accent="amber"] { color: #d97706; background: #fef3e2; border-color: #fce3bd; }
.mh-card__tag[data-accent="pink"] { color: #db2777; background: #fdeaf3; border-color: #fbd3e6; }
.mh-card__tag[data-accent="green"] { color: var(--accent); background: #e6f7ec; border-color: #c8ecd6; }

.mh-card--featured .mh-card__tag {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.mh-card__title {
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
  font-size: var(--fs-base);
  margin-bottom: 0.6rem;
  transition: color 0.2s ease;
}

.mh-card--featured .mh-card__title {
  color: #fff;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 720px;
}

.mh-card:hover .mh-card__title {
  color: var(--accent);
}

.mh-card--featured:hover .mh-card__title {
  color: var(--accent-glow);
}

.mh-card__excerpt {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mh-card--featured .mh-card__excerpt {
  color: rgba(255, 255, 255, 0.55);
  -webkit-line-clamp: 2;
  max-width: 620px;
}

.mh-card__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-faint);
  font-size: var(--fs-xs);
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
}

.mh-card--featured .mh-card__meta {
  color: rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.1);
}

.mh-card__dot {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: #e2e8f0;
  flex-shrink: 0;
}

.mh-card--featured .mh-card__dot {
  background: rgba(255, 255, 255, 0.2);
}

/* Filter/search visibility — toggled via JS */
.mh-card.is-hidden {
  display: none;
}

.mh-empty {
  text-align: center;
  padding: 4.5rem 0;
  color: var(--text-faint);
  font-size: var(--fs-md);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

.mh-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.mh-load-more {
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.mh-load-more:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 153, 64, 0.14);
}

.mh-load-more[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .mh-hero__collage-img--5,
  .mh-hero__collage-img--6 {
    display: none;
  }
}

@media (max-width: 640px) {
  .mh-hero__collage {
    display: none;
  }

  .mh-hero__scrim {
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.92) 0%, rgba(10, 14, 20, 0.98) 100%);
  }
}

@media (max-width: 720px) {
  .mh-toolbar__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .mh-toolbar__utility {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .mh-toolbar__search {
    width: 100%;
  }

  .mh-toolbar__controls {
    justify-content: stretch;
  }

  .mh-select-wrap {
    flex: 1;
  }

  .mh-select {
    width: 100%;
  }
}
