/*
Theme Name: SaberHoy Editorial
Theme URI: https://saberhoy.es
Author: SaberHoy
Description: Tema editorial ligero, mobile-first y accesible para SaberHoy.
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: saberhoy
*/

:root {
  --sh-ink: #0b1f33;
  --sh-ink-2: #17324d;
  --sh-accent: #f4a340;
  --sh-accent-dark: #c96916;
  --sh-sky: #eaf2f7;
  --sh-paper: #ffffff;
  --sh-muted: #607286;
  --sh-line: #d8e2ea;
  --sh-green: #08775c;
  --sh-radius: 18px;
  --sh-shadow: 0 12px 34px rgba(11, 31, 51, .09);
  --sh-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--sh-ink);
  background: #f8fafc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sh-ink); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--sh-accent-dark); }
.wrap { width: min(calc(100% - 32px), var(--sh-width)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { position: fixed; z-index: 9999; top: 12px; left: 12px; width: auto; height: auto; clip: auto; padding: 10px 14px; background: #fff; }

.site-topline { background: var(--sh-ink); color: #dbe7ef; font-size: 13px; }
.site-topline .wrap { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-topline p { margin: 0; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--sh-line); backdrop-filter: blur(12px); }
.header-main { min-height: 76px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.brand-mark { width: 38px; height: 38px; }
.brand-name { font-size: clamp(24px, 4vw, 32px); line-height: 1; font-weight: 850; letter-spacing: -.045em; }
.brand-name span { color: var(--sh-accent-dark); }
.primary-nav { margin-left: auto; }
.primary-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 0; margin: 0; list-style: none; }
.primary-nav a { display: block; padding: 8px 0; font-size: 15px; font-weight: 700; text-decoration: none; }
.header-search { width: 38px; height: 38px; border: 1px solid var(--sh-line); border-radius: 50%; display: grid; place-items: center; text-decoration: none; font-size: 19px; }
.menu-toggle { display: none; border: 0; background: transparent; padding: 8px; font: inherit; font-weight: 800; color: var(--sh-ink); }

.hero { padding: clamp(38px, 7vw, 84px) 0 38px; background: linear-gradient(145deg, #071727 0%, #0f3556 68%, #194b70 100%); color: white; overflow: hidden; }
.hero-grid { display: grid; gap: 24px; align-items: end; }
.eyebrow { margin: 0 0 12px; color: var(--sh-accent); font-size: 13px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { max-width: 850px; margin: 0; font-size: clamp(40px, 8vw, 84px); line-height: .98; letter-spacing: -.055em; }
.hero-copy { max-width: 690px; margin: 20px 0 0; color: #d5e4ef; font-size: clamp(18px, 2.5vw, 24px); }

.trending { margin-top: -1px; background: #fff; border-bottom: 1px solid var(--sh-line); }
.trending-inner { display: grid; gap: 16px; padding: 24px 0; }
.trending-title { margin: 0; font-size: 13px; letter-spacing: .09em; text-transform: uppercase; }
.trend-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.trend-list a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--sh-line); border-radius: 999px; background: #f8fafc; text-decoration: none; font-size: 14px; font-weight: 720; }
.trend-list a::before { content: "↗"; color: var(--sh-green); }

.section { padding: clamp(42px, 6vw, 76px) 0; }
.section + .section { border-top: 1px solid var(--sh-line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -.04em; }
.section-link { font-size: 14px; font-weight: 800; }
.card-grid { display: grid; gap: 22px; }
.story-card { min-width: 0; background: var(--sh-paper); border: 1px solid var(--sh-line); border-radius: var(--sh-radius); overflow: hidden; box-shadow: 0 1px 0 rgba(11,31,51,.02); transition: transform .2s ease, box-shadow .2s ease; }
.story-card:hover { transform: translateY(-3px); box-shadow: var(--sh-shadow); }
.story-card a { text-decoration: none; }
.card-media { aspect-ratio: 16/9; overflow: hidden; background: var(--sh-sky); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.story-card:hover .card-media img { transform: scale(1.025); }
.card-body { padding: 20px; }
.category-pill { display: inline-block; margin-bottom: 9px; color: var(--sh-accent-dark); font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.card-title { margin: 0; font-size: clamp(21px, 2.5vw, 28px); line-height: 1.13; letter-spacing: -.025em; }
.card-excerpt { margin: 12px 0 0; color: var(--sh-muted); font-size: 15px; }
.story-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; color: var(--sh-muted); font-size: 13px; }

.archive-header { padding: 48px 0 22px; }
.archive-header h1 { margin: 0; font-size: clamp(38px, 7vw, 70px); line-height: 1; letter-spacing: -.05em; }
.archive-description { max-width: 700px; color: var(--sh-muted); }
.pagination { margin-top: 34px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination a, .pagination span { padding: 8px 12px; border: 1px solid var(--sh-line); border-radius: 10px; background: #fff; text-decoration: none; }

.article-wrap { width: min(calc(100% - 32px), 860px); margin-inline: auto; padding: clamp(38px, 7vw, 72px) 0; }
.breadcrumbs { margin-bottom: 22px; color: var(--sh-muted); font-size: 14px; }
.breadcrumbs a { color: inherit; }
.article-header h1 { margin: 8px 0 18px; font-size: clamp(38px, 7vw, 68px); line-height: 1.02; letter-spacing: -.052em; }
.article-deck { margin: 0 0 22px; color: var(--sh-ink-2); font-size: clamp(19px, 2.5vw, 24px); line-height: 1.45; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 14px 0; border-block: 1px solid var(--sh-line); color: var(--sh-muted); font-size: 14px; }
.article-hero { margin: 30px 0; border-radius: var(--sh-radius); overflow: hidden; background: var(--sh-sky); }
.article-hero figcaption { padding: 10px 14px; background: #eef3f6; color: var(--sh-muted); font-size: 13px; }
.entry-content { font-family: Georgia, "Times New Roman", serif; font-size: clamp(18px, 2vw, 21px); }
.entry-content > * { max-width: 740px; margin-left: auto; margin-right: auto; }
.entry-content h2, .entry-content h3 { font-family: Inter, ui-sans-serif, system-ui, sans-serif; line-height: 1.15; letter-spacing: -.025em; margin-top: 2em; }
.entry-content h2 { font-size: clamp(28px, 4vw, 40px); }
.entry-content h3 { font-size: 24px; }
.entry-content a { color: #075d87; }
.entry-content blockquote, .essential { padding: 22px; border-left: 4px solid var(--sh-accent); border-radius: 0 14px 14px 0; background: #fff7eb; }
.sources { margin-top: 44px; padding: 22px; border: 1px solid var(--sh-line); border-radius: var(--sh-radius); background: #fff; }
.sources h2 { margin-top: 0; font-size: 24px; }
.sources li + li { margin-top: 8px; }
.article-disclosure { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--sh-line); color: var(--sh-muted); font-size: 14px; }

.page-header { padding-top: 40px; }
.page-header h1 { margin: 0; font-size: clamp(38px, 6vw, 62px); line-height: 1.05; letter-spacing: -.045em; }
.notice { padding: 16px 18px; border: 1px solid #f0d3a7; border-radius: 12px; background: #fff7eb; }
.contact-form { display: grid; gap: 16px; margin-top: 28px; }
.contact-form label { display: grid; gap: 6px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-weight: 750; }
.contact-form input, .contact-form textarea { width: 100%; padding: 12px 14px; border: 1px solid #b9c8d3; border-radius: 10px; background: #fff; font: inherit; }
.contact-form button { width: fit-content; padding: 12px 20px; border: 0; border-radius: 10px; background: var(--sh-ink); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.contact-form .hp { position: absolute; left: -9999px; }

.site-footer { margin-top: 40px; padding: 52px 0 28px; background: var(--sh-ink); color: #d7e4ee; }
.footer-grid { display: grid; gap: 30px; }
.site-footer .brand { color: #fff; }
.site-footer h2 { margin: 0 0 10px; color: #fff; font-size: 16px; }
.footer-links { margin: 0; padding: 0; list-style: none; columns: 2; }
.footer-links li { margin-bottom: 7px; break-inside: avoid; }
.site-footer a { color: #d7e4ee; }
.footer-bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); color: #9fb2c1; font-size: 13px; }

@media (min-width: 700px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 260px; }
  .trending-inner { grid-template-columns: 210px 1fr; align-items: start; }
  .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .card-grid .story-card:first-child { grid-column: span 2; }
  .card-grid .story-card:first-child .card-title { font-size: clamp(28px, 4vw, 42px); }
  .footer-grid { grid-template-columns: 1.1fr 2fr; }
}

@media (min-width: 1040px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .card-grid .story-card:first-child { grid-column: span 2; grid-row: span 2; }
  .card-grid .story-card:first-child .card-media { aspect-ratio: 16/10; }
}

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 76px; padding: 18px 16px 24px; background: #fff; border-bottom: 1px solid var(--sh-line); box-shadow: var(--sh-shadow); }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { display: grid; gap: 0; }
  .primary-nav a { padding: 10px 0; }
  .header-search { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
