/* =========================================================
   ForHombres — Manual Oficial de Convivencia
   Estética: documento institucional formal + parodia.
   Paleta sobria (tinta marino, burdeos, oro viejo, pergamino).
   ========================================================= */

:root {
  --ink: #16203a;          /* tinta marino — texto y cabeceras */
  --ink-soft: #2b3552;
  --oxblood: #7c2434;      /* burdeos — acento formal */
  --oxblood-dark: #5f1a27;
  --gold: #a9853f;         /* oro viejo / latón */
  --gold-light: #c3a057;
  --parchment: #f3eddf;    /* fondo pergamino */
  --parchment-2: #e9e0cc;
  --paper: #fbf8f1;        /* tarjetas / papel */
  --line: #d9cdb2;         /* filete dorado tenue */
  --line-strong: #c3b48f;
  --muted: #6c6550;
  --stamp: #b23a2e;        /* rojo tampón */
  --ok: #2f6b4f;

  --shadow-sm: 0 1px 3px rgba(22,32,58,.10);
  --shadow-md: 0 12px 34px rgba(22,32,58,.14);
  --shadow-lg: 0 26px 60px rgba(22,32,58,.20);

  --radius: 8px;
  --radius-sm: 5px;
  --maxw: 1180px;

  --serif: "Playfair Display", "Times New Roman", Georgia, serif;
  --body: "Lora", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background-color: var(--parchment);
  /* textura sutil de papel */
  background-image:
    radial-gradient(circle at 20% 15%, rgba(169,133,63,.05), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(124,36,52,.04), transparent 45%);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* Etiquetas tipo "expediente / sección" */
.label {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: .22em;
  font-size: .72rem; font-weight: 700; color: var(--gold);
}
.label-ox { color: var(--oxblood); }

/* ---------- Iconos de línea ---------- */
.ic { width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -0.16em; flex: none; }
.thumb-ic { width: 60px; height: 60px; stroke-width: 1.4; }
.cover-ic { width: 78px; height: 78px; stroke-width: 1.3; }
.cat-ic { width: 30px; height: 30px; }
.cat .ico { color: var(--oxblood); line-height: 0; }
.mini-ic { width: 22px; height: 22px; color: var(--oxblood); }
.meta-ic { width: 14px; height: 14px; vertical-align: -0.2em; opacity: .85; }
.side-ic { width: 18px; height: 18px; vertical-align: -0.28em; }
.tf-ic { width: 16px; height: 16px; vertical-align: -0.22em; }
.btn-ic { width: 16px; height: 16px; vertical-align: -0.18em; margin-right: 6px; }
.btn .btn-ic { margin-right: 0; }
.sec-ic { color: var(--oxblood); width: .92em; height: .92em; vertical-align: -0.02em; margin-right: .12em; }
.cunao-feature .sec-ic { color: var(--gold-light); }
.forum-head .sec-ic { color: var(--gold-light); }
.ca-ic { color: var(--oxblood); width: 18px; height: 18px; vertical-align: -0.28em; }
.send-ic { width: 18px; height: 18px; color: #fff; vertical-align: -0.25em; }
.peril .pf { width: 15px; height: 15px; color: var(--line-strong); vertical-align: -0.22em; }
.peril .pf.on { color: var(--oxblood); }

/* Avatares con logo */
.cc-avatar { overflow: hidden; }
.cc-avatar img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); display: block; }
.chat-fab .fab-face { overflow: hidden; }
.chat-fab .fab-face img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); display: block; }
.avatar-mini.cunao-av { overflow: hidden; background: var(--ink); border: 2px solid var(--gold); }
.avatar-mini.cunao-av img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); display: block; }

/* Filete ornamental centrado con rombo */
.rule-orn {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: var(--gold); margin: 8px 0 0;
}
.rule-orn::before, .rule-orn::after {
  content: ""; height: 1px; width: 60px; background: var(--line-strong);
}
.rule-orn span { font-size: .8rem; }

/* =========================================================
   Barra superior institucional + Header
   ========================================================= */
.topstrip {
  background: var(--ink); color: #d9cfb6;
  font-family: var(--sans); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  text-align: center; padding: 6px 0; border-bottom: 2px solid var(--gold);
}

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(243,237,223,.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 var(--gold) inset;
}
.nav { display: flex; align-items: center; gap: 22px; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .crest {
  width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--ink); box-shadow: var(--shadow-sm);
}
.brand .crest img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); display: block; }

/* Logo como sello del hero */
.seal-badge {
  width: 132px; height: 132px; border-radius: 50%; overflow: hidden;
  background: var(--ink); box-shadow: var(--shadow-lg); transform: rotate(-6deg);
}
.seal-badge img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); display: block; }
.brand .bname { line-height: 1; }
.brand .bname b { font-family: var(--serif); font-weight: 800; font-size: 1.4rem; color: var(--ink); letter-spacing: .3px; }
.brand .bname b i { color: var(--oxblood); font-style: normal; }
.brand .bname small { display: block; font-family: var(--sans); font-size: .58rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); margin-top: 3px; }

.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; font-family: var(--sans); }
.nav-links a {
  padding: 9px 15px; border-radius: var(--radius-sm); font-weight: 600; font-size: .92rem; color: var(--ink);
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--parchment-2); }
.nav-links a.active { color: var(--oxblood); }
.btn-nav { background: var(--oxblood) !important; color: #fff !important; }
.btn-nav:hover { background: var(--oxblood-dark) !important; }
.hamburger { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

/* =========================================================
   Botones
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 12px 24px; border-radius: var(--radius); font-family: var(--sans); font-weight: 700; font-size: .95rem;
  border: 0; transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--oxblood); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--oxblood-dark); box-shadow: var(--shadow-md); }
.btn-dark { background: var(--ink); color: #f3ecdc; }
.btn-dark:hover { background: var(--ink-soft); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #916f31; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 9px 16px; font-size: .85rem; }

/* Sello circular (parodia oficial) */
.seal {
  width: 118px; height: 118px; border-radius: 50%;
  border: 2px solid var(--gold); color: var(--parchment);
  background: radial-gradient(circle at 50% 35%, var(--ink-soft), var(--ink));
  box-shadow: inset 0 0 0 6px rgba(243,237,223,.08), inset 0 0 0 7px var(--gold), var(--shadow-md);
  display: grid; place-items: center; text-align: center; font-family: var(--sans);
  transform: rotate(-8deg);
}
.seal .in { font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-light); line-height: 1.5; }
.seal .in b { display: block; font-family: var(--serif); font-size: 1.5rem; letter-spacing: 0; color: #fff; margin: 2px 0; }

/* Estampado tipo tampón de goma */
.stamp {
  display: inline-block; font-family: var(--sans); font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--stamp); border: 3px solid var(--stamp);
  padding: 6px 14px; border-radius: 6px; font-size: .82rem;
  transform: rotate(-6deg); opacity: .85; box-shadow: inset 0 0 0 1px rgba(178,58,46,.3);
}

/* =========================================================
   Hero — portada de manual
   ========================================================= */
.hero {
  position: relative; overflow: hidden; padding: 60px 0 70px;
  background:
    linear-gradient(180deg, rgba(22,32,58,.02), transparent),
    var(--parchment);
  border-bottom: 1px solid var(--line-strong);
}
.hero::before {
  content: ""; position: absolute; inset: 18px; border: 1px solid var(--line-strong);
  pointer-events: none; margin: 0 22px;
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 46px; align-items: center; position: relative; z-index: 2; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--sans);
  font-size: .74rem; letter-spacing: .24em; text-transform: uppercase; color: var(--oxblood); font-weight: 700;
}
.hero h1 {
  font-family: var(--serif); font-weight: 900; font-size: clamp(2.2rem, 4.8vw, 3.7rem);
  line-height: 1.06; letter-spacing: -.5px; color: var(--ink); margin: 16px 0 8px;
}
.hero h1 em { color: var(--oxblood); font-style: italic; }
.hero .subtitle { font-family: var(--sans); font-size: .82rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
.hero p.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 540px; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 34px; margin-top: 34px; font-family: var(--sans); }
.hero-stats .stat b { display: block; font-family: var(--serif); font-size: 1.9rem; color: var(--oxblood); font-weight: 800; }
.hero-stats .stat span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* Tarjeta-chat del hero (elemento que SÍ gustaba, reestilizado) */
.hero-visual { position: relative; }
.chat-card {
  background: var(--paper); color: var(--ink); border-radius: 12px; padding: 20px;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  position: relative; transform: rotate(1deg);
}
.chat-card::before {
  content: ""; position: absolute; inset: 7px; border: 1px solid var(--line); border-radius: 8px; pointer-events: none;
}
.chat-card .cc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; position: relative; z-index: 2; }
.cc-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); border: 2px solid var(--gold); display: grid; place-items: center; font-size: 1.35rem; }
.cc-head b { display: block; font-family: var(--serif); font-size: 1.05rem; }
.cc-head small { font-family: var(--sans); color: var(--gold); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.bubble { padding: 11px 15px; border-radius: 12px; margin-bottom: 9px; font-size: .95rem; max-width: 88%; position: relative; z-index: 2; font-family: var(--sans); }
.bubble.them { background: var(--parchment-2); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.bubble.me { background: var(--ink); color: #f3ecdc; margin-left: auto; border-bottom-right-radius: 3px; }
.seal-float { position: absolute; right: -18px; bottom: -26px; z-index: 3; }

/* =========================================================
   Secciones
   ========================================================= */
section { padding: 66px 0; }
.section-alt { background: var(--paper); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 46px; }
.section-head .expediente { font-family: var(--sans); font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.section-head h2 { font-family: var(--serif); font-weight: 800; font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -.4px; margin: 10px 0 6px; color: var(--ink); }
.section-head h2 em { color: var(--oxblood); font-style: italic; }
.section-head p { color: var(--muted); font-size: 1.04rem; margin: 12px auto 0; max-width: 560px; }

/* =========================================================
   Rejilla de artículos (fichas de expediente)
   ========================================================= */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .thumb {
  height: 150px; display: grid; place-items: center; font-size: 3.2rem; position: relative;
  background: var(--ink); color: var(--parchment); border-bottom: 3px solid var(--gold);
}
.card .thumb .tag {
  position: absolute; top: 12px; left: 12px; font-family: var(--sans); background: var(--oxblood); color: #fff;
  padding: 4px 11px; border-radius: 4px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.card .thumb .exp { position: absolute; top: 12px; right: 12px; font-family: var(--sans); font-size: .64rem; letter-spacing: .12em; color: var(--gold-light); }
.card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card .body h3 { font-family: var(--serif); margin: 0 0 9px; font-size: 1.24rem; line-height: 1.24; color: var(--ink); }
.card .body p { color: var(--muted); font-size: .94rem; margin: 0 0 16px; flex: 1; }
.card .meta { display: flex; align-items: center; gap: 9px; font-family: var(--sans); font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.card .meta .read { margin-left: auto; color: var(--oxblood); font-weight: 700; }

/* =========================================================
   Diccionario — fichas
   ========================================================= */
.dict-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dict-item {
  background: var(--paper); border: 1px solid var(--line-strong); border-top: 3px solid var(--oxblood);
  border-radius: var(--radius-sm); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative;
}
.dict-item .phrase { font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: 1.12rem; }
.dict-item .phrase::before { content: "«"; color: var(--gold); }
.dict-item .phrase::after { content: "»"; color: var(--gold); }
.dict-item .arrow { font-family: var(--sans); color: var(--gold); font-weight: 700; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; margin: 7px 0; }
.dict-item .real { color: var(--ink-soft); font-size: .96rem; }
.dict-item .real b { color: var(--oxblood); }
.dict-item .df-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-family: var(--sans); font-size: .72rem; }
.dict-item .cat-tag { background: var(--parchment-2); color: var(--ink); padding: 3px 10px; border-radius: 999px; font-weight: 600; letter-spacing: .04em; }
.peril { margin-left: auto; letter-spacing: -1px; filter: saturate(1.1); }

/* Controles del diccionario */
.dict-controls {
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); display: grid; gap: 14px; margin-bottom: 22px;
}
.dict-controls .row1 { display: grid; grid-template-columns: 1fr 210px 210px; gap: 12px; }
.dict-controls input, .dict-controls select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: .95rem; background: var(--parchment); color: var(--ink);
}
.dict-controls input:focus, .dict-controls select:focus { outline: none; border-color: var(--oxblood); }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
  font-family: var(--sans); background: var(--parchment); border: 1.5px solid var(--line-strong);
  padding: 7px 14px; border-radius: 999px; font-size: .82rem; cursor: pointer; color: var(--ink); font-weight: 600;
}
.cat-chip:hover { border-color: var(--oxblood); }
.cat-chip.active { background: var(--oxblood); color: #fff; border-color: var(--oxblood); }

/* Índice alfabético */
.az-index { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-bottom: 24px; font-family: var(--sans); }
.az-index a {
  width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-weight: 700; font-size: .85rem; color: var(--ink); background: var(--paper);
}
.az-index a:hover { background: var(--ink); color: var(--parchment); }
.az-index a.disabled { opacity: .3; pointer-events: none; }
.letter-head { font-family: var(--serif); font-size: 1.6rem; color: var(--oxblood); border-bottom: 2px solid var(--line-strong); margin: 26px 0 14px; padding-bottom: 6px; scroll-margin-top: 90px; }
.dict-count { font-family: var(--sans); color: var(--muted); font-size: .88rem; margin-bottom: 14px; }

/* =========================================================
   El Cuñao — sección destacada
   ========================================================= */
.cunao-feature { background: var(--ink); color: var(--parchment); position: relative; overflow: hidden; }
.cunao-feature::after {
  content: ""; position: absolute; inset: 20px; border: 1px solid rgba(201,160,87,.3); pointer-events: none;
}
.cunao-grid { display: grid; grid-template-columns: 280px 1fr; gap: 44px; align-items: center; position: relative; z-index: 2; }
.cunao-portrait {
  background: radial-gradient(circle at 50% 30%, var(--ink-soft), var(--ink));
  border: 1px solid var(--gold); border-radius: 12px; padding: 26px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.cunao-portrait .face { width: 132px; height: 132px; border-radius: 50%; overflow: hidden; margin: 0 auto; background: var(--ink); border: 2px solid var(--gold); }
.cunao-portrait .face img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); display: block; }
.cunao-portrait .name { font-family: var(--serif); font-size: 1.6rem; font-weight: 800; color: #fff; margin: 10px 0 2px; }
.cunao-portrait .cred { font-family: var(--sans); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); }
.cunao-portrait .colegiado { font-family: var(--sans); font-size: .72rem; color: #b9b195; margin-top: 12px; border-top: 1px solid rgba(201,160,87,.25); padding-top: 12px; }
.cunao-feature h2 { font-family: var(--serif); font-size: clamp(1.8rem, 3.6vw, 2.6rem); color: #fff; margin: 0 0 10px; font-weight: 800; }
.cunao-feature h2 em { color: var(--gold-light); font-style: italic; }
.cunao-feature .expediente { color: var(--gold-light); }
.cunao-feature p { color: #cfc7b0; font-size: 1.06rem; max-width: 560px; }
.cunao-samples { display: grid; gap: 10px; margin: 20px 0 24px; }
.cunao-sample { background: rgba(243,237,223,.06); border-left: 3px solid var(--gold); padding: 12px 16px; border-radius: 0 8px 8px 0; font-family: var(--sans); font-size: .93rem; }
.cunao-sample b { color: var(--gold-light); }

/* =========================================================
   Foro — preview (fichas de sección)
   ========================================================= */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cat {
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; position: relative;
}
.cat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); border-radius: var(--radius) 0 0 var(--radius); }
.cat:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cat .ico { font-size: 2rem; }
.cat h3 { font-family: var(--serif); margin: 12px 0 6px; color: var(--ink); font-size: 1.22rem; }
.cat p { color: var(--muted); font-size: .92rem; margin: 0 0 12px; }
.cat .count { font-family: var(--sans); font-size: .78rem; color: var(--oxblood); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* =========================================================
   Anuncios
   ========================================================= */
.ad-slot { margin: 10px auto; max-width: var(--maxw); padding: 0 22px; text-align: center; }
.ad-box {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  min-height: 90px; overflow: hidden;
}
.ad-box::before {
  content: "Publicidad"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--sans); font-size: .64rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: #c0b697; pointer-events: none;
}
.ad-box.tall { min-height: 250px; }
.ad-box ins { position: relative; display: block; width: 100%; }

/* =========================================================
   Banda / newsletter (decreto oficial)
   ========================================================= */
.band {
  background: var(--ink); color: var(--parchment); border-radius: 12px; padding: 46px; text-align: center;
  position: relative; box-shadow: var(--shadow-md); border: 1px solid var(--gold);
}
.band::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(201,160,87,.35); border-radius: 8px; pointer-events: none; }
.band .expediente { color: var(--gold-light); position: relative; z-index: 2; }
.band h2 { font-family: var(--serif); margin: 8px 0 8px; font-size: 1.9rem; color: #fff; position: relative; z-index: 2; }
.band p { margin: 0 auto 22px; max-width: 520px; color: #cfc7b0; position: relative; z-index: 2; }
.subscribe { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; position: relative; z-index: 2; }
.subscribe input { flex: 1; padding: 13px 18px; border-radius: var(--radius); border: 0; font-family: var(--sans); font-size: 1rem; }
.subscribe .btn { background: var(--oxblood); color: #fff; }

/* =========================================================
   Footer institucional
   ========================================================= */
.site-footer { background: var(--ink); color: #c6bfa8; padding: 56px 0 26px; margin-top: 20px; border-top: 3px solid var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-family: var(--sans); color: var(--gold-light); margin: 0 0 14px; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.site-footer a { display: block; font-family: var(--sans); color: #b8b199; padding: 4px 0; font-size: .92rem; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { display: inline-flex; align-items: center; gap: 12px; padding: 0; }
.site-footer .brand:hover { color: inherit; }
.site-footer .brand .bname small { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(201,160,87,.2); margin-top: 36px; padding-top: 22px; text-align: center; font-family: var(--sans); font-size: .84rem; color: #8f8871; }
.footer-disc { font-size: .8rem; color: #837c66; max-width: 740px; margin: 8px auto 0; font-style: italic; }

/* =========================================================
   Widget flotante — El Cuñao
   ========================================================= */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px;
  border-radius: 999px; border: 1px solid var(--gold); cursor: pointer;
  background: var(--ink); color: var(--parchment); font-family: var(--sans); font-weight: 700; font-size: .9rem;
  box-shadow: var(--shadow-lg); transition: transform .18s;
}
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab .fab-face { width: 40px; height: 40px; border-radius: 50%; background: var(--ink-soft); border: 2px solid var(--gold); display: grid; place-items: center; font-size: 1.3rem; }
.chat-fab .ping { position: absolute; top: -2px; left: 34px; width: 14px; height: 14px; background: var(--stamp); border-radius: 50%; border: 3px solid var(--parchment); }

.chat-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 95;
  width: min(392px, calc(100vw - 32px)); height: min(620px, calc(100vh - 40px));
  background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--gold);
  display: none; flex-direction: column; overflow: hidden;
}
.chat-panel.open { display: flex; animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.chat-top { background: var(--ink); color: var(--parchment); padding: 15px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--gold); }
.chat-top .cc-avatar { width: 42px; height: 42px; }
.chat-top b { font-family: var(--serif); display: block; line-height: 1.15; }
.chat-top small { font-family: var(--sans); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-light); }
.chat-top .x { margin-left: auto; background: none; border: 0; color: var(--parchment); font-size: 1.5rem; cursor: pointer; opacity: .8; }
.chat-top .x:hover { opacity: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--parchment); display: flex; flex-direction: column; gap: 6px; }
.chat-body .bubble { max-width: 85%; }
.chat-body .bubble.them { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing span { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; animation: blink 1.2s infinite; }
.typing span:nth-child(2){ animation-delay: .2s; } .typing span:nth-child(3){ animation-delay: .4s; }
@keyframes blink { 0%,60%,100%{ opacity: .25; } 30%{ opacity: 1; } }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 10px; background: var(--parchment); }
.chip-row.hidden { display: none; }
.chip { font-family: var(--sans); background: var(--paper); border: 1px solid var(--line-strong); padding: 7px 12px; border-radius: 999px; font-size: .8rem; cursor: pointer; color: var(--ink); font-weight: 600; }
.chip:hover { border-color: var(--oxblood); color: var(--oxblood); }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-strong); background: var(--paper); }
.chat-input input { flex: 1; border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 11px 16px; font-family: var(--sans); font-size: .95rem; background: var(--parchment); }
.chat-input input:focus { outline: none; border-color: var(--oxblood); }
.chat-input button { border: 0; background: var(--oxblood); color: #fff; width: 44px; border-radius: 50%; cursor: pointer; font-size: 1.05rem; }
.ai-note { font-family: var(--sans); font-size: .68rem; color: var(--muted); text-align: center; padding: 7px; background: var(--paper); border-top: 1px solid var(--line); }

/* =========================================================
   Página de artículo
   ========================================================= */
.article-hero { padding: 40px 0 6px; }
.breadcrumb { font-family: var(--sans); color: var(--muted); font-size: .82rem; letter-spacing: .04em; margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--oxblood); }
.eyebrow-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--oxblood); }
.article-hero h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(1.9rem, 4vw, 3rem); color: var(--ink); line-height: 1.1; margin: 10px 0 14px; max-width: 820px; }
.article-meta { font-family: var(--sans); display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .86rem; }
.article-cover { height: 230px; border-radius: var(--radius); display: grid; place-items: center; font-size: 4.6rem; margin: 26px 0 8px; background: var(--ink); color: var(--parchment); border-bottom: 4px solid var(--gold); }
.article-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 42px; align-items: start; }
.prose { font-size: 1.1rem; color: #2a2c30; max-width: 720px; }
.prose h2 { font-family: var(--serif); color: var(--ink); font-size: 1.62rem; margin: 34px 0 12px; }
.prose h3 { font-family: var(--serif); color: var(--oxblood); font-size: 1.28rem; margin: 26px 0 8px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose blockquote { border-left: 3px solid var(--oxblood); background: var(--paper); margin: 22px 0; padding: 16px 22px; border-radius: 0 8px 8px 0; color: var(--ink); font-style: italic; box-shadow: var(--shadow-sm); font-size: 1.14rem; }
.callout { background: var(--paper); border: 1px solid var(--line-strong); border-left: 4px solid var(--gold); border-radius: 0 8px 8px 0; padding: 16px 18px; margin: 22px 0; font-size: 1rem; font-family: var(--sans); }
.callout b { color: var(--oxblood); }
.sidebar-box { background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px; margin-bottom: 22px; box-shadow: var(--shadow-sm); position: sticky; top: 92px; }
.sidebar-box h4 { font-family: var(--serif); margin: 0 0 12px; color: var(--ink); font-size: 1.15rem; }
.sidebar-box .mini { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.sidebar-box .mini:last-child { border: 0; }
.sidebar-box .mini .em { font-size: 1.4rem; }
.sidebar-box .mini a { font-family: var(--sans); font-size: .88rem; font-weight: 600; color: var(--ink); }
.sidebar-box .mini a:hover { color: var(--oxblood); }

/* =========================================================
   Foro
   ========================================================= */
.forum-head { background: var(--ink); color: var(--parchment); padding: 42px 0; border-bottom: 3px solid var(--gold); position: relative; }
.forum-head .expediente { color: var(--gold-light); }
.forum-head h1 { font-family: var(--serif); margin: 8px 0 6px; font-size: 2.1rem; color: #fff; }
.forum-head p { font-family: var(--sans); color: #cfc7b0; margin: 0; }
.forum-layout { display: grid; grid-template-columns: 244px minmax(0,1fr); gap: 32px; padding-top: 34px; align-items: start; }
.forum-side { position: sticky; top: 92px; font-family: var(--sans); }
.forum-side .side-cat { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; color: var(--ink); font-size: .92rem; }
.forum-side .side-cat:hover { background: var(--paper); }
.forum-side .side-cat.active { background: var(--ink); color: var(--parchment); }
.forum-side .side-cat .em { font-size: 1.15rem; }

.new-thread { background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.new-thread h3 { font-family: var(--serif); margin: 0 0 14px; color: var(--ink); font-size: 1.3rem; }
.field { margin-bottom: 12px; }
.field label { font-family: var(--sans); display: block; font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); font-family: var(--sans); font-size: .95rem; background: var(--parchment); color: var(--ink); }
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--oxblood); }

.thread { background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow-sm); transition: box-shadow .15s; }
.thread:hover { box-shadow: var(--shadow-md); }
.thread .t-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-family: var(--sans); }
.avatar-mini { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .9rem; flex: none; }
.thread .t-top b { color: var(--ink); }
.thread .t-top .cat-badge { margin-left: auto; font-size: .7rem; background: var(--parchment-2); color: var(--ink); padding: 4px 10px; border-radius: 999px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.thread h3 { font-family: var(--serif); margin: 4px 0 6px; color: var(--ink); font-size: 1.24rem; }
.thread p { color: var(--muted); margin: 0 0 12px; font-size: .97rem; }
.thread .t-foot { display: flex; align-items: center; gap: 18px; font-family: var(--sans); font-size: .84rem; color: var(--muted); }
.thread .t-foot button { background: none; border: 0; cursor: pointer; color: var(--muted); font-weight: 600; font-family: var(--sans); display: inline-flex; gap: 5px; align-items: center; }
.thread .t-foot button:hover { color: var(--oxblood); }
.thread .t-foot .liked { color: var(--oxblood); }

.replies { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); display: none; }
.replies.open { display: block; }
.reply { display: flex; gap: 10px; margin-bottom: 12px; }
.reply .r-body { background: var(--parchment); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; flex: 1; }
.reply .r-body b { font-family: var(--sans); color: var(--ink); font-size: .88rem; }
.reply .r-body p { margin: 3px 0 0; color: var(--ink-soft); font-size: .93rem; }
.reply-form { display: flex; gap: 8px; margin-top: 10px; }
.reply-form input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 999px; font-family: var(--sans); background: var(--parchment); }
.reply.cunao .r-body { background: var(--ink); border-color: var(--gold); }
.reply.cunao .r-body b { color: var(--gold-light); }
.reply.cunao .r-body p { color: #e6dfc9; }

.empty { text-align: center; color: var(--muted); padding: 44px; font-family: var(--sans); }

/* =========================================================
   Autenticación (cabecera + modal)
   ========================================================= */
.auth-slot { display: flex; align-items: center; margin-left: 14px; }
.auth-user { position: relative; }
.auth-toggle {
  display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 4px 10px 4px 5px; cursor: pointer; font-family: var(--sans); font-weight: 600; color: var(--ink);
}
.auth-toggle:hover { border-color: var(--oxblood); }
.auth-name { font-size: .9rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-caret { color: var(--muted); font-size: .8rem; }
.prem-badge { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: #fff; font-size: .58rem; font-weight: 800; letter-spacing: .1em; padding: 2px 7px; border-radius: 999px; }
.auth-menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: var(--shadow-md); min-width: 180px; padding: 6px; display: none; z-index: 60;
}
.auth-user.open .auth-menu { display: block; }
.auth-menu a, .auth-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0; font-family: var(--sans); font-size: .9rem;
  color: var(--ink); padding: 9px 12px; border-radius: 7px; cursor: pointer; font-weight: 600;
}
.auth-menu a:hover, .auth-menu button:hover { background: var(--parchment-2); }
.auth-menu button { color: var(--oxblood); border-top: 1px solid var(--line); margin-top: 4px; }

.auth-modal {
  position: fixed; inset: 0; z-index: 200; background: rgba(22,32,58,.5); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.auth-modal.open { display: flex; animation: pop .18s ease; }
.auth-card {
  background: var(--paper); border: 1px solid var(--gold); border-radius: 14px; width: min(400px, 100%);
  padding: 26px; position: relative; box-shadow: var(--shadow-lg);
}
.auth-x { position: absolute; top: 12px; right: 14px; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.auth-crest { width: 66px; height: 66px; border-radius: 50%; overflow: hidden; margin: 0 auto 14px; background: var(--ink); border: 2px solid var(--gold); }
.auth-crest img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); }
.auth-tabs { display: flex; gap: 6px; background: var(--parchment-2); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 999px; font-family: var(--sans); font-weight: 700; cursor: pointer; color: var(--muted); }
.auth-tabs button.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-only-signup { display: none; }
.auth-modal.is-signup .auth-only-signup { display: block; }
.auth-error { color: var(--oxblood); font-size: .86rem; min-height: 1.1em; margin-bottom: 8px; font-family: var(--sans); }
.auth-foot { text-align: center; color: var(--ok); font-size: .88rem; font-family: var(--sans); margin: 12px 0 0; }

/* =========================================================
   Fotos en el foro
   ========================================================= */
.upload-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.upload-btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-weight: 600; font-size: .88rem;
  border: 1.5px dashed var(--line-strong); background: var(--parchment); color: var(--ink); padding: 9px 14px;
  border-radius: 8px; cursor: pointer;
}
.upload-btn:hover { border-color: var(--oxblood); color: var(--oxblood); }
.upload-btn input { display: none; }
.img-preview { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: .82rem; color: var(--muted); }
.img-preview img { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); }
.img-preview button { background: none; border: 0; color: var(--oxblood); cursor: pointer; font-weight: 700; }
.thread-img, .reply-img { display: block; margin: 4px 0 10px; border-radius: 10px; border: 1px solid var(--line); max-width: 100%; max-height: 340px; object-fit: cover; cursor: zoom-in; }
.reply-img { max-height: 200px; }
.login-hint { font-family: var(--sans); background: var(--paper); border: 1px solid var(--line-strong); border-left: 4px solid var(--gold); border-radius: 0 8px 8px 0; padding: 14px 16px; color: var(--ink); font-size: .95rem; }
.login-hint a { color: var(--oxblood); font-weight: 700; cursor: pointer; }

/* =========================================================
   Perfil
   ========================================================= */
.profile-wrap { max-width: 640px; margin: 0 auto; padding: 40px 0 70px; }
.profile-card { background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.profile-top { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.profile-ava { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; background: var(--ink); border: 2px solid var(--gold); position: relative; flex: none; }
.profile-ava img { width: 100%; height: 100%; object-fit: cover; }
.profile-ava .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--gold-light); font-family: var(--serif); font-size: 2.4rem; }
.profile-ava .cam { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(22,32,58,.55); color: #fff; font-family: var(--sans); font-size: .68rem; font-weight: 700; opacity: 0; cursor: pointer; text-align: center; }
.profile-ava:hover .cam { opacity: 1; }
.profile-top h2 { font-family: var(--serif); margin: 0 0 4px; color: var(--ink); }
.profile-plan { font-family: var(--sans); font-size: .82rem; color: var(--muted); }

/* =========================================================
   Panel admin
   ========================================================= */
.admin-wrap { max-width: var(--maxw); margin: 0 auto; padding: 34px 0 70px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.stat-card { background: var(--paper); border: 1px solid var(--line-strong); border-top: 3px solid var(--oxblood); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.stat-card .n { font-family: var(--serif); font-size: 2.2rem; font-weight: 800; color: var(--ink); line-height: 1; }
.stat-card .l { font-family: var(--sans); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.admin-tablewrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; font-family: var(--sans); }
.admin-table th, .admin-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; white-space: nowrap; }
.admin-table th { background: var(--parchment-2); color: var(--muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .08em; }
.admin-table tr:last-child td { border-bottom: 0; }
.toggle-prem { border: 1.5px solid var(--line-strong); background: var(--parchment); border-radius: 999px; padding: 5px 12px; font-family: var(--sans); font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--ink); }
.toggle-prem.on { background: var(--gold); color: #fff; border-color: var(--gold); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .hero-inner, .article-layout, .forum-layout, .footer-grid, .cunao-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .cats { grid-template-columns: 1fr 1fr; }
  .dict-list { grid-template-columns: 1fr; }
  .dict-controls .row1 { grid-template-columns: 1fr; }
  .article-layout .sidebar { display: none; }
  .forum-side { position: static; display: flex; gap: 8px; overflow-x: auto; }
  .forum-side .side-cat { white-space: nowrap; }
  .chat-card { transform: none; margin-top: 24px; }
  .hero::before { display: none; }
  .cunao-portrait { max-width: 320px; margin: 0 auto; }
}
@media (max-width: 620px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .nav-links.mobile-open {
    display: flex; flex-direction: column; position: absolute; top: 74px; left: 0; right: 0;
    background: var(--parchment); padding: 12px 20px; border-bottom: 1px solid var(--line-strong); gap: 4px;
  }
  .nav-links.mobile-open a { width: 100%; }
  .grid-3, .cats, .grid-2 { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .band { padding: 32px 22px; }
  .subscribe { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .chat-fab span.lbl { display: none; }
}
