/* Home page — /app.html (CR-9). Reuses .video-card styles from public-channel.css. */

.home-main {
  width: 100%;
  padding: 0 0 4rem;
}

/* ---- Featured channel hero ---- */
.home-hero {
  position: relative;
  width: 100%;
  height: 460px;
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
}
.home-hero.no-image { height: 320px; }
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    var(--brand-color, #00617c) 0%,
    var(--brand-color, #00617c) 8%,
    transparent 55%);
  opacity: 0.85;
  pointer-events: none;
}
.home-hero.no-image::before { display: none; }
.home-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}

.home-hero-overlay {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.6rem 1.6rem 2rem;
  gap: 0.8rem;
}
.home-hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.85;
}
.home-hero-name {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.55);
  line-height: 1.1;
}
.home-hero-logo {
  height: 90px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  object-position: left center;
  display: block;
  align-self: flex-start;
  margin: 0 0 0.2rem 0;
}
.home-hero-desc {
  color: #eee;
  font-size: 1rem;
  line-height: 1.5;
  max-width: 640px;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-hero-cta {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.4rem;
  background: #fff;
  color: #111;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.3rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.home-hero-cta:hover { background: #e8e8e8; transform: translateY(-1px); }

/* ---- Rails ---- */
.home-rails {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.6rem 0;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}
.home-rail-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.9rem;
  letter-spacing: 0.01em;
}
.home-rail-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 1rem;
}

/* ---- Empty / loading / error ---- */
.home-loading,
.home-empty,
.home-error {
  text-align: center;
  padding: 4rem 1rem;
  color: #aaa;
}
.home-error { color: #f66; }

/* ---- Tablet (5 cols, still 2 rows = 10 visible) ---- */
@media (max-width: 1100px) {
  .home-rail-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .home-rail-grid > .video-card:nth-child(n+11) { display: none; }
}

/* ---- Small tablet (4 cols) ---- */
@media (max-width: 850px) {
  .home-rail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-rail-grid > .video-card:nth-child(n+9) { display: none; }
}

/* ---- Mobile: 2 cols, cap at 7 cards, stacked hero ---- */
@media (max-width: 640px) {
  .home-hero {
    height: auto;
    min-height: 0;
    background-image: none !important;
    background-color: var(--brand-color, #1a1a1a);
  }
  .home-hero::before,
  .home-hero::after { display: none; }
  .home-hero-image-mobile {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
  }
  .home-hero-overlay {
    padding: 1rem 1rem 1.5rem;
    gap: 0.5rem;
  }
  .home-hero-logo { height: 60px; max-width: 220px; align-self: flex-start; }
  .home-hero-name { font-size: 1.6rem; }
  .home-hero-desc { font-size: 0.92rem; -webkit-line-clamp: 4; }

  .home-rails { padding: 1.5rem 1rem 0; gap: 1.8rem; }
  .home-rail-heading { font-size: 1.05rem; }
  .home-rail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }
  .home-rail-grid > .video-card:nth-child(n+8) { display: none; }
}

/* Hide the mobile hero image element on desktop by default */
.home-hero-image-mobile { display: none; }
