/* =========================================================
   Xtremadura.es — sistema visual
   Paleta inspirada en Extremadura: adobe/terracota de los
   pueblos, verde de la dehesa, dorado del trigo y de las
   puestas de sol, piedra de los monumentos.
   ========================================================= */

:root {
  --color-terracotta: #c1592d;
  --color-terracotta-dark: #9c4522;
  --color-olive: #5f7248;
  --color-olive-dark: #495838;
  --color-gold: #d9a441;
  --color-forest: #33402a;
  --color-ink: #2b2420;
  --color-ink-soft: #55493f;
  --color-cream: #fbf6ee;
  --color-cream-dark: #f1e6d3;
  --color-white: #ffffff;
  --color-border: #e4d7c0;

  --font-heading: "PT Serif", Georgia, "Times New Roman", serif;
  --font-serif: "PT Serif", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", "Segoe UI", Arial, sans-serif;

  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-card: 0 6px 20px rgba(43, 36, 32, 0.1);
  --shadow-card-hover: 0 12px 28px rgba(43, 36, 32, 0.18);
  --container-width: 1180px;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--color-ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0;
}

.section-alt {
  background: var(--color-cream-dark);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 40px;
}

.section-header .eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--color-terracotta);
  margin-bottom: 10px;
}

.section-header p {
  color: var(--color-ink-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--color-terracotta);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-terracotta-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-white);
  color: var(--color-white);
}

.btn-outline:hover {
  background: var(--color-white);
  color: var(--color-terracotta);
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-ink);
}

.btn-ghost:hover {
  border-color: var(--color-terracotta);
  color: var(--color-terracotta);
}

/* ---------- Header / navegación ---------- */
.promo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--color-terracotta), var(--color-gold));
  color: var(--color-white);
  text-align: center;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.3;
}

.promo-banner:hover {
  filter: brightness(1.06);
}

.promo-banner strong {
  font-weight: 700;
}

.promo-banner span {
  font-weight: 500;
  opacity: 0.95;
}

@media (max-width: 480px) {
  .promo-banner {
    flex-direction: column;
    gap: 2px;
    padding: 8px 14px;
  }
}

/* ---------- Foto de monumento ---------- */
.monument-photo {
  margin: 0;
  position: relative;
  background: var(--color-ink);
}

.monument-photo img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}

.monument-photo figcaption {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  padding: 5px 12px;
  border-top-left-radius: 8px;
}

@media (max-width: 760px) {
  .monument-photo img {
    height: 240px;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 246, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-terracotta);
}

.nav-brand .brand-mark {
  width: 30px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  background:
    linear-gradient(
      to bottom,
      #2f6b3c 0%,
      #2f6b3c 33.33%,
      #ffffff 33.33%,
      #ffffff 66.66%,
      #161616 66.66%,
      #161616 100%
    );
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 26px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-menu > li {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-menu > li > .nav-link:hover,
.nav-menu > li:focus-within > .nav-link {
  background: var(--color-cream-dark);
  color: var(--color-terracotta);
}

.chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -4px;
  transition: transform 0.15s ease;
}

.has-dropdown:focus-within .chevron,
.has-dropdown:hover .chevron {
  transform: rotate(225deg);
  margin-top: 4px;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-hover);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  max-height: 60vh;
  overflow-y: auto;
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
}

.dropdown a:hover {
  background: var(--color-cream-dark);
  color: var(--color-terracotta);
}

.dropdown-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 6px;
  padding-top: 6px;
}

.dropdown-footer a {
  color: var(--color-terracotta);
  font-weight: 600;
}

.dropdown-filter-status {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--color-terracotta);
  background: var(--color-cream-dark);
  padding: 7px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 100px 0 90px;
  background: linear-gradient(160deg, var(--color-forest) 0%, var(--color-olive-dark) 55%, var(--color-terracotta-dark) 130%);
  color: var(--color-white);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 85% 20%, rgba(217, 164, 65, 0.35), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(193, 89, 45, 0.35), transparent 40%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 700px;
}

.hero .eyebrow {
  color: var(--color-gold);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.hero h1 {
  color: var(--color-white);
  margin-top: 14px;
}

.hero p.lead {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.hero-stats {
  position: relative;
  display: flex;
  gap: 36px;
  margin-top: 56px;
  flex-wrap: wrap;
}

.hero-stats .stat strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-gold);
}

.hero-stats .stat span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- Page header (páginas interiores) ---------- */
.page-hero {
  background: linear-gradient(140deg, var(--color-forest), var(--color-olive-dark));
  color: var(--color-white);
  padding: 56px 0 48px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 14px;
}

.breadcrumb a:hover {
  color: var(--color-gold);
}

.page-hero h1 {
  color: var(--color-white);
  margin-bottom: 8px;
}

.page-hero .subtitle {
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
}

.tag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ---------- Buscador de página (listados) ---------- */
.page-hero-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.page-hero-text {
  flex: 1 1 420px;
}

.page-search-box {
  flex: 0 0 auto;
  width: 100%;
  max-width: 320px;
  position: relative;
}

.page-search-box input[type="search"] {
  width: 100%;
  padding: 13px 20px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-ink);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.page-search-box input[type="search"]::placeholder {
  color: var(--color-ink-soft);
}

.page-search-box input[type="search"]:focus {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

.page-search-status {
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  min-height: 1.2em;
}

.no-results {
  display: none;
  text-align: center;
  padding: 48px 20px;
  color: var(--color-ink-soft);
  font-size: 1.05rem;
}

.no-results.visible {
  display: block;
}

@media (max-width: 760px) {
  .page-search-box {
    max-width: 100%;
  }
}

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.card-media {
  height: 170px;
  background: linear-gradient(135deg, var(--color-olive), var(--color-terracotta));
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  overflow: hidden;
}

.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.card-media .card-badge {
  position: relative;
  z-index: 1;
}

.card-media .card-badge {
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-white);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h3 {
  margin-bottom: 8px;
}

.card-body p {
  color: var(--color-ink-soft);
  font-size: 0.94rem;
  flex: 1;
}

.card-link {
  margin-top: 12px;
  font-weight: 700;
  color: var(--color-terracotta);
  font-size: 0.9rem;
}

.card-link::after {
  content: " →";
}

/* ---------- Provincia banner (índice pueblos) ---------- */
.province-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 32px;
  border-radius: var(--radius-lg);
  color: var(--color-white);
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.province-banner.badajoz {
  background: linear-gradient(120deg, var(--color-terracotta-dark), var(--color-terracotta));
}

.province-banner.caceres {
  background: linear-gradient(120deg, var(--color-olive-dark), var(--color-olive));
}

.province-banner h2 {
  color: var(--color-white);
  margin-bottom: 4px;
}

.province-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Contenido de ficha (pueblo/fiesta/monumento) ---------- */
.detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 44px;
  align-items: start;
}

.prose h2 {
  margin-top: 1.4em;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--color-ink-soft);
}

.info-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 100px;
}

.info-card h3 {
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.info-list li {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}

.info-list li:last-child {
  border-bottom: none;
}

.maps-directions-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  margin-top: 4px;
  margin-bottom: 18px;
}

.info-list .label {
  font-weight: 600;
  color: var(--color-ink-soft);
  min-width: 92px;
  flex-shrink: 0;
}

.info-list li > span:last-child {
  flex: 1;
  min-width: 0;
}

/* ---------- Franja "Extremadura en cifras" / CTA ---------- */
.cta-band {
  background: var(--color-forest);
  color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cta-band h2 {
  color: var(--color-white);
  margin-bottom: 6px;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* ---------- Directorio negocios ---------- */
.business-card {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.business-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--color-gold), var(--color-terracotta));
  flex-shrink: 0;
}

.business-card h3 {
  margin-bottom: 4px;
}

.business-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  margin-top: 10px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.75);
  padding: 60px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-grid h4 {
  color: var(--color-white);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.footer-grid li {
  margin-bottom: 10px;
}

.footer-grid a:hover {
  color: var(--color-gold);
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-white);
  margin-bottom: 10px;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.footer-social a:hover {
  background: var(--color-terracotta);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom a:hover {
  color: var(--color-gold);
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 18px;
  left: 18px;
  right: 18px;
  max-width: 560px;
  margin: 0 auto;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-hover);
  padding: 20px 22px;
  z-index: 200;
  display: none;
}

.cookie-banner.visible {
  display: block;
}

.cookie-banner p {
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cookie-actions .btn {
  padding: 9px 18px;
  font-size: 0.85rem;
}

/* ---------- Utilidades ---------- */
.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .info-card {
    position: static;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    inset: 68px 16px auto 16px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card-hover);
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  }

  .nav-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-menu > li {
    width: 100%;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    display: none;
    max-height: none;
    padding-left: 12px;
  }

  .has-dropdown.open .dropdown {
    display: block;
  }

  .has-dropdown.open .chevron {
    transform: rotate(225deg);
    margin-top: 4px;
  }

  .grid,
  .grid-2,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .cta-band {
    flex-direction: column;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .province-banner {
    flex-direction: column;
    text-align: center;
  }
}
