/* ══════════════════════════════════════════════════════
   styles.css — Ritmipedia
   Sistema de diseño propio dentro del ecosistema
   Pasión por la Rítmica
   Paleta: Teal #2a9d8f · Gold #e9c46a · Coral #e76f51
══════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────── */
:root {
  --rp-teal:        #2a9d8f;
  --rp-teal-dk:     #1f7a6e;
  --rp-teal-lt:     #e0f5f2;
  --rp-gold:        #e9c46a;
  --rp-gold-dk:     #c9a44a;
  --rp-gold-lt:     #fdf6e3;
  --rp-coral:       #e76f51;
  --rp-coral-lt:    #fce8e3;

  --rp-bg:          #ffffff;
  --rp-bg-alt:      #f8f9fa;
  --rp-bg-card:     #ffffff;
  --rp-bg-hover:    #f1f5f4;
  --rp-border:      #e2e8e6;
  --rp-border-dk:   #c8d4d1;

  --rp-text:        #1a2421;
  --rp-text-muted:  #4a6260;
  --rp-text-label:  #7a9490;

  --rp-header-h:    64px;
  --rp-radius:      12px;
  --rp-radius-sm:   8px;
  --rp-radius-lg:   16px;

  --rp-sh-sm:  0 1px 4px rgba(42,157,143,.08);
  --rp-sh-md:  0 4px 16px rgba(42,157,143,.12);
  --rp-sh-lg:  0 12px 40px rgba(42,157,143,.16);
}

.dark {
  --rp-bg:         #0d1514;
  --rp-bg-alt:     #111a18;
  --rp-bg-card:    #152220;
  --rp-bg-hover:   #1c2e2b;
  --rp-border:     #1e3330;
  --rp-border-dk:  #2a4540;
  --rp-text:       #e8f0ef;
  --rp-text-muted: #9ab8b4;
  --rp-text-label: #6a9490;
}

/* ── Reset / base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  background-color: var(--rp-bg);
  color: var(--rp-text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  line-height: 1.6;
  transition: background-color .2s, color .2s;
}

/* ── Layout helpers ───────────────────────────────── */
.rp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 768px) { .rp-container { padding: 0 2rem; } }

/* ── HEADER ───────────────────────────────────────── */
.rp-header {
  position: sticky; top: 0; z-index: 200;
  height: var(--rp-header-h);
  background: var(--rp-bg-card);
  border-bottom: 1px solid var(--rp-border);
  backdrop-filter: blur(12px);
}
.rp-header-inner {
  max-width: 1200px; margin: 0 auto;
  height: 100%; padding: 0 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
@media (min-width: 768px) { .rp-header-inner { padding: 0 2rem; } }

/* Logo */
.rp-logo {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; flex-shrink: 0;
}
.rp-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--rp-teal);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 1.1rem; font-weight: 700; color: white;
  flex-shrink: 0;
}
.rp-logo-icon-sm {
  width: 26px; height: 26px; border-radius: 7px; font-size: .85rem;
}
.rp-logo-name {
  display: block; font-family: 'Fraunces', serif;
  font-size: 1.05rem; font-weight: 700;
  color: var(--rp-text); line-height: 1.1;
}
.rp-logo-tagline {
  display: block; font-size: .68rem;
  color: var(--rp-text-label); line-height: 1;
}

/* Header search */
.rp-header-search {
  flex: 1; max-width: 420px; display: none;
  position: relative;
}
@media (min-width: 640px) { .rp-header-search { display: flex; } }
.rp-header-search input {
  width: 100%; padding: .45rem .45rem .45rem .9rem;
  border-radius: 24px; border: 1.5px solid var(--rp-border);
  background: var(--rp-bg-alt); color: var(--rp-text);
  font-size: .83rem; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.rp-header-search input:focus {
  border-color: var(--rp-teal);
  box-shadow: 0 0 0 3px rgba(42,157,143,.15);
}
.rp-header-search button {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  background: var(--rp-teal); color: white;
  border: none; border-radius: 20px; padding: .3rem .6rem;
  cursor: pointer; display: flex; align-items: center;
  transition: background .15s;
}
.rp-header-search button:hover { background: var(--rp-teal-dk); }

/* Header actions */
.rp-header-actions {
  display: flex; align-items: center; gap: .4rem; margin-left: auto;
}
.rp-icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--rp-text-muted); font-size: .95rem;
  transition: background .15s, color .15s;
}
.rp-icon-btn:hover { background: var(--rp-bg-hover); color: var(--rp-teal); }

/* Ecosistema dropdown */
.rp-ecosistema-wrap { position: relative; }
.rp-ecosistema-btn {
  display: none; align-items: center; gap: .3rem;
  background: none; border: 1px solid var(--rp-border); border-radius: 8px;
  padding: .35rem .7rem; font-size: .76rem; font-weight: 600;
  color: var(--rp-text-muted); cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
@media (min-width: 768px) { .rp-ecosistema-btn { display: flex; } }
.rp-ecosistema-btn:hover { background: var(--rp-bg-hover); color: var(--rp-teal); }
.rp-ecosistema-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); min-width: 220px;
  box-shadow: var(--rp-sh-lg); overflow: hidden; z-index: 300;
}
.rp-ecosistema-dropdown a,
.rp-eco-current {
  display: block; padding: .6rem 1rem;
  font-size: .82rem; color: var(--rp-text-muted);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.rp-ecosistema-dropdown a:hover { background: var(--rp-bg-hover); color: var(--rp-teal); }
.rp-eco-current {
  color: var(--rp-teal); font-weight: 600;
  background: var(--rp-teal-lt);
}
.dark .rp-eco-current { background: rgba(42,157,143,.15); }

/* ── MOBILE MENU ──────────────────────────────────── */
.rp-mobile-menu {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
  display: none;
}
.rp-mobile-menu.open { display: block; }
.rp-mobile-menu-inner {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: min(320px, 85vw);
  background: var(--rp-bg-card);
  border-right: 1px solid var(--rp-border);
  display: flex; flex-direction: column;
  overflow-y: auto;
  animation: slideInLeft .22s ease;
}
@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
.rp-mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.1rem; border-bottom: 1px solid var(--rp-border);
}
.rp-mobile-search {
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--rp-border);
  display: flex; gap: .4rem;
}
.rp-mobile-search input {
  flex: 1; padding: .45rem .7rem; border-radius: 8px;
  border: 1.5px solid var(--rp-border); background: var(--rp-bg-alt);
  color: var(--rp-text); font-size: .83rem; outline: none;
}
.rp-mobile-search button {
  background: var(--rp-teal); color: white; border: none;
  border-radius: 8px; padding: .45rem .9rem;
  font-size: .82rem; font-weight: 600; cursor: pointer;
}
.rp-mobile-nav {
  flex: 1; padding: .6rem;
  display: flex; flex-direction: column; gap: .1rem;
}
.rp-mobile-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .8rem; border-radius: 8px;
  font-size: .85rem; color: var(--rp-text-muted); text-decoration: none;
  transition: background .12s, color .12s;
}
.rp-mobile-nav a:hover { background: var(--rp-bg-hover); color: var(--rp-teal); }
.rp-mobile-nav-section {
  padding: .6rem .8rem .2rem;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--rp-text-label);
}
.rp-mobile-menu-footer { padding: 1rem 1.1rem; border-top: 1px solid var(--rp-border); }

/* ── HERO ─────────────────────────────────────────── */
.rp-hero {
  background: linear-gradient(135deg,
    var(--rp-teal-lt) 0%, var(--rp-bg) 60%);
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--rp-border);
}
.dark .rp-hero {
  background: linear-gradient(135deg,
    rgba(42,157,143,.12) 0%, var(--rp-bg) 60%);
}
.rp-hero-inner {
  max-width: 700px; margin: 0 auto;
  padding: 0 1.25rem; text-align: center;
}
.rp-hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 700; line-height: 1.2;
  color: var(--rp-text); margin-bottom: 1rem;
}
.rp-hero-title em {
  font-style: italic; color: var(--rp-teal);
}
.rp-hero-subtitle {
  font-size: .95rem; color: var(--rp-text-muted);
  max-width: 520px; margin: 0 auto 2rem; line-height: 1.6;
}

/* Hero search */
.rp-hero-search-wrap { position: relative; max-width: 560px; margin: 0 auto 1.5rem; }
.rp-hero-search {
  display: flex; align-items: center; gap: .6rem;
  background: var(--rp-bg-card); border: 2px solid var(--rp-border);
  border-radius: 50px; padding: .5rem .5rem .5rem 1.1rem;
  box-shadow: var(--rp-sh-md);
  transition: border-color .2s, box-shadow .2s;
}
.rp-hero-search:focus-within {
  border-color: var(--rp-teal);
  box-shadow: 0 0 0 4px rgba(42,157,143,.15), var(--rp-sh-md);
}
.rp-hero-search-icon { color: var(--rp-text-label); flex-shrink: 0; }
.rp-hero-search input {
  flex: 1; border: none; background: transparent;
  color: var(--rp-text); font-size: .92rem; outline: none;
}
.rp-hero-search input::placeholder { color: var(--rp-text-label); }
.rp-hero-search button {
  background: var(--rp-teal); color: white;
  border: none; border-radius: 50px;
  padding: .5rem 1.2rem; font-size: .84rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background .15s;
}
.rp-hero-search button:hover { background: var(--rp-teal-dk); }

/* Search dropdown */
.rp-search-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); box-shadow: var(--rp-sh-lg);
  overflow: hidden; z-index: 100;
}
.rp-search-sug {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem 1rem; text-decoration: none;
  color: var(--rp-text); font-size: .83rem;
  transition: background .12s;
}
.rp-search-sug:hover { background: var(--rp-bg-hover); }
.rp-search-sug-icon { font-size: .95rem; flex-shrink: 0; }
.rp-search-sug-label { flex: 1; font-weight: 500; }
.rp-search-sug-type {
  font-size: .7rem; color: var(--rp-text-label);
  background: var(--rp-bg-alt); padding: .12rem .45rem;
  border-radius: 20px;
}

/* Hero stats */
.rp-hero-stats {
  display: flex; align-items: center; justify-content: center; gap: 2rem;
  margin-top: .5rem;
}
.rp-stat-item {
  display: flex; flex-direction: column; align-items: center;
}
.rp-stat-num {
  font-family: 'Fraunces', serif; font-size: 1.6rem; font-weight: 700;
  color: var(--rp-teal); line-height: 1.1;
}
.rp-stat-label { font-size: .74rem; color: var(--rp-text-label); }

/* ── SECTIONS ─────────────────────────────────────── */
.rp-section     { padding: 3rem 0; }
.rp-section-alt { background: var(--rp-bg-alt); }
.rp-section-header {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 1.75rem;
}
.rp-section-title {
  font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 700;
  color: var(--rp-text);
}
.rp-section-subtitle {
  font-size: .84rem; color: var(--rp-text-label); margin-top: .3rem;
}
.rp-section-link {
  font-size: .82rem; font-weight: 600; color: var(--rp-teal);
  text-decoration: none; white-space: nowrap;
  transition: color .15s;
}
.rp-section-link:hover { color: var(--rp-teal-dk); }

/* ── ARTICLE GRID ─────────────────────────────────── */
.rp-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}

/* ── ARTICLE CARD ─────────────────────────────────── */
.rp-card {
  display: flex; flex-direction: column;
  background: var(--rp-bg-card);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  overflow: hidden; text-decoration: none;
  transition: box-shadow .18s, border-color .18s, transform .18s;
  position: relative;
}
.rp-card:hover {
  box-shadow: var(--rp-sh-md);
  border-color: var(--cat-color, var(--rp-teal));
  transform: translateY(-2px);
}
.rp-card-cat-bar {
  height: 3px; flex-shrink: 0;
  background: var(--cat-color, var(--rp-teal));
}
.rp-card-body { padding: 1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.rp-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: .4rem; margin-bottom: .55rem;
}
.rp-card-cat-badge {
  font-size: .72rem; font-weight: 700;
  display: flex; align-items: center; gap: .25rem;
}
.rp-card-date { font-size: .7rem; color: var(--rp-text-label); }
.rp-card-title {
  font-family: 'Fraunces', serif; font-size: 1rem; font-weight: 600;
  color: var(--rp-text); line-height: 1.35; margin-bottom: .5rem;
  transition: color .15s;
}
.rp-card:hover .rp-card-title { color: var(--cat-color, var(--rp-teal)); }
.rp-card-resumen {
  font-size: .8rem; color: var(--rp-text-muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.rp-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-top: .8rem; padding-top: .65rem;
  border-top: 1px solid var(--rp-border);
}
.rp-card-etiquetas { display: flex; flex-wrap: wrap; gap: .3rem; }
.rp-card-more {
  font-size: .75rem; font-weight: 700;
  color: var(--cat-color, var(--rp-teal)); white-space: nowrap;
  flex-shrink: 0;
}

/* ── SMALL CARD (sidebar, relacionados) ───────────── */
.rp-card-sm {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .65rem 0; border-bottom: 1px solid var(--rp-border);
  text-decoration: none;
  transition: opacity .15s;
}
.rp-card-sm:last-child { border-bottom: none; }
.rp-card-sm:hover { opacity: .75; }
.rp-card-sm-color {
  width: 3px; border-radius: 2px; align-self: stretch;
  flex-shrink: 0; min-height: 40px;
}
.rp-card-sm-body { flex: 1; min-width: 0; }
.rp-card-sm-cat {
  font-size: .68rem; font-weight: 700; display: block; margin-bottom: .2rem;
}
.rp-card-sm-title {
  font-size: .82rem; font-weight: 600; color: var(--rp-text);
  line-height: 1.35; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rp-card-sm-date { font-size: .68rem; color: var(--rp-text-label); margin-top: .2rem; }

/* ── CATEGORY CARD ────────────────────────────────── */
.rp-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}
.rp-cat-card {
  display: flex; align-items: flex-start; gap: .85rem;
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); padding: 1.1rem;
  text-decoration: none;
  transition: box-shadow .18s, border-color .18s, transform .18s;
  border-left: 4px solid var(--cat-color, var(--rp-teal));
}
.rp-cat-card:hover {
  box-shadow: var(--rp-sh-md); transform: translateY(-2px);
}
.rp-cat-card-icon {
  font-size: 1.6rem; flex-shrink: 0; width: 44px;
  height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--rp-bg-alt); border-radius: 10px;
}
.rp-cat-card-body { flex: 1; min-width: 0; }
.rp-cat-card-nombre {
  font-family: 'Fraunces', serif; font-size: .95rem; font-weight: 700;
  color: var(--rp-text); margin-bottom: .3rem;
  transition: color .15s;
}
.rp-cat-card:hover .rp-cat-card-nombre { color: var(--cat-color, var(--rp-teal)); }
.rp-cat-card-desc {
  font-size: .76rem; color: var(--rp-text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.rp-cat-card-count {
  display: inline-block; margin-top: .4rem;
  font-size: .68rem; color: var(--cat-color, var(--rp-teal)); font-weight: 600;
}

/* ── ARTICLE DESTACADO ────────────────────────────── */
.rp-destacado {
  background: var(--rp-bg-card);
  border: 1px solid var(--rp-border);
  border-left: 5px solid var(--cat-color, var(--rp-teal));
  border-radius: var(--rp-radius); padding: 1.75rem 2rem;
  display: flex; flex-direction: column; gap: .75rem;
}
.rp-destacado-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--cat-color, var(--rp-teal));
  display: flex; align-items: center; gap: .35rem;
}
.rp-destacado-titulo {
  font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 700;
  color: var(--rp-text); line-height: 1.25;
}
.rp-destacado-titulo a {
  text-decoration: none; color: inherit;
  transition: color .15s;
}
.rp-destacado-titulo a:hover { color: var(--cat-color, var(--rp-teal)); }
.rp-destacado-resumen {
  font-size: .88rem; color: var(--rp-text-muted); line-height: 1.6;
  max-width: 600px;
}
.rp-destacado-meta {
  display: flex; gap: 1rem; font-size: .76rem; color: var(--rp-text-label);
}
.rp-destacado-btn {
  display: inline-flex; align-items: center;
  color: white; text-decoration: none;
  padding: .5rem 1.25rem; border-radius: 50px;
  font-size: .84rem; font-weight: 700; align-self: flex-start;
  transition: opacity .15s;
}
.rp-destacado-btn:hover { opacity: .88; }

/* ── TAGS ─────────────────────────────────────────── */
.rp-tag {
  display: inline-block;
  background: var(--rp-bg-alt); color: var(--rp-text-muted);
  border: 1px solid var(--rp-border);
  border-radius: 20px; padding: .15rem .6rem;
  font-size: .69rem; font-weight: 600;
  transition: background .12s;
}
.rp-tag-link { text-decoration: none; }
.rp-tag-link:hover {
  background: var(--rp-teal-lt); color: var(--rp-teal);
  border-color: rgba(42,157,143,.3);
}
.dark .rp-tag-link:hover { background: rgba(42,157,143,.2); }
.rp-tag-active {
  background: var(--rp-teal-lt); color: var(--rp-teal);
  border-color: rgba(42,157,143,.3);
}

/* ── BREADCRUMB ───────────────────────────────────── */
.rp-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: .25rem;
  font-size: .75rem; color: var(--rp-text-label);
  margin-bottom: .5rem;
}
.rp-bc-link {
  color: var(--rp-teal); text-decoration: none;
  transition: color .15s;
}
.rp-bc-link:hover { color: var(--rp-teal-dk); text-decoration: underline; }
.rp-bc-sep { color: var(--rp-text-label); padding: 0 .1rem; }
.rp-bc-current { color: var(--rp-text-muted); }

/* ── ARTICLE PAGE ─────────────────────────────────── */
.rp-article-layout {
  display: grid; grid-template-columns: 1fr;
  gap: 2rem; padding: 1.5rem 0 4rem;
}
@media (min-width: 1024px) {
  .rp-article-layout {
    grid-template-columns: 1fr 280px;
    align-items: start;
  }
}

/* Article header */
.art-header { padding: 1.5rem 0 1rem; }
.art-header-cat {
  display: flex; align-items: center; gap: .35rem;
  margin-bottom: .75rem;
}
.art-cat-link {
  font-size: .75rem; font-weight: 700; text-decoration: none;
  text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; gap: .25rem;
  transition: opacity .15s;
}
.art-cat-link:hover { opacity: .75; }
.art-header-sep { color: var(--rp-text-label); }
.art-subcat { font-size: .75rem; color: var(--rp-text-label); }
.art-titulo {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 700; line-height: 1.2;
  color: var(--rp-text); margin-bottom: .75rem;
}
.art-resumen {
  font-size: 1.05rem; color: var(--rp-text-muted);
  line-height: 1.65; margin-bottom: .85rem; max-width: 680px;
}
.art-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
  font-size: .78rem; color: var(--rp-text-label); margin-bottom: .75rem;
}
.art-meta-item {
  display: flex; align-items: center; gap: .3rem;
}
.art-etiquetas { display: flex; flex-wrap: wrap; gap: .35rem; }

/* Article body typography */
.rp-article-body {
  font-size: .96rem; line-height: 1.8;
  color: var(--rp-text);
}
.rp-article-body .rp-h1,
.rp-article-body h1 {
  font-family: 'Fraunces', serif; font-size: 1.7rem;
  font-weight: 700; color: var(--rp-text); margin: 2rem 0 .75rem;
  line-height: 1.25; position: relative;
}
.rp-article-body .rp-h2,
.rp-article-body h2 {
  font-family: 'Fraunces', serif; font-size: 1.35rem;
  font-weight: 600; color: var(--rp-text);
  margin: 1.75rem 0 .65rem; padding-bottom: .4rem;
  border-bottom: 2px solid var(--rp-teal-lt); line-height: 1.3;
}
.dark .rp-article-body h2 { border-bottom-color: rgba(42,157,143,.25); }
.rp-article-body .rp-h3,
.rp-article-body h3 {
  font-size: 1.05rem; font-weight: 700; color: var(--rp-text);
  margin: 1.4rem 0 .5rem;
}
.rp-article-body .rp-h4,
.rp-article-body h4 {
  font-size: .95rem; font-weight: 700; color: var(--rp-text-muted);
  margin: 1.2rem 0 .4rem; text-transform: uppercase;
  letter-spacing: .05em;
}
.rp-article-body p { margin: 0 0 1rem; }
.rp-article-body ul,
.rp-article-body ol {
  margin: 0 0 1rem 1.4rem; display: flex;
  flex-direction: column; gap: .3rem;
}
.rp-article-body li { line-height: 1.7; }
.rp-article-body strong { font-weight: 700; color: var(--rp-text); }
.rp-article-body em { font-style: italic; color: var(--rp-teal-dk); }
.dark .rp-article-body em { color: var(--rp-teal); }
.rp-article-body code {
  font-family: 'JetBrains Mono', monospace; font-size: .85em;
  background: var(--rp-bg-alt); border: 1px solid var(--rp-border);
  border-radius: 4px; padding: .1em .35em;
}
.rp-article-body blockquote {
  border-left: 4px solid var(--rp-teal); margin: 1.25rem 0;
  padding: .75rem 1.1rem; background: var(--rp-teal-lt);
  border-radius: 0 var(--rp-radius-sm) var(--rp-radius-sm) 0;
  font-style: italic; color: var(--rp-text-muted);
}
.dark .rp-article-body blockquote {
  background: rgba(42,157,143,.1);
}

/* Links in article */
.rp-link-interno,
.rp-link-externo,
.rp-link {
  color: var(--rp-teal); text-decoration: underline;
  text-decoration-color: rgba(42,157,143,.4);
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
.rp-link-interno:hover,
.rp-link-externo:hover,
.rp-link:hover {
  color: var(--rp-teal-dk);
  text-decoration-color: var(--rp-teal);
}
.rp-anchor {
  opacity: 0; font-size: .75em; color: var(--rp-text-label);
  text-decoration: none; margin-left: .4rem;
  transition: opacity .15s;
}
h1:hover .rp-anchor, h2:hover .rp-anchor,
h3:hover .rp-anchor, h4:hover .rp-anchor { opacity: 1; }

/* Tables in article */
.rp-tabla-wrap { overflow-x: auto; margin: 1.25rem 0; }
.rp-tabla {
  width: 100%; border-collapse: collapse; font-size: .86rem;
  border: 1px solid var(--rp-border); border-radius: var(--rp-radius-sm);
  overflow: hidden;
}
.rp-tabla th {
  background: var(--rp-teal); color: white;
  padding: .6rem .9rem; text-align: left; font-weight: 700;
  font-size: .8rem; white-space: nowrap;
}
.rp-tabla td {
  padding: .55rem .9rem; border-top: 1px solid var(--rp-border);
  color: var(--rp-text);
}
.rp-tabla tr:nth-child(even) td { background: var(--rp-bg-alt); }

/* TOC */
.rp-toc {
  background: var(--rp-bg-alt); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
}
.rp-toc-mobile { display: block; }
@media (min-width: 1024px) { .rp-toc-mobile { display: none; } }
.rp-toc-desktop {
  position: sticky; top: calc(var(--rp-header-h) + 1rem);
}
.rp-toc-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--rp-text-label); margin-bottom: .6rem;
}
.rp-toc-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: .1rem;
}
.rp-toc-item { padding-left: 0; }
.rp-toc-h3 { padding-left: .9rem; }
.rp-toc-link {
  font-size: .78rem; color: var(--rp-text-muted); text-decoration: none;
  display: block; padding: .2rem .25rem; border-radius: 5px;
  transition: background .12s, color .12s;
}
.rp-toc-link:hover { background: var(--rp-bg-hover); color: var(--rp-teal); }

/* Sidebar */
.rp-article-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.rp-sidebar-section {
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); padding: 1.1rem;
}
.rp-sidebar-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--rp-text-label); margin-bottom: .8rem;
}
.rp-sidebar-toc-wrap { display: none; }
@media (min-width: 1024px) { .rp-sidebar-toc-wrap { display: block; } }

/* Article actions */
.rp-article-actions {
  display: flex; align-items: center; gap: .75rem;
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--rp-border);
}

/* Progress bar */
.rp-progress-bar {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--rp-teal), var(--rp-gold));
  transition: width .1s linear;
}

/* Directorio CTA */
.rp-directorio-cta {
  display: flex; align-items: flex-start; gap: .75rem;
  background: var(--rp-teal-lt); border: 1px solid rgba(42,157,143,.3);
  border-radius: var(--rp-radius); padding: .9rem 1.1rem;
  font-size: .82rem; margin-bottom: 1.25rem; color: var(--rp-teal-dk);
}
.dark .rp-directorio-cta {
  background: rgba(42,157,143,.1); color: var(--rp-teal);
}
.rp-directorio-cta strong { display: block; font-weight: 700; margin-bottom: .2rem; }
.rp-directorio-cta span { color: var(--rp-text-muted); }

/* ── SEARCH PAGE ──────────────────────────────────── */
.rp-buscar-hero {
  background: var(--rp-bg-alt);
  border-bottom: 1px solid var(--rp-border);
  padding: 2rem 0 1.5rem;
}
.rp-buscar-title {
  font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 700;
  color: var(--rp-text); margin-bottom: 1rem;
}
.rp-buscar-form-wrap { max-width: 560px; }
.rp-buscar-form {
  display: flex; align-items: center; gap: .5rem;
  background: var(--rp-bg-card); border: 2px solid var(--rp-border);
  border-radius: 50px; padding: .45rem .45rem .45rem 1rem;
  box-shadow: var(--rp-sh-sm);
  transition: border-color .2s;
}
.rp-buscar-form:focus-within { border-color: var(--rp-teal); }
.rp-buscar-icon { color: var(--rp-text-label); flex-shrink: 0; }
.rp-buscar-form input {
  flex: 1; border: none; background: transparent;
  color: var(--rp-text); font-size: .92rem; outline: none;
}
.rp-buscar-form button {
  background: var(--rp-teal); color: white; border: none;
  border-radius: 50px; padding: .45rem 1.1rem;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  flex-shrink: 0; transition: background .15s;
}
.rp-buscar-form button:hover { background: var(--rp-teal-dk); }
.rp-buscar-info {
  font-size: .8rem; color: var(--rp-text-label); margin-top: .65rem;
}
.rp-buscar-layout {
  display: grid; grid-template-columns: 1fr;
  gap: 2rem; padding: 1.75rem 0 4rem;
  align-items: start;
}
@media (min-width: 900px) {
  .rp-buscar-layout { grid-template-columns: 1fr 260px; }
}
.rp-buscar-resultados { display: flex; flex-direction: column; gap: .75rem; }

/* Search result item */
.buscar-result {
  display: block; background: var(--rp-bg-card);
  border: 1px solid var(--rp-border); border-radius: var(--rp-radius);
  padding: 1rem 1.15rem; text-decoration: none;
  transition: box-shadow .15s, border-color .15s;
}
.buscar-result:hover {
  box-shadow: var(--rp-sh-md); border-color: var(--rp-teal);
}
.buscar-result-cat {
  font-size: .72rem; font-weight: 700; margin-bottom: .35rem;
  display: flex; align-items: center; gap: .25rem;
}
.buscar-result-subcat { font-weight: 400; color: var(--rp-text-label); }
.buscar-result-titulo {
  font-family: 'Fraunces', serif; font-size: .98rem; font-weight: 600;
  color: var(--rp-text); line-height: 1.3; margin-bottom: .4rem;
  transition: color .15s;
}
.buscar-result:hover .buscar-result-titulo { color: var(--rp-teal); }
.buscar-result-resumen {
  font-size: .8rem; color: var(--rp-text-muted); line-height: 1.6;
  margin-bottom: .55rem;
}
.buscar-result-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem;
  font-size: .7rem; color: var(--rp-text-label);
}
.rp-highlight { background: var(--rp-gold-lt); color: var(--rp-gold-dk); border-radius: 2px; }
.dark .rp-highlight { background: rgba(233,196,106,.2); color: var(--rp-gold); }

/* Búsqueda sidebar */
.buscar-tags-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--rp-text-label); margin-bottom: .6rem;
}
.buscar-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.rp-buscar-cats { display: flex; flex-direction: column; gap: .35rem; }
.rp-buscar-cat-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .6rem; border-radius: var(--rp-radius-sm);
  background: var(--rp-bg-alt); text-decoration: none;
  transition: background .12s;
  border-left: 3px solid var(--cat-color, var(--rp-teal));
}
.rp-buscar-cat-item:hover { background: var(--rp-bg-hover); }
.rp-buscar-cat-icon { font-size: .9rem; }
.rp-buscar-cat-nombre {
  flex: 1; font-size: .8rem; font-weight: 600; color: var(--rp-text);
}
.rp-buscar-cat-count {
  font-size: .7rem; color: var(--rp-text-label);
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: 20px; padding: .1rem .45rem;
}

/* ── CATEGORY PAGE ────────────────────────────────── */
.cat-header {
  display: flex; align-items: flex-start; gap: 1.1rem;
  padding: .5rem 0;
}
.cat-header-icon {
  font-size: 2rem; width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--rp-bg-alt); border-radius: 14px; flex-shrink: 0;
}
.cat-header-nombre {
  font-family: 'Fraunces', serif; font-size: 1.6rem; font-weight: 700;
  color: var(--rp-text); margin-bottom: .3rem;
}
.cat-header-desc { font-size: .88rem; color: var(--rp-text-muted); line-height: 1.55; }

/* Category toolbar */
.rp-cat-toolbar {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .75rem;
  padding: .75rem 0; border-bottom: 1px solid var(--rp-border);
  margin-bottom: 1.25rem;
}
.rp-subcat-chips { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }
.rp-subcat-chip {
  background: var(--rp-bg-alt); border: 1px solid var(--rp-border);
  border-radius: 20px; padding: .25rem .75rem;
  font-size: .76rem; font-weight: 600; color: var(--rp-text-muted);
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.rp-subcat-chip:hover { background: var(--rp-bg-hover); color: var(--rp-teal); }
.rp-subcat-chip.active {
  background: var(--rp-teal); color: white; border-color: var(--rp-teal);
}
.rp-cat-controls { display: flex; align-items: center; gap: .75rem; }
.rp-cat-count { font-size: .78rem; color: var(--rp-text-label); white-space: nowrap; }
.rp-sort-wrap { display: flex; align-items: center; gap: .4rem; }
.rp-sort-label { font-size: .76rem; color: var(--rp-text-label); }
.rp-sort-select {
  padding: .3rem .6rem; border-radius: 8px;
  border: 1px solid var(--rp-border); background: var(--rp-bg-alt);
  color: var(--rp-text); font-size: .78rem; cursor: pointer; outline: none;
}

/* ── BUTTONS ──────────────────────────────────────── */
.rp-btn-primary {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--rp-teal); color: white; text-decoration: none;
  border: none; border-radius: 50px; padding: .55rem 1.3rem;
  font-size: .85rem; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .15s;
}
.rp-btn-primary:hover { background: var(--rp-teal-dk); transform: translateY(-1px); }
.rp-btn-outline {
  display: inline-flex; align-items: center; gap: .4rem;
  background: transparent; color: var(--rp-text-muted);
  border: 1.5px solid var(--rp-border); border-radius: 50px;
  padding: .5rem 1.1rem; font-size: .82rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.rp-btn-outline:hover {
  background: var(--rp-bg-hover); color: var(--rp-teal);
  border-color: var(--rp-teal);
}

/* ── SKELETON LOADING ─────────────────────────────── */
.rp-skeleton {
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); padding: 1.1rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.rp-sk-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg,
    var(--rp-bg-alt) 25%, var(--rp-border) 50%, var(--rp-bg-alt) 75%);
  background-size: 200%;
  animation: shimmer 1.4s infinite;
}
.rp-sk-title  { height: 18px; width: 70%; }
.rp-sk-short  { width: 40%; }
@keyframes shimmer {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-sk-line { animation: none; }
}

/* ── EMPTY / ERROR STATES ─────────────────────────── */
.rp-empty, .rp-error {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .75rem; padding: 3rem 1rem;
  text-align: center; color: var(--rp-text-label);
}
.rp-empty-icon { opacity: .4; }
.rp-empty-msg  { font-weight: 600; font-size: .9rem; color: var(--rp-text-muted); }
.rp-empty-hint { font-size: .8rem; }
.rp-error      { color: var(--rp-coral); }

/* ── CTA SECTION ──────────────────────────────────── */
.rp-cta-section {
  background: linear-gradient(135deg, var(--rp-teal) 0%, var(--rp-teal-dk) 100%);
  padding: 3rem 0;
}
.rp-cta {
  max-width: 540px; margin: 0 auto;
  text-align: center; display: flex;
  flex-direction: column; align-items: center; gap: 1rem;
}
.rp-cta-icon  { font-size: 2.5rem; }
.rp-cta-title {
  font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 700;
  color: white; line-height: 1.25;
}
.rp-cta-text  { font-size: .88rem; color: rgba(255,255,255,.85); line-height: 1.6; }
.rp-cta-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.rp-cta-section .rp-btn-primary {
  background: white; color: var(--rp-teal);
}
.rp-cta-section .rp-btn-primary:hover { background: rgba(255,255,255,.9); }

/* ── FOOTER ───────────────────────────────────────── */
.rp-footer {
  background: var(--rp-bg-alt);
  border-top: 1px solid var(--rp-border);
  padding: 2.5rem 0 1.5rem;
}
.rp-footer-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 2rem; margin-bottom: 2rem;
}
@media (min-width: 640px) {
  .rp-footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.rp-footer-brand { max-width: 280px; }
.rp-footer-logo {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem;
}
.rp-footer-logo-name {
  font-family: 'Fraunces', serif; font-size: .95rem; font-weight: 700;
  color: var(--rp-text);
}
.rp-footer-tagline { font-size: .78rem; color: var(--rp-text-muted); line-height: 1.5; }
.rp-footer-links { display: flex; flex-direction: column; gap: .35rem; }
.rp-footer-links h4 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--rp-text-label); margin-bottom: .25rem;
}
.rp-footer-links a {
  font-size: .82rem; color: var(--rp-text-muted);
  text-decoration: none; transition: color .15s;
}
.rp-footer-links a:hover { color: var(--rp-teal); }
.rp-footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  padding-top: 1.25rem; border-top: 1px solid var(--rp-border);
  font-size: .75rem; color: var(--rp-text-label);
}
.rp-footer-logo-sm {
  display: flex; align-items: center; gap: .35rem;
  text-decoration: none; color: var(--rp-text-muted);
  font-size: .82rem; font-weight: 600;
  transition: color .15s;
}
.rp-footer-logo-sm:hover { color: var(--rp-teal); }

/* ── TOAST ────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1rem;
  z-index: 9999; display: flex;
  flex-direction: column; gap: .4rem;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .9rem; border-radius: 10px;
  font-size: .82rem; font-weight: 500; max-width: 300px;
  opacity: 0; transform: translateX(16px);
  transition: opacity .25s, transform .25s;
  box-shadow: var(--rp-sh-md); pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: #e8f5e0; border: 1.5px solid #8bc06a; color: #2a5a10; }
.toast-error   { background: #fff0f0; border: 1.5px solid #f0b0b0; color: #c0392b; }
.toast-info    { background: var(--rp-teal-lt); border: 1.5px solid rgba(42,157,143,.4); color: var(--rp-teal-dk); }
.dark .toast-success { background: #1a3010; border-color: #4a7a30; color: #8adf5a; }
.dark .toast-error   { background: #3a0d12; border-color: #7a2020; color: #f0a0a0; }

/* ── SCROLL TO TOP ────────────────────────────────── */
.rp-scroll-top {
  position: fixed; bottom: 1.5rem; left: 1rem; z-index: 800;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--rp-teal); color: white;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--rp-sh-md);
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.rp-scroll-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.rp-scroll-top:hover { background: var(--rp-teal-dk); }

/* ══════════════════════════════════════════════════════
   Fase 2 — Autenticación, Editor y Panel
══════════════════════════════════════════════════════ */

/* ── User menu en el header ───────────────────────── */
.rp-user-menu { position: relative; }
.rp-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--rp-teal); color: white;
  border: 2px solid var(--rp-teal-lt);
  font-size: .85rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: border-color .15s;
}
.rp-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.rp-user-avatar:hover { border-color: var(--rp-teal); }
.rp-user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); min-width: 200px;
  box-shadow: var(--rp-sh-lg); overflow: hidden; z-index: 400;
}
.rp-user-dropdown[hidden] { display: none; }
.rp-user-name {
  display: block; padding: .7rem 1rem .4rem;
  font-size: .78rem; font-weight: 700; color: var(--rp-text);
}
.rp-user-sep { border-color: var(--rp-border); margin: .2rem 0; }
.rp-user-dropdown a,
.rp-user-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: .5rem 1rem; font-size: .82rem;
  color: var(--rp-text-muted); text-decoration: none;
  background: none; border: none; cursor: pointer;
  transition: background .12s, color .12s;
}
.rp-user-dropdown a:hover,
.rp-user-dropdown button:hover { background: var(--rp-bg-hover); color: var(--rp-teal); }

/* ── Auth modal ───────────────────────────────────── */
#auth-modal {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
#auth-modal[hidden] { display: none; }
#auth-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
}
#auth-modal-inner {
  position: relative; z-index: 1;
  background: var(--rp-bg-card); border-radius: var(--rp-radius-lg);
  width: min(420px, 96vw); max-height: 92vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
  animation: slideUp .2s ease;
  padding: 1.5rem;
}
#auth-modal-close {
  position: absolute; top: 1rem; right: 1rem;
}
.auth-header { text-align: center; margin-bottom: 1.25rem; }
.auth-logo {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--rp-teal); color: white;
  font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .75rem;
}
.auth-title {
  font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 700;
  color: var(--rp-text); margin-bottom: .2rem;
}
.auth-subtitle { font-size: .8rem; color: var(--rp-text-label); }

/* Auth tabs */
.auth-tabs {
  display: flex; gap: .25rem; background: var(--rp-bg-alt);
  border-radius: 10px; padding: .25rem; margin-bottom: 1.1rem;
}
.auth-tab {
  flex: 1; padding: .45rem; border: none; border-radius: 8px;
  background: transparent; font-size: .82rem; font-weight: 600;
  color: var(--rp-text-label); cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tab.active { background: var(--rp-bg-card); color: var(--rp-text); box-shadow: var(--rp-sh-sm); }

/* Google button */
.auth-google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: .6rem;
  background: var(--rp-bg-card); border: 1.5px solid var(--rp-border);
  border-radius: 9px; padding: .6rem 1rem; font-size: .85rem; font-weight: 600;
  color: var(--rp-text); cursor: pointer; transition: background .15s, border-color .15s;
  margin-bottom: .85rem;
}
.auth-google-btn:hover { background: var(--rp-bg-hover); border-color: var(--rp-border-dk); }
.auth-google-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Divider */
.auth-divider {
  display: flex; align-items: center; gap: .6rem; margin-bottom: .85rem;
  font-size: .73rem; color: var(--rp-text-label);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--rp-border);
}

/* Form groups */
.auth-form-group { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .7rem; }
.auth-form-group label {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--rp-text-label);
}
.auth-hint { font-weight: 400; text-transform: none; letter-spacing: 0; }
.auth-form-group input,
.auth-form-group textarea {
  padding: .5rem .75rem; border-radius: 9px;
  border: 1.5px solid var(--rp-border); background: var(--rp-bg-alt);
  color: var(--rp-text); font-size: .85rem; outline: none;
  transition: border-color .15s; font-family: inherit;
}
.auth-form-group input:focus,
.auth-form-group textarea:focus { border-color: var(--rp-teal); }
.auth-error {
  font-size: .78rem; color: var(--rp-coral); background: var(--rp-coral-lt);
  border: 1px solid rgba(231,111,81,.3); border-radius: 8px;
  padding: .4rem .7rem; margin-bottom: .5rem;
}
.auth-submit-btn {
  width: 100%; background: var(--rp-teal); color: white;
  border: none; border-radius: 9px; padding: .6rem; font-size: .88rem;
  font-weight: 700; cursor: pointer; transition: background .15s;
  margin-bottom: .5rem;
}
.auth-submit-btn:hover { background: var(--rp-teal-dk); }
.auth-link-btn {
  background: none; border: none; color: var(--rp-teal); font-size: .78rem;
  cursor: pointer; text-decoration: underline; display: block;
  text-align: center;
}
.auth-footer-note {
  font-size: .71rem; color: var(--rp-text-label); text-align: center;
  margin-top: 1rem; line-height: 1.5;
}

/* ── Editor page ──────────────────────────────────── */
.editor-layout {
  display: grid; grid-template-columns: 1fr;
  min-height: calc(100vh - var(--rp-header-h));
  gap: 0;
}
@media (min-width: 1024px) {
  .editor-layout { grid-template-columns: 1fr 280px; align-items: start; }
}

.editor-main { padding: 1.25rem 1.5rem 4rem; min-width: 0; }

/* Metadata section */
.editor-meta-section {
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.editor-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
}
@media (max-width: 640px) { .editor-meta-grid { grid-template-columns: 1fr; } }
.editor-field { display: flex; flex-direction: column; gap: .3rem; }
.editor-field-full { grid-column: 1 / -1; }
.editor-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--rp-text-label);
}
.editor-label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; }
.editor-input,
.editor-select {
  padding: .5rem .75rem; border-radius: 9px;
  border: 1.5px solid var(--rp-border); background: var(--rp-bg-alt);
  color: var(--rp-text); font-size: .85rem; outline: none;
  transition: border-color .15s; font-family: inherit;
}
.editor-input:focus, .editor-select:focus { border-color: var(--rp-teal); }
.editor-title-input  { font-size: 1rem; font-weight: 600; }
.editor-resumen-input{ resize: vertical; }
.editor-slug-input   { font-family: 'JetBrains Mono', monospace; font-size: .78rem; }
.editor-slug-preview {
  font-size: .7rem; color: var(--rp-text-label);
  font-family: 'JetBrains Mono', monospace;
}

/* Content section (EasyMDE) */
.editor-content-section { margin-bottom: 1rem; }
.editor-content-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .4rem;
}
.editor-md-guide { font-size: .75rem; color: var(--rp-teal); text-decoration: none; }
.editor-md-guide:hover { text-decoration: underline; }
/* Override EasyMDE styles */
.CodeMirror {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: .88rem !important;
  border-radius: 0 0 9px 9px !important;
  border-color: var(--rp-border) !important;
  background: var(--rp-bg-alt) !important;
  color: var(--rp-text) !important;
  min-height: 380px;
}
.dark .CodeMirror { background: var(--rp-bg-alt) !important; color: var(--rp-text) !important; }
.editor-toolbar {
  border-color: var(--rp-border) !important;
  background: var(--rp-bg-card) !important;
  border-radius: 9px 9px 0 0 !important;
}
.dark .editor-toolbar { background: var(--rp-bg-hover) !important; }
.editor-toolbar a { color: var(--rp-text-muted) !important; }
.editor-toolbar a:hover, .editor-toolbar a.active { color: var(--rp-teal) !important; background: var(--rp-bg-hover) !important; }
.editor-statusbar { font-size: .72rem; color: var(--rp-text-label) !important; border-color: var(--rp-border) !important; }

/* Editor sidebar */
.editor-sidebar {
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
  background: var(--rp-bg-alt);
  border-left: 1px solid var(--rp-border);
}
@media (min-width: 1024px) {
  .editor-sidebar {
    position: sticky; top: var(--rp-header-h);
    height: calc(100vh - var(--rp-header-h));
    overflow-y: auto;
  }
}
.editor-sidebar-card {
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); padding: 1rem;
  display: flex; flex-direction: column; gap: .65rem;
}
.editor-sidebar-card-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--rp-text-label);
}
.editor-publish-info { display: flex; flex-direction: column; gap: .4rem; }
.editor-publish-step {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .78rem; color: var(--rp-text-muted);
}
.editor-publish-step-icon {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--rp-teal-lt); color: var(--rp-teal);
  font-size: .68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.editor-publish-step-final { opacity: .6; }
.editor-btn-save {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--rp-bg-hover); border: 1.5px solid var(--rp-border);
  border-radius: 9px; padding: .55rem; font-size: .83rem; font-weight: 600;
  color: var(--rp-text); cursor: pointer; transition: background .15s;
}
.editor-btn-save:hover { background: var(--rp-border); }
.editor-btn-submit {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--rp-teal); color: white; border: none;
  border-radius: 9px; padding: .55rem; font-size: .83rem; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.editor-btn-submit:hover { opacity: .88; }
.editor-btn-submit:disabled,
.editor-btn-save:disabled { opacity: .5; cursor: not-allowed; }
.editor-btn-back { text-align: center; justify-content: center; }
.editor-guide-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: .35rem;
  font-size: .74rem; color: var(--rp-text-muted);
}
.editor-guide-list code {
  font-family: 'JetBrains Mono', monospace; font-size: .78em;
  background: var(--rp-bg-alt); padding: .1em .35em;
  border-radius: 3px; color: var(--rp-teal);
}
.editor-header-status { flex: 1; text-align: center; }
.editor-status-text { font-size: .76rem; color: var(--rp-text-label); }

/* ── Panel de administración ─────────────────────── */
.panel-layout {
  display: grid; grid-template-columns: 220px 1fr;
  min-height: calc(100vh - var(--rp-header-h));
}
@media (max-width: 768px) {
  .panel-layout { grid-template-columns: 1fr; }
}
.panel-nav {
  background: var(--rp-bg-alt); border-right: 1px solid var(--rp-border);
  padding: 1.25rem .75rem;
  position: sticky; top: var(--rp-header-h);
  height: calc(100vh - var(--rp-header-h));
  overflow-y: auto; display: flex; flex-direction: column; gap: .2rem;
}
@media (max-width: 768px) {
  .panel-nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--rp-border); }
}
.panel-nav-title {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--rp-text-label);
  padding: .25rem .5rem .5rem; margin-bottom: .25rem;
}
@media (max-width: 768px) { .panel-nav-title { display: none; } }
.panel-tab {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .75rem; border: none; border-radius: 9px;
  background: transparent; font-size: .82rem; font-weight: 500;
  color: var(--rp-text-muted); cursor: pointer; text-align: left;
  width: 100%; transition: background .12s, color .12s; position: relative;
}
.panel-tab:hover { background: var(--rp-bg-hover); color: var(--rp-text); }
.panel-tab.active { background: var(--rp-teal-lt); color: var(--rp-teal); font-weight: 700; }
.dark .panel-tab.active { background: rgba(42,157,143,.15); }
.panel-nav-badge {
  background: var(--rp-coral); color: white;
  font-size: .6rem; font-weight: 700; border-radius: 9px;
  padding: 1px 5px; min-width: 16px; text-align: center;
}
.panel-nav-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; border-radius: 9px;
  font-size: .8rem; color: var(--rp-text-muted); text-decoration: none;
  transition: background .12s, color .12s;
}
.panel-nav-link:hover { background: var(--rp-bg-hover); color: var(--rp-teal); }
.panel-content-area { padding: 1.5rem; overflow-y: auto; }

/* Panel sections */
.panel-section-header { margin-bottom: 1.25rem; }
.panel-section-title {
  font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 700;
  color: var(--rp-text); display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem;
}
.panel-badge {
  background: var(--rp-coral); color: white; border-radius: 20px;
  font-size: .7rem; font-weight: 700; padding: .1rem .5rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.panel-section-hint { font-size: .8rem; color: var(--rp-text-muted); }

/* Revision cards */
.panel-revision-list { display: flex; flex-direction: column; gap: 1rem; }
.panel-revision-card {
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--rp-gold);
}
.panel-rev-header { margin-bottom: .85rem; }
.panel-rev-meta {
  display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
  margin-bottom: .45rem;
}
.panel-rev-badge {
  background: var(--rp-gold-lt); color: var(--rp-gold-dk);
  border: 1px solid var(--rp-gold); border-radius: 20px;
  font-size: .68rem; font-weight: 700; padding: .12rem .55rem;
}
.panel-rev-autor { font-size: .78rem; color: var(--rp-text-muted); }
.panel-rev-fecha  { font-size: .74rem; color: var(--rp-text-label); }
.panel-rev-titulo {
  font-family: 'Fraunces', serif; font-size: .98rem; font-weight: 600;
  color: var(--rp-text);
}
.panel-rev-nota {
  font-size: .78rem; color: var(--rp-text-muted); margin-top: .35rem;
  background: var(--rp-bg-alt); border-radius: 6px; padding: .35rem .6rem;
}
.panel-rev-actions {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.panel-btn-approve { background: var(--rp-teal) !important; color: white !important; border: none !important; }
.panel-btn-approve:hover { opacity: .88 !important; }
.panel-btn-reject  { color: var(--rp-coral) !important; border-color: var(--rp-coral) !important; }
.panel-btn-reject:hover { background: var(--rp-coral-lt) !important; }

/* Publicados grid */
.panel-publicados-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .85rem;
}
.panel-pub-card {
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); padding: .9rem 1rem;
  display: flex; flex-direction: column; gap: .4rem;
}
.panel-pub-cat  { font-size: .72rem; font-weight: 700; }
.panel-pub-titulo {
  font-size: .88rem; font-weight: 600; color: var(--rp-text); line-height: 1.3;
}
.panel-pub-meta { display: flex; gap: .75rem; font-size: .72rem; color: var(--rp-text-label); }
.panel-pub-actions { display: flex; gap: .4rem; margin-top: .2rem; }
.panel-btn-sm { padding: .25rem .65rem !important; font-size: .73rem !important; border-radius: 6px !important; }

/* Usuarios nota */
.panel-usuarios-nota {
  display: flex; align-items: flex-start; gap: .75rem;
  background: var(--rp-teal-lt); border: 1px solid rgba(42,157,143,.3);
  border-radius: var(--rp-radius); padding: 1.1rem 1.25rem;
  font-size: .83rem; color: var(--rp-teal-dk); line-height: 1.6;
}
.dark .panel-usuarios-nota { background: rgba(42,157,143,.1); color: var(--rp-teal); }

/* Rechazo modal */
#rechazo-modal {
  position: fixed; inset: 0; z-index: 9600;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.rechazo-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
}
.rechazo-inner {
  position: relative; z-index: 1;
  background: var(--rp-bg-card); border-radius: var(--rp-radius-lg);
  width: min(460px, 96vw); padding: 1.5rem;
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
  animation: slideUp .2s ease;
}
.rechazo-title    { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 700; margin-bottom: .25rem; }
.rechazo-subtitle { font-size: .82rem; color: var(--rp-text-muted); margin-bottom: 1rem; }
.rechazo-actions  { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; }
.panel-btn-reject-confirm { background: var(--rp-coral) !important; }

/* Loading spinner */
.panel-loading {
  display: flex; align-items: center; gap: .6rem;
  color: var(--rp-text-label); font-size: .85rem; padding: 2rem 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .9s linear infinite; }

/* ══════════════════════════════════════════════════════
   Fase 3 — Historial, roles y notificaciones
══════════════════════════════════════════════════════ */

/* ── Notification bell ────────────────────────────── */
.rp-notif-btn { position: relative; }
.rp-notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--rp-coral); color: white;
  font-size: .62rem; font-weight: 700; line-height: 1;
  min-width: 16px; height: 16px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid var(--rp-bg-card);
}

/* ── Panel: tabla de usuarios ──────────────────────── */
.panel-usuarios-table-wrap {
  overflow-x: auto; border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); margin-bottom: 1.5rem;
}
.panel-usuarios-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
  min-width: 640px;
}
.panel-usuarios-table th {
  background: var(--rp-bg-alt); color: var(--rp-text-label);
  text-align: left; padding: .6rem .9rem; font-size: .7rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--rp-border);
}
.panel-usuarios-table td {
  padding: .55rem .9rem; border-bottom: 1px solid var(--rp-border);
  color: var(--rp-text); vertical-align: middle;
}
.panel-usuarios-table tr:last-child td { border-bottom: none; }
.panel-usuarios-table tr.panel-row-self { background: var(--rp-teal-lt); }
.dark .panel-usuarios-table tr.panel-row-self { background: rgba(42,157,143,.08); }

.panel-user-cell { display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.panel-user-avatar-img,
.panel-user-avatar-placeholder {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover;
}
.panel-user-avatar-placeholder {
  background: var(--rp-teal); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
}
.panel-user-email { color: var(--rp-text-muted); font-size: .78rem; }
.panel-user-date  { color: var(--rp-text-label); font-size: .76rem; white-space: nowrap; }
.panel-self-badge {
  background: var(--rp-teal); color: white; font-size: .62rem;
  font-weight: 700; border-radius: 10px; padding: .05rem .45rem;
}
.panel-self-hint {
  display: block; font-size: .68rem; color: var(--rp-text-label);
  margin-top: .2rem;
}

/* Role select */
.panel-role-select {
  padding: .3rem .55rem; border-radius: 7px;
  border: 1.5px solid var(--role-color, var(--rp-border));
  background: var(--rp-bg-alt); color: var(--rp-text);
  font-size: .78rem; font-weight: 600; cursor: pointer; outline: none;
  transition: border-color .15s;
}
.panel-role-select:disabled { opacity: .55; cursor: not-allowed; }

/* Active toggle switch */
.panel-toggle-wrap {
  position: relative; display: inline-block; width: 38px; height: 21px;
  cursor: pointer;
}
.panel-toggle-wrap input { opacity: 0; width: 0; height: 0; position: absolute; }
.panel-toggle-slider {
  position: absolute; inset: 0; background: var(--rp-border);
  border-radius: 21px; transition: background .2s;
}
.panel-toggle-slider::before {
  content: ''; position: absolute; width: 15px; height: 15px;
  left: 3px; top: 3px; background: white; border-radius: 50%;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.panel-toggle-wrap input:checked + .panel-toggle-slider { background: var(--rp-teal); }
.panel-toggle-wrap input:checked + .panel-toggle-slider::before { transform: translateX(17px); }
.panel-toggle-wrap input:disabled + .panel-toggle-slider { opacity: .5; cursor: not-allowed; }

/* Roles legend */
.panel-roles-legend {
  background: var(--rp-bg-alt); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); padding: 1rem 1.25rem;
}
.panel-roles-legend-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--rp-text-label); margin-bottom: .6rem;
}
.panel-roles-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: .4rem;
  font-size: .8rem; color: var(--rp-text-muted);
}
.panel-roles-list li { display: flex; align-items: center; gap: .55rem; }
.panel-role-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   Página de historial
══════════════════════════════════════════════════ */
.hist-page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-bottom: 1rem;
  border-bottom: 1px solid var(--rp-border);
}
.hist-page-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--rp-teal); display: block; margin-bottom: .2rem;
}
.hist-page-title {
  font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 700;
  color: var(--rp-text);
}

.hist-layout {
  display: grid; grid-template-columns: 1fr; gap: 1.5rem;
  padding: 1.25rem 0 4rem;
}
@media (min-width: 900px) {
  .hist-layout { grid-template-columns: 300px 1fr; align-items: start; }
}

.hist-sidebar { display: flex; flex-direction: column; gap: .6rem; }
@media (min-width: 900px) {
  .hist-sidebar {
    position: sticky; top: calc(var(--rp-header-h) + 1rem);
    max-height: calc(100vh - var(--rp-header-h) - 2rem);
    overflow-y: auto;
  }
}
.hist-timeline { display: flex; flex-direction: column; gap: .4rem; }

.hist-timeline-item {
  display: flex; align-items: flex-start; gap: .65rem;
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-sm); padding: .65rem .8rem;
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, background .15s;
}
.hist-timeline-item:hover { background: var(--rp-bg-hover); }
.hist-timeline-item.active {
  border-color: var(--rp-teal); background: var(--rp-teal-lt);
}
.dark .hist-timeline-item.active { background: rgba(42,157,143,.1); }
.hist-timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rp-border-dk); margin-top: .25rem; flex-shrink: 0;
}
.hist-timeline-dot.current { background: var(--rp-teal); }
.hist-timeline-body { flex: 1; min-width: 0; }
.hist-timeline-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .5rem; margin-bottom: .15rem;
}
.hist-timeline-version { font-size: .82rem; font-weight: 700; color: var(--rp-text); }
.hist-timeline-date { font-size: .68rem; color: var(--rp-text-label); white-space: nowrap; }
.hist-timeline-author { font-size: .74rem; color: var(--rp-text-muted); }
.hist-timeline-nota {
  font-size: .72rem; color: var(--rp-text-muted); margin-top: .25rem;
  background: var(--rp-bg-alt); border-radius: 5px; padding: .25rem .5rem;
}
.hist-empty-versions {
  font-size: .82rem; color: var(--rp-text-label); padding: 1rem;
  background: var(--rp-bg-alt); border-radius: var(--rp-radius-sm);
  text-align: center; line-height: 1.6;
}

/* Diff content area */
.hist-content { min-width: 0; }
.hist-diff-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.hist-diff-title {
  font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 700;
  color: var(--rp-text);
}
.hist-diff-meta { font-size: .78rem; color: var(--rp-text-label); margin-top: .2rem; }

.hist-title-diff {
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-sm); padding: .75rem 1rem;
  margin-bottom: 1rem; font-size: .85rem;
}
.hist-title-diff-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--rp-text-label); display: block; margin-bottom: .3rem;
}
.hist-title-diff-old {
  background: var(--rp-coral-lt); color: #a13a20; border-radius: 4px;
  padding: .2rem .5rem; margin-bottom: .25rem;
  font-family: 'JetBrains Mono', monospace; font-size: .8rem;
}
.hist-title-diff-new {
  background: #e3f5e0; color: #2a6a10; border-radius: 4px;
  padding: .2rem .5rem;
  font-family: 'JetBrains Mono', monospace; font-size: .8rem;
}
.dark .hist-title-diff-old { background: rgba(231,111,81,.15); color: #f0a08a; }
.dark .hist-title-diff-new { background: rgba(60,160,40,.15); color: #9adf80; }

.hist-fulltext {
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius); padding: 1.25rem 1.5rem;
}
.hist-fulltext .rp-h1, .hist-fulltext h1 { font-size: 1.4rem; }
.hist-fulltext .rp-h2, .hist-fulltext h2 { font-size: 1.15rem; }

/* diff2html theme adjustments */
.hist-diff-wrap { border-radius: var(--rp-radius); overflow: hidden; border: 1px solid var(--rp-border); }
.hist-diff-wrap .d2h-wrapper { font-size: .8rem; }
.hist-diff-wrap .d2h-file-header { display: none; }
.hist-diff-wrap .d2h-code-line, .hist-diff-wrap .d2h-code-side-line {
  font-family: 'JetBrains Mono', monospace;
}
.dark .hist-diff-wrap .d2h-file-diff { background: var(--rp-bg-card); }
.dark .hist-diff-wrap .d2h-code-line, .dark .hist-diff-wrap .d2h-code-side-line { color: var(--rp-text); }
.dark .hist-diff-wrap .d2h-ins { background-color: rgba(60,160,40,.15); }
.dark .hist-diff-wrap .d2h-del { background-color: rgba(231,111,81,.15); }
.dark .hist-diff-wrap .d2h-code-line-ctn { color: var(--rp-text); }
.dark .hist-diff-wrap .d2h-info { background: var(--rp-bg-alt); color: var(--rp-text-label); }
.dark .hist-diff-wrap tbody { background: var(--rp-bg-card); }

/* ══════════════════════════════════════════════════════
   Fase 4 — Integración con el ecosistema
══════════════════════════════════════════════════════ */

/* ── Widget "Busca tu club" (sidebar artículo) ────── */
.eco-sidebar-section { display: flex; flex-direction: column; gap: .6rem; }
.eco-widget-text {
  font-size: .8rem; color: var(--rp-text-muted); line-height: 1.55;
}
.eco-search-box {
  display: flex; align-items: center; gap: .5rem;
  background: var(--rp-bg-alt); border: 1.5px solid var(--rp-border);
  border-radius: 24px; padding: .4rem .9rem;
  transition: border-color .15s;
}
.eco-search-box:focus-within { border-color: var(--rp-teal); }
.eco-search-icon { color: var(--rp-text-label); flex-shrink: 0; }
.eco-search-box input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: .8rem; color: var(--rp-text);
}
.eco-search-box input::placeholder { color: var(--rp-text-label); }

.eco-loading { font-size: .76rem; color: var(--rp-text-label); padding: .5rem .2rem; }
.eco-no-results {
  font-size: .78rem; color: var(--rp-text-muted); padding: .5rem .2rem; line-height: 1.6;
}
.eco-no-results a { color: var(--rp-teal); text-decoration: underline; }

.eco-club-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .55rem; border-radius: var(--rp-radius-sm);
  text-decoration: none; transition: background .12s;
  border: 1px solid transparent;
}
.eco-club-item:hover { background: var(--rp-bg-hover); border-color: var(--rp-border); }
.eco-club-item + .eco-club-item { margin-top: .25rem; }
.eco-club-icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--rp-teal-lt); display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
}
.dark .eco-club-icon { background: rgba(42,157,143,.15); }
.eco-club-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eco-club-nombre {
  font-size: .8rem; font-weight: 600; color: var(--rp-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eco-club-ciudad { font-size: .7rem; color: var(--rp-text-label); }
.eco-club-arrow { color: var(--rp-text-label); flex-shrink: 0; }
.eco-club-item:hover .eco-club-arrow { color: var(--rp-teal); }

.eco-widget-link {
  font-size: .78rem; font-weight: 600; color: var(--rp-teal);
  text-decoration: none; margin-top: .2rem;
}
.eco-widget-link:hover { text-decoration: underline; }

/* ── Búsqueda cruzada en buscar.html ──────────────── */
.eco-crosssearch {
  background: var(--rp-bg-card); border: 1px solid var(--rp-border);
  border-left: 4px solid var(--rp-coral);
  border-radius: var(--rp-radius); padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}
.eco-crosssearch-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem;
}
.eco-crosssearch-title {
  font-family: 'Fraunces', serif; font-size: 1rem; font-weight: 700;
  color: var(--rp-text); display: flex; align-items: center; gap: .4rem;
}
.eco-crosssearch-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .4rem;
}

/* ── Hero CTA "Escribe un artículo" ───────────────── */
.rp-hero-cta {
  margin-top: 1.5rem;
}
.rp-hero-cta-inner {
  display: inline-flex; align-items: center; gap: .85rem; flex-wrap: wrap;
  justify-content: center;
  background: rgba(42,157,143,.10);
  border: 1.5px solid rgba(42,157,143,.30);
  border-radius: 50px;
  padding: .55rem .55rem .55rem 1rem;
  transition: border-color .2s, background .2s;
}
.rp-hero-cta-inner:hover {
  background: rgba(42,157,143,.16);
  border-color: rgba(42,157,143,.55);
}
.dark .rp-hero-cta-inner {
  background: rgba(42,157,143,.12);
  border-color: rgba(42,157,143,.28);
}
.rp-hero-cta-text {
  display: flex; align-items: center; gap: .45rem;
  font-size: .84rem; color: var(--rp-text-muted);
}
.rp-hero-cta-text svg { color: var(--rp-teal); flex-shrink: 0; }
.rp-hero-cta-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--rp-teal); color: white;
  border-radius: 50px; padding: .45rem 1rem;
  font-size: .82rem; font-weight: 700; text-decoration: none;
  transition: background .15s, transform .15s;
  white-space: nowrap;
}
.rp-hero-cta-btn:hover { background: var(--rp-teal-dk); transform: translateY(-1px); }

/* ── User info en el dropdown ─────────────────────── */
.rp-user-info {
  padding: .75rem 1rem .5rem;
  display: flex; flex-direction: column; gap: .18rem;
}
.rp-user-name {
  font-size: .82rem; font-weight: 700; color: var(--rp-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rp-user-email {
  font-size: .74rem; color: var(--rp-text-label);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rp-user-role {
  display: flex; align-items: center; gap: .3rem; margin-top: .2rem;
}
.rp-role-icon { font-size: .8rem; line-height: 1; }
.rp-role-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; border-radius: 20px;
  padding: .12rem .55rem; border: 1.5px solid;
}
.rp-role-lector      { color: #6b8b87; border-color: #b0d0cc; background: #f0f8f7; }
.rp-role-colaborador { color: #2a6a9d; border-color: #a0c8e8; background: #eef6fd; }
.rp-role-editor      { color: #a07820; border-color: #e8c87a; background: #fdf6e3; }
.rp-role-admin       { color: #a03020; border-color: #f0a898; background: #fef0ee; }
.dark .rp-role-lector      { background: rgba(107,139,135,.15); }
.dark .rp-role-colaborador { background: rgba(42,106,157,.15); }
.dark .rp-role-editor      { background: rgba(160,120,32,.15); }
.dark .rp-role-admin       { background: rgba(160,48,32,.15); }

/* ══════════════════════════════════════════════════════
   User bar — barra horizontal de usuario autenticado
   Aparece pegada bajo el header principal cuando hay
   sesión activa. Se oculta completamente en logout.
══════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════
   User bar — barra horizontal completa de usuario autenticado
   Incluye: logo · identidad · acciones · campana · tema · avatar
   Aparece sticky bajo el header cuando hay sesión activa.
══════════════════════════════════════════════════════ */
.rp-user-bar {
  position: sticky;
  top: var(--rp-header-h);
  z-index: 190;
  background: var(--rp-teal);
  color: white;
  border-bottom: 1px solid rgba(0,0,0,.14);
  box-shadow: 0 3px 12px rgba(42,157,143,.28);
}
.rp-user-bar[hidden] { display: none; }

.rp-user-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 48px;
  display: flex;
  align-items: center;
  gap: .5rem;
}
@media (min-width: 768px) { .rp-user-bar-inner { padding: 0 1.5rem; gap: .75rem; } }

/* ── Logo ────────────────────────────────────────── */
.rp-user-bar-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,.22);
  color: white; font-family: 'Fraunces', serif;
  font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.3);
  transition: background .15s;
}
.rp-user-bar-logo:hover { background: rgba(255,255,255,.35); }

/* ── Identidad ───────────────────────────────────── */
.rp-user-bar-identity {
  display: flex; align-items: center; gap: .5rem;
  min-width: 0; flex-shrink: 1; overflow: hidden;
}
.rp-user-bar-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 1.5px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
  overflow: hidden;
}
.rp-user-bar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.rp-user-bar-info {
  display: flex; align-items: baseline; gap: .4rem;
  min-width: 0; overflow: hidden;
}
.rp-user-bar-name {
  font-size: .8rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px;
}
.rp-user-bar-email {
  font-size: .72rem; opacity: .72;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 180px; display: none;
}
@media (min-width: 640px) { .rp-user-bar-email { display: block; } }
@media (min-width: 1024px) { .rp-user-bar-name { max-width: 200px; } .rp-user-bar-email { max-width: 240px; } }

.rp-user-bar-role {
  font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  border-radius: 20px; padding: .12rem .5rem;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.32);
  white-space: nowrap; flex-shrink: 0; display: none;
}
@media (min-width: 520px) { .rp-user-bar-role { display: inline-block; } }

/* ── Separador flexible ──────────────────────────── */
.rp-user-bar-sep { flex: 1; }

/* ── Acciones de texto ───────────────────────────── */
.rp-user-bar-nav {
  display: flex; align-items: center; gap: .1rem; flex-shrink: 0;
}
.rp-user-bar-nav a,
.rp-user-bar-nav button {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .65rem; border-radius: 6px;
  font-size: .77rem; font-weight: 600;
  color: rgba(255,255,255,.88); background: transparent;
  border: none; cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: background .15s, color .15s;
}
.rp-user-bar-nav a:hover,
.rp-user-bar-nav button:hover {
  background: rgba(255,255,255,.18); color: white;
}
.rp-user-bar-nav a[hidden] { display: none; }
/* Ocultar texto de acciones en móvil muy pequeño, mostrar solo iconos */
@media (max-width: 479px) {
  .rp-user-bar-nav a span,
  .rp-user-bar-nav button span { display: none; }
}

/* ── Separador vertical ──────────────────────────── */
.rp-user-bar-divider {
  width: 1px; height: 20px;
  background: rgba(255,255,255,.22); flex-shrink: 0;
}

/* ── Utilidades: campana · tema · avatar · logout ── */
.rp-user-bar-utils {
  display: flex; align-items: center; gap: .1rem; flex-shrink: 0;
}
.rp-user-bar-util-btn {
  width: 32px; height: 32px; border-radius: 7px;
  background: transparent; border: none; cursor: pointer;
  color: rgba(255,255,255,.88);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s; position: relative;
}
.rp-user-bar-util-btn:hover { background: rgba(255,255,255,.18); color: white; }
.rp-user-bar-util-btn .theme-icon { font-size: .9rem; line-height: 1; pointer-events: none; }

/* Avatar en la barra de utilidades */
.rp-user-bar-util-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.28);
  border: 2px solid rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; overflow: hidden;
}
.rp-user-bar-util-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Botón cerrar sesión: texto visible desde sm */
.rp-user-bar-logout-text { display: none; }
@media (min-width: 768px) { .rp-user-bar-logout-text { display: inline; } }

.rp-user-bar-logout { opacity: .78; }
.rp-user-bar-logout:hover { opacity: 1 !important; }

/* Badge de notificaciones sobre la campana */
.rp-user-bar-util-btn .rp-notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: #e9c46a; color: #2c1a00;
  font-size: .58rem; font-weight: 800;
  min-width: 15px; height: 15px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 1.5px solid var(--rp-teal);
}

/* ══════════════════════════════════════════════════════
   NAVBAR UNIFICADA — sustituye al antiguo <header> + user bar
   Un único nivel sticky que cambia de contenido según el
   estado de autenticación (rp-navbar-anon / rp-navbar-user).
══════════════════════════════════════════════════════ */
.rp-navbar {
  position: sticky; top: 0; z-index: 500;
  height: var(--rp-header-h);
  background: var(--rp-bg-card);
  border-bottom: 1px solid var(--rp-border);
  backdrop-filter: blur(10px);
}
.rp-navbar-inner {
  max-width: 1400px; margin: 0 auto; height: 100%;
  padding: 0 1.25rem;
  display: flex; align-items: center; gap: .75rem;
}
@media (min-width: 768px) { .rp-navbar-inner { padding: 0 2rem; } }

/* ── Logo ─────────────────────────────────────────── */
.rp-navbar-logo {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; flex-shrink: 0;
}
.rp-navbar-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--rp-teal); color: white;
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rp-navbar-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.rp-navbar-logo-name { font-family: 'Fraunces', serif; font-size: 1.02rem; font-weight: 700; color: var(--rp-text); }
.rp-navbar-logo-tagline { font-size: .67rem; color: var(--rp-text-label); display: none; }
@media (min-width: 640px) { .rp-navbar-logo-tagline { display: block; } }

/* ── Búsqueda (solo páginas que la incluyen) ─────── */
.rp-navbar-search {
  display: none; align-items: center; gap: .5rem;
  background: var(--rp-bg-alt); border: 1.5px solid var(--rp-border);
  border-radius: 50px; padding: .4rem .9rem;
  flex: 1; max-width: 320px; transition: border-color .15s;
}
.rp-navbar-search:focus-within { border-color: var(--rp-teal); }
.rp-navbar-search svg { color: var(--rp-text-label); flex-shrink: 0; }
.rp-navbar-search input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: .82rem; color: var(--rp-text); min-width: 0;
}
.rp-navbar-search input::placeholder { color: var(--rp-text-label); }
@media (min-width: 860px) { .rp-navbar-search { display: flex; } }

/* ── Separador flexible ──────────────────────────── */
.rp-navbar-sep { flex: 1; }

/* ── Estado: anónimo ──────────────────────────────── */
.rp-navbar-anon {
  display: flex; align-items: center; gap: .4rem; flex-shrink: 0;
}
.rp-navbar-anon[hidden] { display: none; }
.rp-navbar-login-btn { font-size: .82rem; padding: .4rem .9rem; white-space: nowrap; }

/* ── Estado: autenticado ──────────────────────────── */
.rp-navbar-user {
  display: flex; align-items: center; gap: .55rem; flex-shrink: 0;
  min-width: 0;
}
.rp-navbar-user[hidden] { display: none; }

/* Identidad */
.rp-navbar-identity {
  display: flex; align-items: center; gap: .5rem; min-width: 0; overflow: hidden;
}
.rp-navbar-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--rp-teal); color: white; border: 2px solid var(--rp-teal-lt);
  font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.rp-navbar-info {
  display: none; flex-direction: column; line-height: 1.2; min-width: 0; overflow: hidden;
}
@media (min-width: 980px) { .rp-navbar-info { display: flex; } }
.rp-navbar-name {
  font-size: .8rem; font-weight: 700; color: var(--rp-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
}
.rp-navbar-email {
  font-size: .7rem; color: var(--rp-text-label);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px;
}
.rp-navbar-role {
  display: none; font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  border-radius: 20px; padding: .15rem .5rem; white-space: nowrap;
  background: var(--rp-teal-lt); color: var(--rp-teal-dk);
  border: 1px solid rgba(42,157,143,.3); flex-shrink: 0;
}
.dark .rp-navbar-role { color: var(--rp-teal); }
@media (min-width: 1180px) { .rp-navbar-role { display: inline-block; } }

/* Separador vertical */
.rp-navbar-vert-sep {
  width: 1px; height: 22px; background: var(--rp-border); flex-shrink: 0;
  display: none;
}
@media (min-width: 700px) { .rp-navbar-vert-sep { display: block; } }

/* Acciones de texto */
.rp-navbar-actions {
  display: none; align-items: center; gap: .1rem; flex-shrink: 0;
}
@media (min-width: 700px) { .rp-navbar-actions { display: flex; } }
.rp-navbar-action-link {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .35rem .65rem; border-radius: 7px;
  font-size: .78rem; font-weight: 600; color: var(--rp-text-muted);
  text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.rp-navbar-action-link:hover { background: var(--rp-bg-hover); color: var(--rp-teal); }
.rp-navbar-action-link[hidden] { display: none; }
@media (max-width: 859px) { .rp-navbar-action-link span { display: none; } }

/* Utilidades: campana · tema · avatar · logout */
.rp-navbar-utils {
  display: flex; align-items: center; gap: .15rem; flex-shrink: 0;
}
.rp-navbar-util-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  color: var(--rp-text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s; position: relative; flex-shrink: 0;
}
.rp-navbar-util-btn:hover { background: var(--rp-bg-hover); color: var(--rp-teal); }
.rp-navbar-util-btn .theme-icon { font-size: .92rem; line-height: 1; pointer-events: none; }

.rp-navbar-util-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--rp-teal); color: white; border: 2px solid var(--rp-teal-lt);
  font-size: .76rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  margin: 0 .1rem;
}

.rp-navbar-logout { opacity: .85; }
.rp-navbar-logout:hover { opacity: 1; color: var(--rp-coral); }
.rp-navbar-logout-text { display: none; font-size: .78rem; font-weight: 600; margin-left: .2rem; }
@media (min-width: 860px) { .rp-navbar-logout-text { display: inline; } }
@media (min-width: 860px) { .rp-navbar-logout { width: auto; padding: 0 .55rem; } }

/* Badge de notificaciones */
.rp-navbar-util-btn .rp-notif-badge {
  position: absolute; top: 1px; right: 1px;
  background: var(--rp-coral); color: white;
  font-size: .6rem; font-weight: 700; line-height: 1;
  min-width: 15px; height: 15px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid var(--rp-bg-card);
}

/* Hamburguesa móvil */
.rp-navbar-hamburger { display: flex; }
@media (min-width: 768px) { .rp-navbar-hamburger { display: none; } }
