:root,
[data-theme="light"] {
  --color-bg: #f5f4f1;
  --color-surface: #fcfbf8;
  --color-surface-2: #f0eeea;
  --color-border: #d9d5cd;
  --color-text: #171717;
  --color-text-muted: #66645f;
  --color-primary: #0f766e;
  --color-primary-strong: #0a5c56;
  --color-accent: #d97706;
  --font-body: 'General Sans', system-ui, sans-serif;
  --font-display: 'General Sans', system-ui, sans-serif;
  --radius-sm: .5rem;
  --radius-md: .9rem;
  --radius-lg: 1.4rem;
  --shadow-sm: 0 8px 24px rgba(0,0,0,.05);
  --shadow-md: 0 20px 40px rgba(0,0,0,.08);
  --container: 1180px;
}

[data-theme="dark"] {
  --color-bg: #121313;
  --color-surface: #1a1c1c;
  --color-surface-2: #232626;
  --color-border: #323636;
  --color-text: #f4f3ef;
  --color-text-muted: #a7a49d;
  --color-primary: #49b3aa;
  --color-primary-strong: #73c8c0;
  --color-accent: #f0a13a;
  --shadow-sm: 0 8px 24px rgba(0,0,0,.25);
  --shadow-md: 0 20px 50px rgba(0,0,0,.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light dark;
}

body {
  color: var(--color-text);
  background:
    radial-gradient(circle at 12% -10%, color-mix(in oklab, var(--color-primary), transparent 92%) 0%, transparent 44%),
    radial-gradient(circle at 92% 0%, color-mix(in oklab, var(--color-accent), transparent 93%) 0%, transparent 40%),
    var(--color-bg);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
}

a,
button {
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in oklab, var(--color-primary), white 30%);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-primary);
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -.02em;
  font-weight: 500;
}

h1 {
  font-size: clamp(2rem, 3.6vw, 3.2rem);
}

h2 {
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
}

h3 {
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
  font-weight: 500;
}

p {
  margin: 0;
}

.site-main {
  padding: 0 0 2rem;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--color-bg), transparent 18%);
  border-bottom: 1px solid color-mix(in oklab, var(--color-border), transparent 15%);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  gap: .85rem;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: grid;
  place-items: center;
  color: white;
  box-shadow: var(--shadow-sm);
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
}

.brand-copy small {
  color: var(--color-text-muted);
}

.top-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.top-nav a,
.top-nav .theme-toggle {
  padding: .65rem .9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all .2s;
  text-decoration: none;
  font: inherit;
  font-weight: 500;
  color: inherit;
}

.top-nav a:hover,
.top-nav a:focus-visible,
.top-nav .theme-toggle:hover,
.top-nav .theme-toggle:focus-visible {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.top-nav .theme-toggle {
  background: var(--color-surface);
  cursor: pointer;
}

.eyebrow,
.panel-label,
.footer-label,
.meta-label,
.story-topic,
.topic-index {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-primary);
}

.hero-shell {
  padding: 1.6rem 0 .75rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr .9fr;
  gap: 1.25rem;
}

.hero-copy {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 2rem;
  padding: clamp(1.2rem, 2.4vw, 2.2rem);
  box-shadow: var(--shadow-sm);
}

.hero-panel {
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  border-radius: 1.5rem;
  padding: clamp(1.2rem, 2vw, 1.8rem);
  background: linear-gradient(180deg, color-mix(in oklab, var(--color-primary), var(--color-surface) 97%), var(--color-surface));
}

.hero-lede {
  max-width: 62ch;
  font-size: 1.06rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

.hero-inner {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
}

.hero-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hero-cover-link {
  display: block;
  flex-shrink: 0;
  align-self: stretch;
  aspect-ratio: 1 / 1;
  max-width: 48%;
  border-radius: 1.1rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.hero-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.editoriale-box {
  margin-top: 1.1rem;
}

.editoriale-inner {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--color-primary), var(--color-surface) 95%),
    var(--color-surface)
  );
  border: 1px solid color-mix(in oklab, var(--color-primary), var(--color-border) 65%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(1rem, 2vw, 1.4rem);
}

.editoriale-header {
  margin-bottom: .9rem;
}

.editoriale-body {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.editoriale-cover-link {
  width: min(40%, 390px);
  flex-shrink: 0;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.editoriale-cover {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.editoriale-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.editoriale-text h2 {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.editoriale-text h2 a {
  text-decoration: none;
}

.editoriale-lede {
  color: var(--color-text-muted);
}

.editoriale-meta {
  display: inline-flex;
  width: fit-content;
  padding: .65rem .85rem;
  border-radius: .85rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  font-size: .93rem;
}

.hero-meta-row {
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.meta-pill {
  padding: .95rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.meta-pill .meta-label {
  display: block;
  margin-bottom: .25rem;
}

.meta-pill strong {
  display: block;
}

.hero-actions {
  display: flex;
  gap: .85rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.button-primary,
.button-secondary {
  border-radius: 999px;
  padding: .9rem 1.5rem;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 500;
}

.button-primary {
  background: var(--color-primary);
  color: white;
}

.button-primary:hover {
  background: var(--color-primary-strong);
  color: white;
}

.button-secondary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.signal-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.signal-list li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: .75rem;
  align-items: start;
}

.signal-list span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: .35rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
}

.section-headline {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-top: 2.4rem;
}

.section-link {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.story-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.story-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in oklab, var(--color-primary), var(--color-border) 55%);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.story-content {
  padding: 1.25rem;
}

.story-content h3 {
  margin-top: .4rem;
}

.story-content p {
  color: var(--color-text-muted);
  margin-top: .7rem;
}

.story-content h3 a {
  text-decoration: none;
}

.story-meta {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: .9rem;
  margin-top: 1rem;
  font-size: .92rem;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.topic-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.topic-card h3 {
  margin-top: .35rem;
}

.topic-card p {
  color: var(--color-text-muted);
}

.topic-card a {
  text-decoration: none;
}

.digest-article {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 3rem);
  max-width: 760px;
  margin: 2rem auto;
}

.digest-article .cover-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: 1rem 0;
}

.lede {
  margin-top: .8rem;
  color: var(--color-text-muted);
}

.meta {
  margin-top: .7rem;
  color: var(--color-text-muted);
  font-size: .95rem;
}

.digest-article .intro {
  margin-top: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.digest-article .intro h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--color-border);
}

.digest-article .sources {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.archive-page {
  max-width: 760px;
  margin: 2rem auto;
  padding: 1.5rem;
}

.archive-group + .archive-group {
  margin-top: 2rem;
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-list li {
  padding: .7rem 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.archive-list time {
  color: var(--color-text-muted);
  font-size: .9rem;
  flex-shrink: 0;
}

.topic-page {
  max-width: 760px;
  margin: 2rem auto;
}

.topic-list {
  list-style: none;
  padding: 0;
}

.topic-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--color-border);
}

.page-shell {
  max-width: 760px;
  padding-block: 2rem;
}

.site-footer {
  margin: 2rem auto;
  width: min(calc(100% - 2rem), var(--container));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 2rem;
}

.footer-grid h2 {
  margin: 0;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: .75rem 0 0;
  display: grid;
  gap: .5rem;
}

.footer-grid p {
  color: var(--color-text-muted);
  margin: 0;
}

.footnote {
  padding: 0 2rem 1.5rem;
  margin: 0;
  color: var(--color-text-muted);
  font-size: .9rem;
}

.share-actions {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.share-btn {
  display: inline-block;
  padding: .5rem 1.25rem;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
}

.share-whatsapp {
  background: #25D366;
  color: white;
}

.share-whatsapp:hover {
  background: #1ebe5d;
  color: white;
}

@media (max-width: 980px) {
  .hero-grid,
  .cards-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  h1 {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
  }

  .hero-inner {
    flex-direction: column;
  }

  .editoriale-body {
    flex-direction: column;
  }

  .editoriale-cover-link {
    width: 100%;
  }

  .hero-cover-link {
    align-self: auto;
    aspect-ratio: 16 / 7;
    max-width: 100%;
    width: 100%;
  }

  .header-inner,
  .section-headline {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions,
  .hero-meta-row {
    flex-direction: column;
  }

  .top-nav {
    flex-wrap: wrap;
  }
}

@media (min-width: 560px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 981px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
