/* ============================================================
   AporteLatino — Rediseño estilo KapiRED / Taringa
   Limpio, funcional, fondo gris claro, posts en lista
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --blue:           #1a73e8;
  --blue-dark:      #1558b0;
  --blue-light:     #4a90d9;

  /* Header / Footer theming — overridden by user accent preference */
  --header-bg:      #1a73e8;
  --header-hover:   #1558b0;
  --footer-bg:      #f7f7f7;
  --footer-border:  #dddddd;
  --green:          #2ecc40;
  --red:            #e8321a;
  --accent:         #1a73e8;
  --accent-hover:   #1558b0;
  --accent-light:   rgba(26,115,232,.1);

  --bg:             #f2f2f2;
  --bg-card:        #ffffff;
  --bg-header:      #1a73e8;

  --text:           #333333;
  --text-muted:     #666666;
  --text-light:     #999999;
  --text-white:     #ffffff;

  --border:         #dddddd;
  --border-light:   #eeeeee;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow:         0 2px 8px rgba(0,0,0,.10);
  --shadow-lg:      0 4px 16px rgba(0,0,0,.12);

  --radius:         4px;
  --radius-sm:      3px;
  --radius-lg:      8px;
  --radius-full:    9999px;

  --transition:     all .18s ease;

  --sidebar-w:      220px;
  --sidebar-right-w:240px;
  --header-h:       52px;
}

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* prevent horizontal scroll from wide content */
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 14px;
  /* Sticky footer: el body ocupa toda la pantalla y el wrapper crece */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--header-bg);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.site-header-inner {
  max-width: var(--site-max-width, 1100px);
  margin: 0 auto;
  height: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: 0;
  color: white;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -.5px;
  flex-shrink: 0;
  text-decoration: none;
}
.header-logo .logo-icon { display: none; }
.header-logo .logo-text { color: white; }
.header-logo .logo-text span { color: #ff3b30; }

/* Search */
.header-search {
  flex: 1;
  max-width: 380px;
}
.header-search form {
  display: flex;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  border: none;
}
.header-search input {
  flex: 1;
  padding: 7px 12px;
  background: transparent;
  border: none;
  outline: none;
  color: #333;
  font-size: .875rem;
}
.header-search input::placeholder { color: #aaa; }
.header-search button {
  padding: 7px 14px;
  background: var(--accent-hover, #1558b0);
  border: none;
  color: white;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.header-search button:hover { background: rgba(0,0,0,.25); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.btn-post {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  background: var(--green);
  color: white !important;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: .82rem;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-post:hover { background: #27ae36; color: white !important; }

/* Kbits / points button — styled like KapiRED */
.kbits-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--red);
  color: white !important;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: .82rem;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.kbits-btn:hover { background: #c0281a; color: white !important; }

/* Notifications */
.notif-btn {
  position: relative;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.9);
  font-size: 1rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.3);
}
.notif-btn:hover { background: rgba(255,255,255,.15); color: white; }
.notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 16px; height: 16px;
  background: #ff3b30;
  color: white;
  font-size: .6rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* Theme toggle */
.theme-toggle {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius-full);
  color: rgba(255,255,255,.9);
  font-size: .95rem;
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle:hover { background: rgba(255,255,255,.15); }

/* Login / Register */
.btn-login {
  padding: 6px 14px;
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: .82rem;
  transition: var(--transition);
  white-space: nowrap;
  background: transparent;
  text-decoration: none;
}
.btn-login:hover { background: rgba(255,255,255,.15); color: white; }

.btn-register {
  padding: 6px 14px;
  background: white;
  color: var(--blue) !important;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: .82rem;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-register:hover { background: #e8f0fe; }

/* User menu */
.header-user {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 6px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.header-user:hover { background: rgba(255,255,255,.2); }
.header-user img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.4);
}
.header-user span { color: white; font-size: .83rem; font-weight: 600; }

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;          /* sin gap — el puente ::before cubre el espacio visual */
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  overflow: visible;
  z-index: 1001;
  padding-top: 6px;   /* espacio visual sin perder el hover */
}

/* Puente invisible que cubre el hueco entre el botón y el dropdown */
.user-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background: transparent;
}
.header-user:hover .user-dropdown { display: block; }
.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  color: var(--text);
  font-size: .875rem;
  transition: var(--transition);
}
.user-dropdown a:hover { background: var(--bg); color: var(--accent); }
.user-dropdown .divider { height: 1px; background: var(--border); }

/* Hamburger */
.hamburger { display: none; }

/* ── LAYOUT ─────────────────────────────────────────────────────────────── */
.site-wrapper {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--sidebar-right-w);
  gap: 14px;
  max-width: var(--site-max-width, 1100px);
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 16px 14px;
  /* Sticky footer: el wrapper crece para empujar el footer abajo */
  flex: 1;
}

/* Full-width mode (no sidebars) — e.g. pages that pass $noSidebars = true */
.site-wrapper--full {
  grid-template-columns: 1fr;
  max-width: 860px;
}

/* Left-sidebar only — e.g. search results ($noRightSidebar = true) */
.site-wrapper--no-right {
  grid-template-columns: var(--sidebar-w) 1fr;
  max-width: var(--site-max-width, 1100px);
}

/* ── SIDEBAR LEFT ────────────────────────────────────────────────────────── */
.sidebar-left {
  align-self: start;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.sidebar-widget-title {
  padding: 10px 14px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: #f7f7f7;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Category list — Taringa style with colored dots */
.category-list {}

.category-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--text);
  font-size: .855rem;
  font-weight: 400;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  position: relative;
}
.category-icon-svg {
  flex-shrink: 0;
}
.category-item:last-child { border-bottom: none; }
.category-item:hover {
  background: var(--accent-light, rgba(26,115,232,.07));
  color: var(--accent);
}
.category-item.active {
  color: var(--accent);
  background: var(--accent-light, rgba(26,115,232,.07));
  font-weight: 600;
}
.category-item.active::before {
  content:'';
  position: absolute;
  left:0; top:0; bottom:0;
  width: 3px;
  background: var(--accent);
}

/* Dot icon replaces box icon */
.category-icon {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 10px;
  background: var(--accent);
}

.category-count {
  margin-left: auto;
  font-size: .75rem;
  color: var(--text-light);
}

/* Tags */
.tag {
  display: inline-block;
  padding: 3px 9px;
  background: var(--accent-light, rgba(26,115,232,.08));
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid var(--accent-light, rgba(26,115,232,.2));
}
.tag:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* ── SIDEBAR RIGHT ───────────────────────────────────────────────────────── */
.sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Ad */
.ad-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.promo-card img {
  width: 100%;
  display: block;
  max-height: 250px;
  object-fit: cover;
}

/* Image link wrapper — needed for overlay positioning */
.promo-img-link {
  display: block;
  position: relative;
  overflow: hidden;
}

/* Hover overlay: slides up from bottom */
.promo-hover-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  padding: 28px 12px 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  transform: translateY(100%);
  opacity: 0;
  transition: transform .32s cubic-bezier(.22,1,.36,1), opacity .28s ease;
  pointer-events: none;
}

.promo-img-link:hover .promo-hover-overlay {
  transform: translateY(0);
  opacity: 1;
}

.promo-hover-title {
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  letter-spacing: .01em;
}

.promo-hover-arrow {
  color: rgba(255,255,255,.85);
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform .2s ease;
}

.promo-img-link:hover .promo-hover-arrow {
  transform: translate(2px, -2px);
}

.promo-label {
  display: none !important;
}

/* Stats widget — compact horizontal */
.stats-widget {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px solid var(--border-light);
}
.stat-item:last-child { border-bottom: none; }
.stat-label {
  font-size: .83rem;
  color: var(--text-muted);
}
.stat-number {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
}

/* Popular posts mini list */
.mini-post {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  align-items: flex-start;
  overflow: hidden;
}
.mini-post:last-child { border-bottom: none; }
.mini-post:hover { background: var(--accent-light, rgba(26,115,232,.06)); }
.mini-post:hover .mini-post-title { color: var(--accent); }
.mini-post-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.6;
  line-height: 1;
  flex-shrink: 0;
  width: 18px;
  transition: var(--transition);
}
.mini-post:hover .mini-post-num {
  opacity: 1;
}
.mini-post-title {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  transition: color .2s;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
.mini-post-views { font-size: .72rem; color: var(--text-light); margin-top: 2px; }

/* ── Últimos Comentarios widget ─────────────────────────────────────────── */
.recent-comment-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}
.recent-comment-item:last-child { border-bottom: none; }
.recent-comment-item:hover { background: var(--accent-light, rgba(26,115,232,.06)); }
.recent-comment-user {
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  transition: color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-comment-item:hover .recent-comment-user { color: var(--accent-hover); }
.recent-comment-post {
  font-size: .76rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Top Posts Semanal widget ────────────────────────────────────────────── */
.weekly-top-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}
.weekly-top-item:last-child { border-bottom: none; }
.weekly-top-item:hover { background: var(--accent-light, rgba(26,115,232,.06)); }
.weekly-top-item:hover .weekly-top-title { color: var(--accent); }
.weekly-top-num {
  font-size: .78rem;
  font-weight: 800;
  color: var(--text-light);
  min-width: 18px;
  flex-shrink: 0;
  text-align: right;
}
.weekly-top-title {
  flex: 1;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  transition: color .15s;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.weekly-top-views {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Stat Semanal widget ─────────────────────────────────────────────────── */
.stat-semanal-widget {}

.stsem-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.stsem-tab {
  padding: 4px 12px;
  font-size: .75rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.4;
}
.stsem-tab:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.stsem-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.stsem-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  text-decoration: none;
  color: inherit;
  transition: background .14s;
  border-bottom: 1px solid var(--border-light, var(--border));
}
.stsem-row:last-child { border-bottom: none; }
.stsem-row-alt { background: var(--bg-hover, rgba(0,0,0,.04)); }
.stsem-row:hover { background: var(--accent-light); }
.stsem-row:hover .stsem-name { color: var(--accent); }

.stsem-pos {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 14px;
  text-align: right;
  flex-shrink: 0;
}
.stsem-name {
  flex: 1;
  font-size: .79rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color .14s;
}
.stsem-val {
  font-size: .79rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Home bottom widgets (2 cols) ────────────────────────────────────────── */
.home-bottom-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.home-widget {
  margin-bottom: 0;
  align-self: start;
}
@media (max-width: 640px) {
  .home-bottom-widgets { grid-template-columns: 1fr; }
}

/* ── MAIN CONTENT ────────────────────────────────────────────────────────── */
.main-content { min-width: 0; }

/* Feed header */
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0;               /* padding lo maneja feed-filters */
  overflow: hidden;         /* contiene el scroll interno */
  position: relative;
}



.feed-title { font-size: .95rem; font-weight: 700; color: var(--text); }

.feed-filters {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px;
  flex: 1;
  /* Ocultar scrollbar en todos los navegadores */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.feed-filters::-webkit-scrollbar { display: none; }

.feed-filter {
  padding: 5px 13px;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;         /* ← evita que el texto rompa línea */
  flex-shrink: 0;              /* ← el tab nunca se encoge */
  scroll-snap-align: start;
}
.feed-filter.active, .feed-filter:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── POST LIST (estilo Taringa: fila compacta) ───────────────────────────── */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.post-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  min-width: 0;
}
.post-card:last-child { border-bottom: none; }
.post-card:hover { background: var(--accent-light, rgba(26,115,232,.06)); }

/* Category colored square icon */
.post-card-image {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: #edf3fc;
}
.post-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.post-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

/* Category label inline before title */
.post-card-cat-inline {
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .01em;
}

.post-card-title {
  font-size: .86rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  transition: color .15s;
}
.post-card:hover .post-card-title { color: var(--accent); }

/* Author badge — pill on the right */
.post-card-author-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: var(--accent-light, rgba(26,115,232,.08));
  border: 1px solid rgba(26,115,232,.18);
  font-size: .71rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
.post-card-author-badge:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Hide old elements */
.post-card-footer,
.post-card-meta,
.post-by-label { display: none; }

.post-card-stats { display: flex; gap: 8px; }
.post-stat { font-size: .75rem; color: var(--text-light); display: flex; align-items: center; gap: 3px; }
.post-time { font-size: .75rem; color: var(--text-light); white-space: nowrap; }

/* ── FEATURED SECTION ────────────────────────────────────────────────────── */
.featured-section { margin-bottom: 10px; }
.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
  height: 260px;
}
.featured-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}
.featured-card:first-child { grid-row: 1 / 3; }
.featured-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.featured-card:hover img { transform: scale(1.03); }
.featured-card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px;
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, transparent 100%);
}
.featured-card-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: .7rem;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.featured-card-title { color: white; font-weight: 700; font-size: .9rem; line-height: 1.3; }
.featured-card:first-child .featured-card-title { font-size: 1.05rem; }

/* ── POST SINGLE ─────────────────────────────────────────────────────────── */
.post-single {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* Hero image — always constrained to 400px height regardless of aspect ratio */
.post-single-hero-wrap {
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-single-hero {
  width: 100%;
  height: 400px;
  object-fit: cover;
  object-position: center;
  display: block;
}
.post-single-body { padding: 20px 24px; overflow-x: hidden; }
.post-single-category {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  margin-bottom: 10px;
}
.post-single-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 12px;
}
.post-single-author-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}
.post-single-author-bar img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.author-info {}
.author-info-name { font-weight: 700; font-size: .9rem; color: var(--text); }
.author-info-date { font-size: .78rem; color: var(--text-muted); }
.post-single-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.post-content {
  font-size: .92rem;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
}
.post-content p { margin-bottom: 14px; }
.post-content h2 { font-size: 1.15rem; font-weight: 700; margin: 20px 0 10px; }
.post-content h3 { font-size: 1rem; font-weight: 700; margin: 16px 0 8px; }
.post-content img { max-width: 100%; border-radius: var(--radius); margin: 12px 0; }
.post-content a:not([style]) { color: var(--accent); text-decoration: underline; }

/* ── Snippet decorations: styled button links ─────────────────────────── */
.post-content a[style] {
  display: inline-flex !important;
  align-items: center;
  text-decoration: none !important;
  transition: filter .2s ease, transform .18s ease, box-shadow .2s ease;
  vertical-align: middle;
  margin: 2px 4px 2px 0;
}
.post-content a[style]:hover {
  filter: brightness(1.18);
}

/* ── Snippet decorations: block alert boxes ───────────────────────────── */
.post-content div[style*="border-left"] {
  margin: 14px 0;
  border-radius: 6px;
  line-height: 1.6;
}

/* ── Snippet decorations: spoiler <details> ───────────────────────────── */
.post-content details {
  margin: 14px 0;
  border-radius: 8px;
  overflow: hidden;
}
.post-content details summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.post-content details summary::-webkit-details-marker { display: none; }
.post-content details[open] summary { margin-bottom: 8px; }

/* ── Snippet decorations: figure / image grid ─────────────────────────── */
.post-content figure {
  margin: 14px 0;
}
.post-content figure figcaption {
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Snippet decorations: <hr> separators ─────────────────────────────── */
.post-content hr { margin: 16px 0; }

/* ── Snippet decorations: responsive video iframes ───────────────────── */
.post-content iframe {
  max-width: 100%;
  border: none;
}
.post-content ul { list-style: disc; padding-left: 22px; margin-bottom: 12px; }
.post-content ol { list-style: decimal; padding-left: 22px; margin-bottom: 12px; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  background: var(--accent-light, #f0f6ff);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 12px 0;
  color: var(--text-muted);
}
.post-content code {
  background: #f0f0f0;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: .88em;
}
.post-content pre { background: #1e1e1e; color: #f0f0f0; padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; margin: 12px 0; }
.post-content pre code { background: none; color: inherit; padding: 0; }

/* Tags */
.tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.post-action-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Like button */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  background: #f0f0f0;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.like-btn:hover { background: #ffeef0; border-color: #f77; color: #e33; }
.like-btn.liked { background: #ffeef0; border-color: #f77; color: #e33; }

/* ── COMMENTS ────────────────────────────────────────────────────────────── */
.comments-section {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.comments-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; color: var(--text); }

.comment-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.comment-form img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-form textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: .875rem;
  outline: none;
  resize: vertical;
  min-height: 72px;
  background: white;
  color: var(--text);
  transition: border .2s;
}
.comment-form textarea:focus { border-color: var(--accent); }

.comment {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.comment img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-bubble {
  flex: 1;
  background: #f7f7f7;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-author { font-weight: 700; font-size: .85rem; color: var(--text); }
.comment-time { font-size: .75rem; color: var(--text-light); }
.comment-actions { margin-left: auto; }
.comment-action-btn { background: none; border: none; font-size: .85rem; cursor: pointer; opacity: .5; }
.comment-action-btn:hover { opacity: 1; }
.comment-content { font-size: .875rem; color: var(--text); line-height: 1.5; }
.comment-replies { padding-left: 30px; margin-top: 10px; }

/* ── PROFILE ─────────────────────────────────────────────────────────────── */
.profile-cover {
  height: 200px;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-info-bar {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 0 20px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  flex-wrap: wrap;
}
.profile-avatar-wrap {
  position: relative;
  margin-top: -50px;
  flex-shrink: 0;
}
.profile-avatar-wrap img {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 4px solid white;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.profile-meta { flex: 1; padding-top: 10px; }
.profile-name { font-size: 1.15rem; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.profile-username { font-size: .82rem; color: var(--text-muted); margin-bottom: 6px; }
.profile-bio { font-size: .875rem; color: var(--text-muted); margin-bottom: 6px; }
.profile-stats { display: flex; gap: 20px; }
.profile-stat-item { text-align: center; }
.profile-stat-num { font-size: 1rem; font-weight: 800; color: var(--accent); line-height: 1; }
.profile-stat-label { font-size: .7rem; text-transform: uppercase; color: var(--text-light); letter-spacing: .04em; }

/* ── FORMS ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--text);
  background: white;
  outline: none;
  transition: border .2s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light, rgba(26,115,232,.12)); }
.form-hint { font-size: .78rem; color: var(--text-light); margin-top: 4px; }

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--accent); color: white !important; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: white !important; }

.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: white; }

.btn-danger { background: var(--red); color: white !important; border-color: var(--red); }
.btn-danger:hover { background: #c0281a; color: white !important; }

.btn-success { background: var(--green); color: white !important; border-color: var(--green); }
.btn-success:hover { background: #27ae36; color: white !important; }

/* ── PAGINATION ──────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; padding: 12px 0; }
.pagination ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pagination li { display: contents; }
.pagination a, .pagination span,
.pagination .page-link, .pagination .page-dots {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.pagination .page-dots {
  border-color: transparent;
  background: transparent;
  cursor: default;
}
.pagination a:hover,
.pagination .page-link:hover,
.pagination .current,
.pagination .page-link.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── ALERTS / FLASH ──────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 12px;
  border-left: 3px solid;
}
.alert-success { background: #f0fff4; border-color: var(--green); color: #1a6b2a; }
.alert-error   { background: #fff0f0; border-color: var(--red); color: #9b1010; }
.alert-info    { background: #edf3fc; border-color: var(--accent); color: var(--accent-hover); }
.alert-warning { background: #fffbeb; border-color: #f59e0b; color: #7c5b00; }

/* ── BADGES ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-admin { background: #e8321a; color: white; }
.badge-mod   { background: #1a73e8; color: white; }
.badge-user  { background: #eee; color: #555; }

/* ── PAGE HERO ───────────────────────────────────────────────────────────── */
.page-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.page-hero h1 { font-size: 1.1rem; font-weight: 700; color: var(--text); }

/* ── ADMIN ───────────────────────────────────────────────────────────────── */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.admin-page-header h1 { font-size: 1.1rem; font-weight: 700; }

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table thead { background: #f7f7f7; }
.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #f9f9f9; }
.table-responsive { overflow-x: auto; }

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .emoji { font-size: 2.5rem; margin-bottom: 10px; }
.empty-state h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: .875rem; }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: #f7f7f7;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 20px 24px;
  margin-top: 30px;
  text-align: center;
  font-size: .82rem;
}
.footer-inner { max-width: 1260px; margin: 0 auto; }
.footer-grid { display: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 6px; }
.footer-links a {
  color: var(--accent);
  font-size: .82rem;
  position: relative;
  padding-bottom: 1px;
  transition: color .18s;
}
.footer-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
  transition: right .22s ease;
}
.footer-links a:hover { color: var(--accent-hover); }
.footer-links a:hover::after { right: 0; }
.footer-bottom { margin-top: 8px; color: var(--text-light); }

/* ── SEARCH ──────────────────────────────────────────────────────────────── */
.search-box { margin-bottom: 14px; display: flex; gap: 8px; }
.search-box input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  outline: none;
  background: white;
  color: var(--text);
}
.search-box input:focus { border-color: var(--accent); }
.search-box button { padding: 8px 18px; }

/* ── CARDS / MISC ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

/* Status badge */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: .7rem;
  font-weight: 700;
}
.status-published { background: #d4edda; color: #1a6b2a; }
.status-draft      { background: #e8f0fe; color: #1558b0; }
.status-pending    { background: #fff3cd; color: #7c5b00; }
.status-hidden     { background: #fde8e8; color: #9b1010; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 1100px) {
  :root { --sidebar-right-w: 200px; --sidebar-w: 200px; }
}

@media (max-width: 900px) {
  .site-wrapper { grid-template-columns: var(--sidebar-w) 1fr; }
  .sidebar-right { display: none; }
}

@media (max-width: 680px) {
  .hamburger { display: flex; }
  .site-wrapper { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .sidebar-left { display: none; position: fixed; top: var(--header-h); left: 0; bottom: 0; width: 260px; z-index: 900; overflow-y: auto; background: white; box-shadow: var(--shadow-lg); }
  .sidebar-left.open { display: block; }
  .header-search { max-width: 180px; }
  .post-single-title { font-size: 1.1rem; }
}

/* ── DARK MODE (kept minimal to not break light design) ─────────────────── */
[data-theme="dark"] {
  --bg:        #1a1a2e;
  --bg-card:   #16213e;
  --bg-header: #0d1b3e;
  --bg-hover:  rgba(255,255,255,.04);
  --text:      #e0e0e0;
  --text-muted:#aaa;
  --text-light:#777;
  --border:    #2a2a4a;
  --border-light: #1f1f3a;
}
[data-theme="dark"] .sidebar-widget-title { background: #0f0f28; }
[data-theme="dark"] .header-search form { background: rgba(255,255,255,.08); }
[data-theme="dark"] .header-search input { color: white; }
[data-theme="dark"] .header-search input::placeholder { color: rgba(255,255,255,.4); }
[data-theme="dark"] .post-card:hover { background: #1f2f50; }
[data-theme="dark"] .comment-bubble { background: #0f0f28; }
[data-theme="dark"] .admin-table thead { background: #0f0f28; }
[data-theme="dark"] .admin-table tbody tr:hover { background: #1f2f50; }
[data-theme="dark"] .form-control { background: #0f0f28; }
[data-theme="dark"] .site-footer { background: #0f0f28; border-color: #2a2a4a; }
[data-theme="dark"] .feed-header { background: var(--bg-card); }
[data-theme="dark"] .stats-widget .stat-item { border-color: #2a2a4a; }
[data-theme="dark"] .tag { background: #1f2f50; border-color: #2a2a4a; }
[data-theme="dark"] .sidebar-cta { box-shadow: 0 4px 24px rgba(0,0,0,.5); }
/* Stat Semanal dark mode */
[data-theme="dark"] .stsem-tabs  { background: #0f0f28; }
[data-theme="dark"] .stsem-tab   { background: #1a1a2e; border-color: #2a2a4a; color: #bbb; }
[data-theme="dark"] .stsem-row-alt { background: rgba(255,255,255,.03); }

/* ── Quill editor: prevent horizontal expansion ─────────────────────────── */
.editor-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: visible;            /* allow Quill picker dropdowns to show outside */
  width: 100%;
  box-sizing: border-box;
}
.editor-container.editor-error {
  border-color: #ef4444;
}
/* The actual editable area Quill generates */
.ql-container {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;           /* never grow wider than the container   */
}
.ql-editor {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;           /* key: stop the div from expanding      */
  word-break: break-word;       /* break long words / URLs               */
  overflow-wrap: break-word;    /* standard property                     */
  white-space: pre-wrap;        /* respect newlines, but wrap long lines */
}
/* Toolbar: flex-wrap so items flow to next line, NO overflow (it clips picker dropdowns) */
.ql-toolbar {
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  box-sizing: border-box;
  width: 100%;
  display: flex !important;
  flex-wrap: wrap;
  gap: 2px;
}
/* Quill picker dropdowns must always sit on top of everything */
.ql-toolbar .ql-picker {
  position: relative;
}
.ql-toolbar .ql-picker-options {
  position: absolute !important;
  z-index: 9999 !important;
  top: 100% !important;
  left: 0 !important;
}
.ql-container.ql-snow { border: none !important; }

/* ── Tag chip input — premium styles ─────────────────────────────────────── */
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: text;
  min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
}
.tag-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(26,115,232,.1);
}

/* Chip pill */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 5px 4px 11px;
  border-radius: 99px;
  background: linear-gradient(135deg, #1a73e8 0%, #4f8ef7 100%);
  color: #fff;
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(26,115,232,.28);
  animation: tagChipIn .2s cubic-bezier(.34,1.56,.64,1);
  user-select: none;
}
.tag-chip::before {
  content: '#';
  opacity: .65;
  font-weight: 900;
  font-size: .7rem;
}
@keyframes tagChipIn {
  from { transform: scale(.5) translateY(4px); opacity: 0; }
  to   { transform: scale(1)  translateY(0);   opacity: 1; }
}

/* Remove × button */
.tag-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  border: none;
  color: #fff;
  font-size: .82rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background .15s, transform .15s;
  flex-shrink: 0;
}
.tag-chip-remove:hover {
  background: rgba(255,255,255,.48);
  transform: scale(1.18);
}

/* Text input inside the wrap */
.tag-text-input {
  flex: 1;
  min-width: 140px;
  border: none;
  outline: none;
  background: transparent;
  font-size: .88rem;
  color: var(--text);
  font-family: inherit;
  padding: 3px 2px;
}
.tag-text-input::placeholder { color: var(--text-muted); }

/* Dropdown wrapper */
.tag-dropdown { position: relative; z-index: 200; }

.tag-dropdown-inner {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.07);
  max-height: 230px;
  overflow-y: auto;
  animation: tagDdIn .15s ease;
}
@keyframes tagDdIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tag-dropdown-inner::-webkit-scrollbar { width: 4px; }
.tag-dropdown-inner::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Dropdown header */
.tag-dropdown-header {
  padding: 9px 14px 5px;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
}
.tag-dropdown-header::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .5;
}

/* Suggestion row */
.tag-suggestion {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
  transition: background .1s, color .1s;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.tag-suggestion:last-child { border-bottom: none; border-radius: 0 0 10px 10px; }
.tag-suggestion:hover,
.tag-suggestion.active {
  background: linear-gradient(90deg, rgba(26,115,232,.07), transparent);
  color: #1a73e8;
}
.tag-suggestion-hash {
  font-size: .75rem;
  font-weight: 900;
  color: #1a73e8;
  opacity: .55;
  transition: opacity .1s;
}
.tag-suggestion:hover .tag-suggestion-hash,
.tag-suggestion.active .tag-suggestion-hash { opacity: 1; }
.tag-suggestion-name { flex: 1; }
.tag-suggestion-badge {
  font-size: .67rem;
  background: rgba(26,115,232,.1);
  color: #1a73e8;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
  white-space: nowrap;
}

/* Dark mode adjustments */
[data-theme="dark"] .tag-chip { box-shadow: 0 2px 10px rgba(79,142,247,.35); }
[data-theme="dark"] .tag-dropdown-inner { box-shadow: 0 16px 40px rgba(0,0,0,.4); }
[data-theme="dark"] .tag-suggestion:hover,
[data-theme="dark"] .tag-suggestion.active { background: rgba(79,142,247,.1); }

/* Premium interactive points widget style */
.point-pick-btn:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  transform: scale(1.18);
  box-shadow: 0 4px 10px var(--accent-light);
}

/* ══════════════════════════════════════════════════════════════════════════
   POST PAGE LAYOUT (layout: post)
══════════════════════════════════════════════════════════════════════════ */

/* Outer wrapper — full width, padded like site-wrapper */
.post-layout-wrapper {
  max-width: var(--site-max-width, 1100px);
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 16px 14px;
}

/* 2-column grid: author sidebar | post content */
.post-page-grid {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
}

/* ── Author sidebar ─────────────────────────────────────────────────── */
.post-author-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 14px);
  align-self: start;          /* critical: prevents the sidebar from stretching to grid height */
  max-width: 210px;
  min-width: 0;
  max-height: calc(100vh - var(--header-h) - 28px);
  overflow-y: auto;
  overflow-x: hidden;
}

.pas-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 14px;
  gap: 8px;
  text-align: center;
}

.pas-avatar-wrap { position: relative; }
.pas-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  display: block;
}

.pas-username {
  font-weight: 800;
  font-size: .92rem;
  color: var(--text);
  margin-top: 2px;
}
.pas-username a { color: inherit; text-decoration: none; }
.pas-username a:hover { color: var(--accent); }

.pas-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}
.pas-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  text-align: center;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pas-btn-follow {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.pas-btn-follow:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.pas-btn-follow.pas-btn-following {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-muted);
}
.pas-btn-mp:hover { border-color: var(--accent); color: var(--accent); }

/* 2×2 stats grid */
.pas-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  width: 100%;
  margin-top: 8px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pas-stat {
  background: var(--bg-card);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.pas-stat-val {
  font-size: .95rem;
  font-weight: 800;
  color: var(--accent);
}
.pas-stat-label {
  font-size: .65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ── Post main column ───────────────────────────────────────────────── */
.post-main-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* Header bar: title + nav arrows */
.post-header-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.post-header-left { flex: 1; min-width: 0; }
.post-page-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin: 0 0 6px;
}
.post-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.post-header-cat {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--accent, #6366f1);
  transition: filter .15s;
}
.post-header-cat:hover { filter: brightness(1.15); }
.post-header-date {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* Prev/next nav arrows */
.post-header-nav {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.post-nav-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition);
  font-weight: 700;
}
.post-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Content box */
.post-content-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.post-hero-wrap { width: 100%; overflow: hidden; }
.post-hero-img {
  width: 100%;
  display: block;
  height: 410px;
  object-fit: cover;       /* desktop: crop to fill, looks great */
  object-position: center;
}
/* Mobile: show full image without cropping */
@media (max-width: 680px) {
  .post-hero-img {
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
  }
}
.post-body-content { padding: 20px 24px; }

/* ── Botones de descarga dentro del contenido del post ───────────────────── */
/* Uniforms size: min-width forces equal width for short labels (Mega, Drive…) */
.post-body-content a[style*="border-radius"][style*="background"]:not([style*="font-size:.7"]):not([style*="font-size:.65"]) {
  min-width: 170px !important;
  justify-content: center !important;
  text-align: center;
  display: inline-flex !important;
  box-sizing: border-box;
}
/* Reduce the Quill-generated <p> margin when it wraps a single button link */
.post-body-content p:has(> a[style*="border-radius"]:only-child) {
  margin-top: 5px !important;
  margin-bottom: 5px !important;
  text-align: center;
}
/* Multiple buttons in one <p> — keep them tight and centered */
.post-body-content p:has(> a[style*="border-radius"]) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 5px !important;
  margin-bottom: 5px !important;
}
/* div wrapper used by multi-button snippet */
.post-body-content div:has(> a[style*="border-radius"]) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 6px 0;
}


/* Generic section box */
.post-section-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.post-section-title {
  font-size: .88rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Stats bar */
.post-stats-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.psb-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.psb-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.psb-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .82rem;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}
.psb-btn:hover { color: var(--accent); }
.psb-btn.liked { color: #ef4444; }
.psb-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .82rem;
  color: var(--text-muted);
}
.psb-sep { color: var(--border); font-size: .9rem; }

/* Share buttons */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: white;
  text-decoration: none;
  transition: transform .2s;
}
.share-btn:hover { transform: scale(1.15); }
.share-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.share-copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Más del autor */
.more-author-list { display: flex; flex-direction: column; gap: 0; }
.more-author-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: .82rem;
  transition: background .14s;
  border-bottom: 1px solid var(--border-light);
}
.more-author-item:last-child { border-bottom: none; }
.more-author-item-alt { background: var(--bg); }
.more-author-item:hover { background: var(--accent-light); color: var(--accent); }
.more-author-icon { font-size: .8rem; flex-shrink: 0; color: var(--text-muted); }
.more-author-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .post-page-grid {
    grid-template-columns: 1fr;
  }
  .post-author-sidebar {
    position: static;
  }
  .pas-card {
    flex-direction: row;
    text-align: left;
    align-items: center;
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .pas-avatar { width: 56px; height: 56px; }
  .pas-stats { grid-template-columns: repeat(4, 1fr); }
}

/* ══════════════════════════════════════════════════════════════════
   Ad Zones — Complete System
   ══════════════════════════════════════════════════════════════════ */

/* ── Base wrapper ─────────────────────────────────────────────────── */
.promo-zone {
  position: relative;
  width: 100%;
  max-width: 100%;          /* never exceed parent */
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}
.promo-zone.promo-plain {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;        /* plain banners don't clip */
}

/* ── "Publicidad" label ───────────────────────────────────────────── */
.promo-label, .ad-label {
  display: none !important;
}

/* ── Image / link ─────────────────────────────────────────────────── */
.promo-link {
  display: block;
  line-height: 0;
  width: 100%;
  max-width: 100%;
}
.promo-image {
  width: 100% !important;   /* force full container width */
  max-width: 100% !important;
  height: auto !important;
  display: block;
  object-fit: contain;      /* show whole image, no cropping */
  transition: opacity .2s;
}
.promo-link:hover .promo-image { opacity: .92; }

/* ── HTML/script code ad ──────────────────────────────────────────── */
.promo-code {
  padding: 8px;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;         /* clip any fixed-size code embeds */
}
/* Make images inside code ads responsive too */
.promo-code img,
.promo-code iframe,
.promo-code video {
  max-width: 100% !important;
  height: auto !important;
}

/* ── Banner zones (full-width leaderboard) ───────────────────────── */
/* home_top, home_bottom, post_before, post_after, header, footer */
.promo-zone-banner {
  margin: 12px 0;
  max-width: 100%;
}

/* First ad in center column has no top margin — aligns with sidebar tops */
.main-content > div:first-child .promo-zone-banner,
.main-content .promo-zone-banner:first-child {
  margin-top: 0;
}
/* Banner image adapts proportionally — no fixed height that crops on mobile */
.promo-zone-banner .promo-link,
.promo-zone-banner > .promo-image {
  display: block;
  width: 100%;
  line-height: 0;
}
.promo-zone-banner .promo-image {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain; /* show full image, no cropping */
  display: block;
}
/* On larger screens cap height so giant banners don't dominate */
@media (min-width: 728px) {
  .promo-zone-banner .promo-image {
    max-height: 200px;
    object-fit: cover;
  }
}
@media (min-width: 1024px) {
  .promo-zone-banner .promo-image {
    max-height: 250px;
    object-fit: cover;
  }
}

/* ── Infeed zones (compact card) ─────────────────────────────────── */
/* home_infeed, post_incontent, sidebar */
.promo-zone-infeed {
  margin: 10px 0;
  border-radius: var(--radius-sm);
}
.promo-zone-infeed .promo-image {
  max-height: 280px;
  object-fit: cover;
}

/* ── Home infeed — inside post grid ─────────────────────────────── */
.promo-home-infeed-wrap {
  grid-column: 1 / -1;   /* span full width of the posts-grid */
}

/* ── Post in-content ─────────────────────────────────────────────── */
.promo-incontent-wrap {
  clear: both;
  margin: 20px 0;
}
.promo-incontent-wrap .promo-zone {
  max-width: 560px;
  margin: 0 auto;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.promo-zone-infeed.promo-sidebar {
  margin: 0 0 12px;
}
.promo-zone-infeed.promo-sidebar .promo-image {
  max-height: 300px;
}

/* ── Dark mode ───────────────────────────────────────────────────── */
[data-theme="dark"] .promo-zone {
  background: var(--bg-card);
  border-color: var(--border);
}
[data-theme="dark"] .promo-label {
  background: #0f0f28;
  border-color: var(--border);
}

/* ── Mobile: banner shows full image — no cropping ──────────────── */
@media (max-width: 600px) {
  .promo-zone-banner { border-radius: 0; margin: 0; }
  .promo-zone-banner .promo-image {
    object-fit: contain !important;
  }
  .promo-zone-infeed .promo-image { max-height: 200px; }
  .promo-label, .ad-label { display: none !important; }
}




/* ── Mobile Author Card — oculta por defecto (desktop) ── */
.mobile-author-card { display: none; }

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE NATIVE APP — Completo desde 320px (iPhone SE) hasta tablet
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. Base globals para "app feel" ─────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a, button { -webkit-tap-highlight-color: transparent; }

/* ── 2. Bottom Navigation Bar — oculta en desktop ───────────────── */
.mobile-bottom-nav { display: none; }

/* ══════════════════════════════════════════
   BREAKPOINT PRINCIPAL: 680px y menor
   ══════════════════════════════════════════ */
@media (max-width: 680px) {

  /* ── Bottom Nav visible ── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 2000;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -1px 12px rgba(0,0,0,.1);
    align-items: stretch;
  }

  .mbn-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: 5px 2px;
    transition: color .15s ease;
    position: relative;
    min-width: 0;
    user-select: none;
  }
  .mbn-tab:active { opacity: .65; }
  .mbn-tab.mbn-active { color: var(--accent); }

  .mbn-icon {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    position: relative;
  }
  .mbn-icon svg { width: 22px; height: 22px; }

  .mbn-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 58px;
    font-size: .57rem;
    line-height: 1;
  }

  /* Botón central (+) */
  .mbn-tab-post { flex: 1.15; }
  .mbn-post-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 12px var(--accent-light, rgba(26,115,232,.4));
    flex-shrink: 0;
    transition: transform .13s ease, box-shadow .13s ease;
  }
  .mbn-post-btn svg { width: 20px; height: 20px; stroke: white; }
  .mbn-tab-post:active .mbn-post-btn {
    transform: scale(.91);
    box-shadow: 0 1px 5px var(--accent-light, rgba(26,115,232,.25));
  }

  /* Avatar tab perfil */
  .mbn-avatar-wrap { width: 26px; height: 26px; }
  .mbn-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    display: block;
  }
  .mbn-tab.mbn-active .mbn-avatar { border-color: var(--accent); }

  /* Badge notificaciones */
  .mbn-notif-wrap { position: relative; }
  .mbn-badge {
    position: absolute;
    top: -4px; right: -7px;
    min-width: 16px; height: 16px;
    background: #ff3b30;
    color: white;
    font-size: .57rem;
    font-weight: 800;
    border-radius: 99px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    border: 1.5px solid var(--bg-card);
    line-height: 1;
  }

  /* Punto de tab activo */
  .mbn-tab.mbn-active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 24px; height: 2.5px;
    border-radius: 0 0 3px 3px;
    background: var(--accent);
  }
  .mbn-tab-post.mbn-active::before { display: none; }

  /* Body con espacio para bottom nav */
  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior-y: contain;
  }

  /* ── Header compacto ── */
  .site-header { height: 48px !important; }
  :root { --header-h: 48px !important; }
  .site-header-inner { padding: 0 10px; gap: 8px; }

  /* Buscador oculto en mobile — el drawer tiene el tab de búsqueda */
  .header-search { display: none !important; }

  /* Ocultar en header lo que está en bottom nav */
  .header-actions .btn-post,
  .header-actions .kbits-btn { display: none !important; }

  /* Ocultar dropdown de usuario en header (el drawer lo reemplaza) */
  .header-user { display: none !important; }

  /* Solo mostrar mensajes en header mobile — alertas ya están en bottom nav */
  .header-actions .notif-btn {
    display: inline-flex !important;
    padding: 6px 8px;
    font-size: 1rem;
  }
  .header-actions .notif-btn.notif-btn--alerts { display: none !important; }

  /* Mantener solo hamburger, logo y theme-toggle en el header */

  /* ── Mobile Author Card — solo visible en móvil ── */
  .mobile-author-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
  }
  /* Fila superior: avatar + info + botones */
  .mac-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }
  .mac-avatar-link { flex-shrink: 0; }
  .mac-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    display: block;
  }
  .mac-info { flex: 1; min-width: 0; }
  .mac-name {
    display: block;
    font-weight: 700;
    font-size: .84rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
  }
  .mac-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
  }
  .mac-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
  }
  .mac-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    text-decoration: none;
    transition: background .15s;
    flex-shrink: 0;
  }
  .mac-btn:active { background: var(--bg-hover); }
  .mac-btn-follow[data-following="1"] { background: var(--accent-light); border-color: var(--accent); }

  /* Grid 2×2 de estadísticas */
  .mac-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    border-top: 1px solid var(--border);
  }
  .mac-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border-right: 1px solid var(--border);
    text-align: center;
  }
  .mac-stat-box:last-child { border-right: none; }
  .mac-stat-val {
    font-size: .95rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 2px;
  }
  .mac-stat-lbl {
    font-size: .58rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
  }

  /* ── Layout 1 columna sin sidebars ── */
  .site-wrapper {
    grid-template-columns: 1fr !important;
    padding: 0;
    gap: 0;
  }
  .sidebar-left,
  .sidebar-right { display: none !important; }

  /* ── Feed y cards: full bleed, sin sombras laterales ── */
  .posts-grid,
  .feed-header,
  .sidebar-widget,
  .home-widget,
  .post-card {
    box-shadow: none !important;
  }
  .posts-grid,
  .feed-header,
  .sidebar-widget {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .posts-grid { border-top: none; }

  /* Divisor entre menú de categorías y los posts */
  .feed-header {
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
  }

  /* El tab activo/hover no debe pegarse al borde superior/inferior del rail */
  .feed-filter {
    margin-top: 2px;
    margin-bottom: 2px;
  }

  .post-card { padding: 9px 12px; min-height: 44px; }
  .post-card-title { font-size: .85rem; }
  .post-card-image { width: 30px; height: 30px; }

  /* ── Footer oculto (reemplazado por bottom nav) ── */
  .site-footer { display: none !important; }

  /* Separación inferior: último widget no queda pegado al bottom nav */
  .home-bottom-widgets { margin-bottom: 8px; }
  .home-bottom-widgets .home-widget:last-child { margin-bottom: 0; }

  /* ── Post detail + profile pages ── */
  .post-page-grid {
    display: flex !important;
    flex-direction: column;
    gap: 0;
  }
  /* Ocultar sidebar en mobile (autor del post y tarjeta de perfil) */
  .post-author-sidebar { display: none !important; }
  /* Columna de contenido ocupa todo el ancho cuando la sidebar está oculta */
  .post-page-grid > div { width: 100% !important; box-sizing: border-box; }
  .post-main-col { min-width: 0; }

  .post-content-box,
  .post-section-box {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  .post-section-box { border-bottom: none; }
  .post-section-box + .post-section-box { border-top: 1px solid var(--border); }

  .post-header-bar { padding: 12px; }
  .post-page-title { font-size: 1.1rem !important; line-height: 1.3; }
  .post-body-content {
    padding: 14px 12px;
    font-size: .9rem;
    line-height: 1.68;
  }
  /* Imagen hero full bleed */
  .post-hero-wrap {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
  }
  .post-stats-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    font-size: .77rem;
  }

  /* Comentarios ── */
  .comment { gap: 8px; }
  .comment img, .comment-form img { width: 32px; height: 32px; flex-shrink: 0; }
  .comment-bubble { border-radius: 12px; }
  .comment-content { font-size: .85rem; }
  .comment-form textarea { font-size: 15px !important; min-height: 80px; }
  .comment-form { gap: 8px; }

  /* Tags ── */
  .tags-list { padding: 10px 12px !important; gap: 6px; }
  .tag { padding: 4px 10px; font-size: .73rem; }

  /* More-author widget ── */
  .more-author-item { padding: 10px 12px; min-height: 44px; }
  .more-author-title { font-size: .84rem; }

  /* Forms — evitar zoom en iOS ── */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select { font-size: 16px !important; touch-action: manipulation; }

  /* Botones mínimo táctil 44px ── */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; padding: 7px 12px; }

  /* Back to Top — encima del bottom nav ── */
  #backToTop {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 12px);
    right: 12px;
    width: 40px; height: 40px;
    font-size: 18px;
  }

  /* Scrollbar invisible (nativo) ── */
  ::-webkit-scrollbar { display: none; }
  * { scrollbar-width: none; }

  /* Selección con acento ── */
  ::selection {
    background: var(--accent-light, rgba(26,115,232,.2));
    color: var(--text);
  }

  /* Admin sidebar ── */
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    position: fixed;
    left: -280px; top: 0; bottom: 0;
    width: 280px;
    z-index: 1999;
    transition: left .25s ease;
    overflow-y: auto;
  }
  .admin-sidebar.open { left: 0; }
  .admin-main { padding: 10px; }
}

/* ══════════════════════════════════════════
   iPhone SE (320px) — pantalla mínima
   ══════════════════════════════════════════ */
@media (max-width: 360px) {
  /* Sin labels — solo iconos en bottom nav */
  .mbn-label { display: none; }
  .mobile-bottom-nav { height: calc(50px + env(safe-area-inset-bottom, 0px)); }
  body { padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px)); }
  #backToTop { bottom: calc(50px + env(safe-area-inset-bottom, 0px) + 10px); }

  .mbn-post-btn { width: 38px; height: 38px; }
  .mbn-post-btn svg { width: 18px; height: 18px; }
  .mbn-icon svg { width: 20px; height: 20px; }
  .mbn-avatar, .mbn-avatar-wrap { width: 22px; height: 22px; }

  .site-header-inner { padding: 0 7px; gap: 5px; }
  /* header-search ya está oculto en ≤680px */
  .header-user { padding: 3px 6px 3px 3px; }
  .header-user img { width: 24px; height: 24px; }

  .post-body-content { padding: 12px 10px; font-size: .87rem; }
  .post-card { padding: 8px 10px; }
  .post-card-title { font-size: .82rem; }
  .post-page-title { font-size: 1rem !important; }
}

/* ══════════════════════════════════════════
   Tablet (681–900px): sidebar izq. visible
   ══════════════════════════════════════════ */
@media (min-width: 681px) and (max-width: 900px) {
  .mobile-bottom-nav { display: none !important; }
  body { padding-bottom: 0 !important; }
  .site-wrapper { grid-template-columns: 200px 1fr !important; }
  .sidebar-right { display: none !important; }
}

/* ── Safe area top para iPhone con notch ── */
@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 680px) {
    .site-header {
      padding-top: env(safe-area-inset-top);
      height: calc(48px + env(safe-area-inset-top)) !important;
    }
    :root { --header-h: calc(48px + env(safe-area-inset-top)) !important; }
  }
}

/* ── Dark mode: bottom nav ── */
[data-theme="dark"] .mobile-bottom-nav {
  background: var(--bg-card);
  border-top-color: var(--border);
  box-shadow: 0 -1px 12px rgba(0,0,0,.35);
}
[data-theme="dark"] .mbn-badge { border-color: var(--bg-card); }

/* ── Premium User Role Badges ── */
.user-name-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.05em;
  line-height: 1;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  user-select: none;
}
.user-name-badge-admin {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  font-family: 'Outfit', 'Inter', sans-serif;
  animation: shine-badge 3s infinite linear;
  background-size: 200% auto;
}
.user-name-badge-mod {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  font-family: 'Outfit', 'Inter', sans-serif;
}

@keyframes shine-badge {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* General Badges styling */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-admin {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-mod {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.badge-user {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PCA — Post Card Author Badge (home feed premium role badges)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base — shared by all variants */
.pca-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  border-radius: var(--radius-full, 9999px);
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 10px;
  transition: transform .15s, box-shadow .15s, filter .15s;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pca-badge:hover { transform: translateY(-1px); }

/* Plain user pill */
.pca-badge-user {
  background: var(--accent-light, rgba(26,115,232,.08));
  border: 1px solid rgba(26,115,232,.18);
  color: var(--accent);
}
.pca-badge-user:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Admin badge — golden shimmer ── */
.pca-badge-admin {
  background: linear-gradient(105deg, #92400e, #f59e0b 40%, #fcd34d 60%, #d97706);
  background-size: 250% auto;
  border: 1px solid rgba(251,191,36,.5);
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
  animation: pca-admin-shimmer 3s linear infinite, pca-admin-glow 2.5s ease-in-out infinite;
  font-family: 'Outfit', 'Inter', sans-serif;
}
.pca-badge-admin:hover {
  box-shadow: 0 4px 14px rgba(251,191,36,.55);
  filter: brightness(1.1);
}
.pca-badge-admin .pca-name  { overflow: hidden; text-overflow: ellipsis; }
.pca-badge-admin .pca-role-tag {
  font-size: .55rem;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0,0,0,.25);
  color: #fde68a;
  flex-shrink: 0;
}

@keyframes pca-admin-shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 250% center; }
}
@keyframes pca-admin-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(251,191,36,.35); }
  50%       { box-shadow: 0 0 10px rgba(251,191,36,.65), 0 0 18px rgba(251,191,36,.3); }
}

/* ── Moderator badge — indigo/teal premium ── */
.pca-badge-mod {
  background: linear-gradient(105deg, #1e3a8a, #3b82f6 45%, #818cf8 65%, #4f46e5);
  background-size: 250% auto;
  border: 1px solid rgba(99,102,241,.45);
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
  animation: pca-mod-shimmer 3.5s linear infinite, pca-mod-glow 3s ease-in-out infinite;
  font-family: 'Outfit', 'Inter', sans-serif;
}
.pca-badge-mod:hover {
  box-shadow: 0 4px 14px rgba(99,102,241,.5);
  filter: brightness(1.1);
}
.pca-badge-mod .pca-name  { overflow: hidden; text-overflow: ellipsis; }
.pca-badge-mod .pca-role-tag {
  font-size: .55rem;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0,0,0,.25);
  color: #bfdbfe;
  flex-shrink: 0;
}

@keyframes pca-mod-shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 250% center; }
}
@keyframes pca-mod-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(99,102,241,.3); }
  50%       { box-shadow: 0 0 10px rgba(99,102,241,.55), 0 0 18px rgba(99,102,241,.25); }
}

/* Responsive: shrink on tiny screens */
@media (max-width: 480px) {
  .pca-badge-admin .pca-role-tag,
  .pca-badge-mod  .pca-role-tag { display: none; }
  .pca-badge { max-width: 110px; }
}



