:root {
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 2.5rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --header-height: 4rem;
  --color-ink: #0f172a;
  --color-muted: #526079;
  --color-border: #e2e8f0;
  --color-accent: #059669;
}

html { overflow-x: hidden; }
body { overflow-x: clip; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #34d399;
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.site-header { transition: min-height .2s ease, background-color .2s ease, box-shadow .2s ease; }
.site-header .site-header-row { min-height: var(--header-height); transition: min-height .2s ease; }
.site-header.is-compact { background: rgba(2, 6, 23, .98); box-shadow: 0 8px 24px rgba(2, 6, 23, .18); }
.site-header.is-compact .site-header-row { min-height: 3.5rem; }
.site-header-logo { transition: height .2s ease; }
.site-header.is-compact .site-header-logo { height: 1.75rem; }

.home-shell { padding-block: var(--space-6); }
.home-hero { display: grid; overflow: hidden; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: 0 18px 48px rgba(15, 23, 42, .08); }
.home-hero-media { min-height: 17rem; background: #0f172a; }
.home-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.home-hero-copy { display: flex; flex-direction: column; justify-content: center; padding: var(--space-4); }
.home-hero-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.article-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.article-card { display: flex; min-width: 0; height: 100%; flex-direction: column; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.article-card:hover { transform: translateY(-3px); border-color: #a7f3d0; box-shadow: 0 14px 32px rgba(15, 23, 42, .09); }
.article-card-media { aspect-ratio: 16 / 9; overflow: hidden; background: #e2e8f0; }
.article-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.article-card:hover .article-card-media img { transform: scale(1.025); }
.article-card-body { display: flex; flex: 1; flex-direction: column; padding: var(--space-3); }
.clamp-2 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.clamp-3 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.article-card-meta { margin-top: auto; padding-top: var(--space-2); }

.homepage-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.homepage-sidebar { min-width: 0; }
.sidebar-panel { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; padding: var(--space-3); }
.sidebar-newsletter { border-color: #a7f3d0; background: #ecfdf5; }

.editorial-hero { position: relative; overflow: hidden; background: radial-gradient(circle at 68% 40%, rgba(5, 150, 105, .18), transparent 34%), linear-gradient(135deg, #020617, #07172a 65%, #0f172a); }
.editorial-hero-grid { display: grid; gap: var(--space-3); }
.hero-primary { display: grid; min-width: 0; overflow: hidden; border: 1px solid rgba(52, 211, 153, .24); border-radius: var(--radius-md); background: rgba(15, 23, 42, .72); }
.hero-primary-copy { position: relative; z-index: 1; display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: var(--space-4); }
.hero-label { align-self: flex-start; border: 1px solid rgba(110, 231, 183, .22); border-radius: 999px; background: rgba(5, 150, 105, .25); padding: .35rem .75rem; color: #a7f3d0; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero-primary-media { min-height: 16rem; overflow: hidden; background: #0f172a; }
.hero-primary-media img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: transform .3s ease, opacity .3s ease; }
.hero-primary:hover .hero-primary-media img { transform: scale(1.02); opacity: 1; }
.hero-supporting { display: grid; gap: var(--space-2); }
.hero-support-card { display: flex; min-width: 0; align-items: center; gap: var(--space-2); border: 1px solid rgba(148, 163, 184, .2); border-radius: var(--radius-md); background: rgba(15, 23, 42, .78); padding: var(--space-2); }
.hero-support-card:hover { border-color: rgba(52, 211, 153, .42); }
.hero-support-image { width: 7rem; align-self: stretch; flex: 0 0 auto; overflow: hidden; border-radius: .75rem; background: #111827; }
.hero-support-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.hero-support-card:hover img { transform: scale(1.03); }

.popular-strip { position: relative; z-index: 2; margin-top: calc(var(--space-3) * -1); }
.popular-strip-inner { display: grid; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; box-shadow: 0 12px 30px rgba(15, 23, 42, .1); }
.popular-strip-item { display: grid; min-width: 0; grid-template-columns: 2.5rem minmax(0, 1fr); gap: var(--space-2); align-items: center; padding: var(--space-2); border-bottom: 1px solid #edf2f7; }
.popular-number { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: 999px; background: #ecfdf5; color: #065f46; font-weight: 800; }
.popular-strip-link { display: flex; align-items: center; justify-content: center; padding: var(--space-2); color: #047857; font-size: .875rem; font-weight: 700; }

.section-heading { display: flex; min-height: 2.5rem; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.section-heading h2 { font-family: Poppins, sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--color-ink); }
.section-heading a { color: #047857; font-size: .875rem; font-weight: 700; }
.section-heading.compact { min-height: auto; margin-bottom: .75rem; }
.section-heading.compact h2 { font-size: 1.125rem; }

.popular-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.popular-guide-card { display: flex; min-width: 0; height: 100%; flex-direction: column; overflow: hidden; border: 1px solid var(--color-border); border-radius: .75rem; background: #fff; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.popular-guide-card:hover { transform: translateY(-2px); border-color: #a7f3d0; box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
.popular-guide-image { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: #e2e8f0; }
.popular-guide-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.popular-guide-card:hover img { transform: scale(1.025); }

.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
.topic-card { display: grid; min-width: 0; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .75rem; align-items: center; border: 1px solid var(--color-border); border-radius: .75rem; background: #fff; padding: .75rem; transition: border-color .2s ease, transform .2s ease; }
.topic-card:hover { transform: translateY(-2px); border-color: #a7f3d0; }
.topic-icon { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: .75rem; background: #ecfdf5; color: #059669; }

.latest-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.latest-card { display: grid; min-width: 0; overflow: hidden; border: 1px solid var(--color-border); border-radius: .75rem; background: #fff; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.latest-card:hover { transform: translateY(-2px); border-color: #a7f3d0; box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
.latest-card-image { min-height: 12rem; overflow: hidden; background: #e2e8f0; }
.latest-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.latest-card:hover img { transform: scale(1.025); }
.latest-card-copy { display: flex; min-width: 0; flex-direction: column; padding: var(--space-2); }

.sidebar-story { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .75rem; padding-block: .75rem; }
.sidebar-story-image { overflow: hidden; border-radius: .5rem; background: #e2e8f0; }
.sidebar-story-image img { width: 100%; height: 100%; object-fit: cover; }

.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (min-width: 48rem) {
  .home-hero { grid-template-columns: minmax(0, 1.1fr) minmax(20rem, .9fr); }
  .home-hero-media { min-height: 22rem; }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-primary { grid-template-columns: minmax(0, 1.1fr) minmax(17rem, .9fr); }
  .popular-strip-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .popular-strip-link { grid-column: 1 / -1; }
  .popular-strip-item { border-right: 1px solid #edf2f7; border-bottom: 0; }
  .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
  .home-shell { padding-block: var(--space-8) var(--space-6); }
  .homepage-layout { grid-template-columns: minmax(0, 2fr) minmax(17rem, 1fr); gap: var(--space-5); }
  .homepage-sidebar { position: sticky; top: calc(3.5rem + var(--space-3)); }
  .editorial-hero-grid { grid-template-columns: minmax(0, 2fr) minmax(17rem, 1fr); }
  .popular-strip-inner { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
  .popular-strip-link { grid-column: auto; }
  .popular-guide-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .topic-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 75rem) {
  .latest-card { grid-template-columns: minmax(9rem, .9fr) minmax(0, 1.35fr); }
  .latest-card-image { min-height: 13rem; }
}

@media (max-width: 47.99rem) {
  .home-shell { padding-block: var(--space-4); }
  .home-hero-copy { padding: var(--space-3); }
  .home-hero-media { min-height: 14rem; }
  .article-card-body { padding: var(--space-2); }
  .hero-primary-copy { padding: var(--space-3); }
  .hero-support-card { align-items: stretch; }
  .hero-support-image { width: 6rem; }
  .popular-guide-grid { gap: var(--space-1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
