/*
Theme Name: Nación Digital
Author: Nación Digital
Description: Tema editorial ligero y compatible con Elementor Pro, diseñado para Nación Digital.
Version: 0.1.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nacion-digital
Tags: news, blog, custom-logo, custom-menu, featured-images, elementor
*/

:root {
  --nd-purple: #2e006b;
  --nd-purple-deep: #18002f;
  --nd-purple-soft: #6c3ab2;
  --nd-mint: #4effb1;
  --nd-ink: #17131d;
  --nd-muted: #6e6877;
  --nd-surface: #f7f5fa;
  --nd-white: #ffffff;
  --nd-border: #ded8e6;
  --nd-shadow: 0 18px 50px rgba(24, 0, 47, 0.12);
  --nd-radius: 18px;
  --nd-container: 1240px;
  --nd-font-display: "Editorial New", "Cormorant Garamond", Georgia, serif;
  --nd-font-sans: "Sora", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--nd-ink);
  background: var(--nd-white);
  font-family: var(--nd-font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--nd-purple); text-decoration: none; }
a:hover { color: var(--nd-purple-soft); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.nd-container { width: min(calc(100% - 40px), var(--nd-container)); margin-inline: auto; }
.nd-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;
}
.nd-screen-reader-text:focus {
  clip: auto; width: auto; height: auto; margin: 8px; padding: 12px 16px;
  z-index: 99999; background: var(--nd-white); color: var(--nd-purple);
}

/* Header */
.nd-topbar { background: var(--nd-purple-deep); color: rgba(255,255,255,.86); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.nd-topbar__inner { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nd-topbar p { margin: 0; }
.nd-topbar__date { color: var(--nd-mint); font-weight: 700; }
.nd-header { background: var(--nd-white); border-bottom: 1px solid var(--nd-border); position: relative; z-index: 50; }
.nd-header__brand-row { min-height: 112px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.nd-brand { display: inline-flex; align-items: center; justify-content: center; }
.nd-brand img { display: block; width: min(460px, 42vw); height: auto; }
.nd-brand__text { font-family: var(--nd-font-display); font-size: clamp(32px, 5vw, 66px); line-height: .9; color: var(--nd-purple); letter-spacing: -.035em; }
.nd-brand__text span { display: block; margin-top: 10px; color: var(--nd-mint); font: 700 11px/1 var(--nd-font-sans); letter-spacing: .42em; text-align: center; }
.nd-header__utility { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.nd-icon-button { width: 42px; height: 42px; border: 1px solid var(--nd-border); border-radius: 50%; background: transparent; color: var(--nd-purple); display: inline-grid; place-items: center; }
.nd-icon-button:hover { background: var(--nd-purple); color: var(--nd-white); border-color: var(--nd-purple); }
.nd-nav-wrap { border-top: 1px solid var(--nd-border); }
.nd-nav-row { min-height: 52px; display: flex; align-items: center; justify-content: center; }
.nd-menu { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px 28px; margin: 0; padding: 0; list-style: none; }
.nd-menu a { display: block; padding: 15px 0 13px; color: var(--nd-ink); font-size: 13px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; border-bottom: 3px solid transparent; }
.nd-menu a:hover, .nd-menu .current-menu-item > a, .nd-menu .current_page_item > a { color: var(--nd-purple); border-color: var(--nd-mint); }
.nd-mobile-toggle { display: none; }
.nd-search-panel { display: none; padding: 20px 0; border-top: 1px solid var(--nd-border); background: var(--nd-surface); }
.nd-search-panel.is-open { display: block; }
.nd-search-form { display: flex; gap: 10px; }
.nd-search-form input[type="search"] { flex: 1; min-width: 0; padding: 13px 16px; border: 1px solid var(--nd-border); border-radius: 999px; background: var(--nd-white); }
.nd-search-form button { padding: 13px 24px; border: 0; border-radius: 999px; background: var(--nd-purple); color: var(--nd-white); font-weight: 700; }

/* Editorial components */
.nd-main { min-height: 50vh; }
.nd-section { padding: clamp(48px, 7vw, 92px) 0; }
.nd-section--soft { background: var(--nd-surface); }
.nd-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 28px; padding-bottom: 12px; border-bottom: 1px solid var(--nd-border); }
.nd-section-heading h2, .nd-archive-header h1 { margin: 0; font-family: var(--nd-font-display); color: var(--nd-purple); font-size: clamp(34px, 4.5vw, 60px); line-height: .98; letter-spacing: -.025em; }
.nd-section-heading h2::before, .nd-archive-header h1::before { content: ""; display: inline-block; width: 30px; height: 12px; margin-right: 12px; background: var(--nd-mint); transform: skewX(-35deg); vertical-align: .18em; }
.nd-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--nd-purple); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.nd-kicker::before { content: ""; width: 17px; height: 7px; background: var(--nd-mint); transform: skewX(-35deg); }
.nd-card { min-width: 0; }
.nd-card__media { position: relative; display: block; overflow: hidden; border-radius: var(--nd-radius); background: var(--nd-purple-deep); aspect-ratio: 16/10; }
.nd-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.nd-card:hover .nd-card__media img { transform: scale(1.035); }
.nd-card__body { padding-top: 16px; }
.nd-card__title { margin: 0; font-family: var(--nd-font-display); font-size: clamp(25px, 2.2vw, 36px); line-height: 1.05; letter-spacing: -.02em; }
.nd-card__title a { color: var(--nd-ink); }
.nd-card__title a:hover { color: var(--nd-purple); }
.nd-card__excerpt { margin: 10px 0 0; color: var(--nd-muted); font-size: 14px; }
.nd-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; color: var(--nd-muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.nd-grid { display: grid; gap: 32px 24px; }
.nd-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nd-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.nd-hero { padding: 34px 0 68px; background: linear-gradient(180deg, var(--nd-white) 0%, var(--nd-surface) 100%); }
.nd-hero__grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 22px; }
.nd-hero__lead { position: relative; min-height: 610px; overflow: hidden; border-radius: 26px; background: var(--nd-purple-deep); box-shadow: var(--nd-shadow); }
.nd-hero__lead img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.nd-hero__lead::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(24,0,47,.04) 28%, rgba(24,0,47,.94) 100%); }
.nd-hero__content { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: clamp(28px, 5vw, 62px); color: var(--nd-white); }
.nd-hero__content .nd-kicker { color: var(--nd-mint); }
.nd-hero__title { max-width: 900px; margin: 0; font-family: var(--nd-font-display); font-size: clamp(44px, 6vw, 84px); line-height: .93; letter-spacing: -.04em; }
.nd-hero__title a { color: var(--nd-white); }
.nd-hero__excerpt { max-width: 740px; margin: 18px 0 0; color: rgba(255,255,255,.83); font-size: clamp(15px, 1.6vw, 19px); }
.nd-hero__side { display: grid; gap: 18px; }
.nd-hero__side .nd-card { padding-bottom: 18px; border-bottom: 1px solid var(--nd-border); }
.nd-hero__side .nd-card__media { border-radius: 14px; }
.nd-hero__side .nd-card__title { font-size: 28px; }

/* Archive */
.nd-archive-header { padding: 62px 0 28px; }
.nd-archive-description { max-width: 700px; color: var(--nd-muted); }
.nd-pagination { margin-top: 48px; }
.nd-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nd-pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center; border: 1px solid var(--nd-border); border-radius: 999px; }
.nd-pagination .current, .nd-pagination a:hover { background: var(--nd-purple); border-color: var(--nd-purple); color: var(--nd-white); }

/* Single */
.nd-single { padding: clamp(48px, 7vw, 90px) 0; }
.nd-article-header { max-width: 980px; margin: 0 auto 36px; text-align: center; }
.nd-article-title { margin: 0; font-family: var(--nd-font-display); color: var(--nd-purple-deep); font-size: clamp(48px, 7vw, 92px); line-height: .94; letter-spacing: -.042em; }
.nd-article-deck { max-width: 760px; margin: 22px auto 0; color: var(--nd-muted); font-size: clamp(17px, 2vw, 22px); }
.nd-article-header .nd-meta { justify-content: center; margin-top: 22px; }
.nd-featured-image { width: min(calc(100% - 40px), 1380px); margin: 0 auto 48px; overflow: hidden; border-radius: 24px; background: var(--nd-surface); }
.nd-featured-image img { width: 100%; max-height: 780px; object-fit: cover; display: block; }
.nd-article-layout { width: min(calc(100% - 40px), 1120px); margin-inline: auto; display: grid; grid-template-columns: minmax(0, 760px) 260px; justify-content: space-between; gap: 64px; }
.nd-entry-content { font-family: Georgia, serif; font-size: 19px; line-height: 1.82; }
.nd-entry-content > * { max-width: 100%; }
.nd-entry-content h2, .nd-entry-content h3 { font-family: var(--nd-font-display); color: var(--nd-purple); line-height: 1.05; }
.nd-entry-content h2 { margin-top: 2em; font-size: 46px; }
.nd-entry-content h3 { margin-top: 1.8em; font-size: 34px; }
.nd-entry-content a { text-decoration: underline; text-decoration-color: var(--nd-mint); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.nd-entry-content blockquote { margin: 2em 0; padding: 28px 34px; border-left: 7px solid var(--nd-mint); background: var(--nd-surface); color: var(--nd-purple-deep); font-family: var(--nd-font-display); font-size: 31px; line-height: 1.16; }
.nd-article-aside { align-self: start; position: sticky; top: 28px; }
.nd-share-box, .nd-author-box { padding: 24px; border: 1px solid var(--nd-border); border-radius: var(--nd-radius); background: var(--nd-white); }
.nd-share-box h3 { margin-top: 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.nd-share-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nd-share-links a { min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--nd-purple); color: var(--nd-white); font-size: 12px; font-weight: 700; }
.nd-author-box { display: grid; grid-template-columns: 72px 1fr; gap: 18px; margin-top: 42px; }
.nd-author-box img { border-radius: 50%; }
.nd-author-box h3 { margin: 0; font-family: var(--nd-font-display); color: var(--nd-purple); font-size: 28px; }
.nd-author-box p { margin: 6px 0 0; color: var(--nd-muted); font-size: 14px; }
.nd-tags { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 8px; }
.nd-tags a { padding: 6px 12px; border-radius: 999px; background: var(--nd-surface); font: 700 11px/1.2 var(--nd-font-sans); letter-spacing: .06em; text-transform: uppercase; }

/* Footer */
.nd-footer { margin-top: 70px; background: var(--nd-purple-deep); color: rgba(255,255,255,.78); position: relative; overflow: hidden; }
.nd-footer::before { content: ""; position: absolute; width: 480px; height: 480px; right: -190px; top: -230px; border: 70px solid rgba(78,255,177,.09); border-radius: 50%; }
.nd-footer__grid { position: relative; z-index: 1; padding: 72px 0 48px; display: grid; grid-template-columns: 1.25fr .8fr .8fr; gap: 50px; }
.nd-footer__logo img { width: min(400px, 100%); filter: brightness(0) invert(1); }
.nd-footer h3 { margin-top: 0; color: var(--nd-mint); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.nd-footer-menu { list-style: none; margin: 0; padding: 0; }
.nd-footer-menu li + li { margin-top: 8px; }
.nd-footer a { color: var(--nd-white); }
.nd-footer a:hover { color: var(--nd-mint); }
.nd-footer__bottom { position: relative; z-index: 1; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.13); display: flex; justify-content: space-between; gap: 20px; color: rgba(255,255,255,.55); font-size: 12px; }

/* Elementor canvas helpers */
.page-template-elementor-canvas .nd-header,
.page-template-elementor-canvas .nd-footer { display: none; }
.nd-elementor-full-width .nd-main { overflow: hidden; }

/* 404 */
.nd-404 { padding: 100px 0; text-align: center; }
.nd-404__code { font-family: var(--nd-font-display); color: var(--nd-purple); font-size: clamp(110px, 20vw, 260px); line-height: .7; opacity: .12; }
.nd-button { display: inline-flex; align-items: center; justify-content: center; padding: 13px 22px; border-radius: 999px; background: var(--nd-purple); color: var(--nd-white); font-weight: 700; }
.nd-button:hover { background: var(--nd-purple-soft); color: var(--nd-white); }

@media (max-width: 1024px) {
  .nd-grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .nd-hero__grid { grid-template-columns: 1fr; }
  .nd-hero__lead { min-height: 540px; }
  .nd-hero__side { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .nd-article-layout { grid-template-columns: 1fr; }
  .nd-article-aside { position: static; }
  .nd-share-box { max-width: 760px; }
}
@media (max-width: 780px) {
  .nd-container { width: min(calc(100% - 28px), var(--nd-container)); }
  .nd-topbar__inner { min-height: 32px; }
  .nd-topbar__date { display: none; }
  .nd-header__brand-row { min-height: 78px; grid-template-columns: auto 1fr auto; }
  .nd-header__brand-row > :first-child { display: none; }
  .nd-brand { justify-content: flex-start; }
  .nd-brand img { width: min(260px, 58vw); }
  .nd-mobile-toggle { display: inline-grid; }
  .nd-nav-wrap { display: none; }
  .nd-nav-wrap.is-open { display: block; }
  .nd-nav-row { padding: 10px 0 18px; }
  .nd-menu { width: 100%; display: block; }
  .nd-menu a { padding: 12px 4px; border-bottom: 1px solid var(--nd-border); }
  .nd-grid--3, .nd-grid--4 { grid-template-columns: 1fr; }
  .nd-hero { padding-top: 16px; }
  .nd-hero__lead { min-height: 500px; border-radius: 18px; }
  .nd-hero__side { grid-template-columns: 1fr; }
  .nd-hero__side .nd-card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
  .nd-hero__side .nd-card__body { padding-top: 0; }
  .nd-hero__side .nd-card__title { font-size: 23px; }
  .nd-article-title { font-size: clamp(45px, 14vw, 70px); }
  .nd-entry-content { font-size: 18px; }
  .nd-footer__grid { grid-template-columns: 1fr; gap: 30px; }
  .nd-footer__bottom { display: block; }
}
