/*
Theme Name: EcoMex Pulso
Theme URI: https://www.ecomexdiario.online/
Author: EcoMex Diario
Description: Tema editorial original para EcoMex Diario, inspirado en patrones de revistas y portales de noticias modernos: ticker, hero modular, bloques temáticos, sidebar y espacios comerciales. No contiene código ni recursos de Jannah.
Version: 1.2.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: ecomex-pulso
*/

:root {
  --emx-bg: #f4f6f8;
  --emx-surface: #ffffff;
  --emx-text: #15191f;
  --emx-muted: #69727d;
  --emx-border: #e4e8ed;
  --emx-accent: #0e7354;
  --emx-accent-dark: #09583f;
  --emx-ink: #0b1118;
  --emx-gold: #b79142;
  --emx-radius: 10px;
  --emx-shadow: 0 10px 30px rgba(11,17,24,.07);
  --emx-container: 1320px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--emx-bg);
  color: var(--emx-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--emx-accent); }
img { max-width: 100%; height: auto; display: block; }

.emx-container { width: min(calc(100% - 32px), var(--emx-container)); margin-inline: auto; }
.emx-topbar { background: var(--emx-ink); color: #c8d0d9; font-size: 13px; }
.emx-topbar__inner { min-height: 38px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.emx-topbar__links { display:flex; gap:18px; flex-wrap:wrap; }
.emx-topbar__links a:hover { color:#fff; }

.emx-brandbar { background:#fff; border-bottom:1px solid var(--emx-border); }
.emx-brandbar__inner { min-height:118px; display:grid; grid-template-columns: 260px 1fr; align-items:center; gap:36px; }
.emx-logo-wrap { display:flex; align-items:center; }
.emx-text-logo { display:inline-flex; flex-direction:column; line-height:.9; font-weight:900; letter-spacing:-2px; font-size:38px; color:var(--emx-ink); }
.emx-text-logo small { margin-top:8px; font-size:11px; letter-spacing:2.6px; font-weight:800; color:var(--emx-accent); text-transform:uppercase; }
.custom-logo { max-height:72px; width:auto; }
.emx-leaderboard { min-height:76px; border:1px solid var(--emx-border); background:#fafbfc; display:flex; align-items:center; justify-content:center; color:#9aa2aa; text-transform:uppercase; letter-spacing:1.2px; font-size:11px; overflow:hidden; }
.emx-leaderboard img { width:100%; height:100%; object-fit:cover; }

.emx-nav { position:sticky; top:0; z-index:50; background:var(--emx-ink); box-shadow:0 2px 15px rgba(0,0,0,.12); }
.emx-nav__inner { min-height:52px; display:flex; align-items:center; gap:8px; }
.emx-menu-toggle { display:none; color:#fff; background:transparent; border:0; padding:10px; font-size:24px; cursor:pointer; }
.emx-nav .menu { list-style:none; display:flex; gap:0; margin:0; padding:0; width:100%; align-items:center; }
.emx-nav .menu > li { position:relative; }
.emx-nav .menu > li > a { display:block; color:#fff; padding:17px 14px 15px; font-size:13px; line-height:20px; font-weight:800; text-transform:uppercase; letter-spacing:.35px; border-bottom:3px solid transparent; }
.emx-nav .menu > li.current-menu-item > a,
.emx-nav .menu > li > a:hover { background:#131b24; border-bottom-color:var(--emx-accent); }
.emx-nav .sub-menu { display:none; position:absolute; top:100%; left:0; min-width:230px; list-style:none; margin:0; padding:8px; background:#111821; box-shadow:var(--emx-shadow); }
.emx-nav li:hover > .sub-menu { display:block; }
.emx-nav .sub-menu a { color:#d8dde3; display:block; padding:10px 12px; font-size:13px; }
.emx-nav .sub-menu a:hover { background:#19232e; color:#fff; }
.emx-search-link { margin-left:auto; color:white; padding:10px 0 10px 16px; font-weight:800; }

.emx-ticker { background:#fff; border-bottom:1px solid var(--emx-border); }
.emx-ticker__inner { min-height:44px; display:grid; grid-template-columns:auto 1fr; align-items:center; gap:16px; overflow:hidden; }
.emx-ticker__label { background:var(--emx-accent); color:#fff; font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:1px; padding:7px 10px; border-radius:4px; white-space:nowrap; }
.emx-ticker__track { position:relative; height:22px; overflow:hidden; }
.emx-ticker__item { position:absolute; inset:0; opacity:0; transform:translateY(12px); transition:.45s ease; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; font-size:14px; font-weight:650; }
.emx-ticker__item.is-active { opacity:1; transform:none; }

.emx-main { padding:28px 0 48px; }
.emx-hero { display:grid; grid-template-columns: 1.55fr 1fr; gap:8px; min-height:510px; margin-bottom:28px; }
.emx-hero__side { display:grid; grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; gap:8px; }
.emx-story-card { position:relative; overflow:hidden; border-radius:8px; background:#111; min-height:0; }
.emx-story-card::after { content:""; position:absolute; inset:0; background:linear-gradient(to top, rgba(4,8,12,.92) 0%, rgba(4,8,12,.42) 48%, rgba(4,8,12,.05) 78%); pointer-events:none; }
.emx-story-card img { width:100%; height:100%; object-fit:cover; transition:transform .5s ease; }
.emx-story-card:hover img { transform:scale(1.035); }
.emx-story-card__body { position:absolute; z-index:2; inset:auto 0 0; padding:22px; color:#fff; }
.emx-story-card--lead .emx-story-card__body { padding:32px; }
.emx-kicker { display:inline-flex; align-items:center; gap:6px; margin-bottom:9px; padding:5px 8px; background:var(--emx-accent); color:#fff; border-radius:4px; font-size:10px; line-height:1; font-weight:900; text-transform:uppercase; letter-spacing:.65px; }
.emx-story-card h2, .emx-story-card h3 { margin:0; letter-spacing:-.4px; line-height:1.12; text-wrap:balance; }
.emx-story-card h2 { font-size:clamp(28px, 3.2vw, 48px); }
.emx-story-card h3 { font-size:18px; }
.emx-meta { margin-top:10px; font-size:12px; color:#c9d0d8; }

.emx-grid { display:grid; grid-template-columns:minmax(0, 1fr) 330px; gap:28px; align-items:start; }
.emx-content-stack { display:flex; flex-direction:column; gap:26px; }
.emx-section { background:var(--emx-surface); border:1px solid var(--emx-border); border-radius:var(--emx-radius); box-shadow:0 2px 12px rgba(11,17,24,.03); overflow:hidden; }
.emx-section__head { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:58px; padding:0 20px; border-bottom:1px solid var(--emx-border); }
.emx-section__title { display:flex; align-items:center; gap:10px; margin:0; font-size:18px; text-transform:uppercase; letter-spacing:.25px; font-weight:900; }
.emx-section__title::before { content:""; display:block; width:5px; height:24px; border-radius:4px; background:var(--emx-accent); }
.emx-section__more { font-size:12px; color:var(--emx-muted); font-weight:800; text-transform:uppercase; letter-spacing:.5px; }
.emx-section__body { padding:20px; }

.emx-news-layout { display:grid; grid-template-columns:1.08fr .92fr; gap:20px; }
.emx-feature img { width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:7px; }
.emx-feature h3 { margin:12px 0 7px; font-size:25px; line-height:1.18; letter-spacing:-.35px; }
.emx-feature p { margin:0; color:var(--emx-muted); font-size:14px; }
.emx-list { display:flex; flex-direction:column; }
.emx-list-item { display:grid; grid-template-columns:115px 1fr; gap:13px; padding:0 0 14px; margin:0 0 14px; border-bottom:1px solid var(--emx-border); }
.emx-list-item:last-child { border-bottom:0; margin-bottom:0; padding-bottom:0; }
.emx-list-item img { width:115px; height:76px; object-fit:cover; border-radius:6px; }
.emx-list-item h4 { margin:0 0 6px; font-size:15px; line-height:1.28; }
.emx-list-item .emx-date { color:#8b949e; font-size:11px; }

.emx-two-cols { display:grid; grid-template-columns:1fr 1fr; gap:26px; }
.emx-mini-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:18px; }
.emx-mini-card img { width:100%; aspect-ratio:16/10; object-fit:cover; border-radius:6px; }
.emx-mini-card h4 { margin:9px 0 0; font-size:16px; line-height:1.25; }

.emx-sidebar { position:sticky; top:76px; display:flex; flex-direction:column; gap:22px; }
.widget { background:#fff; border:1px solid var(--emx-border); border-radius:var(--emx-radius); padding:18px; }
.widget-title { margin:-18px -18px 16px; padding:15px 18px; border-bottom:1px solid var(--emx-border); font-size:14px; font-weight:900; text-transform:uppercase; letter-spacing:.55px; }
.widget ul { margin:0; padding:0; list-style:none; }
.widget li { padding:9px 0; border-bottom:1px solid var(--emx-border); }
.widget li:last-child { border-bottom:0; }
.emx-ad-box { min-height:260px; display:flex; align-items:center; justify-content:center; background:#eef1f4; border:1px dashed #cbd2da; color:#929aa3; text-transform:uppercase; font-size:11px; letter-spacing:1px; text-align:center; }
.emx-sidebar-trending { counter-reset: trend; }
.emx-trending-item { display:grid; grid-template-columns:38px 1fr; gap:10px; padding:12px 0; border-bottom:1px solid var(--emx-border); }
.emx-trending-item:last-child { border-bottom:0; }
.emx-trending-item::before { counter-increment:trend; content:counter(trend, decimal-leading-zero); font-size:22px; line-height:1; font-weight:900; color:#c0c7cf; }
.emx-trending-item h4 { margin:0; font-size:14px; line-height:1.28; }

.emx-latest { display:flex; flex-direction:column; gap:18px; }
.emx-latest-item { display:grid; grid-template-columns:280px 1fr; gap:18px; padding-bottom:18px; border-bottom:1px solid var(--emx-border); }
.emx-latest-item:last-child { border-bottom:0; padding-bottom:0; }
.emx-latest-item img { width:280px; aspect-ratio:16/9; object-fit:cover; border-radius:7px; }
.emx-latest-item h3 { margin:4px 0 8px; font-size:22px; line-height:1.2; }
.emx-latest-item p { margin:0; color:var(--emx-muted); font-size:14px; }

.emx-article { background:#fff; border:1px solid var(--emx-border); border-radius:var(--emx-radius); padding:clamp(22px, 4vw, 48px); }
.emx-breadcrumbs { color:var(--emx-muted); font-size:12px; margin-bottom:18px; }
.emx-article__title { margin:0; font-size:clamp(34px, 5vw, 58px); line-height:1.03; letter-spacing:-1.4px; text-wrap:balance; }
.emx-article__meta { display:flex; gap:12px; flex-wrap:wrap; margin:18px 0 24px; color:var(--emx-muted); font-size:13px; }
.emx-article__image { width:100%; border-radius:8px; margin:0 0 30px; }
.emx-article__content { font-family:Georgia, "Times New Roman", serif; font-size:19px; line-height:1.75; }
.emx-article__content p { margin:0 0 1.35em; }
.emx-article__content h2 { font-family:Inter, ui-sans-serif, system-ui, sans-serif; font-size:30px; line-height:1.2; margin:1.8em 0 .7em; }
.emx-article__content blockquote { margin:1.6em 0; padding:10px 0 10px 24px; border-left:5px solid var(--emx-accent); font-size:24px; line-height:1.4; color:#313842; }

.emx-archive-head { background:#fff; border:1px solid var(--emx-border); border-radius:var(--emx-radius); padding:24px; margin-bottom:22px; }
.emx-archive-head h1 { margin:0; font-size:34px; }
.emx-pagination { margin-top:22px; display:flex; gap:8px; flex-wrap:wrap; }
.emx-pagination .page-numbers { background:#fff; border:1px solid var(--emx-border); padding:8px 12px; border-radius:5px; }
.emx-pagination .current { background:var(--emx-accent); color:white; border-color:var(--emx-accent); }

.emx-footer { margin-top:36px; background:var(--emx-ink); color:#b7c0ca; }
.emx-footer__grid { display:grid; grid-template-columns:1.35fr 1fr 1fr 1fr; gap:28px; padding:48px 0; }
.emx-footer h3 { color:#fff; font-size:14px; text-transform:uppercase; letter-spacing:.6px; }
.emx-footer p, .emx-footer li, .emx-footer a { font-size:13px; }
.emx-footer ul { list-style:none; padding:0; margin:0; }
.emx-footer li { margin:8px 0; }
.emx-footer__bottom { border-top:1px solid #222c37; padding:18px 0; font-size:12px; display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; }

.screen-reader-text { position:absolute !important; height:1px; width:1px; overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; }

@media (max-width: 1024px) {
  .emx-brandbar__inner { grid-template-columns:220px 1fr; }
  .emx-grid { grid-template-columns:minmax(0, 1fr) 290px; gap:20px; }
  .emx-hero { min-height:440px; }
  .emx-story-card h3 { font-size:16px; }
  .emx-news-layout { grid-template-columns:1fr; }
}

@media (max-width: 820px) {
  .emx-brandbar__inner { min-height:auto; padding:20px 0; grid-template-columns:1fr; }
  .emx-leaderboard { display:none; }
  .emx-menu-toggle { display:block; }
  .emx-nav__inner { justify-content:space-between; }
  .emx-nav .menu { display:none; position:absolute; top:52px; left:0; right:0; background:var(--emx-ink); flex-direction:column; align-items:stretch; padding:8px 16px 18px; }
  .emx-nav .menu.is-open { display:flex; }
  .emx-nav .menu > li > a { padding:12px 8px; }
  .emx-nav .sub-menu { position:static; display:block; box-shadow:none; padding:0 0 0 14px; }
  .emx-search-link { margin-left:auto; }
  .emx-hero { grid-template-columns:1fr; min-height:auto; }
  .emx-story-card--lead { min-height:420px; }
  .emx-hero__side { min-height:360px; }
  .emx-grid { grid-template-columns:1fr; }
  .emx-sidebar { position:static; }
  .emx-two-cols { grid-template-columns:1fr; }
  .emx-footer__grid { grid-template-columns:1fr 1fr; }
}

@media (max-width: 560px) {
  .emx-container { width:min(calc(100% - 22px), var(--emx-container)); }
  .emx-topbar__links { display:none; }
  .emx-topbar__inner { justify-content:center; }
  .emx-ticker__inner { grid-template-columns:auto 1fr; gap:10px; }
  .emx-hero__side { grid-template-columns:1fr; grid-template-rows:repeat(4, 210px); }
  .emx-story-card--lead { min-height:360px; }
  .emx-story-card--lead .emx-story-card__body { padding:22px; }
  .emx-story-card h2 { font-size:30px; }
  .emx-story-card h3 { font-size:18px; }
  .emx-mini-grid { grid-template-columns:1fr; }
  .emx-latest-item { grid-template-columns:1fr; }
  .emx-latest-item img { width:100%; }
  .emx-list-item { grid-template-columns:100px 1fr; }
  .emx-list-item img { width:100px; height:70px; }
  .emx-footer__grid { grid-template-columns:1fr; }
}

/* EcoMex Pulso 1.1: Estados + Política inmediatamente después del Hero */
.emx-section--wide { margin-bottom:28px; }
.emx-states-layout { display:grid; grid-template-columns:1.25fr 1fr; gap:24px; }
.emx-states-feature img { width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:8px; margin-bottom:12px; }
.emx-states-feature h3 { margin:6px 0 8px; font-size:28px; line-height:1.12; }
.emx-states-feature p { margin:0; color:var(--emx-muted); line-height:1.55; }
.emx-states-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.emx-state-card img { width:100%; aspect-ratio:16/10; object-fit:cover; border-radius:7px; margin-bottom:8px; }
.emx-state-card h4 { margin:0 0 6px; font-size:16px; line-height:1.25; }
.emx-politics-wrap { margin:0 0 30px; }
.emx-band-title { display:flex; align-items:baseline; gap:14px; padding:0 2px 12px; border-bottom:3px solid var(--emx-text); margin-bottom:16px; }
.emx-band-title span { font-size:24px; font-weight:950; text-transform:uppercase; letter-spacing:.2px; }
.emx-band-title small { color:var(--emx-muted); font-weight:700; }
.emx-politics-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.emx-politics-card .emx-section__head { min-height:52px; padding:0 16px; }
.emx-politics-card .emx-section__body { padding:16px; }
.emx-politics-lead img { width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:7px; margin-bottom:10px; }
.emx-politics-lead h3 { margin:0 0 12px; font-size:19px; line-height:1.2; }
.emx-politics-row { padding:11px 0; border-top:1px solid var(--emx-border); }
.emx-politics-row h4 { margin:0 0 4px; font-size:14px; line-height:1.3; }
.emx-two-cols--single { grid-template-columns:1fr; }

@media (max-width: 900px) {
  .emx-states-layout { grid-template-columns:1fr; }
  .emx-politics-grid { grid-template-columns:1fr; }
}
@media (max-width: 620px) {
  .emx-states-grid { grid-template-columns:1fr; }
  .emx-band-title { align-items:flex-start; flex-direction:column; gap:3px; }
  .emx-states-feature h3 { font-size:23px; }
}
