/*
Theme Name: NMAD Precision
Theme URI: https://www.noticiasmexicoaldia.com/
Author: Noticias México al Día
Description: Tema editorial adaptable inspirado en la dirección visual de Stitch Precision Studio.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nmad-precision
*/

:root {
  --nmad-red: #b91c1c;
  --nmad-red-dark: #991b1b;
  --nmad-green: #15803d;
  --nmad-ink: #18181b;
  --nmad-ink-soft: #3f3f46;
  --nmad-paper: #fbfbf9;
  --nmad-white: #fff;
  --nmad-muted: #71717a;
  --nmad-line: #e4e4e7;
  --nmad-panel: #f4f4f2;
  --nmad-width: 1220px;
  --nmad-radius: 12px;
  --nmad-shadow: 0 10px 28px rgba(24, 24, 27, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--nmad-ink);
  background: var(--nmad-paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--nmad-red); }
button, input, textarea, select { font: inherit; }
.nmad-wrap { width: min(calc(100% - 36px), var(--nmad-width)); margin-inline: auto; }
.nmad-skip-link { position: absolute; z-index: 99; left: 12px; top: -80px; padding: 10px 14px; color: #fff; background: var(--nmad-ink); }
.nmad-skip-link:focus { top: 12px; }

.nmad-topline { color: #e4e4e7; background: var(--nmad-ink); font-size: 12px; }
.nmad-topline-inner { min-height: 34px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.nmad-date { color: #d4d4d8; text-transform: capitalize; }
.nmad-topnav { display: flex; gap: 18px; overflow: auto; white-space: nowrap; }
.nmad-topnav a { color: #f4f4f5; text-decoration: none; }
.nmad-topnav a:hover { color: #fca5a5; }

.nmad-header { background: var(--nmad-white); border-bottom: 1px solid var(--nmad-line); }
.nmad-brand-row { width: min(calc(100% - 36px), 1480px); min-height: 102px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 16px; }
.nmad-brand { display: flex; align-items: center; gap: 15px; min-width: 0; text-decoration: none; }
.nmad-brand .custom-logo-link { display: flex; flex: none; }
.nmad-brand-copy { min-width: 0; text-decoration: none; }
.nmad-brand img { width: auto; max-width: 260px; max-height: 70px; object-fit: contain; }
.nmad-brand-copy { min-width: 0; }
.nmad-brand-name { margin: 0; font-size: clamp(25px, 3vw, 38px); font-weight: 850; line-height: 1.05; letter-spacing: -.055em; }
.nmad-brand-tagline { margin: 6px 0 0; color: var(--nmad-muted); font-size: 13px; line-height: 1.35; }
.nmad-masthead-message { display: flex; flex: 0 0 920px; width: 920px; max-width: 100%; min-width: 0; flex-direction: column; gap: 4px; }
.nmad-masthead-message-label { color: var(--nmad-muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; line-height: 1; text-transform: uppercase; }
.nmad-masthead-message img { display: block; width: 100%; height: 80px; max-height: none; object-fit: fill; object-position: left center; }
.nmad-search-form { display: flex; align-items: center; gap: 6px; }
.nmad-search-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.nmad-search-form input[type="search"] { width: 210px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--nmad-line); border-radius: 8px; background: var(--nmad-paper); }
.nmad-search-form button, .nmad-button, .wp-block-search__button {
  min-height: 42px; padding: 9px 15px; border: 0; border-radius: 8px; color: #fff; background: var(--nmad-red); font-weight: 750; cursor: pointer;
}
.nmad-search-form button:hover, .nmad-button:hover, .wp-block-search__button:hover { color: #fff; background: var(--nmad-red-dark); }

.nmad-nav-wrap { border-top: 1px solid var(--nmad-line); }
.nmad-nav { min-height: 48px; display: flex; align-items: center; gap: 23px; overflow-x: auto; white-space: nowrap; }
.nmad-nav ul, .nmad-topnav ul, .nmad-footer-menu ul { display: flex; align-items: center; gap: 23px; padding: 0; margin: 0; list-style: none; }
.nmad-nav a { color: var(--nmad-ink); font-size: 13px; font-weight: 750; text-decoration: none; }
.nmad-nav a:hover, .nmad-nav .current-menu-item > a { color: var(--nmad-red); }
.nmad-nav .menu-item-has-children { position: relative; }
.nmad-nav .sub-menu { display: none; position: absolute; z-index: 20; top: 100%; left: 0; min-width: 190px; padding: 12px; background: #fff; border: 1px solid var(--nmad-line); box-shadow: var(--nmad-shadow); }
.nmad-nav .menu-item-has-children:hover > .sub-menu, .nmad-nav .menu-item-has-children:focus-within > .sub-menu { display: block; }
.nmad-nav .sub-menu li { padding: 5px 0; }
.nmad-banner-area, .nmad-ad-slot { margin: 18px auto; text-align: center; }
.nmad-ad-slot:empty, .nmad-banner-area:empty { display: none; }
.nmad-ad-label { display: block; margin-bottom: 6px; color: var(--nmad-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }

.nmad-section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 11px; margin: 0 0 18px; border-bottom: 2px solid var(--nmad-ink); }
.nmad-section-head h1, .nmad-section-head h2 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.035em; }
.nmad-section-head a { color: var(--nmad-muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.nmad-home { padding-block: 28px 58px; }
.nmad-lead-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .85fr); gap: 25px; }
.nmad-lead-main { min-width: 0; }
.nmad-lead-side { display: grid; gap: 18px; align-content: start; }
.nmad-card { min-width: 0; overflow: hidden; background: var(--nmad-white); border: 1px solid var(--nmad-line); border-radius: var(--nmad-radius); }
.nmad-card-image { display: block; overflow: hidden; background: var(--nmad-panel); aspect-ratio: 16 / 9; }
.nmad-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.nmad-card:hover .nmad-card-image img { transform: scale(1.025); }
.nmad-placeholder { width: 100%; height: 100%; min-height: 150px; display: grid; place-items: center; color: #a1a1aa; background: linear-gradient(135deg, #f4f4f2, #e4e4e7); font-size: 12px; }
.nmad-card-body { padding: 16px 18px 18px; }
.nmad-card-cats { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.nmad-card-cats a { color: var(--nmad-red); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; text-decoration: none; }
.nmad-card-title { margin: 0; font-size: clamp(18px, 2vw, 24px); font-weight: 800; line-height: 1.25; letter-spacing: -.035em; }
.nmad-card-title a { text-decoration: none; }
.nmad-card-excerpt { margin: 9px 0 0; color: var(--nmad-ink-soft); font-size: 14px; line-height: 1.55; }
.nmad-card-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; color: var(--nmad-muted); font-size: 11px; }
.nmad-card--lead .nmad-card-image { aspect-ratio: 16 / 9; }
.nmad-card--lead .nmad-card-body { padding: 21px 23px 22px; }
.nmad-card--lead .nmad-card-title { font-size: clamp(25px, 3.2vw, 39px); line-height: 1.13; }
.nmad-card--compact { display: grid; grid-template-columns: 130px 1fr; }
.nmad-card--compact .nmad-card-image { aspect-ratio: 1 / 1; }
.nmad-card--compact .nmad-card-body { padding: 12px 14px; }
.nmad-card--compact .nmad-card-title { font-size: 17px; }
.nmad-card--compact .nmad-card-excerpt { display: none; }
.nmad-card--compact .nmad-card-meta { margin-top: 8px; }
.nmad-latest { margin-top: 34px; }
.nmad-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.nmad-post-grid .nmad-card-image { aspect-ratio: 16 / 10; }
.nmad-latest-more { display: flex; justify-content: center; margin-top: 24px; }

.nmad-content { padding-block: 30px 60px; }
.nmad-content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.nmad-archive-heading { margin-bottom: 25px; }
.nmad-archive-heading h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.055em; }
.nmad-archive-heading p { margin: 8px 0 0; color: var(--nmad-muted); }
.nmad-list-grid { display: grid; gap: 18px; }
.nmad-pagination { margin-top: 28px; }
.nmad-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 7px; }
.nmad-pagination a, .nmad-pagination span { display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; padding: 7px 12px; border: 1px solid var(--nmad-line); border-radius: 8px; text-decoration: none; }
.nmad-pagination .current { color: #fff; background: var(--nmad-ink); border-color: var(--nmad-ink); }
.nmad-sidebar { display: grid; gap: 18px; }
.nmad-widget { padding: 17px; background: #fff; border: 1px solid var(--nmad-line); border-radius: var(--nmad-radius); }
.nmad-widget-title { margin: 0 0 11px; font-size: 16px; }
.nmad-widget ul { padding-left: 18px; margin: 0; }
.nmad-widget li + li { margin-top: 8px; }

.nmad-article { max-width: 850px; margin-inline: auto; }
.nmad-article-header { margin-bottom: 21px; }
.nmad-article-title { margin: 5px 0 12px; font-size: clamp(34px, 5.3vw, 56px); line-height: 1.08; letter-spacing: -.06em; }
.nmad-article-deck { margin: 0; color: var(--nmad-ink-soft); font-size: 19px; line-height: 1.5; }
.nmad-article-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 15px; color: var(--nmad-muted); font-size: 12px; }
.nmad-article-figure { margin: 0 0 25px; }
.nmad-article-figure img { width: 100%; max-height: 620px; object-fit: cover; border-radius: var(--nmad-radius); }
.nmad-article-figure figcaption { padding-top: 7px; color: var(--nmad-muted); font-size: 12px; }
.nmad-article-body { color: #27272a; font-size: 18px; line-height: 1.8; }
.nmad-article-body > * { max-width: 760px; margin-inline: auto; }
.nmad-article-body > .alignwide { max-width: 1000px; }
.nmad-article-body > .alignfull { max-width: none; }
.nmad-article-body p { margin-block: 0 1.35em; }
.nmad-article-body h2, .nmad-article-body h3, .nmad-article-body h4 { margin-block: 1.5em .55em; color: var(--nmad-ink); line-height: 1.2; letter-spacing: -.035em; }
.nmad-article-body blockquote { padding: 4px 0 4px 20px; border-left: 4px solid var(--nmad-red); font-size: 21px; }
.nmad-article-body a { color: var(--nmad-red-dark); }
.nmad-article-tags { margin-top: 24px; color: var(--nmad-muted); font-size: 13px; }
.nmad-article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 22px; margin-top: 28px; border-top: 1px solid var(--nmad-line); }
.nmad-article-nav a { padding: 14px; background: #fff; border: 1px solid var(--nmad-line); border-radius: 10px; text-decoration: none; }
.nmad-article-nav small { display: block; color: var(--nmad-muted); }
.nmad-related { margin-top: 42px; }
.nmad-comments { margin-top: 35px; padding-top: 24px; border-top: 1px solid var(--nmad-line); }

.nmad-404 { max-width: 800px; margin-inline: auto; text-align: center; }
.nmad-404-code { margin: 0; color: var(--nmad-red); font-size: clamp(76px, 14vw, 140px); font-weight: 900; line-height: .9; letter-spacing: -.08em; }
.nmad-404 h1 { margin: 17px 0 8px; font-size: clamp(27px, 4vw, 40px); line-height: 1.15; letter-spacing: -.05em; }
.nmad-404 > p { max-width: 560px; margin: 0 auto 20px; color: var(--nmad-muted); }
.nmad-404 .nmad-search-form { justify-content: center; margin: 0 auto 38px; }
.nmad-404 .nmad-search-form input[type="search"] { width: min(460px, 62vw); background: #fff; }
.nmad-404-articles { text-align: left; }

.nmad-footer { padding: 35px 0 22px; color: #d4d4d8; background: var(--nmad-ink); }
.nmad-footer-main { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.nmad-footer .nmad-brand-name { color: #fff; font-size: 24px; }
.nmad-footer p { color: #a1a1aa; }
.nmad-footer-menu ul { flex-wrap: wrap; gap: 10px 18px; }
.nmad-footer-menu a { color: #e4e4e7; font-size: 13px; text-decoration: none; }
.nmad-footer-bottom { padding-top: 16px; margin-top: 22px; border-top: 1px solid #3f3f46; color: #a1a1aa; font-size: 12px; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption, .wp-caption-text, .gallery-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption { color: var(--nmad-muted); font-size: 12px; }
.wp-block-image img, .wp-block-embed iframe { border-radius: 8px; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }

@media (max-width: 850px) {
  .nmad-lead-grid { grid-template-columns: 1fr; }
  .nmad-lead-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nmad-card--compact { display: block; }
  .nmad-card--compact .nmad-card-image { aspect-ratio: 16 / 10; }
  .nmad-card--compact .nmad-card-excerpt { display: block; }
  .nmad-content-layout { grid-template-columns: 1fr; }
  .nmad-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1400px) {
  .nmad-brand-row { flex-wrap: wrap; }
  .nmad-brand { flex: 1 1 100%; }
  .nmad-masthead-message { flex: 0 0 auto; width: min(920px, 100%); margin-inline: auto; }
}
@media (max-width: 960px) {
  .nmad-masthead-message img { height: auto; aspect-ratio: 920 / 80; }
}
@media (max-width: 600px) {
  .nmad-wrap { width: min(calc(100% - 24px), var(--nmad-width)); }
  .nmad-topline-inner { min-height: 32px; }
  .nmad-topnav { gap: 12px; }
  .nmad-brand-row { min-height: auto; align-items: flex-start; flex-wrap: wrap; padding-block: 15px; }
  .nmad-brand { flex: 1 1 100%; }
  .nmad-brand img { max-width: 150px; max-height: 52px; }
  .nmad-brand-name { font-size: 25px; }
  .nmad-brand-tagline { font-size: 11px; }
  .nmad-nav { min-height: 44px; }
  .nmad-nav ul { gap: 18px; }
  .nmad-home { padding-top: 20px; }
  .nmad-lead-side, .nmad-post-grid, .nmad-sidebar { grid-template-columns: 1fr; }
  .nmad-card--compact { display: grid; grid-template-columns: 112px 1fr; }
  .nmad-card--compact .nmad-card-image { aspect-ratio: 1 / 1; }
  .nmad-card--compact .nmad-card-excerpt { display: none; }
  .nmad-card--lead .nmad-card-body { padding: 16px; }
  .nmad-content { padding-top: 22px; }
  .nmad-article-body { font-size: 17px; }
  .nmad-article-nav { grid-template-columns: 1fr; }
  .nmad-footer-main { grid-template-columns: 1fr; gap: 10px; }
  .nmad-404 .nmad-search-form input[type="search"] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Cabecera editorial de inspiración periodística */
.nmad-brand-copy { display: flex; flex-direction: column; gap: 4px; }
.nmad-brand-name { font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 3.1vw, 36px); font-weight: 700; letter-spacing: -.04em; }
.nmad-brand-tagline { margin: 0; color: #626262; font-family: Georgia, "Times New Roman", serif; font-size: 12px; letter-spacing: .035em; }
@media (max-width: 600px) { .nmad-brand-name { font-size: 25px; } .nmad-brand-tagline { font-size: 11px; } }

.nmad-date { text-transform: none; }

/* Titulares y lectura con tono de diario */
.nmad-section-head h1, .nmad-section-head h2, .nmad-card-title, .nmad-article-title, .nmad-archive-heading h1, .nmad-404 h1, .nmad-article-body h2, .nmad-article-body h3, .nmad-article-body h4 { font-family: Georgia, "Times New Roman", serif; }
.nmad-section-head { border-bottom: 1px solid #a32824; padding-bottom: 13px; }
.nmad-section-head h1, .nmad-section-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.nmad-card { border: 1px solid #e7e2d9; border-radius: 4px; box-shadow: none; }
.nmad-card-title { font-size: clamp(20px, 2.1vw, 27px); font-weight: 700; line-height: 1.18; letter-spacing: -.02em; }
.nmad-card--lead .nmad-card-title { font-size: clamp(30px, 3.5vw, 44px); line-height: 1.1; }
.nmad-card--compact .nmad-card-title { font-size: 19px; }
.nmad-card-excerpt { color: #48443f; }
.nmad-article-title { font-size: clamp(36px, 5.4vw, 60px); font-weight: 700; letter-spacing: -.035em; }
.nmad-article-deck { font-family: Georgia, "Times New Roman", serif; font-size: 21px; }
.nmad-article-body { color: #292723; font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.82; }
.nmad-article-body h2, .nmad-article-body h3, .nmad-article-body h4 { letter-spacing: -.02em; }
.nmad-article-figure img { border-radius: 4px; }
@media (max-width: 600px) { .nmad-card-title { font-size: 21px; } .nmad-card--lead .nmad-card-title { font-size: 29px; } .nmad-article-title { font-size: 37px; } .nmad-article-body { font-size: 18px; } }

/* Portada por temas: agenda pública primero, vida y ocio al cierre. */
.nmad-home-section { scroll-margin-top: 24px; }
.nmad-home-section + .nmad-home-section { margin-top: 48px; }
.nmad-home-topics .nmad-home-opening > .nmad-section-head { margin-bottom: 0; border-bottom: 2px solid var(--nmad-ink); }
.nmad-home-topics .nmad-home-opening h1 { font-size: clamp(28px, 3.4vw, 38px); }
.nmad-home-jump { display: flex; flex-wrap: wrap; gap: 8px 0; margin: 0 0 24px; padding: 12px 0; border-bottom: 1px solid var(--nmad-line); }
.nmad-home-jump a { padding: 0 18px; border-left: 1px solid #cfc8bc; color: var(--nmad-ink-soft); font-size: 12px; font-weight: 750; line-height: 1.4; text-decoration: none; }
.nmad-home-jump a:first-child { padding-left: 0; border-left: 0; }
.nmad-home-jump a:hover { color: var(--nmad-red); }
.nmad-topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 32px; }
.nmad-topic-block { min-width: 0; }
.nmad-topic-title { margin: 0 0 8px; color: var(--nmad-ink); font-family: Georgia, "Times New Roman", serif; font-size: 25px; line-height: 1.15; letter-spacing: -.025em; }
.nmad-topic-links { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-bottom: 16px; }
.nmad-topic-links a { color: #7b332d; font-size: 11px; font-weight: 750; line-height: 1.55; text-decoration: none; }
.nmad-topic-links a:hover { text-decoration: underline; }
.nmad-topic-list { display: grid; border-top: 1px solid var(--nmad-line); }
.nmad-topic-list .nmad-card--compact { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 16px 0; border: 0; border-bottom: 1px solid var(--nmad-line); border-radius: 0; background: transparent; }
.nmad-topic-list .nmad-card--compact .nmad-card-image { height: 100%; min-height: 112px; aspect-ratio: auto; border-radius: 2px; }
.nmad-topic-list .nmad-card--compact .nmad-card-image img { min-height: 112px; }
.nmad-topic-list .nmad-card--compact .nmad-card-body { align-self: center; padding: 0; }
.nmad-topic-list .nmad-card--compact .nmad-card-title { font-size: 20px; line-height: 1.2; }
.nmad-topic-list .nmad-card-cats { gap: 3px 8px; margin-bottom: 5px; }
.nmad-topic-list .nmad-card-cats a { font-size: 9px; }
.nmad-topic-list .nmad-card-meta { margin-top: 8px; }
.nmad-section-topics { margin-top: -6px; margin-bottom: 20px; }
.nmad-home-leisure { padding: 26px; border-top: 2px solid var(--nmad-ink); background: #f3f0ea; }
.nmad-home-leisure > .nmad-section-head { border-bottom-color: #b8afa0; }
@media (max-width: 850px) {
  .nmad-topic-grid { gap: 30px 24px; }
  .nmad-topic-list .nmad-card--compact { grid-template-columns: 90px minmax(0, 1fr); gap: 12px; }
  .nmad-topic-list .nmad-card--compact .nmad-card-image, .nmad-topic-list .nmad-card--compact .nmad-card-image img { min-height: 100px; }
  .nmad-topic-list .nmad-card--compact .nmad-card-title { font-size: 18px; }
  .nmad-home-leisure { padding: 22px 18px; }
}
@media (max-width: 650px) {
  .nmad-home-section + .nmad-home-section { margin-top: 36px; }
  .nmad-topic-grid { grid-template-columns: 1fr; gap: 30px; }
  .nmad-topic-title { font-size: 24px; }
  .nmad-home-jump { gap: 10px 16px; }
  .nmad-home-jump a { padding: 0; border: 0; font-size: 11px; }
  .nmad-topic-list .nmad-card--compact { grid-template-columns: 100px minmax(0, 1fr); }
  .nmad-topic-list .nmad-card--compact .nmad-card-title { font-size: 19px; }
  .nmad-home-leisure { padding: 20px 14px; }
}
