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

/* ====== HERO BASE ====== */
:root { --hero-radius: 28px; }

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

.home-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-top: calc(var(--topbar-h) * -1);
  height: calc(100dvh + var(--topbar-h));
  padding: 0 clamp(28px, 6vw, 120px);
  text-align: center;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  background-image: url('../../assets/images/home-banner-portrait.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}

.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: 960px;
  width: 100%;
  display: grid;
  gap: clamp(28px, 6vw, 60px);
  justify-items: center;
  padding-bottom: var(--footer-h);
}

.hero-heading,
.hero-card-grid {
  width: min(720px, 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;
}

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

/* ====== HERO CARDS ====== */
.hero-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px clamp(18px,4vw,28px);
  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;
}

/* ====== 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; }

/* ====== 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 { gap: clamp(36px, 6vw, 80px); }
}

/* Prevent accidental horizontal/vertical scroll on hero */
html, body { overflow-x: hidden; overflow-y: hidden; }
