/* Argalladas · diseño «Gacetilla»: periódico de toda la vida, letra grande y muy legible */
:root {
  --bg: #ffffff; --surface: #f3f1ee; --fg: #16181d; --muted: #555b66;
  --accent: #a50044; --accent-fg: #ffffff; --line: #16181d; --soft: rgba(22,24,29,.18);
  --l1: 62%; --l2: 48%;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --head: "Bitter", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218; --surface: #181d27; --fg: #f1f2f5; --muted: #a2a9b8;
    --accent: #ff7aa5; --accent-fg: #1a0610; --line: #e6e8ee; --soft: rgba(230,232,238,.22);
    --l1: 34%; --l2: 22%; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1218; --surface: #181d27; --fg: #f1f2f5; --muted: #a2a9b8;
  --accent: #ff7aa5; --accent-fg: #1a0610; --line: #e6e8ee; --soft: rgba(230,232,238,.22);
  --l1: 34%; --l2: 22%; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 18px/1.55 var(--body);
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-fg); padding: 8px 14px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 14px max(16px, env(safe-area-inset-left, 0px)) 24px max(16px, env(safe-area-inset-right, 0px)); }

/* cabecera */
.mast {
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px;
  padding: 10px max(12px, env(safe-area-inset-left, 0px)) 8px; border-bottom: 3px double var(--line);
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}
.mast-title { text-align: center; }
.logo { font: 800 clamp(28px, 7vw, 40px)/1 var(--head); letter-spacing: -.02em; text-decoration: none; }
.date { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .1em; }
.mast-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--fg); border-radius: 50%; cursor: pointer; }
.mast-btn:hover { background: var(--surface); }

/* navegación de escritorio */
.topnav { display: none; justify-content: center; flex-wrap: wrap; gap: 4px 6px; padding: 8px 12px; border-bottom: 1px solid var(--soft); }
.topnav a { text-decoration: none; padding: 6px 12px; font-weight: 700; font-size: 16px; border-radius: 4px; }
.topnav a:hover { background: var(--surface); }
.topnav a[aria-current="page"] { background: var(--accent); color: var(--accent-fg); }

/* barra inferior (móvil) */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10; display: flex; background: var(--bg);
  border-top: 3px double var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 2px 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tabbar a[aria-current="page"] { background: var(--accent); color: var(--accent-fg); }

/* etiquetas y rótulos */
.sec { display: block; font: 800 15px/1.2 var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0; }
.sec a { text-decoration: none; }
.sec.rule { border-bottom: 2px solid var(--line); padding-bottom: 4px; margin: 26px 0 12px; }
.sec.big { font-size: 22px; }
.tag { font: 800 12px/1 var(--head); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.meta { font-size: 14px; color: var(--muted); }
.count { margin: -4px 0 14px; }
.lede { font-size: 20px; }

/* miniaturas */
.th {
  position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 4px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 52% var(--l1)), hsl(calc(var(--h) + 18) 46% var(--l2)));
}
.th svg { width: 46%; height: 46%; opacity: .55; stroke-width: 1.5; }
.th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* destacado */
.lead { margin: 6px 0 4px; }
.lead > a { display: flex; flex-direction: column; gap: 8px; text-decoration: none; }
.lead-th { aspect-ratio: 16 / 9; width: 100%; }
.lead h2 { font: 800 clamp(26px, 6.2vw, 36px)/1.12 var(--head); margin: 0; text-wrap: balance; }
.lead p { margin: 0; font-size: 19px; line-height: 1.45; }
.lead > a:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* filas */
.items { display: flex; flex-direction: column; }
.item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--soft); text-decoration: none; }
.item .th { flex: none; width: 84px; height: 84px; }
.item-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item h3 { font: 700 19px/1.2 var(--head); margin: 0; overflow-wrap: anywhere; }
.item:hover h3 { text-decoration: underline; text-underline-offset: 3px; }

/* paginación */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 22px 0 0; }
.pager a, .search button, .pn a {
  display: inline-block; padding: 10px 16px; border: 2px solid var(--line); border-radius: 4px; text-decoration: none; font-weight: 700; background: var(--bg); color: var(--fg);
}
.pager a:hover, .search button:hover, .pn a:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

/* artículo */
.post header { margin-bottom: 12px; }
.post h1 { font: 800 clamp(30px, 7vw, 44px)/1.1 var(--head); margin: 6px 0 8px; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; }
.cover { display: block; width: 100%; height: auto; aspect-ratio: 7 / 3; object-fit: cover; border-radius: 4px; margin: 6px 0 14px; }
.prose { font-size: 19px; line-height: 1.65; overflow-wrap: break-word; }
.prose h2, .prose h3, .prose h4 { font-family: var(--head); line-height: 1.2; margin: 1.5em 0 .4em; }
.prose h2 { font-size: 1.5em; } .prose h3 { font-size: 1.25em; } .prose h4 { font-size: 1.1em; }
.prose p { margin: .8em 0; }
.prose img, .prose iframe, .prose video { max-width: 100%; height: auto; border-radius: 4px; }
.prose iframe.video { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; } .prose li { margin: .25em 0; }
.prose blockquote { margin: 1em 0; padding: .1em 1em; border-left: 4px solid var(--accent); background: var(--surface); }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.prose td, .prose th { border: 1px solid var(--soft); padding: 6px 10px; }
.prose pre { overflow-x: auto; background: var(--surface); padding: 12px; border-radius: 4px; }
.prose object, .prose embed { max-width: 100%; }
.notice { background: var(--surface); border-left: 4px solid var(--accent); padding: 10px 14px; margin: 0 0 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.chips a { text-decoration: none; padding: 5px 12px; border: 1px solid var(--soft); border-radius: 99px; background: var(--surface); font-size: 15px; font-weight: 700; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.chips small { color: var(--muted); font-weight: 400; }

.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 26px 0 0; }
.pn a { display: flex; flex-direction: column; gap: 2px; text-align: left; font-family: var(--head); line-height: 1.25; }
.pn a[rel="prev"] { text-align: right; }
.pn .meta { font-family: var(--body); font-weight: 400; }
.pn a:hover .meta { color: inherit; }

/* buscador */
.search { display: flex; gap: 8px; margin: 10px 0 8px; }
.search input { flex: 1; min-width: 0; font: inherit; padding: 10px 14px; border: 2px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--fg); }

/* archivo */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 92px; padding: 14px; border-radius: 4px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 52% var(--l1)), hsl(calc(var(--h) + 18) 46% var(--l2)));
}
.tile svg { width: 28px; height: 28px; }
.tile b { font: 800 17px/1.2 var(--head); }
.months h3 { font: 800 18px var(--head); margin: 14px 0 0; }
.months .chips { margin: 6px 0; }

/* galería */
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }

.foot { color: var(--muted); font-size: 14px; text-align: center; border-top: 3px double var(--line); margin-top: 28px; }
.foot p { margin: 4px 0; }

@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .item .th { width: 120px; height: 90px; }
  .item h3 { font-size: 21px; }
}
@media print { .tabbar, .topnav, .mast-btn, .pager, .pn, .skip { display: none !important; } body { padding: 0; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* galería del post y visor */
.gallery .cap { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
.gallery li { min-width: 0; }
.gallery a { display: block; }
dialog.lb { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; color: #fff; }
dialog.lb::backdrop { background: rgba(0, 0, 0, .88); }
.lb-inner { height: 100%; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 12px; gap: 8px; }
.lb-inner img { max-width: 100%; max-height: calc(100dvh - 110px); object-fit: contain; border-radius: 4px; }
.lb-cap { text-align: center; min-height: 1.4em; font-size: 16px; }
.lb button { position: absolute; background: rgba(0, 0, 0, .55); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 26px; cursor: pointer; }
.lb .lb-x { top: 12px; right: 12px; } .lb .lb-p { left: 8px; top: 50%; } .lb .lb-n { right: 8px; top: 50%; }
