/*
 * homepage.css — Tier 2 (landing page only)
 *
 * Loaded by src/templates/landing.html. Depends on tokens + base from site.css.
 * Contains: category headings (.cat-head), content cards (.bi-card), thumbnail
 * gradient variants, status badges, "Coming soon" placeholder.
 *
 * Masthead / header / controls rules live in site.css (Tier 1) because they
 * render on every page through the shell.
 *
 * See docs/design-system/tiers.md.
 */

/* ─────────────────────────────────────────────────────────────
 * 1. Landing page wrapper
 * ───────────────────────────────────────────────────────────── */

.landing { padding-top: 8px; }

.landing-section { padding: 24px 0 40px; }
.landing-section + .landing-section { padding-top: 16px; }

/* ─────────────────────────────────────────────────────────────
 * 2. Category heading — outlined poster style
 *    Large uppercase title with the accent word filled in color,
 *    sitting above a thin underline rule.
 * ───────────────────────────────────────────────────────────── */

.cat-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 26px;
}

.cat-head .cat-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 0.95;
  color: transparent;
  -webkit-text-stroke: 1px var(--white);
  text-transform: uppercase;
}

.cat-head .cat-title em {
  font-style: normal;
  color: var(--accent-primary);
  -webkit-text-stroke: 1px var(--accent-primary);
}

/* CJK locales: outlined display type reads poorly; switch to filled. */
body.lang-zh .cat-head .cat-title,
body.lang-ja .cat-head .cat-title,
body.lang-ko .cat-head .cat-title {
  color: var(--white);
  -webkit-text-stroke: 0;
  letter-spacing: 0;
  text-transform: none;
}

body.lang-zh .cat-head .cat-title em,
body.lang-ja .cat-head .cat-title em,
body.lang-ko .cat-head .cat-title em {
  color: var(--accent-primary);
  -webkit-text-stroke: 0;
}

/* ─────────────────────────────────────────────────────────────
 * 3. Card grid
 * ───────────────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  gap: 18px;
}

.calendars-grid   { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.tournaments-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

@media (max-width: 600px) {
  .card-grid,
  .calendars-grid,
  .tournaments-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────
 * 4. .bi-card — thumbnail + body
 * ───────────────────────────────────────────────────────────── */

.bi-card {
  display: block;
  text-decoration: none;
  color: inherit;
  /* Near-black body so cards read as distinct surfaces against the blue body gradient. */
  background: rgba(6, 10, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  /* Subtle resting shadow so cards lift off the gradient even before hover. */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.bi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-primary-rgb), 0.45);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

.bi-thumb {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bi-thumb .overlay-dot {
  position: absolute;
  left: 16px;
  top: 14px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
}

.bi-thumb .overlay-dot .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  /* per-tournament dot color set via inline `style="--swatch-color:#xxx"`
   * (allowlisted parametric custom property). The same color drives the
   * subtle box-shadow halo. */
  background: var(--swatch-color, var(--text-tertiary));
  box-shadow: 0 0 6px var(--swatch-color, transparent);
}

/* Tournament cards use the tennis-convention tier+surface combo pill
 * (shared .combo-badge / .combo-tier / .combo-surface from site.css §9c).
 * On a landing card the badge sits where the overlay-dot did. Font size
 * is slightly smaller than the in-page calendar pills since it lives on
 * the thumbnail, not the content plate. */
.bi-thumb .bi-badge {
  position: absolute;
  left: 14px;
  top: 12px;
  font-size: 11px;
}

.bi-thumb .year {
  position: absolute;
  right: 16px;
  bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 1px;
}

/* Gradient backgrounds + oversized tour wordmark per variant.
 * Thumb gradients lean DARK so the colored wordmark reads as the visual subject
 * and the thumb plate stands clear of the body's blue gradient backdrop. */
.bi-thumb.atp { background: linear-gradient(135deg, #050a14 0%, #0b1638 50%, #14225c 100%); }
.bi-thumb.atp::before {
  content: 'ATP';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: #C8E631;
  opacity: 0.7;
  text-shadow: 0 0 22px rgba(200, 230, 49, 0.32);
  pointer-events: none;
}

.bi-thumb.wta { background: linear-gradient(135deg, #100620 0%, #2a0e54 50%, #3a0e4f 100%); }
.bi-thumb.wta::before {
  content: 'WTA';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: #f39ac9;
  opacity: 0.78;
  text-shadow: 0 0 22px rgba(232, 121, 181, 0.32);
  pointer-events: none;
}

.bi-thumb.usopen { background: linear-gradient(135deg, #050d24 0%, #0a1e54 50%, #112878 100%); }
.bi-thumb.usopen::before {
  content: 'US OPEN';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: #6fdaf6;
  opacity: 0.78;
  text-shadow: 0 0 22px rgba(77, 201, 246, 0.36);
  pointer-events: none;
}

.bi-thumb.ao { background: linear-gradient(135deg, #050d24 0%, #0e2580 50%, #0a1e54 100%); }
.bi-thumb.ao::before {
  content: 'AUS OPEN';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: #6fdaf6;
  opacity: 0.75;
  text-shadow: 0 0 22px rgba(77, 201, 246, 0.36);
  pointer-events: none;
}

.bi-thumb.iw { background: linear-gradient(135deg, #1a0a05 0%, #4a1a0a 50%, #6e2810 100%); }
.bi-thumb.iw::before {
  content: 'INDIAN WELLS';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: #f5b048;
  opacity: 0.8;
  text-shadow: 0 0 22px rgba(245, 176, 72, 0.36);
  pointer-events: none;
}

.bi-thumb.unitedcup { background: linear-gradient(135deg, #021018 0%, #052a3a 50%, #0a4a55 100%); }
.bi-thumb.unitedcup::before {
  content: 'UNITED CUP';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #5dd4f5;
  opacity: 0.78;
  text-shadow: 0 0 22px rgba(93, 212, 245, 0.36);
  pointer-events: none;
}

.bi-thumb.miami { background: linear-gradient(135deg, #050d24 0%, #1a0e54 50%, #4a0e6a 100%); }
.bi-thumb.miami::before {
  content: 'MIAMI';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: #ff6fb3;
  opacity: 0.78;
  text-shadow: 0 0 22px rgba(255, 111, 179, 0.36);
  pointer-events: none;
}

/* Monte-Carlo: clay court meets Mediterranean — terracotta to deep sea. */
.bi-thumb.montecarlo { background: linear-gradient(135deg, #1a0f08 0%, #5c2410 40%, #0a2e3a 100%); }
.bi-thumb.montecarlo::before {
  content: 'MONTE CARLO';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #e88a4a;
  opacity: 0.82;
  text-shadow: 0 0 22px rgba(232, 138, 74, 0.38);
  pointer-events: none;
}

/* Dubai: Burj nocturne — deep ocean blue into gold skyline glow. */
.bi-thumb.dubai { background: linear-gradient(135deg, #050914 0%, #0a1d3f 45%, #3a2708 100%); }
.bi-thumb.dubai::before {
  content: 'DUBAI';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #e8b339;
  opacity: 0.85;
  text-shadow: 0 0 22px rgba(232, 179, 57, 0.40);
  pointer-events: none;
}

/* Doha: Qatari desert twilight — deep maroon sand into late-evening indigo. */
.bi-thumb.doha { background: linear-gradient(135deg, #1a0808 0%, #5a1a1a 45%, #0a1a3a 100%); }
.bi-thumb.doha::before {
  content: 'DOHA';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #f1b63a;
  opacity: 0.85;
  text-shadow: 0 0 22px rgba(241, 182, 58, 0.40);
  pointer-events: none;
}

/* -- Body ------------------------------------------------------- */
.bi-body { padding: 18px 20px 20px; }

.bi-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

.bi-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-top: 8px;
}

.bi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.bi-meta {
  font-family: 'Sora', monospace;
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0;
}

/* ─────────────────────────────────────────────────────────────
 * 5. Placeholder card ("Coming soon")
 * ───────────────────────────────────────────────────────────── */

.bi-card.placeholder {
  border-style: dashed;
  opacity: 0.55;
  background: rgba(11, 21, 53, 0.35);
  cursor: default;
}

.bi-card.placeholder .bi-thumb {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 8px, transparent 8px 16px),
    linear-gradient(135deg, #0b1e4a 0%, #1a3ca0 100%);
}

.bi-card.placeholder .placeholder-body {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────────────────────
 * 6. Status badges (inside .bi-foot)
 * ───────────────────────────────────────────────────────────── */

.status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-live       { background: var(--accent-danger); color: #fff; }
.status-upcoming   { background: var(--accent-primary); color: #0a0a0a; }
.status-published  { background: var(--accent-primary); color: #0a0a0a; }
.status-completed  { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }

/* CJK locales: uppercase is meaningless */
body.lang-zh .status, body.lang-ja .status, body.lang-ko .status {
  text-transform: none;
  letter-spacing: 0;
}

/* ─────────────────────────────────────────────────────────────
 * i18n visibility overrides for landing-specific inline elements.
 * site.css toggles [data-lang] to `display: block !important`, which
 * would break the flex layout inside .bi-foot and the inline tour
 * wordmark span. Restore inline-block for these.
 * ───────────────────────────────────────────────────────────── */

body.lang-en .bi-foot .status[data-lang="en"],
body.lang-zh .bi-foot .status[data-lang="zh"],
body.lang-en .bi-foot .bi-meta[data-lang="en"],
body.lang-zh .bi-foot .bi-meta[data-lang="zh"],
body.lang-en .cs-label[data-lang="en"],
body.lang-zh .cs-label[data-lang="zh"] {
  display: inline-block !important;
}

/* ─────────────────────────────────────────────────────────────
 * 7. Responsive
 * ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .landing-section { padding: 18px 0 28px; }
  .cat-head { gap: 12px; padding-bottom: 14px; margin-bottom: 18px; }
}
