/* Public MAG colour modes. The private article composer keeps its own palette. */
body:not(.smag-compose-page):not(.page-template-page-redactar) {
  --smag-surface: #fff;
  --smag-surface-raised: #f4f2eb;
  --smag-muted: #48616b;
  --smag-accent-text: #9c3929;
  --smag-brand-ink: #102e3a;
  --smag-brand-paper: #fcfbf7;
  color-scheme: light;
}

html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) {
  --smag-ink: #edf3f1;
  --smag-paper: #101b20;
  --smag-cream: #19282e;
  --smag-line: rgba(224, 237, 235, .23);
  --smag-surface: #17262c;
  --smag-surface-raised: #233740;
  --smag-muted: #b4c3c8;
  --smag-accent-text: #ff9b85;
  background: var(--smag-paper);
  color: var(--smag-ink);
  color-scheme: dark;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) ::selection {
  background: var(--smag-lime);
  color: var(--smag-brand-ink);
}

/* The original dark masthead, footer and image overlays work in both modes. */
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-site-header, .smag-site-footer) {
  background: var(--smag-brand-ink);
  color: var(--smag-brand-paper);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-search input, .smag-search button, .smag-menu-toggle) {
  color: var(--smag-brand-paper);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-stories-band, .smag-category-hero, .smag-section-tile-football) {
  background: var(--smag-brand-ink);
  color: var(--smag-brand-paper);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-story-trigger, .smag-stories-dialog, .smag-story-screen) {
  color: var(--smag-brand-paper);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-story-read, .smag-story-initial, .smag-image-fallback, .smag-section-empty-art) {
  color: var(--smag-brand-ink);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-story-read {
  background: #f4f2eb;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-hero-visual .smag-image-fallback {
  background: var(--smag-brand-ink);
  color: var(--smag-brand-paper);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-section-cover, .smag-section-tile-football .smag-section-empty) {
  color: var(--smag-brand-paper);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-skip-link, .smag-lead-read:hover, .smag-football-enter:hover) {
  color: var(--smag-brand-ink);
}

/* Small, named icon buttons have the same touch target throughout the masthead. */
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-icon-button {
  display: inline-flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  line-height: 1;
  text-decoration: none;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-icon-button svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-icon-button:hover {
  border-color: rgba(252, 251, 247, .35);
  background: rgba(252, 251, 247, .08);
  color: var(--smag-lime);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-icon-button:focus-visible {
  outline: 2px solid var(--smag-lime);
  outline-offset: 3px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-masthead-tools, .smag-header-socials, .smag-header-tools, .smag-footer-socials) {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-masthead-tools {
  margin-left: auto;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-header-tools {
  gap: 10px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-footer-socials {
  gap: 2px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-footer-about {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 11px;
  text-underline-offset: 4px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-footer-about:hover {
  text-decoration: underline;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) [data-theme-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html:not([data-smag-theme="dark"]) body:not(.smag-compose-page):not(.page-template-page-redactar) [data-theme-icon="sun"],
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) [data-theme-icon="moon"] {
  display: none;
}

/* Public text and neutral surfaces, including archive and search results. */
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(
  .smag-edition-signature, .smag-opening-label, .smag-lead-body > p,
  .smag-card p, .smag-card time, .smag-card .smag-card-byline,
  .smag-lead-body > p.smag-card-byline, .smag-card-byline,
  .smag-section-note, .smag-category-number, .smag-directory-intro,
  .smag-section-branch > p, .smag-section-tile-heading,
  .smag-section-latest-label, .smag-section-topics a,
  .smag-section-empty, .smag-topic-navigation > p span,
  .smag-photo-caption, .smag-story-content figcaption, .wp-caption-text
) {
  color: var(--smag-muted);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(
  .smag-card-genre, .smag-article-genre, .smag-lead .smag-category,
  .smag-category-links > a:last-child, .smag-section-branch-opinion h3,
  .smag-category-links > a:hover, .smag-section-branch h3 > a:hover,
  .smag-section-topics a:hover
) {
  color: var(--smag-accent-text);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-lead-media, .smag-card-image, .smag-hero-visual) {
  background: var(--smag-surface-raised);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-section-tile:not(.smag-section-tile-football) {
  background: transparent;
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-ticker {
  background: var(--smag-surface);
  color: var(--smag-ink);
  border-color: var(--smag-line);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-ticker-label {
  color: var(--smag-accent-text);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-opinion, .smag-opinion-archive-heading) {
  background: #1c2b24;
  color: var(--smag-ink);
  border-color: #51633d;
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-opinion-columns, .smag-opinion-column + .smag-opinion-column) {
  border-color: #51633d;
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-opinion {
  border-top-color: #9caf56;
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-empty-cover {
  color: var(--smag-brand-ink);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.page-numbers.current, .wp-block-button__link, .smag-lead-read, .smag-topic-navigation a[aria-current="page"]) {
  background: var(--smag-surface-raised);
  color: var(--smag-ink);
  border-color: var(--smag-muted);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-lead-read:hover {
  background: var(--smag-coral);
  color: var(--smag-brand-ink);
}

/* Five article formats share a readable dark body and keep their accents. */
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-single {
  --article-ink: var(--smag-ink);
  --article-paper: var(--smag-paper);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-article-hero {
  background: var(--smag-paper);
  color: var(--smag-ink);
  border-bottom-color: var(--smag-line);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-hero-cinema {
  background: var(--smag-brand-ink);
  color: var(--smag-brand-paper);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-hero-cover .smag-article-series, .smag-hero-cinema .smag-hero-kicker .smag-category) {
  color: var(--smag-brand-ink);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-hero-opinion {
  border-bottom-color: var(--smag-coral);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(
  .smag-story-action, .smag-story-toc, .smag-story-footer,
  .smag-column-signoff, .smag-column-masthead,
  .smag-format-cinema .smag-story-content h2,
  .smag-story-content .smag-qa, .smag-story-content .smag-key-points,
  .smag-story-content .smag-reportage-body .wp-block-pullquote,
  .smag-story-content td, .smag-story-content th
) {
  border-color: var(--smag-line);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-story-content .smag-key-points {
  border-top-color: var(--smag-coral);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-story-content .smag-review-facts {
  background: #0b2530;
  color: var(--smag-brand-paper);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-story-content pre, .smag-story-content .wp-block-code, .entry-content .wp-block-code) {
  background: var(--smag-surface);
  color: var(--smag-ink);
  border-color: var(--smag-line);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.entry-content, .smag-story-content) .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background: var(--smag-surface);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.entry-content, .smag-story-content) .has-white-background-color {
  background-color: var(--smag-surface) !important;
  color: var(--smag-ink);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.entry-content, .smag-story-content) :where(.has-black-color, .has-foreground-color) {
  color: var(--smag-ink) !important;
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.comment-form input:not([type="checkbox"]), .comment-form textarea) {
  background: var(--smag-surface);
  color: var(--smag-ink);
  border-color: var(--smag-line);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .comment-form .submit {
  background: var(--smag-surface-raised) !important;
  color: var(--smag-ink) !important;
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-access-panel {
  background: var(--smag-surface);
  color: var(--smag-ink);
  border-color: var(--smag-line);
  box-shadow: 8px 8px 0 var(--smag-surface-raised);
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-access-eyebrow, .smag-access-private) {
  color: var(--smag-muted);
  border-color: var(--smag-line);
}

/* The compact forecast and its controls stay white with dark ink in both modes. */
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-weather-mini, .smag-weather-panel) {
  background: #fff;
  color: #102e3a;
  border-color: #dce1df;
  color-scheme: light;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-weather-description, .smag-weather-credit, .smag-weather-controls button, .smag-weather-options summary) {
  color: #102e3a;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-weather-controls button {
  background: #fff;
  border-color: #dce1df;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-weather-controls button:hover, .smag-weather-options summary:hover) {
  background: #f2f5f4;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-weather-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: none;
  color: #102e3a;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-weather-icon svg {
  width: 18px;
  height: 18px;
}
html[data-smag-theme="dark"] body:not(.smag-compose-page):not(.page-template-page-redactar) :where(.smag-weather-time, .smag-weather-nojs) {
  color: var(--smag-muted);
}

/* About Sonariva uses editorial type, a simple grid and the original brand mark. */
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about {
  padding-block: clamp(32px, 5vw, 64px) clamp(42px, 6vw, 80px);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-intro {
  max-width: 840px;
  margin-bottom: 36px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-intro h1 {
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.12;
  margin-bottom: 20px;
  text-wrap: balance;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-intro > p:not(.smag-kicker) {
  max-width: 720px;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.75;
  color: var(--smag-muted);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-block: 32px 40px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-card {
  min-width: 0;
  padding: 25px;
  background: var(--smag-surface);
  border: 1px solid var(--smag-line);
  border-top: 3px solid var(--smag-coral);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-card h2 {
  font-size: 25px;
  margin-bottom: 15px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-card p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--smag-muted);
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-card p:last-child {
  margin-bottom: 0;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-values {
  max-width: 880px;
  padding-top: 24px;
  border-top: 1px solid var(--smag-line);
  line-height: 1.8;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-values h2 {
  font-size: 28px;
  margin-bottom: 18px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-values li {
  margin-bottom: 10px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 28px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 5px;
}
body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-mark {
  display: block;
  max-width: 120px;
  margin-bottom: 22px;
}

/* Search and staff access remain visible when only the mobile menu is collapsed. */
@media (max-width: 860px) {
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-masthead {
    gap: 12px;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-menu-toggle {
    margin-left: 4px;
  }
  html.smag-js body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-navigation {
    display: block;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-navigation-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: 8px;
  }
  html.smag-js body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-navigation:not(.is-open) .smag-primary-nav {
    display: none;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-navigation.is-open .smag-primary-nav {
    display: block;
    margin-bottom: 12px;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-header-tools {
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-header-tools .smag-search {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin-top: 0;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
@media (max-width: 600px) {
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-masthead {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding-block: 8px 5px;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-brand-link {
    grid-column: 1;
    grid-row: 1;
    width: 62px;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-brand-link img {
    width: 62px;
    height: 50px;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-brand-note {
    display: none;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-menu-toggle {
    grid-column: 3;
    grid-row: 1;
    margin-left: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-menu-toggle > span:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-masthead-tools {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
    gap: 0;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-header-socials {
    gap: 0;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-footer-inner .smag-footer-socials {
    grid-column: 1 / -1;
    padding: 0;
    gap: 4px;
  }
  body:not(.smag-compose-page):not(.page-template-page-redactar) .smag-about-card {
    padding: 22px 20px;
  }
}
