/* MSA Diario Digital — design system editorial */
@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f4ef;
  --bg-elevated: #ffffff;
  --bg-soft: #efeae2;
  --bg-input: #fffdf9;
  --ink: #1c1a17;
  --ink-strong: #0d0c0b;
  --muted: #5e584f;
  --line: rgba(28, 26, 23, 0.12);
  --line-strong: rgba(28, 26, 23, 0.2);
  --accent: #c41e3a;
  --accent-soft: rgba(196, 30, 58, 0.1);
  --accent-ink: #fff8f8;
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.1);
  --ok: #1f7a4c;
  --ok-soft: rgba(31, 122, 76, 0.1);
  --warn: #9a6700;
  --warn-soft: rgba(154, 103, 0, 0.12);
  --shadow: 0 16px 40px rgba(28, 26, 23, 0.08);
  --header-bg: rgba(247, 244, 239, 0.92);
  --font-display: "Libre Baskerville", Georgia, serif;
  --font-body: "Source Sans 3", sans-serif;
  --radius: 4px;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1120px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121110;
  --bg-elevated: #1c1a18;
  --bg-soft: #171513;
  --bg-input: #151311;
  --ink: #ebe6df;
  --ink-strong: #ffffff;
  --muted: #a39b90;
  --line: rgba(235, 230, 223, 0.12);
  --line-strong: rgba(235, 230, 223, 0.2);
  --accent: #e84a5f;
  --accent-soft: rgba(232, 74, 95, 0.14);
  --accent-ink: #1a070a;
  --danger: #ff7a6e;
  --ok: #5dffb0;
  --warn: #ffc857;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(18, 17, 16, 0.9);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, var(--accent-soft), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 48%, var(--bg) 100%);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.theme-toggle svg { width: 1rem; height: 1rem; }
[data-theme="light"] .icon-sun,
[data-theme="dark"] .icon-moon { display: none; }

.page {
  width: min(var(--max), calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
}

.flash-wrap { width: min(var(--max), calc(100% - 2rem)); margin: 0.75rem auto 0; }
.flash {
  margin: 0 0 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}
.flash-success { background: var(--ok-soft); }
.flash-danger { background: var(--danger-soft); }
.flash-warning { background: var(--warn-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.muted { color: var(--muted); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 1.25rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
}

.footer-inner p { margin: 0; }

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.55rem;
  justify-content: center;
}

.newsletter-form label {
  display: block;
  width: 100%;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.newsletter-form input[type="email"] {
  min-width: min(280px, 70vw);
  min-height: 2.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--ink);
  font: inherit;
}

@media (max-width: 820px) {
  .nav-desktop-only { display: none; }
}
