/* =====================================================================
   Sistema visual del portal
   Fraunces (titulares) + Hanken Grotesk (texto/UI)
   Tema ÚNICO oscuro. Marca: verde petróleo claro. CTA: ocre (presupuesto).
   El nombre del sitio y demás datos están en src/Config/Site.php
   ===================================================================== */

:root {
  --paper:      #15160f;   /* fondo */
  --surface:    #1d1f17;   /* tarjetas */
  --surface-2:  #262820;   /* zonas hundidas / thead */
  --ink:        #ece9df;   /* texto principal */
  --muted:      #a5a294;   /* texto secundario */
  --faint:      #33352b;   /* bordes / divisores */
  --brand:      #57b8ac;   /* marca (relleno de botones y chips) */
  --brand-ink:  #7fd0c4;   /* marca como texto/enlace */
  --brand-tint: #16302c;   /* fondos suaves de marca */
  --on-brand:   #0c1c1a;   /* texto sobre relleno --brand */
  --cta:        #ef6a3e;   /* solo "pedir presupuesto" */
  --cta-hover:  #f4835e;
  --on-cta:     #1a0f0a;   /* texto sobre --cta */
  --ok:         #5bd07f;
  --ok-tint:    #17301f;
  --warn:       #f0b45c;
  --warn-tint:  #33260f;

  --measure: 40rem;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --ui: "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 1.05rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.page { max-width: 68rem; margin: 0 auto; padding: 0 1.5rem; }
@media (max-width: 40rem) { .page { padding: 0 1.15rem; } }

/* ---------- top bar (fija al hacer scroll) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  max-width: 68rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--faint);
  box-shadow: 0 10px 24px -20px rgba(0, 0, 0, 0.9);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.brand .mark, .auth-brand .mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--brand);
  color: var(--on-brand);
  display: grid; place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.nav {
  display: flex;
  gap: 1.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  overflow-x: auto;
}
.nav a { text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 0.9rem; font-size: 0.85rem; }
.topbar-right a { color: var(--brand-ink); text-decoration: none; }
.topbar-user { color: var(--muted); }
.btn-quote {
  font-family: var(--ui);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--cta);
  color: var(--on-cta);
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-quote:hover { background: var(--cta-hover); }

.topbar-search { flex: 0 1 13rem; min-width: 0; margin: 0; }
.topbar-search input {
  width: 100%;
  font-family: var(--ui); font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--faint); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.topbar-search input::placeholder { color: var(--muted); }
.topbar-search input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

@media (max-width: 52rem) {
  .topbar { flex-wrap: wrap; }
  .nav { display: none; }
  .topbar-search { order: 3; flex: 1 1 100%; margin-top: 0.5rem; }
}

/* ---------- notification bell ---------- */
.notif-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; font-size: 1.1rem; line-height: 1;
  cursor: pointer; border-radius: 50%; user-select: none;
}
.notif-bell:hover { background: var(--surface-2); }
.notif-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--cta); color: var(--on-cta);
  font-family: var(--ui); font-size: 0.62rem; font-weight: 700;
  min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.notif-bell--shake { animation: notif-shake 0.4s ease; }
@keyframes notif-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}

/* ---------- botón "volver arriba" ---------- */
.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 60;
  width: 2.9rem; height: 2.9rem;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--brand); color: var(--on-brand);
  cursor: pointer;
  box-shadow: 0 8px 22px -6px rgba(0, 0, 0, 0.6);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { filter: brightness(1.12); }
.to-top:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .to-top { transition: opacity 0.15s linear; }
}

/* ---------- covers (foto de portada o degradado) ---------- */
.cover-link { display: block; text-decoration: none; }
.cover {
  display: block;              /* es un <span>: sin esto, aspect-ratio no aplica */
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--brand) 0%, #14615c 55%, #1c7a6f 100%);
  overflow: hidden;
  border-radius: 10px;
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.c-2 { background: linear-gradient(135deg, #3a3f52 0%, #4a5168 60%, #5b6486 100%); }
.cover.c-3 { background: linear-gradient(135deg, #7a5a2e 0%, #936d38 55%, #a97f45 100%); }
.cover.c-4 { background: linear-gradient(135deg, #1f5f7a 0%, #256f8c 55%, #2f83a3 100%); }
.cover.c-5 { background: linear-gradient(135deg, #5a3f6e 0%, #6d4d84 55%, #82609c 100%); }
.cover::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(120% 120% at 80% 20%, #000 30%, transparent 75%);
  mask-image: radial-gradient(120% 120% at 80% 20%, #000 30%, transparent 75%);
}
.cover.has-photo::after { display: none; }
.cover .cat {
  position: absolute;
  left: 0.85rem; bottom: 0.85rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.30);
  backdrop-filter: blur(4px);
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
}

/* ---------- flashes ---------- */
.flash-error {
  background: color-mix(in srgb, #e0563a 15%, var(--surface));
  border: 1px solid color-mix(in srgb, #e0563a 35%, var(--surface));
  color: color-mix(in srgb, #ff8a66 70%, var(--ink));
  padding: 0.85rem 1rem; border-radius: 10px; font-size: 0.9rem; margin: 1.5rem 0;
}

/* ---------- index ---------- */
.index-main { padding: 2.5rem 0 4rem; }
.eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--brand-ink); margin: 0 0 0.9rem;
}
.page-h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.9rem, 4.5vw, 2.7rem); line-height: 1.08;
  letter-spacing: -0.02em; text-wrap: balance; margin: 0 0 2rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2rem;
  align-items: center;
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--faint);
}
.hero a.cover-link { display: block; text-decoration: none; }
.hero h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem); line-height: 1.1;
  letter-spacing: -0.02em; text-wrap: balance; margin: 0.3rem 0 0.7rem;
}
.hero h2 a { text-decoration: none; }
.hero h2 a:hover { color: var(--brand-ink); }
.hero .excerpt { color: var(--muted); margin: 0 0 1.1rem; }
.hero .meta { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
@media (max-width: 46rem) { .hero { grid-template-columns: 1fr; gap: 1.2rem; } }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.chip {
  font-size: 0.82rem; font-weight: 600;
  padding: 0.4rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--faint); color: var(--muted);
  background: var(--surface); text-decoration: none;
}
.chip:hover { color: var(--ink); }
.chip.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 1.5rem; }
@media (max-width: 46rem) { .grid { grid-template-columns: 1fr; } }

.card { display: flex; flex-direction: column; }
.card .cover { margin-bottom: 0.85rem; }
.card h3 {
  font-family: var(--display); font-weight: 600;
  font-size: 1.22rem; line-height: 1.2; letter-spacing: -0.01em;
  text-wrap: balance; margin: 0 0 0.4rem;
}
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--brand-ink); }
.card .excerpt { color: var(--muted); font-size: 0.92rem; margin: 0 0 0.7rem; }
.card .meta {
  margin-top: auto; font-size: 0.78rem; color: var(--muted); font-weight: 500;
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
}
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.read-pill {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.12rem 0.4rem; border-radius: 4px;
}
.read-pill.is-read { background: var(--ok-tint); color: var(--ok); }
.read-pill.is-unread { background: var(--warn-tint); color: var(--warn); }

.empty {
  text-align: center; color: var(--muted);
  padding: 3.5rem 1.5rem; background: var(--surface);
  border: 1px solid var(--faint); border-radius: 14px;
}

/* ---------- article ---------- */
.article { padding-bottom: 3rem; }
.article-head {
  max-width: var(--measure); margin: 0 auto;
  padding: 2.75rem 1.5rem 1.75rem; text-align: center;
}
.breadcrumb { font-size: 0.78rem; color: var(--muted); font-weight: 500; margin-bottom: 1rem; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb b { color: var(--brand-ink); font-weight: 600; }
.article-head h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.06;
  letter-spacing: -0.025em; text-wrap: balance; margin: 0 0 1.1rem;
}
.byline {
  display: flex; align-items: center; justify-content: center;
  gap: 0.6rem; font-size: 0.85rem; color: var(--muted); font-weight: 500;
  flex-wrap: wrap;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-tint); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}
.article-cover { max-width: 56rem; margin: 0.5rem auto 2.5rem; padding: 0 1.5rem; }
.article-cover .cover { aspect-ratio: 21 / 9; border-radius: 14px; }

.prose {
  max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem;
  font-size: 1.16rem; line-height: 1.75;
}
.prose > p:first-of-type::first-letter {
  font-family: var(--display); float: left;
  font-size: 3.4rem; line-height: 0.82;
  padding: 0.1rem 0.6rem 0 0; color: var(--brand-ink);
}
.prose p { margin: 1.35rem 0; }
.prose h2 {
  font-family: var(--display); font-weight: 600;
  font-size: 1.7rem; letter-spacing: -0.015em;
  margin: 2.8rem 0 0.6rem; text-wrap: balance;
}
.prose strong { font-weight: 600; }

.cta-card {
  max-width: var(--measure); margin: 2.5rem auto;
  padding: 1.6rem 1.75rem;
  background: var(--brand-tint);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
}
.cta-card .t {
  font-family: var(--display); font-weight: 600; font-size: 1.22rem;
  line-height: 1.2; margin: 0 0 0.2rem; color: var(--brand-ink);
}
.cta-card .d { font-size: 0.92rem; color: var(--muted); margin: 0; }
.cta-card.cta-inline { margin: 2.2rem 0; max-width: none; }
.cta-inline .t { font-size: 1.1rem; }
@media (max-width: 40rem) {
  .cta-card { flex-direction: column; align-items: flex-start; }
  .prose, .article-head, .article-cover { padding-left: 1.15rem; padding-right: 1.15rem; }
}

.band { max-width: var(--measure); margin: 3.5rem auto 0; padding: 0 1.5rem; }
@media (max-width: 40rem) { .band { padding: 0 1.15rem; } }
.author-card {
  display: flex; gap: 1rem; padding: 1.4rem;
  background: var(--surface-2); border-radius: 14px;
}
.author-card .avatar { width: 46px; height: 46px; font-size: 1rem; }
.author-card .n { font-weight: 700; }
.author-card .b { font-size: 0.9rem; color: var(--muted); margin: 0.2rem 0 0; }

.section-h {
  font-family: var(--display); font-weight: 600;
  font-size: 1.4rem; margin: 3.5rem 0 1.25rem;
}
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 46rem) { .related { grid-template-columns: 1fr; } }
.related .card h3 { font-size: 1.02rem; }

/* ---------- comments ---------- */
.comments { max-width: var(--measure); margin: 3.5rem auto 0; padding: 0 1.5rem; }
@media (max-width: 40rem) { .comments { padding: 0 1.15rem; } }
.comments-empty { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }
.comment { margin-bottom: 1.1rem; font-size: 0.95rem; border-radius: 8px; scroll-margin-top: 5rem; }
.comment-replies {
  margin: 0.85rem 0 0 0.75rem; padding-left: 1rem;
  border-left: 2px solid var(--faint);
}
.comment-replies .comment:last-child { margin-bottom: 0; }
.comment--flash { animation: commentFlash 2.2s ease-out; }
@keyframes commentFlash {
  0%, 20% { background: var(--warn-tint); box-shadow: 0 0 0 6px var(--warn-tint); }
  100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
.comment-head {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.2rem;
}
.comment-author { font-weight: 700; }
.comment-team {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--brand); color: var(--on-brand); padding: 0.1rem 0.4rem; border-radius: 4px;
}
.comment-date { color: var(--muted); font-size: 0.76rem; }
.comment-mod { display: inline; margin: 0; }
.comment-mod button {
  background: none; border: none; color: var(--cta); cursor: pointer;
  font-size: 0.76rem; text-decoration: underline; padding: 0; font-family: var(--ui);
}
.comment-body { color: var(--ink); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.comment-reply-toggle {
  background: none; border: none; color: var(--brand-ink); cursor: pointer;
  font-size: 0.8rem; padding: 0.15rem 0; margin-top: 0.15rem; font-family: var(--ui);
}
.comment-form { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.comment-form[hidden] { display: none; }
.comment-form--reply { margin: 0.7rem 0; }
.comment-form textarea {
  width: 100%; min-height: 80px; padding: 0.7rem 0.85rem;
  border: 1px solid var(--faint); border-radius: 10px;
  font-family: var(--ui); font-size: 0.95rem; resize: vertical;
  background: var(--surface); color: var(--ink);
}
.comment-form textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.comment-form button {
  align-self: flex-start; font-family: var(--ui); font-weight: 600; font-size: 0.88rem;
  background: var(--brand); color: var(--on-brand); border: none; border-radius: 8px;
  padding: 0.55rem 1.1rem; cursor: pointer;
}
.comment-login-hint {
  background: var(--surface-2); border: 1px solid var(--faint); border-radius: 10px;
  padding: 0.9rem 1.1rem; font-size: 0.9rem; color: var(--muted); margin-top: 1rem;
}
.comment-login-hint a { color: var(--brand-ink); font-weight: 600; }

/* ---------- footer / 404 ---------- */
.site-foot {
  max-width: 68rem; margin: 4rem auto 3rem; padding: 1.4rem 1.5rem 0;
  border-top: 1px solid var(--faint);
  font-size: 0.8rem; color: var(--muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
/* ---------- contacto ---------- */
.contact-main { padding: 2.5rem 0 4rem; }
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: start;
}
.contact-intro .page-h1 { margin: 0.4rem 0 0.9rem; }
.contact-intro p { max-width: 30rem; }
@media (max-width: 46rem) {
  .contact-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}

.notfound { max-width: 34rem; margin: 5rem auto; padding: 0 1.5rem; text-align: center; }
.notfound h1 {
  font-family: var(--display); font-weight: 600; font-size: 2.4rem;
  letter-spacing: -0.02em; margin: 0 0 0.75rem;
}
.notfound p { color: var(--muted); margin: 0 0 1.5rem; }

/* ---------- auth (login / registro) ---------- */
.auth {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem; padding: 2.5rem 1.25rem;
}
.auth-brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--display); font-weight: 600; font-size: 1.2rem;
  letter-spacing: -0.01em; text-decoration: none; color: var(--ink);
}
.auth-card {
  width: 100%; max-width: 24rem;
  background: var(--surface);
  border: 1px solid var(--faint);
  border-radius: 16px; padding: 2rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 18px 50px -18px rgba(20,20,16,0.16);
}
.auth-card h1 {
  font-family: var(--display); font-weight: 600; font-size: 1.7rem;
  letter-spacing: -0.02em; margin: 0 0 0.3rem; text-align: center;
}
.auth-card .lead {
  text-align: center; color: var(--muted); font-size: 0.92rem; margin: 0 0 1.5rem;
}
.auth-card.auth-msg { text-align: center; }
.auth-icon { font-size: 2.25rem; line-height: 1; margin-bottom: 0.75rem; }
.auth-card p.msg { color: var(--muted); font-size: 0.95rem; line-height: 1.6; margin: 0 auto; max-width: 22rem; }
.btn-auth--inline {
  width: auto; display: inline-block; padding: 0.7rem 1.6rem;
  margin-top: 1.4rem; text-decoration: none;
}

.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); margin-bottom: 0.4rem;
}
.field .hint { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.78rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.65rem 0.8rem;
  border: 1px solid var(--faint); border-radius: 9px;
  font-family: var(--ui); font-size: 0.98rem;
  background: var(--paper); color: var(--ink);
}
.field textarea { min-height: 12rem; line-height: 1.55; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.btn-auth {
  width: 100%; font-family: var(--ui); font-weight: 600; font-size: 0.95rem;
  background: var(--brand); color: var(--on-brand); border: none;
  border-radius: 9px; padding: 0.78rem; cursor: pointer; margin-top: 0.3rem;
}
.btn-auth:hover { filter: brightness(1.08); }
.auth-alert {
  background: color-mix(in srgb, #d9482f 14%, var(--surface));
  border: 1px solid color-mix(in srgb, #d9482f 34%, var(--surface));
  color: color-mix(in srgb, #d9482f 60%, var(--ink));
  padding: 0.7rem 0.9rem; border-radius: 9px; font-size: 0.88rem;
  text-align: center; margin-bottom: 1.2rem;
}
.auth-foot { text-align: center; font-size: 0.88rem; color: var(--muted); margin: 1.4rem 0 0; }
.auth-foot a { color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.auth-back { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.auth-back:hover { color: var(--ink); }

/* ---------- panel de administración ---------- */
.admin-topbar {
  position: sticky; top: 0; z-index: 50;
  max-width: 62rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--paper); border-bottom: 1px solid var(--faint);
  box-shadow: 0 10px 24px -20px rgba(0, 0, 0, 0.9);
  font-size: 0.88rem;
}
.admin-topbar .brand .mark { background: var(--ink); }
.admin-topbar .right { display: flex; align-items: center; gap: 1rem; color: var(--muted); }
.admin-topbar .right a { color: var(--brand-ink); text-decoration: none; }
.admin-topbar .right a:hover { text-decoration: underline; }
.admin-nav { display: flex; gap: 1.2rem; font-size: 0.88rem; font-weight: 500; }
.admin-nav a { color: var(--muted); text-decoration: none; }
.admin-nav a.active, .admin-nav a:hover { color: var(--ink); }
.nav-badge {
  display: inline-block; font-size: 0.66rem; font-weight: 700; line-height: 1.1rem;
  background: var(--cta); color: var(--on-cta);
  min-width: 1.1rem; padding: 0 0.28rem; border-radius: 999px; text-align: center;
}
@media (max-width: 40rem) {
  .admin-topbar { flex-wrap: wrap; }
  .admin-nav { order: 3; width: 100%; }
}

/* moderación de comentarios */
.mod-list { display: flex; flex-direction: column; gap: 0.85rem; }
.mod-item {
  background: var(--surface); border: 1px solid var(--faint);
  border-radius: 12px; padding: 1rem 1.15rem;
}
.mod-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.65rem;
  font-size: 0.85rem; margin-bottom: 0.35rem;
}
.mod-head .who { font-weight: 700; color: var(--ink); }
.mod-head .when { color: var(--muted); font-size: 0.78rem; }
.mod-head .where { color: var(--muted); }
.mod-head .where a { color: var(--brand-ink); text-decoration: none; }
.mod-head .where a:hover { text-decoration: underline; }
.mod-reply-of {
  font-size: 0.78rem; color: var(--muted); margin-bottom: 0.35rem;
  padding-left: 0.9rem; border-left: 2px solid var(--faint);
}
.mod-body {
  font-size: 0.92rem; line-height: 1.55; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
  max-height: 12rem; overflow: auto;
}
.mod-actions { display: flex; gap: 1.1rem; margin-top: 0.7rem; font-size: 0.83rem; }
.mod-actions form { display: inline; margin: 0; }
.mod-actions a { color: var(--brand-ink); text-decoration: none; }
.mod-actions button {
  background: none; border: none; color: var(--cta); text-decoration: underline;
  cursor: pointer; font-family: var(--ui); font-size: 0.83rem; padding: 0;
}
.mod-actions a:hover, .mod-actions button:hover { opacity: 0.75; }

/* solicitudes de contacto */
.req-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.req-filters a {
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
  padding: 0.35rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--faint); color: var(--muted); background: var(--surface);
}
.req-filters a.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.req-contact {
  font-size: 0.85rem; color: var(--ink); margin: 0.1rem 0 0.5rem;
  display: flex; flex-wrap: wrap; gap: 0.3rem 1rem;
}
.req-contact a { color: var(--brand-ink); text-decoration: none; }
.pill-new { background: color-mix(in srgb, var(--cta) 22%, var(--surface)); color: var(--cta); }
.pill-read { background: var(--surface-2); color: var(--muted); }
.pill-archived { background: var(--surface-2); color: var(--muted); border: 1px solid var(--faint); }

.admin-wrap { max-width: 62rem; margin: 0 auto; padding: 2.25rem 1.5rem 5rem; }
.admin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.admin-head h1 {
  font-family: var(--display); font-weight: 600; font-size: 1.6rem;
  letter-spacing: -0.015em; margin: 0;
}
.btn-primary {
  font-family: var(--ui); font-weight: 600; font-size: 0.88rem;
  background: var(--brand); color: var(--on-brand); border: none; border-radius: 9px;
  padding: 0.6rem 1.1rem; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.08); }

.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--faint);
  border-radius: 14px;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th {
  text-align: left; padding: 0.7rem 1rem;
  background: var(--surface-2); color: var(--muted);
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap; border-bottom: 1px solid var(--faint);
}
.admin-table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--faint); vertical-align: top; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tr[hidden] { display: none; }
.admin-table tr.post-main { cursor: pointer; }
.admin-table tr.post-main:hover > td { background: var(--surface-2); }
.row-toggle {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 0.85rem; line-height: 1; padding: 0 0.45rem 0 0;
  transition: transform 0.15s ease; font-family: var(--ui);
}
.admin-table tr.post-main.is-open .row-toggle { transform: rotate(90deg); }
.admin-table tr.post-detail > td { background: var(--surface-2); padding: 0; }
.detail-body {
  padding: 1rem 1.25rem; white-space: pre-wrap; word-break: break-word;
  color: var(--ink); font-size: 0.9rem; line-height: 1.6;
  max-height: 26rem; overflow: auto;
}
.pill {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem; border-radius: 999px;
}
.pill-ok { background: var(--ok-tint); color: var(--ok); }
.pill-pending { background: var(--warn-tint); color: var(--warn); }
.act { display: inline-flex; gap: 0.85rem; align-items: baseline; white-space: nowrap; }
.act form { display: inline; margin: 0; }
.act a, .act button {
  font-family: var(--ui); font-size: 0.85rem; background: none; border: none;
  cursor: pointer; padding: 0; text-decoration: none;
}
.act .a-edit { color: var(--brand-ink); }
.act .a-pub { color: var(--ok); font-weight: 600; }
.act .a-del { color: var(--cta); text-decoration: underline; }
.act a:hover, .act button:hover { opacity: 0.75; }

.admin-empty {
  text-align: center; color: var(--muted);
  padding: 3rem 1.5rem; background: var(--surface);
  border: 1px solid var(--faint); border-radius: 14px;
}

.admin-form {
  max-width: 46rem;
  background: var(--surface); border: 1px solid var(--faint);
  border-radius: 16px; padding: 2rem;
}
.admin-form h1 {
  font-family: var(--display); font-weight: 600; font-size: 1.55rem;
  letter-spacing: -0.015em; margin: 0 0 0.4rem;
}
.admin-form .sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.75rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 34rem) { .form-row { grid-template-columns: 1fr; gap: 0; } }
.form-actions {
  display: flex; align-items: center; gap: 1.25rem;
  margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--faint);
}
.btn-cancel { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.btn-cancel:hover { color: var(--ink); }

/* "los más leídos" */
.most-read {
  background: var(--surface); border: 1px solid var(--faint);
  border-radius: 12px; padding: 1.1rem 1.3rem; margin-bottom: 1.75rem;
}
.most-read h2 {
  font-family: var(--display); font-weight: 600; font-size: 1.1rem;
  margin: 0 0 0.7rem;
}
.most-read ol { margin: 0; padding-left: 1.3rem; }
.most-read li { margin: 0.4rem 0; font-size: 0.92rem; }
.most-read li a { color: var(--brand-ink); text-decoration: none; }
.most-read li a:hover { text-decoration: underline; }
.most-read li span { color: var(--muted); font-size: 0.82rem; margin-left: 0.5rem; }
.most-read--public {
  max-width: var(--measure); margin: 3.5rem auto 0;
}
.field input[type="file"] {
  font-family: var(--ui); font-size: 0.88rem; padding: 0.5rem;
  background: var(--surface-2); cursor: pointer;
}
.cover-current {
  display: block; max-width: 260px; width: 100%;
  border-radius: 10px; border: 1px solid var(--faint); margin-bottom: 0.6rem;
}
