/*
Theme Name: FinanzasHoy
Description: Tema de noticias financieras con diseño de tarjetas, cabecera degradada y pestañas de categorías. Creado a medida para FinanzasHoy.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: finanzashoy
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:      #0bbfbc;
  --purple:    #6b21a8;
  --orange:    #e85d26;
  --dark:      #111827;
  --mid:       #374151;
  --muted:     #9ca3af;
  --bg:        #f4f6f8;
  --white:     #ffffff;
  --card-r:    12px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
}

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

/* ── TOP NAV ────────────────────────────────── */
.topbar {
  background: linear-gradient(135deg, var(--teal) 0%, #4f46e5 55%, var(--purple) 100%);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}

.nav-icons { display: flex; gap: 20px; align-items: center; }

.nav-icons svg {
  width: 20px; height: 20px;
  stroke: rgba(255,255,255,0.85);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
}

.nav-icons svg:hover { stroke: #fff; }

/* ── HERO ───────────────────────────────────── */
.hero { position: relative; height: 320px; overflow: hidden; }

.hero-bg { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }

.hero-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(160deg, #0d1b2a 0%, #1a2744 60%, #2d1b69 100%);
  position: relative;
  overflow: hidden;
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,15,35,0.92) 40%, rgba(10,15,35,0.25) 100%);
}

.hero-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 20px 24px;
  max-width: 700px;
  margin: 0 auto;
}

.badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.hero-headline {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 10px;
}

.hero-sub { font-size: 0.82rem; color: rgba(255,255,255,0.72); line-height: 1.55; }

/* ── TABS ───────────────────────────────────── */
.tabs-wrap {
  background: var(--white);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 56px;
  z-index: 90;
}

.tabs {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 12px;
  gap: 4px;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 13px 14px 11px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  background: none;
  border-top: none; border-left: none; border-right: none;
}

.tab:hover { color: var(--dark); }
.tab.active { color: var(--orange); border-bottom-color: var(--orange); }

/* ── FEED ───────────────────────────────────── */
.feed {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px 12px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── TICKER ─────────────────────────────────── */
.ticker-wrap { max-width: 700px; margin: 16px auto 0; padding: 0 12px; }

.ticker {
  background: var(--white);
  border-radius: var(--card-r);
  padding: 12px 16px;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ticker::-webkit-scrollbar { display: none; }

.tick-item { flex-shrink: 0; text-align: center; }
.tick-name { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; margin-bottom: 2px; }
.tick-val { font-size: 0.95rem; font-weight: 700; color: var(--dark); }
.tick-chg { font-size: 0.72rem; font-weight: 600; margin-top: 1px; }
.up   { color: #16a34a; }
.down { color: #dc2626; }

/* ── NEWS CARD ──────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--card-r);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.18s, box-shadow 0.18s;
}

.card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

.card-img { width: 100%; height: 200px; object-fit: cover; display: block; }
.card-img-placeholder { width: 100%; height: 200px; }

.card-body { padding: 16px 18px 20px; }

.card-cat {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--orange); margin-bottom: 8px;
}

.card-title { font-size: 1.05rem; font-weight: 700; color: var(--dark); line-height: 1.35; margin-bottom: 8px; }
.card-title a:hover { color: var(--orange); }

.card-desc { font-size: 0.82rem; color: var(--mid); line-height: 1.58; margin-bottom: 12px; }

.card-meta { font-size: 0.72rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.card-meta span.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

/* ── HORIZONTAL CARD ────────────────────────── */
.card-h {
  background: var(--white);
  border-radius: var(--card-r);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  transition: transform 0.18s, box-shadow 0.18s;
}

.card-h:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

.card-h .card-img,
.card-h .card-img-placeholder { width: 110px; height: 110px; object-fit: cover; flex-shrink: 0; }

.card-h .card-body { padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; }
.card-h .card-title { font-size: 0.9rem; }
.card-h .card-desc { display: none; }

/* ── SECTION LABEL ──────────────────────────── */
.section-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 8px 4px 4px; }

/* ── PAGINATION ─────────────────────────────── */
.pagination { max-width: 700px; margin: 0 auto; padding: 0 12px 24px; display: flex; justify-content: space-between; gap: 10px; }
.pagination a, .pagination span {
  display: inline-block; padding: 10px 16px; background: var(--white); border-radius: 8px;
  font-size: 0.8rem; font-weight: 600; color: var(--dark); box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.pagination a:hover { color: var(--orange); }

/* ── SINGLE POST ────────────────────────────── */
.single-wrap { max-width: 700px; margin: 0 auto; padding: 0 16px 40px; }
.single-eyebrow { padding-top: 20px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); margin-bottom: 10px; }
.single-title { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.single-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 20px; display: flex; gap: 8px; align-items: center; }
.single-meta span.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.single-featured { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--card-r); margin-bottom: 24px; }
.single-content { font-size: 1rem; line-height: 1.75; color: var(--mid); }
.single-content p { margin-bottom: 18px; }
.single-content h2 { font-family: 'Playfair Display', serif; font-size: 1.3rem; margin: 28px 0 12px; color: var(--dark); }
.single-content h3 { font-size: 1.1rem; margin: 22px 0 10px; color: var(--dark); }
.single-content a { color: var(--teal); text-decoration: underline; }
.single-content img { border-radius: 8px; margin: 16px 0; }
.single-back { display: inline-block; margin-top: 28px; font-size: 0.82rem; font-weight: 600; color: var(--orange); }

/* ── PAGE (static pages: aviso legal, privacidad) ──── */
.page-wrap { max-width: 700px; margin: 0 auto; padding: 28px 16px 40px; }
.page-title { font-family: 'Playfair Display', serif; font-size: 1.6rem; margin-bottom: 18px; }
.page-content { font-size: 0.95rem; line-height: 1.75; color: var(--mid); }
.page-content p { margin-bottom: 16px; }

/* ── ARCHIVE HEADER ─────────────────────────── */
.archive-header { max-width: 700px; margin: 0 auto; padding: 18px 12px 4px; }
.archive-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; }

/* ── TIPS / GUIDE PAGE ──────────────────────── */
.tips-wrap { max-width: 700px; margin: 0 auto; padding: 24px 16px 40px; }
.tips-eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); margin-bottom: 10px; }
.tips-title { font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.tips-intro { font-size: 0.92rem; color: var(--mid); line-height: 1.65; margin-bottom: 26px; }

.tip-list { display: flex; flex-direction: column; gap: 12px; }

.tip-card {
  background: var(--white);
  border-radius: var(--card-r);
  padding: 18px 18px 18px 56px;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.tip-num {
  position: absolute;
  left: 16px; top: 18px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.tip-title { font-size: 0.98rem; font-weight: 700; color: var(--dark); margin-bottom: 6px; line-height: 1.35; }
.tip-text { font-size: 0.85rem; color: var(--mid); line-height: 1.6; }

/* ── ARTÍCULOS RELACIONADOS ────────────────── */
.related-wrap { margin-top: 24px; }
.related-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* ── ANUNCIOS (ADSENSE) ─────────────────────── */
.ad-slot { margin: 2px 0; }
.ad-slot-placeholder {
  border: 1px dashed #cbd5e1;
  border-radius: var(--card-r);
  background: #f1f5f9;
  padding: 30px 16px;
  text-align: center;
}
.ad-slot-placeholder span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── FOOTER ─────────────────────────────────── */
footer.site-footer {
  background: linear-gradient(135deg, var(--teal) 0%, #4f46e5 55%, var(--purple) 100%);
  padding: 28px 20px;
  text-align: center;
  margin-top: 24px;
}

.footer-logo { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.footer-links { margin-bottom: 10px; }
.footer-links a { font-size: 0.75rem; color: rgba(255,255,255,0.85); margin: 0 8px; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
footer.site-footer p { font-size: 0.75rem; color: rgba(255,255,255,0.6); }

@media (min-width: 600px) {
  .hero { height: 380px; }
  .hero-headline { font-size: 1.75rem; }
}

/* ══════════════════════════════════════════
   SEO v2.0 — nuevos componentes
   ══════════════════════════════════════════ */

/* ── Barra de progreso de lectura ─────── */
#read-progress {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--orange));
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Breadcrumbs ─────────────────────── */
.breadcrumbs { padding: 14px 0 4px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 2px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { font-size: 0.72rem; color: var(--muted); }
.breadcrumbs li a { color: var(--teal); }
.breadcrumbs li a:hover { text-decoration: underline; }
.bc-sep { margin: 0 2px; }
.bc-current { color: var(--dark); font-weight: 600; }

/* ── Tabla de contenidos (TOC) ────────── */
.toc {
  background: #f8fafc;
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--card-r) var(--card-r) 0;
  padding: 16px 18px;
  margin: 20px 0;
}
.toc-title {
  font-size: 0.82rem; font-weight: 700;
  color: var(--dark); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.toc-list { margin: 0; padding-left: 18px; }
.toc-list li { margin-bottom: 6px; }
.toc-list a { font-size: 0.85rem; color: var(--teal); }
.toc-list a:hover { text-decoration: underline; }

/* ── Botones de compartir ─────────────── */
.share-wrap {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; margin: 16px 0;
}
.share-label {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-right: 4px;
}
.share-btn {
  display: inline-block; padding: 6px 12px;
  border-radius: 6px; font-size: 0.75rem; font-weight: 700;
  text-decoration: none; transition: opacity 0.15s;
}
.share-btn:hover { opacity: 0.85; }
.share-x  { background: #000; color: #fff; }
.share-wa { background: #25d366; color: #fff; }
.share-tg { background: #0088cc; color: #fff; }
.share-li { background: #0a66c2; color: #fff; }

/* ── Caja de autor ────────────────────── */
.author-box {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--white); border-radius: var(--card-r);
  padding: 18px; margin: 24px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.author-avatar img { border-radius: 50%; width: 56px; height: 56px; }
.author-name { font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; }
.author-name a { color: var(--dark); }
.author-name a:hover { color: var(--orange); }
.author-bio { font-size: 0.8rem; color: var(--mid); line-height: 1.55; }

/* ── Anterior / Siguiente ─────────────── */
.prev-next {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin: 24px 0;
}
.prev-next-card {
  background: var(--white); border-radius: var(--card-r);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}
.prev-next-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.09); }
.next-card { text-align: right; }
.pn-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange); }
.pn-title { font-size: 0.82rem; font-weight: 600; color: var(--dark); line-height: 1.35; }

/* ── Archive description ──────────────── */
.archive-desc { font-size: 0.85rem; color: var(--mid); margin-top: 6px; line-height: 1.6; }


/* ══════════════════════════════════════════
   SEO v3.0 — Correcciones completas
   ══════════════════════════════════════════ */

/* ── Barra de progreso de lectura ─────── */
#read-progress {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--orange));
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Breadcrumbs ─────────────────────── */
.breadcrumbs { padding: 14px 0 4px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 2px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { font-size: 0.72rem; color: var(--muted); }
.breadcrumbs li a { color: var(--teal); }
.breadcrumbs li a:hover { text-decoration: underline; }
.bc-sep { margin: 0 2px; }
.bc-current { color: var(--dark); font-weight: 600; }

/* ── TOC ──────────────────────────────── */
.toc { background: #f8fafc; border-left: 3px solid var(--teal); border-radius: 0 var(--card-r) var(--card-r) 0; padding: 16px 18px; margin: 20px 0; }
.toc-title { font-size: 0.82rem; font-weight: 700; color: var(--dark); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.toc-list { margin: 0; padding-left: 18px; }
.toc-list li { margin-bottom: 6px; }
.toc-list a { font-size: 0.85rem; color: var(--teal); }
.toc-list a:hover { text-decoration: underline; }

/* ── Botones de compartir ─────────────── */
.share-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
.share-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.share-btn { display: inline-block; padding: 6px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; text-decoration: none; transition: opacity 0.15s; }
.share-btn:hover { opacity: 0.85; }
.share-x  { background: #000; color: #fff; }
.share-wa { background: #25d366; color: #fff; }
.share-tg { background: #0088cc; color: #fff; }
.share-li { background: #0a66c2; color: #fff; }

/* ── Caja de autor ────────────────────── */
.author-box { display: flex; gap: 14px; align-items: flex-start; background: var(--white); border-radius: var(--card-r); padding: 18px; margin: 24px 0; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.author-avatar img { border-radius: 50%; width: 56px; height: 56px; }
.author-name { font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; }
.author-name a { color: var(--dark); }
.author-name a:hover { color: var(--orange); }
.author-bio { font-size: 0.8rem; color: var(--mid); line-height: 1.55; }

/* ── Anterior / Siguiente ─────────────── */
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 24px 0; }
.prev-next-card { background: var(--white); border-radius: var(--card-r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); transition: transform 0.15s, box-shadow 0.15s; }
.prev-next-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.09); }
.next-card { text-align: right; }
.pn-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange); }
.pn-title { font-size: 0.82rem; font-weight: 600; color: var(--dark); line-height: 1.35; }

/* ── Artículos relacionados ────────────── */
.related-wrap { margin-top: 24px; }
.related-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* ── AdSense ──────────────────────────── */
.ad-slot { margin: 2px 0; min-height: 50px; }
.ad-slot-placeholder-text { display: block; border: 1px dashed #cbd5e1; border-radius: var(--card-r); background: #f1f5f9; padding: 30px 16px; text-align: center; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ── Archive description ──────────────── */
.archive-desc { font-size: 0.85rem; color: var(--mid); margin-top: 6px; line-height: 1.6; }

/* ── Footer links ─────────────────────── */
.footer-links a { font-size: 0.75rem; color: rgba(255,255,255,0.85); margin: 0 8px; }
.footer-links a:hover { color: #fff; text-decoration: underline; }


/* ── Screen reader only (H1 SEO portada) ── */
.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
