/* File: src/css/specific/home.css */

/* ====== HERO BASE ====== */
:root {
  --hero-radius: 28px;
  --home-thumb-height: 88px;
  --home-thumb-gap: 12px;
  --home-thumb-nav-size: 42px;
}

body.home-page { overflow-x: hidden; }

.home-page main { padding-bottom: 0; min-height: 0; }


.home-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: calc(100vh - var(--footer-h));
  padding: var(--topbar-h) clamp(28px, 6vw, 120px) clamp(28px, 6vw, 120px);
  padding-bottom: clamp(60px, 10vw, 180px);
  text-align: center;
  overflow: visible;
  background: transparent;
  isolation: isolate;
}

.home-hero::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('../../assets/images/SP-bg-mobile.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: 0;
  opacity: 0.95;
  pointer-events: none;
}

@media (min-width: 768px) {
  .home-hero::before {
    background-image: url('../../assets/images/SP-bg-desktop.webp');
  }
}

.home-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,10,22,0.10), rgba(5,10,22,0.22));
  pointer-events: none;
  z-index: 1;
}

.hero-slideshow {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-slide { position: absolute; inset: 0; opacity: 0; background-size: cover; background-position: center; background-repeat: no-repeat; transition: opacity 1.6s ease-in-out; will-change: opacity; }
.hero-slide.is-active { opacity: 1; }

/* ====== HERO CONTENT ====== */
.home-hero__content {
  position: relative;
  z-index: 2;
  max-width: min(1240px, 94vw);
  width: 100%;
  display: grid;
  gap: clamp(28px, 6vw, 60px);
  justify-items: center;
}

.hero-heading {
  width: min(720px, 100%);
  margin-inline: auto;
}

.hero-card-grid {
  width: min(1100px, 100%);
  margin-inline: auto;
}

.hero-heading h2 {
  font-size: clamp(2.8rem, 5vw, 4.25rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.hero-subtitle {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: rgba(231,236,243,0.85);
  letter-spacing: 0.06em;
}


.hero-beta-note {
  width: clamp(320px, 70vw, 1200px);
  margin-inline: auto;   /* centres it */
  margin-bottom: 40px;   /* or whatever spacing you want */
  margin-inline: auto;
  justify-self: center;
  align-self: center;
  padding: clamp(22px, 3.4vw, 34px);
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(14px, 2vw, 20px);
}

.hero-beta-note__icon {
  font-size: clamp(2rem, 3.2vw, 3rem);
  color: var(--accent);
  line-height: 1;
}

.hero-beta-note__content {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vw, 16px);
}

.hero-beta-note__title {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  color: #fff;
}

.hero-beta-note__body {
  margin: 0;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.4;
}

.hero-beta-note a {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .hero-beta-note {
    width: 100%;
    padding: 18px;
  }

  .hero-beta-note__title {
    letter-spacing: 0.12em;
  }
}

@media (min-width: 1100px) {
  .hero-beta-note {
  }
}

/* ====== GRID FOR CARDS ====== */
.hero-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(18px, 3vw, 28px);
}

/* ====== HERO CARDS ====== */
.hero-card {
  --hero-card-pad-inline: clamp(18px,3.4vw,30px);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px var(--hero-card-pad-inline);
  text-decoration: none;
  color: var(--text-primary);
  border-radius: var(--hero-radius);
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  box-shadow: var(--panel-shadow);
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease, background .35s ease;
}

.hero-card:hover,
.hero-card:focus-visible {
  transform: translateY(-4px);
  background: var(--panel-hover-bg);
  border-color: var(--glass-border-strong);
  box-shadow: 0 32px 90px rgba(3,6,14,0.52);
}

.hero-card .material-symbols-outlined {
  font-size: clamp(2rem, 3vw, 2.6rem);
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1;
}

.hero-card--calendar {
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}

.hero-card--calendar .hero-card__primary {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: inherit;
}

.hero-card--calendar .hero-card__primary:hover .hero-card__title,
.hero-card--calendar .hero-card__primary:focus-visible .hero-card__title {
  text-decoration: underline;
}

.calendar-mockups {
  display: flex;
  gap: 14px;
  width: 100%;
}

.calendar-mockup {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.calendar-mockup__thumb {
  position: relative;
  width: 100%;
  height: clamp(86px, 11vw, 128px);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.calendar-mockup__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.calendar-mockup__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: rgba(231,236,243,0.85);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}

.calendar-mockup__thumb.has-image .calendar-mockup__placeholder {
  opacity: 0;
  visibility: hidden;
}

.calendar-mockup__name {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(231,236,243,0.88);
}

.hero-card--with-thumbs {
  flex-direction: column;
  align-items: stretch;
}

.hero-card__main-link {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.hero-card__main-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 18px;
}

/* ====== TEXT ====== */
.hero-card__text { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; line-height: 1.2; }

/* Allow long titles like BroadlandAstro.com to wrap naturally */
.hero-card__title {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: normal;
  overflow-wrap: anywhere; /* crucial */
  word-break: break-word;  /* fallback */
}

.hero-card__subtitle { font-size: clamp(0.95rem, 1.4vw, 1.05rem); color: rgba(231,236,243,0.75); margin-top: -2px; }

/* ====== HERO THUMB STRIP ====== */
.hero-card__thumbnails {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.hero-card--with-thumbs .hero-thumb-strip {
  margin-inline: calc(var(--hero-card-pad-inline) * -1);
  padding-inline: var(--hero-card-pad-inline);
}

.hero-card--with-thumbs .home-thumb-track {
  min-height: var(--home-thumb-height);
}

.hero-card__thumbnails--gifts {
  margin-top: 4px;
  border-top-color: rgba(255,255,255,0.16);
}

.hero-card__thumbnails--spacepix .hero-thumb-strip {
  margin-inline: calc(var(--hero-card-pad-inline) * -1);
  padding-inline: var(--hero-card-pad-inline);
}

.hero-card__thumbnails--spacepix .home-thumb-track,
.hero-card__thumbnails--spacepix .home-thumb {
  min-height: var(--home-thumb-height);
}

.hero-card__thumb-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-card__thumb-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0;
}

.hero-card__thumb-hint {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(231,236,243,0.7);
}

.hero-thumb-strip {
  position: relative;
}

.home-thumb-track {
  display: flex;
  gap: var(--home-thumb-gap);
  overflow-x: auto;
  padding: 0 calc(var(--home-thumb-nav-size) + 8px);
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  align-items: stretch;
  scroll-behavior: smooth;
  cursor: grab;
}

.home-thumb-track.is-dragging { cursor: grabbing; }

.home-thumb-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.home-thumb-track::-webkit-scrollbar {
  height: 8px;
}

.home-thumb-track::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
}

.home-thumb {
  flex: 0 0 160px;
  min-height: var(--home-thumb-height);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(9,12,22,0.7);
  box-shadow: 0 18px 38px rgba(3, 6, 14, 0.45);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-thumb:hover,
.home-thumb:focus-visible {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 22px 44px rgba(5, 10, 20, 0.65);
}

.home-thumb.selected {
  border-color: var(--accent);
  box-shadow: 0 24px 48px rgba(8, 14, 28, 0.7);
}

.home-thumb__media {
  flex: 1;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.02);
}

.home-thumb__media .material-symbols-outlined {
  font-size: 2.1rem;
  color: var(--accent);
}

.home-thumb__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-thumb__placeholder {
  font-size: 0.85rem;
  color: rgba(231,236,243,0.7);
  text-align: center;
  padding: 18px;
}

.home-thumb__label {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 8px 12px 10px;
  text-transform: uppercase;
}

.home-thumb--more {
  border-style: dashed;
  border-color: rgba(255,255,255,0.35);
  background: rgba(12,14,26,0.9);
  justify-content: center;
  text-align: center;
}

.home-thumb--more .home-thumb__media {
  background: rgba(255,255,255,0.05);
}

.home-thumb--more .home-thumb__label {
  text-transform: none;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
}

.home-thumb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--home-thumb-nav-size);
  height: var(--home-thumb-nav-size);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 10, 18, 0.8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  z-index: 2;
}

.home-thumb-nav:hover,
.home-thumb-nav:focus-visible {
  border-color: var(--accent);
  background: rgba(20, 24, 34, 0.95);
}

.home-thumb-nav.prev { left: 0; }
.home-thumb-nav.next { right: 0; }

.hero-card__thumb-status {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(231,236,243,0.78);
  min-height: 1.3rem;
}

/* ====== MOBILE ====== */
@media (max-width: 1220px) {
  .hero-heading h2 { letter-spacing: 0.12em; }
  .hero-card { justify-content: center; text-align: left; }
  .hero-card__text { align-items: flex-start; }
}

/* ====== LARGE SCREENS ====== */
@media (min-width: 1100px) {
  .home-hero__content { gap: clamp(32px, 4vw, 72px); justify-items: start; }
  .hero-heading { text-align: left; }
  .hero-card-grid { justify-self: stretch; }
}

/* ====== DESKTOP LAYOUT ====== */
@media (min-width: 1221px) {
  .home-hero { text-align: left; }
  .home-hero__content {
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    align-items: start;
    justify-items: stretch;
    gap: clamp(32px, 4vw, 72px);
  }
  /* Keep heading ABOVE the cards, spanning full width */
  .hero-heading { grid-column: 1 / -1; }
}

@media (min-width: 1221px) {
  .hero-card-grid {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 32px);
  }
}

/* ====== LANDSCAPE DESKTOP ====== */
@media (orientation: landscape) and (min-width: 1221px) {
  .home-hero { align-items: center; background: transparent; }
  .hero-slideshow { display: block; }
}

/* ====== LARGE DESKTOP ====== */
@media (min-width: 1601px) {
  .home-hero { padding-bottom: clamp(72px, 12vh, 160px); }
  .home-hero__content {
    max-width: min(1800px, 94vw);
    gap: clamp(40px, 5vw, 96px);
  }
  .hero-card-grid { gap: clamp(32px, 4vw, 52px); }
  .hero-card {
    --hero-card-pad-inline: clamp(24px, 3vw, 48px);
    gap: 24px;
  }
}

