/* ============================================================
   EA5OL — www.ea5ol.net
   Hoja de estilos única. Sin dependencias externas.
   Paleta derivada de la tarjeta QSL (azul marino + rojo).
   ============================================================ */

:root {
  --navy: #1a2f6b;
  --navy-deep: #10204d;
  --red: #d62828;
  --red-soft: #fbe3e3;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #5b6474;
  --border: #e2e6ee;
  --link: #1a4fb4;
  --chip: rgba(255, 255, 255, 0.12);
  --shadow: 0 6px 24px rgba(16, 32, 80, 0.08);
  --radius: 14px;
  --header-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #14265a;
    --navy-deep: #0b1638;
    --red: #ef4444;
    --red-soft: #3a1d1d;
    --bg: #0f172a;
    --surface: #172035;
    --text: #e5e9f2;
    --muted: #9aa5b8;
    --border: #283349;
    --link: #8db4ff;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

/* ---------- Idioma: por defecto español; EN sólo si data-lang="en" ---------- */
html:not([data-lang="en"]) [lang="en"] { display: none !important; }
html[data-lang="en"] [lang="es"] { display: none !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.container { width: min(1100px, 100% - 2rem); margin-inline: auto; }
.section { padding: clamp(2.5rem, 4vw, 4.5rem) 0; }
.section-title { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-title h2 { margin: 0; }
.section-title .more { margin-left: auto; font-weight: 600; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy-deep);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }
.brand {
  font-size: 1.6rem; font-weight: 900; letter-spacing: -0.03em; color: #fff;
  display: inline-flex; align-items: baseline; gap: 0.35rem;
}
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; color: var(--red); }
.brand small { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.12em; opacity: 0.7; text-transform: uppercase; }
.nav-toggle {
  margin-left: auto; display: none;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); color: #fff;
  border-radius: 8px; padding: 0.4rem 0.6rem; font-size: 1.2rem; cursor: pointer;
}
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  color: rgba(255, 255, 255, 0.85); font-weight: 600; padding: 0.5rem 0.7rem; border-radius: 8px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.lang-toggle {
  margin-left: 0.5rem; background: var(--red); color: #fff; border: 0; border-radius: 999px;
  padding: 0.35rem 0.8rem; font-weight: 700; cursor: pointer; font-size: 0.85rem; letter-spacing: 0.05em;
}
.lang-toggle:hover { filter: brightness(1.1); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy-deep); padding: 0.5rem 1rem 1rem;
    display: none; border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.8rem 0.6rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
  .lang-toggle { margin: 0.8rem 0 0; align-self: flex-start; }
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 600px at 80% -20%, #2a4aa8 0%, var(--navy) 45%, var(--navy-deep) 100%);
  color: #fff; padding: clamp(3rem, 7vw, 6rem) 0;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px; opacity: 0.5;
}
.hero .container { position: relative; z-index: 1; }
.hero-kicker { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.8rem; opacity: 0.8; margin-bottom: 0.5rem; }
.callsign {
  font-size: clamp(3.5rem, 14vw, 8rem); font-weight: 900; letter-spacing: -0.04em; line-height: 0.95; margin: 0 0 0.3em;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}
.callsign em { font-style: normal; color: var(--red); }
.hero-sub { font-size: clamp(1.1rem, 1rem + 0.8vw, 1.4rem); max-width: 40ch; opacity: 0.95; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.2rem 0 1.8rem; padding: 0; list-style: none; }
.chips li {
  background: var(--chip); border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.9rem; font-weight: 600;
}
.btn {
  display: inline-block; padding: 0.7rem 1.3rem; border-radius: 10px; font-weight: 700;
  border: 2px solid transparent; cursor: pointer; transition: transform 0.15s, filter 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.08); }
.btn-primary { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.btn-outline { background: var(--surface); color: var(--navy); border-color: var(--border); }
@media (prefers-color-scheme: dark) { .btn-outline { color: var(--text); } }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Hero de páginas interiores */
.page-hero { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.page-hero .callsign { font-size: clamp(2.6rem, 9vw, 5rem); }
.page-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.page-hero-grid img { border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); max-width: 260px; }
@media (max-width: 720px) { .page-hero-grid { grid-template-columns: 1fr; } .page-hero-grid img { max-width: 200px; } }

/* ---------- Tarjetas ---------- */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.5rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
a.card { color: inherit; }
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 32px rgba(16, 32, 80, 0.14); }
.card .badge {
  display: inline-block; align-self: flex-start; background: var(--navy); color: #fff;
  font-weight: 800; letter-spacing: 0.05em; padding: 0.25rem 0.7rem; border-radius: 8px; font-size: 0.95rem;
}
.card h3 { margin: 0.4rem 0 0; }
.card p { margin: 0; color: var(--muted); }
.card .card-link { margin-top: auto; padding-top: 0.6rem; font-weight: 700; color: var(--red); }
.card-icon { font-size: 2rem; line-height: 1; }

/* ---------- Galería QSL ---------- */
.qsl-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.qsl-grid figure { margin: 0; }
.qsl-grid img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px;
  box-shadow: var(--shadow); border: 1px solid var(--border); background: #fff;
}
.qsl-grid figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }

/* ---------- Blog ---------- */
.blog-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.blog-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; box-shadow: var(--shadow); }
.blog-list time { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.3rem; }
.blog-list a { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.blog-list p { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.95rem; }
.blog-status { color: var(--muted); font-style: italic; }
.media-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- Propagación ---------- */
.propagation { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; align-items: center; }
.propagation img { border-radius: 10px; box-shadow: var(--shadow); margin-inline: auto; }
@media (max-width: 760px) { .propagation { grid-template-columns: 1fr; } }

/* ---------- Contenido largo (bases) ---------- */
.prose { max-width: 75ch; }
.prose h2 { margin-top: 2.2rem; padding-top: 0.5rem; border-top: 3px solid var(--red); display: inline-block; }
.prose h3 { margin-top: 1.6rem; color: var(--navy); }
@media (prefers-color-scheme: dark) { .prose h3 { color: #a9c1ff; } }
.prose ol, .prose ul { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.5rem; }
.prose address { font-style: normal; background: var(--surface); border-left: 4px solid var(--navy); padding: 0.8rem 1.2rem; border-radius: 0 10px 10px 0; margin: 1rem 0; }
.callout { background: var(--red-soft); border: 1px solid rgba(214, 40, 40, 0.25); border-radius: 12px; padding: 1rem 1.2rem; margin: 1rem 0; }
.notice { background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; padding: 0.8rem 1.2rem; color: var(--muted); font-size: 0.95rem; }

.doc-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.doc-buttons .btn { display: inline-flex; align-items: center; gap: 0.5rem; }

/* Tablas */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { padding: 0.6rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--navy); color: #fff; font-weight: 700; position: sticky; top: 0; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.rank { color: var(--muted); width: 3rem; }
tr.me td { background: var(--red-soft); font-weight: 700; }

/* Lista de diplomas otorgados */
.awarded { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.awarded li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 1rem; display: flex; gap: 0.6rem; align-items: center; }
.awarded .n { font-weight: 800; color: var(--red); min-width: 2.4rem; }

/* Dos columnas página interior */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 2.5rem; align-items: start; }
.two-col aside { position: sticky; top: calc(var(--header-h) + 1rem); }
.aside-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.aside-box h3 { margin-top: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.aside-box ul { padding-left: 1.1rem; margin: 0; }
.aside-box li { margin-bottom: 0.35rem; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .two-col aside { position: static; } }

/* ---------- Pie ---------- */
.site-footer { background: var(--navy-deep); color: rgba(255, 255, 255, 0.85); padding: 3rem 0 2rem; margin-top: 2rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h3 { color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.8rem; }
.site-footer a { color: #fff; }
.site-footer address { font-style: normal; line-height: 1.7; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 2rem; padding-top: 1.2rem; font-size: 0.85rem; opacity: 0.75; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.9rem; opacity: 0.85; margin-bottom: 0.8rem; }
.breadcrumb a { color: #fff; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .card { transition: none; } }
