/* ══════════════════════════════════════════════════════════
   MAREA — Sidebar widgets
══════════════════════════════════════════════════════════ */

/* ── WIDGET BASE ─────────────────────────────────────────── */
.sw { border: 1px solid var(--mist); }

.sw-head {
  background: var(--ink);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sw-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--cream);
  letter-spacing: -0.2px;
}

.sw-wave,
.sw-line {
  height: 2px;
  flex: 1;
  background: var(--wave);
}

.sw-body { background: var(--paper); }

/* ── SIDEBAR CONTAINER ───────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

/* ── TRENDING ─────────────────────────────────────────────────
   v2 class names: .trend-list / .trend-item / .trend-link / .trend-n
   legacy:         .trending-list / .trending-item / .trend-num
   ─────────────────────────────────────────────────────────── */
.trending-list,
.trend-list { list-style: none; }

/* v2: link is the flex container */
.trend-item {
  border-bottom: 1px solid var(--mist);
}
.trend-item:last-child { border-bottom: none; }

.trend-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 13px;
  text-decoration: none;
  color: inherit;
  transition: background var(--t-fast);
  width: 100%;
}
.trend-link:hover { background: var(--cream); }
.trend-link:hover .trend-n { color: var(--wave); }

/* legacy: item is the flex container */
.trending-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--mist);
  cursor: pointer;
  transition: background var(--t-fast);
  text-decoration: none;
  color: inherit;
}
.trending-item:last-child { border-bottom: none; }
.trending-item:hover { background: var(--cream); }

/* Number — v2: .trend-n, legacy: .trend-num */
.trend-n,
.trend-num {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  color: var(--mist);
  flex-shrink: 0;
  width: 24px;
}
.trending-item:hover .trend-num { color: var(--wave); }

.trend-cat {
  font-family: var(--font-condensed);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--wave);
  margin-bottom: 2px;
}

.trend-title {
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

/* ── NEWSLETTER WIDGET (v2: .w-nl / .wnl-*; legacy: .newsletter-widget / .nw-*) ── */
.newsletter-widget,
.w-nl {
  background: var(--ink);
  padding: 22px;
}

.nw-label,
.wnl-badge {
  font-family: var(--font-condensed);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--wave);
  margin-bottom: 10px;
}

.nw-title,
.wnl-title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 0.97;
  color: var(--cream);
  margin-bottom: 9px;
  letter-spacing: -0.3px;
}

.nw-desc,
.wnl-desc {
  font-size: 13px;
  color: var(--fog);
  margin-bottom: 14px;
  line-height: 1.5;
}

.nw-form,
.wnl-form { display: flex; flex-direction: column; gap: 0; }

.nw-input,
.wnl-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--cream);
  padding: 9px 12px;
  outline: none;
  margin-bottom: 8px;
  border-radius: 0;
}
.nw-input::placeholder,
.wnl-input::placeholder { color: var(--fog); }
.nw-input:focus,
.wnl-input:focus { border-color: var(--wave); }

.nw-btn,
.wnl-btn {
  width: 100%;
  background: var(--wave);
  color: var(--ink);
  font-family: var(--font-condensed);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 9px;
  border: none;
  cursor: pointer;
  transition: background var(--t-fast);
}
.nw-btn:hover,
.wnl-btn:hover { background: var(--cream); }

.nw-disclaimer,
.wnl-disclaimer {
  font-size: 11px;
  color: rgba(155,149,144,.45);
  margin-top: 8px;
  line-height: 1.4;
}

/* ── TAGS / TAG CLOUD ────────────────────────────────────── */
.tag-cloud {
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  font-family: var(--font-condensed);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 11px;
  border: 1px solid var(--mist);
  color: var(--fog);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  display: inline-block;
}
.tag-pill:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.tag-pill.hot   { border-color: var(--wave); color: var(--wave); }
.tag-pill.hot:hover { background: var(--wave); color: var(--ink); }

/* ── SOCIAL FOLLOW ───────────────────────────────────────── */
.social-follow {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--mist);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  color: inherit;
}
.sf-item:hover { border-color: var(--ink); background: var(--cream); }

.sf-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.sf-label {
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.sf-count { font-size: 12px; color: var(--fog); margin-left: auto; }

/* ── TOC (article sidebar) ───────────────────────────────── */
.toc-widget {
  background: var(--cream);
  border: 1px solid var(--mist);
}

.toc-head {
  background: var(--ink);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toc-title { font-family: var(--font-display); font-size: 15px; color: var(--cream); letter-spacing: -0.1px; }
.toc-wave  { height: 2px; flex: 1; background: var(--wave); }
.toc-body  { padding: 16px; }
.toc-list  { list-style: none; display: flex; flex-direction: column; gap: 0; }

.toc-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--mist);
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 600;
  color: var(--fog);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--t-fast);
  text-decoration: none;
}
.toc-item:last-child { border-bottom: none; }
.toc-item:hover, .toc-item.active { color: var(--ink); background: var(--paper); }
.toc-item.active .toc-num { color: var(--wave); }

.toc-num {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--mist);
  flex-shrink: 0;
  width: 22px;
}

/* ── STICKY SHARE (article sidebar) ─────────────────────── */
.sticky-share { background: var(--ink); padding: 18px; }

.ss-label {
  font-family: var(--font-condensed);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--wave);
  margin-bottom: 12px;
}

.ss-btns { display: flex; flex-direction: column; gap: 8px; }

.ss-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.08);
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fog);
  cursor: pointer;
  transition: all var(--t-fast);
  background: none;
  text-decoration: none;
}
.ss-btn:hover { border-color: var(--wave); color: var(--cream); }

.ss-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.ss-counter { margin-left: auto; font-size: 13px; color: var(--sand); }

/* ── TOC: anchor links & active state ───────────────────── */

/* El <li> es solo contenedor; el <a> lleva el estilo interactivo */
.toc-item {
  padding: 0;            /* override the padding on <li> — moved to <a> */
  cursor: default;
}

.toc-item a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  width: 100%;
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fog);
  text-decoration: none;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}

.toc-item a:hover {
  color: var(--ink);
  background: var(--paper);
}

/* Ítem activo: borde wave + color wave */
.toc-item.active {
  border-left: 3px solid var(--wave);
}

.toc-item.active a {
  color: var(--wave);
  background: var(--paper);
  padding-left: 9px; /* compensar border-left 3px */
}

.toc-item.active .toc-num {
  color: var(--wave);
}

/* H3: ligeramente indentado y más pequeño */
.toc-level-3 a {
  padding-left: 28px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(155,149,144,.8);
}
.toc-item.active.toc-level-3 a {
  padding-left: 25px;
  color: var(--wave);
}
