/* PressEuropa light/dark theme layer */
:root {
  color-scheme: light;
}

html[data-pe-theme="dark"] {
  color-scheme: dark;
  --wp--preset--color--base: #0f1b2d;
  --wp--preset--color--main: #ffffff;
  --wp--preset--color--secondary: #dbe4ef;
  --wp--preset--color--tertiary: #16263d;
  --wp--preset--color--border-light: #2a3c54;
  --wp--preset--color--border-dark: #8ea0b7;
}

html[data-pe-theme="dark"] body {
  background: #0f1b2d;
  color: #ffffff;
}

/* Homepage type scale: restrained editorial hierarchy */
.pe-section-head h1.wp-block-heading {
  font-size: clamp(1.7rem, 3vw, 2.5rem) !important;
  line-height: 1.1 !important;
}

/* Editorial link palette: blue/neutral, readable in both themes */
a,
.wp-block-post-title a,
.wp-block-navigation-item__content {
  color: #003399;
}

a:hover,
a:focus-visible,
.wp-block-post-title a:hover,
.wp-block-post-title a:focus-visible,
.wp-block-navigation-item__content:hover,
.wp-block-navigation-item__content:focus-visible {
  color: #001f66;
}

html[data-pe-theme="dark"] a,
html[data-pe-theme="dark"] .wp-block-post-title a,
html[data-pe-theme="dark"] .wp-block-navigation-item__content {
  color: #8fb8ff;
}

html[data-pe-theme="dark"] a:hover,
html[data-pe-theme="dark"] a:focus-visible,
html[data-pe-theme="dark"] .wp-block-post-title a:hover,
html[data-pe-theme="dark"] .wp-block-post-title a:focus-visible,
html[data-pe-theme="dark"] .wp-block-navigation-item__content:hover,
html[data-pe-theme="dark"] .wp-block-navigation-item__content:focus-visible {
  color: #c5dcff;
}

.pe-logo-light { display: none; }
html[data-pe-theme="dark"] .pe-logo-dark { display: none; }
html[data-pe-theme="dark"] .pe-logo-light { display: block; }

.pe-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 10px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.pe-theme-toggle:hover { opacity: .8; }
.pe-theme-toggle svg { width: 18px; height: 18px; fill: currentColor; }

html[data-pe-theme="dark"] .wp-block-navigation__responsive-container {
  background: #0f1b2d !important;
  color: #fff;
}
html[data-pe-theme="dark"] .wp-block-navigation__responsive-container .wp-block-navigation-item__content,
html[data-pe-theme="dark"] .wp-block-navigation__responsive-container-close {
  color: #fff;
}

@media (max-width: 781px) {
  .pe-header .alignwide {
    width: 100%;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .pe-site-brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 160px;
  }

  .pe-site-brand img {
    display: block;
    width: 100% !important;
    max-width: 160px;
    height: auto;
  }

  .pe-header .wp-block-navigation {
    flex: 0 0 auto;
  }

  .pe-theme-toggle {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    margin-left: 0;
  }

  .pe-section-head,
  .pe-latest-head {
    margin-bottom: 18px !important;
  }

  .pe-featured-story .wp-block-post-featured-image {
    margin-bottom: 14px;
  }

  .pe-latest-query .wp-block-post-template {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .pe-news-card .wp-block-post-featured-image {
    margin-bottom: 10px;
  }

  .pe-featured-excerpt,
  .pe-card-excerpt {
    margin-top: 0;
  }
}
