/* =========================================================
   InfoDGT — hoja de estilos base (placeholder de marca)
   Sin frameworks. Ligera, accesible, claro/oscuro automático.
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --bg-card: #ffffff;
  --text: #16202c;
  --text-soft: #4a5a6a;
  --border: #e3e8ee;
  --brand: #0b6bcb;
  --brand-strong: #084e95;
  --brand-soft: #e7f1fc;
  --accent: #12a150;
  --warning-bg: #fff4e0;
  --warning-border: #f0c063;
  --shadow: 0 1px 2px rgba(16, 32, 44, .06), 0 8px 24px rgba(16, 32, 44, .06);
  --radius: 14px;
  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141b;
    --bg-soft: #141c26;
    --bg-card: #161f2b;
    --text: #e8eef5;
    --text-soft: #a3b1c2;
    --border: #26313f;
    --brand: #4ea3f0;
    --brand-strong: #7cc0ff;
    --brand-soft: #16283b;
    --accent: #46c987;
    --warning-bg: #2c2416;
    --warning-border: #6b5525;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

/* Accesibilidad: foco visible para navegación por teclado */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .62rem; letter-spacing: -.01em;
}
.nav { display: flex; gap: 22px; }
.nav a { color: var(--text-soft); font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--brand); text-decoration: none; }
@media (max-width: 640px) { .nav { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 48px; text-align: center; background: radial-gradient(1200px 400px at 50% -50%, var(--brand-soft), transparent); }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; margin: 0 0 16px; letter-spacing: -.02em; }
.hero p { font-size: 1.15rem; color: var(--text-soft); max-width: 620px; margin: 0 auto 28px; }

/* ---------- Search box (decorativo por ahora) ---------- */
.searchbar {
  display: flex; max-width: 520px; margin: 0 auto; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 6px 6px 20px;
  box-shadow: var(--shadow);
}
.searchbar input { flex: 1; border: 0; background: transparent; color: var(--text); font-size: 1rem; outline: none; }
.searchbar button {
  border: 0; background: var(--brand); color: #fff; font-weight: 600;
  padding: 10px 22px; border-radius: 999px; cursor: pointer; font-size: .95rem;
}
.searchbar button:hover { background: var(--brand-strong); }

/* ---------- Section ---------- */
.section { padding: 56px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: 1.9rem; margin: 0 0 8px; letter-spacing: -.01em; }
.section-head p { color: var(--text-soft); margin: 0; }

/* ---------- Grid de guías ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); text-decoration: none; }
.card .tag { font-size: .78rem; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.card h3 { margin: 0 0 8px; font-size: 1.18rem; color: var(--text); }
.card p { margin: 0; color: var(--text-soft); font-size: .95rem; }
.card .read { margin-top: 16px; font-weight: 600; color: var(--brand); font-size: .92rem; }
.card-soon { opacity: .62; cursor: default; }
.card-soon:hover { transform: none; box-shadow: none; border-color: var(--border); }
.card-soon .read { color: var(--text-soft); }

/* ---------- Article ---------- */
.article { padding: 40px 0 64px; }
.article-wrap { max-width: 760px; margin: 0 auto; }
.breadcrumb { font-size: .88rem; color: var(--text-soft); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-soft); }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
.article .meta { color: var(--text-soft); font-size: .9rem; margin-bottom: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
.article h2 { font-size: 1.5rem; margin: 40px 0 12px; letter-spacing: -.01em; }
.article h3 { font-size: 1.2rem; margin: 28px 0 8px; }
.article p, .article li { font-size: 1.06rem; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: 8px; }

.callout {
  background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  border-radius: var(--radius); padding: 18px 22px; margin: 28px 0;
}
.callout strong { color: var(--brand-strong); }
.note-warning { background: var(--warning-bg); border-color: var(--warning-border); }

.toc {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin: 0 0 36px;
}
.toc strong { display: block; margin-bottom: 10px; font-size: .95rem; }
.toc ol { margin: 0; padding-left: 20px; }
.toc a { color: var(--text-soft); }

.faq { margin-top: 40px; }
.faq details {
  border: 1px solid var(--border); border-radius: 12px; padding: 4px 18px; margin-bottom: 12px; background: var(--bg-card);
}
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--brand); font-weight: 700; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq p { padding: 12px 0; margin: 0; }

/* ---------- Contenido relacionado (interlinking) ---------- */
.related { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--border); }
.related h2 { margin: 0 0 14px; font-size: 1.35rem; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin-bottom: 12px; padding-left: 22px; position: relative; }
.related li::before { content: "→"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.related a { font-weight: 600; }

/* ---------- Autor / firma (E-E-A-T) ---------- */
.article .meta a { color: var(--brand); font-weight: 600; }
.author-box {
  max-width: 760px; margin: 48px auto 0; display: flex; gap: 18px; align-items: flex-start;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px;
}
.author-box .avatar {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
}
.author-box .who { margin: 0; }
.author-box .who strong { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.author-box .role { color: var(--text-soft); font-size: .85rem; margin: 0 0 8px; }
.author-box p { margin: 0; color: var(--text-soft); font-size: .95rem; }
.author-box .who a { color: var(--brand); font-weight: 600; }

/* ---------- Fuentes oficiales (verificabilidad / E-E-A-T) ---------- */
.sources { margin-top: 40px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; font-size: .95rem; }
.sources h2 { font-size: 1.05rem; margin: 0 0 10px; }
.sources ul { margin: 0; padding-left: 20px; }
.sources li { margin-bottom: 6px; color: var(--text-soft); }
.sources .checked { color: var(--accent); font-weight: 600; }

/* ---------- CTA ---------- */
.cta {
  margin: 48px 0; text-align: center; background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff; border-radius: var(--radius); padding: 40px 28px;
}
.cta h2 { color: #fff; margin: 0 0 10px; }
.cta p { color: rgba(255, 255, 255, .9); margin: 0 0 22px; }
.btn {
  display: inline-block; background: #fff; color: var(--brand-strong); font-weight: 700;
  padding: 13px 28px; border-radius: 999px; font-size: 1rem;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 40px 0; margin-top: 40px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.site-footer .col h4 { margin: 0 0 12px; font-size: .95rem; }
.site-footer .col a { display: block; color: var(--text-soft); font-size: .92rem; margin-bottom: 7px; }
.site-footer .legal { width: 100%; border-top: 1px solid var(--border); padding-top: 20px; color: var(--text-soft); font-size: .85rem; }

/* ---------- Utils ---------- */
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 12px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
