/* =========================================================
   TheSpaceLaunches · Launches template page styles
   ========================================================= */

/* —— Hero banner —— */
.hero {
  position: relative;
  height: 320px;
  border-radius: var(--radius-lg);
  border: var(--border-glow);
  overflow: hidden;
  margin-bottom: 28px;
  /* Multi-layer hero background:
     1) Dark overlay, lighter on the right so the hero photography shows through
     2) Per-page background image via inline --hero-img (falls back to none)
     3) Base glow gradients
  */
  background-color: #050a18;
  background-image:
    linear-gradient(105deg, rgba(5,10,24,0.55) 0%, rgba(5,10,24,0.35) 40%, rgba(5,10,24,0.15) 75%, rgba(5,10,24,0) 100%),
    var(--hero-img, none),
    radial-gradient(ellipse at 80% 40%, rgba(76, 201, 255, 0.2), transparent 60%),
    radial-gradient(ellipse at 15% 90%, rgba(255, 138, 61, 0.18), transparent 55%),
    linear-gradient(135deg, #050a18, #0a1226 40%, #16244a);
  background-size: cover, cover, auto, auto, auto;
  background-position: center right, center right, center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 30% 80%, #fff, transparent),
    radial-gradient(1px 1px at 60% 25%, #fff, transparent),
    radial-gradient(1px 1px at 80% 70%, #fff, transparent),
    radial-gradient(1px 1px at 90% 30%, #fff, transparent),
    radial-gradient(2px 2px at 45% 60%, var(--accent-blue), transparent),
    radial-gradient(1.5px 1.5px at 70% 50%, var(--accent-orange), transparent);
  opacity: 0.85;
}
.hero::after {
  /* Soft orange glow at lower-left; keeps the right-side hero photography unobstructed */
  content: "";
  position: absolute;
  left: 8%;
  bottom: 8%;
  width: 200px; height: 120px;
  background: radial-gradient(ellipse, rgba(255, 138, 61, 0.32), transparent 60%);
  filter: blur(30px);
  opacity: 0.85;
  pointer-events: none;
}
.hero__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 56px;
  max-width: 60%;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 10px;
}
.hero__eyebrow::before {
  content: "";
  width: 32px; height: 1px;
  background: var(--accent-blue);
}
.hero__title {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 12px;
  text-shadow: 0 2px 18px rgba(0,0,0,0.5), 0 0 22px rgba(76, 201, 255, 0.3);
}
.hero__sub {
  font-size: 14px;
  color: var(--text-1);
  max-width: 520px;
  line-height: 1.7;
}

/* —— Hero countdown card —— */
.hero__countdown {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 240px;
  padding: 18px;
  background: var(--glass-bg-strong);
  border: var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}
.hero__countdown-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent-orange);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hero__countdown-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 12px;
  line-height: 1.4;
}
.hero__countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.cd-cell {
  background: rgba(4, 7, 15, 0.6);
  border: 1px solid rgba(76, 201, 255, 0.2);
  border-radius: 6px;
  padding: 8px 0;
  text-align: center;
}
.cd-cell b {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent-blue);
  text-shadow: 0 0 8px rgba(76, 201, 255, 0.4);
}
.cd-cell span {
  display: block;
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* —— Hero countdown extras: thumbnail + pad + country (home only, inherits .hero__countdown glass base) —— */
.hero__cd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.hero__cd-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(4, 7, 15, 0.6);
  border: 1px solid rgba(76, 201, 255, 0.18);
  position: relative;
}
.hero__cd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero__cd-thumb .media-placeholder {
  width: 100%;
  height: 100%;
}
.hero__cd-meta {
  flex: 1;
  min-width: 0;
}
.hero__cd-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent-orange);
  text-transform: uppercase;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero__cd-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  line-height: 1.35;
  margin-bottom: 2px;
  /* Limit to two lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero__cd-sub {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero__cd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* —— Main layout: left filter + center content —— */
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: flex-start; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 240px 1fr; gap: 18px; }
}

/* —— Status segments —— */
.segment {
  margin-bottom: 36px;
}
.segment__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(76, 201, 255, 0.18);
}
.segment__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.segment__icon {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(76, 201, 255, 0.4);
  background: rgba(76, 201, 255, 0.1);
}
.segment__icon svg { width: 16px; height: 16px; }
.segment__count {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-2);
  padding: 3px 10px;
  background: rgba(15, 28, 61, 0.6);
  border-radius: 999px;
  border: 1px solid rgba(76, 201, 255, 0.18);
}
.segment__count b { color: var(--accent-blue); font-family: var(--font-display); }
.segment__title--upcoming  .segment__icon { color: var(--accent-green); border-color: rgba(92, 227, 155, 0.4); background: rgba(92, 227, 155, 0.1); }
.segment__title--in-flight .segment__icon { color: var(--accent-red);   border-color: rgba(255, 92, 122, 0.4); background: rgba(255, 92, 122, 0.1); }
.segment__title--completed .segment__icon { color: var(--accent-yellow);border-color: rgba(255, 211, 92, 0.4); background: rgba(255, 211, 92, 0.1); }

/* —— Mission card grid —— */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* —— Mission card fields —— */
.card__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.card__title-row .badge {
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(76, 201, 255, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(76, 201, 255, 0.3);
  font-weight: 600;
  text-transform: uppercase;
}
.card__title-row .badge--orange { background: rgba(255, 138, 61, 0.1); color: var(--accent-orange); border-color: rgba(255, 138, 61, 0.35); }

/* —— Map placeholder (data visualization TBD) —— */
.map-block {
  margin-top: 36px;
  padding: 24px;
  background: var(--glass-bg);
  border: var(--border-glow);
  border-radius: var(--radius-md);
}
.map-block__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.map-block__canvas {
  height: 360px;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(76, 201, 255, 0.06), transparent 70%),
    linear-gradient(135deg, #050a18, #0a1226);
  border: 1px dashed rgba(76, 201, 255, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* —— Empty state —— */
.empty {
  padding: 36px 18px;
  text-align: center;
  border: 1px dashed rgba(76, 201, 255, 0.25);
  border-radius: var(--radius-md);
  background: rgba(8, 16, 42, 0.4);
  color: var(--text-2);
}
.empty svg { width: 36px; height: 36px; color: var(--text-3); margin-bottom: 8px; }
.empty h4 { color: var(--text-1); margin-bottom: 6px; font-size: 14px; }
.empty p { margin: 0; font-size: 12px; }

/* —— Breadcrumb —— */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  margin: 16px 0 18px;
  letter-spacing: 0.06em;
}
.breadcrumb a { color: var(--text-2); transition: color .15s ease; }
.breadcrumb a:hover { color: var(--accent-blue); }
.breadcrumb .sep { color: var(--text-3); }

/* —— Launches sub-section tabs (Upcoming & In-Flight / Completed) —— */
.launches-tabs {
  display: flex;
  gap: 0;
  margin: 24px 0 18px;
  border-bottom: 1px solid var(--border-soft, rgba(255,255,255,0.08));
}
.launches-tab {
  padding: 14px 28px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; /* overlap parent border */
  transition: color .15s ease, border-color .15s ease;
}
.launches-tab:hover { color: var(--text-1); }
.launches-tab.is-active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* —— Pager: page-number buttons with auto-folding ellipsis —— */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;  /* Prev pinned left, .pager__pages centered, Next pinned right */
  gap: 8px;
  margin: 18px 0 8px;
  flex-wrap: wrap;
}
.pager__pages {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pager__page {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border-soft, rgba(255,255,255,0.08));
  border-radius: var(--radius-sm, 6px);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.pager__page:hover:not(:disabled):not(.is-active) {
  color: var(--text-1);
  border-color: var(--accent-blue);
}
.pager__page.is-active {
  color: #fff;
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  cursor: default;
}
.pager__page:disabled {
  cursor: default;
}
.pager__dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 36px;
  color: var(--text-3);
  font-size: 14px;
  user-select: none;
}

/* —— Launches top stats bar —— */
.launches-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.launches-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 18px;
  background: var(--glass-bg);
  border: var(--border-glow);
  border-radius: var(--radius-md);
}
.launches-stats .stat__b {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-blue);
  text-shadow: 0 0 12px rgba(76, 201, 255, 0.45);
  line-height: 1;
}
.launches-stats .stat__l {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
}
@media (max-width: 900px) {
  .launches-stats { grid-template-columns: repeat(2, 1fr); }
}

/* —— Mobile fallback rules (PC-only) —— */
@media (max-width: 760px) {
  .hero { height: auto; padding: 36px 0 56px; }
  .hero__content { padding: 24px; max-width: 100%; }
  .hero__countdown { position: static; transform: none; margin: 16px 24px 0; width: auto; }
  .layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
}

/* =========================================================
   Phase 2 (P1) — launches single-column phone tweaks
   Per mobile plan §2.4. The 760-px block already collapses
   layout to a single column and unsticks the filter panel;
   what is missing is the <= 480 single-column phone tier
   where hero / card padding needs another step down so the
   content fills a 360 px viewport. Desktop rules (1-466)
   are untouched.
   ========================================================= */

@media (max-width: 480px) {
  .hero { padding: 24px 0 36px; }
  .hero__content { padding: 18px; }
  .hero__title { font-size: 24px; }
  .hero__sub { font-size: 14px; }
  .hero__countdown { margin: 14px 18px 0; padding: 14px; }
  .filter-panel { padding: 14px; }
  .filter-panel__title { font-size: 13px; }
  .card { padding: 14px; }
  .card__title { font-size: 15px; }
}
