/* ==========================================================================
   HORIZON 99 — Design System (Task 4)
   ==========================================================================
   Editorial + modern cards. Black / White / Emerald Green.
   Brand: Lilita One. Article titles: Amaranth. Body: Outfit.
   Emerald is used selectively: active nav, primary actions, highlights,
   links. No gradients, no neon, no glassmorphism, no unnecessary motion.
   This file is the approved visual foundation for the homepage and for the
   category / article / review / prompt / search pages (reusable classes).
   ========================================================================== */

:root {
  /* Colour */
  --h99-black: #000000;
  --h99-near-black: #0a0a0a;
  --h99-white: #ffffff;
  --h99-surface: #f7f8f7;
  --h99-ink: #0b1220;
  --h99-muted: #5b6472;
  --h99-muted-on-dark: #a7b0ba;
  --h99-border: #e3e7e4;
  --h99-border-dark: #262626;
  --h99-emerald: #10b981;
  --h99-emerald-dark: #047857;
  --h99-emerald-soft: #ecfdf5;
  --h99-emerald-soft-dark: #064e3b;

  /* Type */
  --h99-font-brand: "Lilita One", "Arial Black", sans-serif;
  --h99-font-head: "Amaranth", "Trebuchet MS", sans-serif;
  --h99-font-body: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --h99-max: 1120px;
  --h99-gap: 20px;
  --h99-radius: 14px;
  --h99-radius-sm: 8px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--h99-font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--h99-ink);
  background: var(--h99-white);
}
h1, h2, h3, h4 { font-family: var(--h99-font-head); line-height: 1.2; color: var(--h99-black); margin: 0 0 12px; }
h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
p { margin: 0 0 12px; }
a { color: var(--h99-emerald-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input { font-family: inherit; font-size: inherit; }

/* Visible keyboard focus on every interactive element. */
a:focus-visible, button:focus-visible, input:focus-visible,
summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--h99-emerald);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Header ---------- */
.h99-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--h99-near-black);
  color: var(--h99-white);
  border-bottom: 1px solid var(--h99-border-dark);
}
.h99-header-inner {
  max-width: var(--h99-max); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 20px;
}
.h99-brand { color: var(--h99-white); text-decoration: none; display: flex; flex-direction: column; line-height: 1.05; flex-shrink: 0; }
.h99-brand:hover { text-decoration: none; }
.h99-brand-name { font-family: var(--h99-font-brand); font-size: 26px; letter-spacing: 1px; white-space: nowrap; }
.h99-brand-num { color: var(--h99-emerald); }
.h99-brand-tagline { font-size: 12px; color: var(--h99-muted-on-dark); letter-spacing: 0.4px; }

/* Menu button — visible only below the nav breakpoint. */
.h99-menu-btn {
  display: none;
  align-items: center; gap: 8px;
  background: transparent; color: var(--h99-white);
  border: 1px solid var(--h99-border-dark); border-radius: var(--h99-radius-sm);
  padding: 10px 14px; min-height: 44px; cursor: pointer;
  font-weight: 600; font-size: 15px;
}
.h99-menu-btn:hover { border-color: var(--h99-emerald); color: var(--h99-emerald); }
.h99-menu-icon { display: flex; flex-direction: column; gap: 4px; width: 18px; }
.h99-menu-icon span { display: block; height: 2px; background: currentColor; border-radius: 2px; }
.h99-nav-open .h99-menu-icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.h99-nav-open .h99-menu-icon span:nth-child(2) { opacity: 0; }
.h99-nav-open .h99-menu-icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Main nav — Home + 6 categories. */
.h99-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: 8px; }
.h99-nav a {
  color: var(--h99-white); font-weight: 600; font-size: 15px;
  padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center;
  border-radius: var(--h99-radius-sm); white-space: nowrap;
}
.h99-nav a:hover { color: var(--h99-emerald); text-decoration: none; background: rgba(255, 255, 255, 0.06); }
.h99-nav a[aria-current="page"] { color: var(--h99-emerald); }
.h99-nav a[aria-current="page"]::after {
  content: ""; position: absolute;
}

.h99-search-btn {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--h99-white); font-weight: 600; font-size: 15px;
  border: 1px solid var(--h99-border-dark); border-radius: 999px;
  padding: 10px 16px; min-height: 44px;
}
.h99-search-btn:hover { border-color: var(--h99-emerald); color: var(--h99-emerald); text-decoration: none; }
.h99-search-btn .h99-icon { display: inline-block; }

/* ---------- Main ---------- */
.h99-main { max-width: var(--h99-max); margin: 0 auto; padding: 0 20px 64px; }

/* Shared section scaffolding. */
.h99-section { margin-top: 56px; }
.h99-section-head { margin-bottom: 20px; max-width: 680px; }
.h99-section-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--h99-emerald-dark); margin: 0 0 8px;
}
.h99-section-title { font-size: 28px; margin: 0 0 8px; }
.h99-section-sub { color: var(--h99-muted); font-size: 17px; margin: 0; }

.h99-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--h99-emerald-dark); margin: 0 0 8px;
}
.h99-lead { font-size: 19px; color: var(--h99-muted); }
.h99-meta { font-size: 14px; color: var(--h99-muted); }

/* Placeholder badge + notice. Placeholder content is always visibly marked. */
.h99-badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--h99-emerald-dark);
  background: var(--h99-emerald-soft); border: 1px dashed var(--h99-emerald-dark);
  border-radius: 999px; padding: 4px 10px; margin-bottom: 12px;
}
.h99-placeholder {
  border: 1px dashed var(--h99-emerald-dark);
  background: var(--h99-emerald-soft);
  border-radius: var(--h99-radius-sm);
  padding: 12px 16px; font-size: 15px; margin: 16px 0;
}

/* ---------- Hero ---------- */
.h99-hero {
  background: var(--h99-near-black); color: var(--h99-white);
  border-radius: 0 0 var(--h99-radius) var(--h99-radius);
  padding: 56px 32px 48px; margin: 0 0 8px;
}
.h99-hero-eyebrow { color: var(--h99-emerald); font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin: 0 0 12px; }
.h99-hero-title { color: var(--h99-white); font-size: 52px; line-height: 1.08; max-width: 720px; margin: 0 0 16px; }
.h99-hero-title em { font-style: normal; color: var(--h99-emerald); }
.h99-hero-lead { color: #d6dbe0; font-size: 19px; max-width: 640px; margin: 0 0 28px; }
.h99-hero-search { display: flex; gap: 10px; max-width: 640px; margin: 0 0 24px; }
.h99-hero-search input {
  flex: 1; min-width: 0; padding: 14px 16px; font-size: 17px;
  color: var(--h99-ink); background: var(--h99-white);
  border: 2px solid transparent; border-radius: var(--h99-radius-sm);
}
.h99-hero-search input:focus-visible { outline: 3px solid var(--h99-emerald); outline-offset: 2px; }
.h99-hero-search button {
  padding: 14px 24px; min-height: 52px; font-size: 16px; font-weight: 700;
  color: var(--h99-white); background: var(--h99-emerald);
  border: 0; border-radius: var(--h99-radius-sm); cursor: pointer; white-space: nowrap;
}
.h99-hero-search button:hover { background: var(--h99-emerald-dark); }
.h99-hero-trending { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 720px; }
.h99-hero-trending-label { color: var(--h99-muted-on-dark); font-size: 14px; font-weight: 600; margin-right: 4px; }
.h99-chip {
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 6px 14px; font-size: 14px; font-weight: 600; color: var(--h99-white);
  border: 1px solid #3a3a3a; border-radius: 999px; background: transparent;
}
.h99-chip:hover { border-color: var(--h99-emerald); color: var(--h99-emerald); text-decoration: none; }

/* ---------- Cards (shared) ---------- */
.h99-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--h99-gap); margin: 20px 0; }
.h99-card {
  border: 1px solid var(--h99-border); border-radius: var(--h99-radius);
  padding: 20px; background: var(--h99-white);
  display: flex; flex-direction: column;
}
.h99-card:hover { border-color: var(--h99-emerald); }
.h99-card-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--h99-emerald-dark); margin: 0 0 8px; }
.h99-card-title { font-size: 20px; margin: 0 0 8px; }
.h99-card-title a { color: var(--h99-black); }
.h99-card-title a:hover { color: var(--h99-emerald-dark); }
.h99-card-excerpt { font-size: 15px; color: var(--h99-muted); flex: 1; }
.h99-card-link { font-weight: 700; font-size: 15px; margin-top: 12px; }
.h99-card-link::after { content: " \2192"; }

/* ---------- Category discovery ---------- */
.h99-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--h99-gap); margin: 20px 0; }
.h99-cat-card {
  border: 1px solid var(--h99-border); border-radius: var(--h99-radius);
  padding: 24px 20px; background: var(--h99-white);
  display: flex; flex-direction: column; min-height: 200px;
}
.h99-cat-card:hover { border-color: var(--h99-emerald); }
.h99-cat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--h99-emerald-soft); color: var(--h99-emerald-dark);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.h99-cat-icon svg { width: 26px; height: 26px; }
.h99-cat-name { font-size: 21px; margin: 0 0 8px; }
.h99-cat-name a { color: var(--h99-black); }
.h99-cat-name a:hover { color: var(--h99-emerald-dark); }
.h99-cat-desc { font-size: 15px; color: var(--h99-muted); flex: 1; }
.h99-cat-link { font-weight: 700; font-size: 15px; margin-top: 16px; }
.h99-cat-link::after { content: " \2192"; }

/* ---------- Featured story ---------- */
.h99-featured {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 0;
  border: 1px solid var(--h99-border); border-radius: var(--h99-radius);
  overflow: hidden; background: var(--h99-white); margin: 20px 0;
}
.h99-featured-visual {
  background: var(--h99-near-black); color: var(--h99-white);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 32px; min-height: 260px; gap: 12px;
}
.h99-featured-visual .h99-cat-icon { background: rgba(16, 185, 129, 0.16); color: var(--h99-emerald); margin: 0; }
.h99-featured-visual-label { font-family: var(--h99-font-brand); font-size: 22px; letter-spacing: 1px; }
.h99-featured-visual-label span { color: var(--h99-emerald); }
.h99-featured-body { padding: 32px; display: flex; flex-direction: column; }
.h99-featured-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--h99-emerald-dark); margin: 0 0 10px; }
.h99-featured-title { font-size: 30px; margin: 0 0 12px; }
.h99-featured-title a { color: var(--h99-black); }
.h99-featured-title a:hover { color: var(--h99-emerald-dark); }
.h99-featured-excerpt { font-size: 17px; color: var(--h99-muted); flex: 1; }
.h99-featured-link { font-weight: 700; margin-top: 16px; }
.h99-featured-link::after { content: " \2192"; }

/* ---------- Explore list (not cards) ---------- */
.h99-explore-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; margin: 20px 0; }
.h99-explore-item { border-bottom: 1px solid var(--h99-border); padding: 14px 0; }
.h99-explore-item a { color: var(--h99-black); font-weight: 700; font-size: 17px; }
.h99-explore-item a:hover { color: var(--h99-emerald-dark); }
.h99-explore-item p { font-size: 15px; color: var(--h99-muted); margin: 4px 0 0; }

/* ---------- Newsletter (Coming Soon — no backend) ---------- */
.h99-newsletter {
  border: 1px dashed var(--h99-emerald-dark); background: var(--h99-emerald-soft);
  border-radius: var(--h99-radius); padding: 28px; margin: 20px 0;
  display: flex; flex-direction: column; gap: 8px; max-width: 680px;
}
.h99-newsletter h3 { margin: 0; }
.h99-newsletter p { margin: 0; color: var(--h99-muted); }
.h99-newsletter-badge {
  align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--h99-emerald-dark);
  border: 1px solid var(--h99-emerald-dark); border-radius: 999px; padding: 4px 10px;
}

/* ---------- Article / review / prompt pages ---------- */
.h99-prose { max-width: 720px; }
.h99-prose p { font-size: 18px; }
.h99-article-meta { font-size: 15px; color: var(--h99-muted); margin-bottom: 20px; }
.h99-facts { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 20px 0; max-width: 720px; }
.h99-facts dt { font-weight: 700; }
.h99-facts dd { margin: 0; }
pre {
  background: var(--h99-surface); border: 1px solid var(--h99-border);
  border-radius: var(--h99-radius-sm); padding: 16px;
  overflow-x: auto; font-size: 15px; line-height: 1.5; white-space: pre-wrap;
}
details { border: 1px solid var(--h99-border); border-radius: var(--h99-radius-sm); padding: 14px 16px; margin: 12px 0; max-width: 720px; }
summary { font-weight: 700; cursor: pointer; }

/* ---------- Search ---------- */
.h99-search-form { display: flex; gap: 10px; margin: 20px 0; max-width: 640px; }
.h99-search-form input {
  flex: 1; min-width: 0; padding: 13px 16px; font-size: 17px;
  border: 1px solid var(--h99-border); border-radius: var(--h99-radius-sm);
}
.h99-search-form button {
  padding: 13px 22px; min-height: 52px; font-size: 16px; font-weight: 700;
  color: var(--h99-white); background: var(--h99-emerald);
  border: 0; border-radius: var(--h99-radius-sm); cursor: pointer;
}
.h99-search-form button:hover { background: var(--h99-emerald-dark); }
#h99-search-results .h99-card { margin-bottom: 12px; }

/* ---------- Footer ---------- */
.h99-footer { background: var(--h99-near-black); color: var(--h99-white); margin-top: 64px; }
.h99-footer-inner { max-width: var(--h99-max); margin: 0 auto; padding: 40px 20px 32px; display: flex; flex-direction: column; gap: 20px; }
.h99-footer-name { font-family: var(--h99-font-brand); font-size: 24px; letter-spacing: 1px; margin: 0 0 4px; }
.h99-footer-tagline { color: var(--h99-emerald); font-size: 14px; margin: 0 0 12px; }
.h99-footer-about { color: var(--h99-muted-on-dark); font-size: 15px; max-width: 560px; margin: 0; }
.h99-footer-nav { display: flex; gap: 8px 20px; flex-wrap: wrap; border-top: 1px solid var(--h99-border-dark); padding-top: 20px; }
.h99-footer-nav a { color: var(--h99-white); font-size: 15px; padding: 6px 0; min-height: 32px; }
.h99-footer-nav a:hover { color: var(--h99-emerald); }
.h99-footer-note, .h99-footer-copy { font-size: 13px; color: var(--h99-muted-on-dark); margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .h99-hero-title { font-size: 44px; }
  .h99-cards, .h99-cat-grid { grid-template-columns: repeat(2, 1fr); }
  .h99-featured { grid-template-columns: 1fr; }
  .h99-featured-visual { min-height: 0; padding: 24px; }
}

/* Mobile navigation breakpoint: below 900px the nav becomes a menu panel. */
@media (max-width: 900px) {
  .h99-menu-btn { display: inline-flex; margin-left: auto; }
  .h99-search-btn { margin-left: 0; }
  .h99-search-btn span { display: none; }
  .h99-search-btn { padding: 10px 12px; border-radius: var(--h99-radius-sm); }
  .h99-nav {
    display: none;
    order: 3; flex-basis: 100%; flex-direction: column; align-items: stretch;
    margin: 8px 0 0; border-top: 1px solid var(--h99-border-dark); padding-top: 8px;
  }
  .h99-nav-open .h99-nav { display: flex; }
  .h99-nav a { padding: 12px 8px; }
  .h99-nav a[aria-current="page"] { background: rgba(16, 185, 129, 0.12); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 30px; }
  h2, .h99-section-title { font-size: 24px; }
  .h99-main { padding: 0 16px 48px; }
  .h99-header-inner { padding: 10px 16px; gap: 12px; }
  .h99-brand-name { font-size: 22px; }
  .h99-hero { padding: 36px 20px 32px; border-radius: 0 0 12px 12px; }
  .h99-hero-title { font-size: 34px; }
  .h99-hero-lead { font-size: 17px; }
  .h99-hero-search { flex-direction: column; }
  .h99-hero-search button { width: 100%; }
  .h99-cards, .h99-cat-grid { grid-template-columns: 1fr; }
  .h99-explore-list { grid-template-columns: 1fr; }
  .h99-featured-body { padding: 24px 20px; }
  .h99-featured-title { font-size: 24px; }
  .h99-facts { grid-template-columns: 1fr; }
  .h99-section { margin-top: 40px; }
  .h99-newsletter { padding: 20px; }
}
