/* Portal domingogallegos.com — propio, basado en el estilo del sitio del curso */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1d2230;
  --muted: #5b6272;
  --line: #e3e0d8;
  --blue: #1a1a1a;          /* acento oscuro (títulos, dibujos) */
  --orange: #b4530a;        /* enlaces y acentos sobre fondo claro */
  --bar: #111111;           /* encabezado y pie */
  --bar-ink: #f2efe9;
  --bar-muted: #a8a49c;
  --bar-accent: #f28c28;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171f;
    --surface: #1c2029;
    --ink: #e7e9ee;
    --muted: #a3a9b6;
    --line: #2e3442;
    --blue: #ece8e1;
    --orange: #f0a060;
    --bar: #050505;
    --bar-ink: #f2efe9;
    --bar-muted: #9a968e;
    --bar-accent: #f28c28;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: 18px; line-height: 1.6;
  overflow-wrap: break-word;
}
a { color: var(--orange); }
a:hover { color: var(--ink); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

header.site { background: var(--bar); border-bottom: 4px solid var(--bar-accent); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; padding-top: 14px; padding-bottom: 12px; }
header.site .brand { font-weight: 700; font-size: 1.2rem; color: var(--bar-ink); text-decoration: none; letter-spacing: 0.01em; }
header.site .brand:hover { color: var(--bar-accent); }
header.site nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--sans); font-size: 0.9rem; }
header.site nav a { text-decoration: none; color: var(--bar-muted); }
header.site nav a:hover, header.site nav a[aria-current] { color: var(--bar-accent); }

main { padding: 28px 0 40px; }
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 6px; color: var(--ink); font-weight: 700; }
h2 { font-size: 1.3rem; margin: 36px 0 12px; font-weight: 600; border-bottom: 2px solid var(--orange); display: inline-block; padding-bottom: 2px; }
h3 { font-size: 1.05rem; margin: 0 0 4px; }
.kicker { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); margin: 0 0 6px; }
.kicker a { color: inherit; text-decoration: none; }
.lead { font-size: 1.1rem; }
.muted { color: var(--muted); }
.status { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); margin: 0 0 18px; }
.soon { color: var(--muted); font-style: italic; }

ul.lines { padding-left: 1.2em; }
ul.lines li { margin: 0.4em 0; }
ul.lines a { text-decoration: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
a.card:hover { border-color: var(--orange); color: var(--ink); }
.card h3 { color: var(--ink); }
.card p { margin: 0; font-size: 0.95rem; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); font-weight: 600; }
tbody th { font-weight: 600; }
tbody th a { text-decoration: none; }

footer.site { background: var(--bar); border-top: 4px solid var(--bar-accent); padding: 22px 0 30px; font-family: var(--sans); font-size: 0.82rem; color: var(--bar-muted); }
footer.site a { color: var(--bar-accent); }
footer.site a:hover { color: var(--bar-ink); }
footer.site p { margin: 4px 0; }

@media (max-width: 600px) {
  body { font-size: 17px; }
  h1 { font-size: 1.7rem; }
  /* Tabla de tesis: una tarjeta por línea */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.stack th, table.stack td { border: 0; padding: 2px 0; }
  table.stack td::before { content: attr(data-nivel) ": "; font-style: normal; color: var(--ink); font-family: var(--sans); font-size: 0.85rem; }
}

/* Bloques visuales (tarjetas con ilustración, filas) */
.hero { padding: 8px 0 4px; }
.hero h1 { font-size: 2.3rem; }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 14px; margin-top: 16px; }
.tiles > .tile { flex: 0 0 100%; }
@media (min-width: 700px) {
  .tiles.t221 > .tile { flex-basis: calc((100% - 14px) / 2); }
  .tiles.t32 > .tile { flex-basis: calc((100% - 28px) / 3); flex-direction: column; }
  .tiles.t32 .ilu { width: 120px; }
}
.tile { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 6px; padding: 14px; text-decoration: none; color: var(--ink); }
a.tile:hover { border-color: var(--orange); color: var(--ink); }
.ilu { flex: none; width: 96px; color: var(--blue); }
.ilu svg { width: 100%; height: auto; display: block; }
.tbody { min-width: 0; }
.tile h3 { color: var(--ink); font-size: 1.02rem; line-height: 1.3; }
.tile p { margin: 0 0 6px; font-size: 0.93rem; color: var(--muted); line-height: 1.45; }
.more { font-family: var(--sans); font-size: 0.82rem; color: var(--orange); }
.linehead { display: flex; gap: 18px; align-items: center; }
.linehead .ilu { width: 140px; }

ul.rows { list-style: none; padding: 0; margin: 8px 0; border-top: 1px solid var(--line); }
ul.rows li { border-bottom: 1px solid var(--line); }
ul.rows a, ul.rows.plain li { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; padding: 10px 2px; text-decoration: none; color: var(--ink); }
ul.rows a b { color: var(--orange); }
ul.rows a:hover b { color: var(--ink); }
ul.rows b { min-width: 11em; }
ul.rows span { color: var(--muted); font-size: 0.93rem; }
ol.steps { padding-left: 1.4em; }
ol.steps li { margin: 0.3em 0; }

.fcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 24px; }
.fname { font-weight: 600; color: var(--bar-ink); }
ul.flinks { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
footer.site .disc { margin-top: 14px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.9rem; }
  .ilu { width: 72px; }
  .linehead { flex-direction: column; align-items: flex-start; gap: 6px; }
  .linehead .ilu { width: 120px; }
}

/* Encabezado de la página de inicio */
.aff { font-family: var(--sans); color: var(--muted); margin: 4px 0 14px; line-height: 1.45;
       font-size: clamp(12px, 3.55vw, 15.5px); }
.aff span { display: block; white-space: nowrap; }
.tagline { font-style: italic; color: var(--orange); font-size: clamp(14px, 4.1vw, 19px); margin: 0 0 8px; padding-left: 12px; border-left: 2px solid var(--orange); }
h3.lh { margin: 16px 0 2px; font-size: 1rem; }
h3.lh a { color: var(--ink); text-decoration: none; }
h3.lh a:hover { color: var(--orange); }
.grp { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 0; display: block; margin: 28px 0 0; font-weight: 600; }
ul.invite { list-style: none; padding: 0; margin: 16px 0; }
ul.invite li { position: relative; padding: 10px 0 10px 18px; border-bottom: 1px solid var(--line); }
ul.invite li::before { content: ""; position: absolute; left: 0; top: 1.15em; width: 7px; height: 7px; background: var(--orange); border-radius: 50%; }
ul.invite li:first-child { font-size: 1.12rem; font-weight: 600; }
/* «En el horizonte»: línea en desarrollo, borde punteado */
.tiles.solo { margin-top: 28px; }
.tiles.solo > .tile, a.tile[href$="en-el-horizonte/"] { border-style: dashed; border-left-style: solid; }

/* Investigación: índice editorial */
section.grupo { margin-top: 30px; }
section.grupo > h2 { margin-bottom: 4px; }
.gintro { color: var(--muted); margin: 6px 0 10px; max-width: 46em; }
ol.idx { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
ol.idx li.row { display: grid; grid-template-columns: 2.2em 160px 1fr; gap: 0 20px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--line); }
ol.idx .n { font-family: var(--sans); font-weight: 700; font-size: 1.5rem; line-height: 1; color: var(--orange); padding-top: 4px; }
ol.idx .ilu { width: 160px; color: var(--blue); }
.rbody { min-width: 0; }
.rbody h3 { font-size: 1.12rem; margin: 0 0 4px; }
.rbody h3 a { color: var(--ink); text-decoration: none; }
.rbody h3 a:hover { color: var(--orange); }
.rbody p { margin: 0 0 8px; }
.rlinks { font-family: var(--sans); font-size: 0.85rem; }
.rlinks a { text-decoration: none; }
.cons { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.cons span { font-weight: 600; margin-right: 2px; }
.cons a { color: var(--muted); }
.cons a:hover { color: var(--orange); }
section.horizonte ol.idx { border: 1px dashed var(--muted); border-left: 4px solid var(--orange); border-radius: 6px; padding: 0 16px; margin-top: 12px; background: var(--surface); }
section.horizonte ol.idx li.row { border-bottom: 0; }
@media (max-width: 640px) {
  ol.idx li.row { grid-template-columns: 2em 1fr; }
  ol.idx .ilu { grid-column: 2; width: 140px; margin-bottom: 8px; }
  ol.idx .rbody { grid-column: 2; }
}
.rep { font-size: 0.93rem; }
.rep .rl { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-right: 4px; }
.rep .ri { display: block; margin-top: 2px; }
.rep .nota { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); margin-left: 4px; }
ul.pubs { list-style: none; padding: 0; margin: 4px 0 12px; }
ul.pubs li { padding: 3px 0 3px 14px; position: relative; }
ul.pubs li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 6px; height: 1px; background: var(--orange); }
ul.pubs .ref { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
ul.pubs .nota { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }
