/*
Theme Name: Hispania Nova
Theme URI: https://hispanianova.com/
Author: Hispania Nova
Author URI: https://hispanianova.com/
Description: Tema editorial de bloques para Hispania Nova. Diseñado para historia narrativa, filosofía y divulgación rigurosa.
Requires at least: 6.8
Tested up to: 7.0
Requires PHP: 8.0
Version: 1.2.7
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hispania-nova
Tags: block-patterns, full-site-editing, blog, news, accessibility-ready, custom-colors, custom-logo, editor-style, featured-images, wide-blocks
*/

:root {
  --hn-shadow-sm: 0 8px 24px rgba(10, 11, 8, 0.08);
  --hn-shadow-lg: 0 24px 70px rgba(10, 11, 8, 0.14);
  --hn-border: rgba(37, 41, 31, 0.16);
  --hn-radius-sm: 0.65rem;
  --hn-radius-md: 1rem;
  --hn-radius-lg: 1.5rem;
}

html { scroll-behavior: smooth; }

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #e4c982;
  color: #090a08;
}

a {
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.08em;
}

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid #e4c982;
  outline-offset: 3px;
}

.wp-site-blocks { overflow: clip; }
.wp-site-blocks > * { margin-block-start: 0; }

.hn-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(228, 201, 130, 0.2);
  background: rgba(9, 10, 8, 0.92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.hn-site-header > .wp-block-group { min-height: 54px; }

.admin-bar .hn-site-header { top: 32px; }

.hn-brand-lockup { gap: 0.7rem; }
.hn-brand-lockup .wp-block-site-logo { line-height: 0; }
.hn-brand-lockup .custom-logo { filter: drop-shadow(0 5px 14px rgba(228, 201, 130, 0.18)); }
.hn-brand-lockup .wp-block-site-title {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hn-main-nav .wp-block-navigation-item__content {
  position: relative;
  text-decoration: none;
}

.hn-main-nav .wp-block-navigation-item__content::after {
  position: absolute;
  right: 0;
  bottom: -0.35rem;
  left: 0;
  height: 2px;
  content: "";
  background: #e4c982;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.hn-main-nav .wp-block-navigation-item__content:hover::after,
.hn-main-nav .current-menu-item .wp-block-navigation-item__content::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hn-mobile-menu { display: none; position: relative; }
.hn-mobile-menu > summary {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(228, 201, 130, 0.36);
  border-radius: 999px;
  color: #fbf5df;
  cursor: pointer;
  list-style: none;
}
.hn-mobile-menu > summary::-webkit-details-marker { display: none; }
.hn-mobile-menu > summary svg { width: 21px; height: 21px; }
.hn-mobile-menu[open] > summary { background: #e4c982; color: #090a08; }
.hn-mobile-menu-panel {
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  z-index: 120;
  display: grid;
  width: min(290px, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid rgba(228, 201, 130, 0.3);
  border-radius: var(--hn-radius-md);
  background: #11130f;
  box-shadow: var(--hn-shadow-lg);
  padding: 0.55rem;
}
.hn-mobile-menu-panel a {
  border-radius: 0.7rem;
  color: #fbf5df;
  font-weight: 700;
  padding: 0.9rem 1rem;
  text-decoration: none;
}
.hn-mobile-menu-panel a:hover,
.hn-mobile-menu-panel a:focus-visible { background: rgba(228, 201, 130, 0.14); color: #e4c982; }

.hn-search-link {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 999px;
  color: #fbf5df;
  line-height: 0;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

.hn-search-link:hover {
  background: rgba(228, 201, 130, 0.14);
  color: #e4c982;
}

.hn-search-link svg { display: block; width: 20px; height: 20px; }

.hn-search { position: relative; }
.hn-search summary { list-style: none; cursor: pointer; }
.hn-search summary::-webkit-details-marker { display: none; }
.hn-search[open] .hn-search-link { background: rgba(228, 201, 130, 0.14); color: #e4c982; }
.hn-search-panel {
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  width: min(340px, calc(100vw - 2rem));
  border: 1px solid rgba(228, 201, 130, 0.2);
  border-radius: var(--hn-radius-md);
  background: #11130f;
  box-shadow: var(--hn-shadow-lg);
  color: #fbf5df;
  padding: 1rem;
}
.hn-search-panel label { display: block; margin-bottom: 0.55rem; font-size: 0.82rem; font-weight: 700; }
.hn-search-row { display: flex; gap: 0.5rem; }
.hn-search-row input { min-width: 0; min-height: 44px; background: #fffdf7; font-size: 0.9rem; }
.hn-search-row button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: #e4c982;
  color: #090a08;
  cursor: pointer;
  font-weight: 700;
  padding-inline: 1rem;
}

.hn-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: #090a08 !important;
  background-image:
    linear-gradient(90deg, rgba(9, 10, 8, 0.99) 0%, rgba(9, 10, 8, 0.92) 44%, rgba(9, 10, 8, 0.5) 76%, rgba(9, 10, 8, 0.32) 100%),
    url("assets/images/fondo-roma.jpg");
  background-position: center;
  background-size: cover;
}

.hn-hero::before,
.hn-hero::after {
  display: none;
}

.hn-eyebrow {
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.has-large-font-size { font-size: clamp(1.15rem, 1.08rem + 0.28vw, 1.35rem) !important; }
.has-x-large-font-size { font-size: clamp(1.5rem, 1.3rem + 0.75vw, 2rem) !important; }
.has-display-font-size { font-size: clamp(2.25rem, 4.2vw, 3.7rem) !important; }

.hn-display {
  max-width: 15ch;
  margin-right: 0 !important;
  margin-left: 0 !important;
  text-wrap: balance;
}

.hn-lede {
  max-width: 62ch;
  text-wrap: pretty;
}

.hn-featured-query .wp-block-post-template { margin: 0; padding: 0; }

.hn-featured-story {
  overflow: hidden;
  border: 1px solid rgba(228, 201, 130, 0.18);
  border-radius: var(--hn-radius-lg);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.035), rgba(228, 201, 130, 0.025));
}

.hn-featured-copy { padding: clamp(2rem, 5vw, 4.5rem); }
.hn-featured-copy .wp-block-post-title {
  max-width: 15ch;
  margin-block: 0.65rem 1rem;
  text-wrap: balance;
}
.hn-featured-copy .wp-block-post-title a { color: inherit; text-decoration: none; }
.hn-featured-copy .wp-block-post-excerpt { max-width: 55ch; color: #aeb1b3; }
.hn-featured-copy .wp-block-post-excerpt__more-text { margin-top: 1.5rem; }
.hn-featured-copy .wp-block-post-excerpt__more-link,
.hn-read-more {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  border-radius: 999px;
  background: #e4c982;
  color: #090a08 !important;
  font-family: Roboto, Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.7rem 1.25rem;
  text-decoration: none;
}
.hn-featured-media { min-height: 430px; background: #151812; }
.hn-featured-media .wp-block-post-featured-image,
.hn-featured-media .wp-block-post-featured-image a,
.hn-featured-media .wp-block-post-featured-image img { width: 100%; height: 100%; }
.hn-featured-media .wp-block-post-featured-image { margin: 0; }
.hn-featured-media .wp-block-post-featured-image img { object-fit: cover; }
.hn-hero-fallback { max-width: 850px; padding-block: clamp(3.25rem, 7vw, 5rem); }
.hn-hero-fallback > * {
  margin-right: 0 !important;
  margin-left: 0 !important;
}
.hn-hero-fallback .hn-display { margin-block: 0.75rem 1.2rem; }

.wp-block-button .wp-block-button__link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease;
}

.wp-block-button .wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(10, 11, 8, 0.16);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: #e4c982;
  color: #090a08;
}

.hn-section-heading { text-wrap: balance; }

.hn-post-grid .wp-block-post-template { align-items: stretch; }
.hn-post-grid .has-x-large-font-size { font-size: var(--wp--preset--font-size--large) !important; }

.hn-article-rail .wp-block-post-template {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.25rem 0.1rem 1.35rem;
  scroll-snap-type: x mandatory;
  scrollbar-color: #a89668 transparent;
  scrollbar-width: thin;
}

.hn-article-rail .wp-block-post { flex: 0 0 clamp(285px, 31vw, 370px); scroll-snap-align: start; }
.hn-article-rail .wp-block-query-pagination { display: none; }

.hn-post-card {
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--hn-border);
  border-radius: var(--hn-radius-lg);
  background: #fffdf7;
  box-shadow: var(--hn-shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.hn-post-card:hover {
  border-color: rgba(168, 150, 104, 0.5);
  box-shadow: var(--hn-shadow-lg);
  transform: translateY(-5px);
}

.hn-post-card .wp-block-post-featured-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.hn-post-card .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms ease;
}

.hn-post-card:hover .wp-block-post-featured-image img { transform: scale(1.035); }
.hn-post-card .wp-block-post-title a { text-decoration: none; }
.hn-post-card .wp-block-post-title a:hover { color: #806f43; }

.hn-topic-band {
  background-image:
    linear-gradient(90deg, rgba(28, 32, 23, 0.94) 0%, rgba(28, 32, 23, 0.86) 48%, rgba(28, 32, 23, 0.78) 100%),
    url("assets/images/fondo-roma-otro.jpg");
  background-position: center;
  background-size: cover;
}

.hn-topic-card {
  height: 100%;
  border: 1px solid rgba(228, 201, 130, 0.16);
  border-radius: var(--hn-radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.hn-topic-card::before {
  display: block;
  width: 2.25rem;
  height: 3px;
  margin-bottom: 1rem;
  border-radius: 999px;
  content: "";
  background: #e4c982;
}

.hn-empty-state {
  border: 1px dashed rgba(168, 150, 104, 0.6);
  border-radius: var(--hn-radius-lg);
  background: #fffdf7;
}

.hn-article-header { position: relative; }
.hn-article-header::after {
  display: block;
  width: 5rem;
  height: 3px;
  margin-top: 2rem;
  content: "";
  background: #e4c982;
}

.hn-article-title {
  max-width: 18ch;
  margin-right: 0 !important;
  margin-left: 0 !important;
  text-wrap: balance;
}
.hn-article-meta { letter-spacing: 0.035em; }

.hn-single-hero {
  background-color: #090a08 !important;
  background-image:
    linear-gradient(90deg, rgba(9, 10, 8, 0.99) 0%, rgba(9, 10, 8, 0.94) 48%, rgba(9, 10, 8, 0.72) 74%, rgba(9, 10, 8, 0.5) 100%),
    url("assets/images/personajes-fondos.jpg");
  background-position: center right;
  background-size: cover;
}

.hn-featured-image img {
  max-height: 680px;
  border-radius: var(--hn-radius-lg);
  object-fit: cover;
  box-shadow: var(--hn-shadow-lg);
}

.hn-article-content {
  font-family: "Crimson Pro", Georgia, serif;
  font-size: clamp(1.08rem, 1.04rem + 0.2vw, 1.2rem);
  line-height: 1.72;
}

.hn-article-content > p:first-of-type { font-size: 1.06em; }

.hn-article-content h2,
.hn-article-content h3 {
  margin-top: 2.2em;
  text-wrap: balance;
}

.hn-article-content blockquote {
  margin-block: 2.2em;
}

.hn-article-content :where(img, video) { border-radius: var(--hn-radius-md); }

.hn-article-content .wp-block-pullquote {
  border-block: 1px solid rgba(168, 150, 104, 0.45);
  color: #25291f;
}

.hn-source-note {
  border-left: 3px solid #e4c982;
  background: #fbf5df;
}

.hn-page-title {
  max-width: 22ch;
  font-size: clamp(2.2rem, 4.5vw, 3.5rem) !important;
  text-wrap: balance;
}

.wp-block-search__inside-wrapper {
  overflow: hidden;
  border-radius: 999px;
}

.wp-block-search__input { min-height: 48px; }

.wp-block-query-pagination { gap: 0.55rem; }
.wp-block-query-pagination a,
.wp-block-query-pagination .current {
  display: inline-grid;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--hn-border);
  border-radius: 999px;
  text-decoration: none;
}

.wp-block-query-pagination .current {
  border-color: #e4c982;
  background: #e4c982;
  color: #090a08;
}

.wp-block-table { overflow-x: auto; }
.wp-block-table table { min-width: 560px; }
.wp-block-table th { background: #25291f; color: #fbf5df; }

input:not([type="submit"]),
textarea,
select {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(37, 41, 31, 0.28);
  border-radius: var(--hn-radius-sm);
  background: #fffdf7;
  color: #090a08;
  font: inherit;
  padding: 0.75rem 0.9rem;
}

textarea { min-height: 10rem; resize: vertical; }

input[type="submit"],
.wpcf7-submit {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: #e4c982;
  color: #090a08;
  cursor: pointer;
  font-weight: 700;
  padding: 0.75rem 1.35rem;
}

.wpcf7-form label { display: block; font-weight: 700; }
.wpcf7-form-control-wrap { display: block; margin-top: 0.45rem; }
.wpcf7-not-valid-tip { color: #9f2f2f; font-size: 0.9rem; }

.hn-footer { background: linear-gradient(155deg, #090a08 0%, #171a13 100%); }
.hn-footer-card {
  border: 1px solid rgba(228, 201, 130, 0.13);
  border-radius: var(--hn-radius-lg);
  background: rgba(255, 255, 255, 0.025);
}
.hn-footer-brand { max-width: 46ch; }
.hn-footer ul { margin: 0; padding: 0; list-style: none; }
.hn-footer li + li { margin-top: 0.55rem; }
.hn-footer a { color: inherit; text-decoration: none; }
.hn-footer a:hover { color: #e4c982; }
.hn-footer-meta { color: #aeb1b3; }

.cmplz-cookiebanner {
  border: 1px solid rgba(228, 201, 130, 0.22) !important;
  border-radius: var(--hn-radius-lg) !important;
  background: #10120e !important;
  color: #fbf5df !important;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34) !important;
  font-family: Roboto, Arial, sans-serif !important;
}

.cmplz-cookiebanner .cmplz-title {
  color: #fbf5df !important;
  font-family: "Crimson Pro", Georgia, serif !important;
  font-size: 1.45rem !important;
}

.cmplz-cookiebanner .cmplz-message,
.cmplz-cookiebanner .cmplz-category-title { color: #d6d7d2 !important; }
.cmplz-cookiebanner a { color: #e4c982 !important; }
.cmplz-cookiebanner .cmplz-btn {
  min-height: 46px !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
}
.cmplz-cookiebanner .cmplz-btn.cmplz-accept {
  border-color: #e4c982 !important;
  background: #e4c982 !important;
  color: #090a08 !important;
}
.cmplz-cookiebanner .cmplz-btn.cmplz-deny,
.cmplz-cookiebanner .cmplz-btn.cmplz-view-preferences,
.cmplz-cookiebanner .cmplz-btn.cmplz-save-preferences {
  border-color: rgba(228, 201, 130, 0.45) !important;
  background: #25291f !important;
  color: #fbf5df !important;
}

@media (max-width: 781px) {
  .admin-bar .hn-site-header { top: 46px; }
  .hn-display { max-width: 15ch; }
  .hn-featured-media { min-height: 320px; }
  .hn-featured-story .wp-block-columns { gap: 0; }
  .hn-site-header .wp-block-site-title { font-size: 0.96rem !important; }
  .hn-article-content { font-size: 1.08rem; }
  .hn-topic-band .wp-block-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hn-footer .wp-block-columns { gap: 2rem; }
  .hn-site-header nav.wp-block-navigation.hn-main-nav { display: none !important; }
  .hn-mobile-menu { display: block; }
}

@media (max-width: 600px) {
  .hn-brand-lockup .wp-block-site-logo { width: 38px; }
  .hn-site-header .wp-block-site-title { display: none; }
  .hn-site-header { position: relative; }
  .admin-bar .hn-site-header { top: 0; }
  .hn-hero { padding-top: 2rem !important; padding-bottom: 2rem !important; }
  .hn-hero {
    background-image:
      linear-gradient(90deg, rgba(9, 10, 8, 0.96), rgba(9, 10, 8, 0.76)),
      url("assets/images/fondo-roma.jpg");
    background-position: 58% center;
  }
  .hn-featured-copy { padding: 2rem 1.35rem; }
  .hn-featured-media { min-height: 240px; }
  .hn-hero-fallback { padding-block: 2.5rem; }
  .hn-article-rail .wp-block-post { flex-basis: min(86vw, 330px); }
  .hn-topic-band .wp-block-columns { grid-template-columns: 1fr; }
  .hn-topic-band {
    background-image:
      linear-gradient(rgba(28, 32, 23, 0.9), rgba(28, 32, 23, 0.86)),
      url("assets/images/fondo-roma-otro.jpg");
    background-position: 68% center;
  }
  .hn-single-hero {
    background-image:
      linear-gradient(rgba(9, 10, 8, 0.9), rgba(9, 10, 8, 0.82)),
      url("assets/images/personajes-fondos.jpg");
    background-position: 63% center;
  }
  .hn-post-card { border-radius: var(--hn-radius-md); }
  .hn-featured-image img { border-radius: var(--hn-radius-md); }
  .hn-footer { padding-top: 2rem !important; padding-bottom: 1.5rem !important; }
  .hn-footer-card { padding: 1.5rem !important; }
  .hn-footer-card .wp-block-columns { gap: 1.25rem; }
  .hn-footer-card ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; row-gap: 0.5rem; }
  .hn-footer-card li + li { margin-top: 0; }
  .hn-search-panel { right: -0.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
