/* =====================================================================
   COSTA DE LA LUZ · CÁDIZ — Hoja de estilos principal
   Paleta marinera (azul atlántico + arena) · Playfair Display + Mulish
   ===================================================================== */

/* ===== 1. VARIABLES ===== */
:root {
  /* Marca */
  --navy:        #0f2f4f;   /* azul profundo (textos, footer) */
  --primary:     #1e5b9c;   /* azul atlántico principal */
  --primary-dk:  #16456f;   /* azul oscuro hover */
  --teal:        #0e8aa0;   /* acento turquesa (detalles) */
  --sand:        #f3e3cf;   /* arena */
  --sand-soft:   #faf5ee;   /* arena muy clara (fondos) */
  --gold:        #e0a44b;   /* dorado/sol (badges, acentos) */

  /* Texto */
  --ink:         #1d2733;
  --ink-soft:    #5b6b7a;
  --ink-faint:   #93a1ad;
  --line:        #e7ded2;

  --white: #ffffff;

  /* Tipografía */
  --serif: "Playfair Display", Georgia, serif;
  --sans:  "Mulish", system-ui, -apple-system, sans-serif;

  /* Sombras (suaves, en tono frío) */
  --sh-sm: 0 1px 2px rgba(15, 47, 79, .06);
  --sh:    0 6px 20px rgba(15, 47, 79, .08);
  --sh-lg: 0 18px 44px rgba(15, 47, 79, .14);

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ===== 2. RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; object-fit: cover; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ===== 3. TIPOGRAFÍA ===== */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -.01em;
}
p { color: var(--ink-soft); }

.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: .9rem;
}

/* ===== 4. LAYOUT ===== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }

.section-header { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-header h2 { font-size: clamp(2rem, 4vw, 2.7rem); }

.section-cta { text-align: center; margin-top: 3rem; }

/* ===== 5. BOTONES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1.8rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .98rem;
  letter-spacing: .01em;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
  border: 2px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--white); box-shadow: var(--sh); }
.btn-primary:hover { background: var(--primary-dk); transform: translateY(-2px); box-shadow: var(--sh-lg); }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); transform: translateY(-2px); }

.btn-light { background: var(--white); color: var(--navy); box-shadow: var(--sh); }
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }

/* ===== 6. HEADER ===== */
.header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  z-index: 1000;
  padding: .35rem 0;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  box-shadow: var(--sh-sm);
  transition: background .35s var(--ease), box-shadow .35s var(--ease), padding .35s var(--ease);
}

.navbar { display: flex; align-items: center; justify-content: space-between; padding: .85rem 0; }

.logo {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.4rem;
  color: var(--navy);
  transition: color .35s var(--ease);
}
.logo i { font-size: 1.5rem; color: var(--gold); }
.header.scrolled .logo { color: var(--navy); }

.nav-menu { display: flex; align-items: center; gap: 2.1rem; }

.nav-link {
  position: relative;
  color: var(--ink);
  font-weight: 600;
  font-size: .98rem;
  padding: .4rem 0;
  transition: color .25s var(--ease);
}
.header.scrolled .nav-link { color: var(--ink); }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px; background: var(--teal); transition: width .3s var(--ease);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link:hover, .nav-link.active { color: var(--primary); }
.header.scrolled .nav-link:hover, .header.scrolled .nav-link.active { color: var(--primary); }

/* CTA del menú */
.nav-link--cta {
  background: var(--gold);
  color: var(--navy) !important;
  padding: .55rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
}
.nav-link--cta::after { display: none; }
.nav-link--cta:hover { background: #cf9038; transform: translateY(-1px); }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-toggle { display: flex; align-items: center; gap: .35rem; }
.dropdown-toggle i { font-size: .7rem; transition: transform .25s var(--ease); }
.nav-dropdown:hover .dropdown-toggle i { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(8px);
  min-width: 232px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--sh-lg);
  padding: .5rem;
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.nav-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown-menu::before {
  content: ""; position: absolute; top: -16px; left: 0; width: 100%; height: 16px;
}
.dropdown-menu li a {
  display: block; padding: .6rem .85rem; border-radius: 8px;
  color: var(--ink-soft); font-weight: 600; font-size: .95rem;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.dropdown-menu li a:hover { background: var(--sand-soft); color: var(--primary); }

/* Toggle móvil */
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { width: 26px; height: 2.5px; border-radius: 3px; background: var(--navy); transition: var(--ease) .3s; }
.header.scrolled .nav-toggle span { background: var(--navy); }

/* ===== 7. HERO ===== */
.hero { position: relative; height: 100vh; min-height: 600px; overflow: hidden; }
.hero-slider { height: 100%; width: 100%; }
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 1.1s var(--ease);
}
.hero-slide.active { opacity: 1; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,47,79,.35) 0%, rgba(15,47,79,.30) 45%, rgba(15,47,79,.72) 100%);
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center; color: #fff; max-width: 820px; padding: 0 1.5rem;
}
.hero-eyebrow {
  display: inline-block; font-weight: 700; font-size: .82rem; letter-spacing: .18em;
  text-transform: uppercase; color: #fff;
  padding: .4rem 1rem; border: 1px solid rgba(255,255,255,.5); border-radius: 999px;
  margin-bottom: 1.4rem; backdrop-filter: blur(4px);
}
.hero-title {
  color: #fff; font-size: clamp(2.4rem, 6vw, 4.3rem);
  text-shadow: 0 2px 30px rgba(0,0,0,.35); margin-bottom: 1.1rem;
}
.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: rgba(255,255,255,.94);
  max-width: 620px; margin: 0 auto 2rem; font-weight: 400;
}

.hero-controls {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 100%; display: flex; justify-content: space-between; padding: 0 1.5rem;
  pointer-events: none;
}
.hero-prev, .hero-next {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  pointer-events: all; transition: var(--ease) .25s;
}
.hero-prev:hover, .hero-next:hover { background: rgba(255,255,255,.32); transform: scale(1.08); }

.hero-indicators { position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%); display: flex; gap: .7rem; }
.indicator { width: 10px; height: 10px; border-radius: 999px; background: rgba(255,255,255,.5); cursor: pointer; transition: var(--ease) .3s; }
.indicator.active { width: 30px; background: #fff; }

/* ===== 8. INTRO ===== */
.intro-section { padding: clamp(4rem, 8vw, 6.5rem) 0; background: var(--sand-soft); }
.intro-content { max-width: 760px; margin: 0 auto; text-align: center; }
.intro-title { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 1.3rem; }
.intro-text { font-size: 1.12rem; line-height: 1.85; }

.intro-features {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem;
  margin-top: 2.6rem;
}
.feature {
  display: flex; align-items: center; gap: .65rem;
  background: var(--white); padding: .8rem 1.4rem; border-radius: 999px;
  box-shadow: var(--sh-sm); font-weight: 600; color: var(--navy); font-size: .98rem;
}
.feature i { color: var(--teal); }

/* ===== 9. ARTÍCULOS DESTACADOS ===== */
.featured-posts { padding: clamp(4rem, 8vw, 6.5rem) 0; }

.posts-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 1.6rem;
}
.post-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--sh); display: flex; flex-direction: column;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); }
.post-card.featured { grid-row: 1 / 3; grid-column: 1; }

.post-image { position: relative; display: block; overflow: hidden; height: 210px; }
.post-card.featured .post-image { height: 100%; min-height: 340px; }
.post-image img { width: 100%; height: 100%; transition: transform .5s var(--ease); }
.post-card:hover .post-image img { transform: scale(1.06); }

.post-category {
  position: absolute; top: 1rem; left: 1rem;
  background: rgba(255,255,255,.92); color: var(--primary);
  padding: .35rem .85rem; border-radius: 999px; font-size: .76rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}

.post-content { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.post-card.featured .post-content { padding: 1.9rem; }
.post-content h3 { font-size: 1.65rem; margin-bottom: .7rem; }
.post-content h4 { font-size: 1.18rem; line-height: 1.3; margin-bottom: .5rem; }
.post-content h3 a, .post-content h4 a { transition: color .2s var(--ease); }
.post-content h3 a:hover, .post-content h4 a:hover { color: var(--primary); }
.post-excerpt { font-size: .98rem; line-height: 1.6; }
.post-card.featured .post-excerpt { font-size: 1.08rem; }

.post-readmore {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1.1rem; color: var(--primary); font-weight: 700; font-size: .95rem;
}
.post-readmore i { transition: transform .25s var(--ease); }
.post-card:hover .post-readmore i { transform: translateX(4px); }

/* ===== 10. CATEGORÍAS ===== */
.categories-section { padding: clamp(4rem, 8vw, 6.5rem) 0; background: var(--sand-soft); }
.categories-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.6rem; }

.category-card {
  background: var(--white); padding: 2.6rem 2rem; border-radius: var(--radius);
  text-align: center; box-shadow: var(--sh);
  border: 1px solid transparent;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
  display: flex; flex-direction: column; align-items: center;
}
.category-card:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); border-color: var(--sand); }
.category-icon {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sand) 0%, #f8ecdb 100%);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1.4rem;
  transition: background .3s var(--ease);
}
.category-icon i { font-size: 1.8rem; color: var(--primary); transition: color .3s var(--ease); }
.category-card:hover .category-icon { background: var(--primary); }
.category-card:hover .category-icon i { color: #fff; }
.category-card h3 { font-size: 1.5rem; margin-bottom: .7rem; }
.category-card p { font-size: .98rem; flex: 1; }
.category-link {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1.3rem; color: var(--primary); font-weight: 700; font-size: .95rem;
}
.category-link i { transition: transform .25s var(--ease); }
.category-card:hover .category-link i { transform: translateX(4px); }

/* ===== 12. FOOTER ===== */
.footer { background: var(--navy); color: rgba(255,255,255,.78); padding: 4rem 0 1.6rem; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.6rem; margin-bottom: 2.6rem; }
.logo--footer { color: #fff; font-size: 1.35rem; margin-bottom: 1.1rem; }
.footer-about p { color: rgba(255,255,255,.7); font-size: .98rem; max-width: 340px; }
.footer-links h4 { color: #fff; font-size: 1.05rem; margin-bottom: 1.1rem; font-family: var(--sans); font-weight: 800; }
.footer-links li { margin-bottom: .55rem; }
.footer-links a { color: rgba(255,255,255,.72); font-size: .96rem; transition: color .2s var(--ease); }
.footer-links a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.6rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: .9rem; color: rgba(255,255,255,.55);
}
.footer-bottom i { color: var(--gold); }
.footer-legal { display: flex; gap: 1.4rem; }
.footer-legal a { color: rgba(255,255,255,.65); transition: color .2s var(--ease); }
.footer-legal a:hover { color: #fff; }

/* ===== BOTÓN SUBIR ARRIBA ===== */
.scroll-top {
  position: fixed; bottom: 1.8rem; right: 1.8rem; z-index: 900;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff; box-shadow: var(--sh-lg);
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), background .25s var(--ease);
}
.scroll-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { background: var(--primary-dk); transform: translateY(-3px); }
@media (max-width: 768px) { .scroll-top { bottom: 1.2rem; right: 1.2rem; width: 44px; height: 44px; } }

/* ===== BANNER DE COOKIES ===== */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; width: 100%; z-index: 1500;
  background: var(--navy); color: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.2rem 1.6rem; box-shadow: 0 -6px 24px rgba(15,47,79,.22);
  transform: translateY(100%); transition: transform .4s var(--ease);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner[hidden] { display: flex; }
.cookie-banner__text { max-width: 760px; }
.cookie-banner__text strong { color: #fff; font-size: 1rem; }
.cookie-banner__text p { color: rgba(255,255,255,.8); font-size: .9rem; line-height: 1.5; margin-top: .25rem; }
.cookie-banner__text a { color: var(--gold); font-weight: 600; text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: .7rem; flex-shrink: 0; }
.cookie-btn { padding: .65rem 1.4rem; border-radius: 999px; font-weight: 700; font-size: .92rem; transition: all .2s var(--ease); }
.cookie-btn--accept { background: var(--gold); color: var(--navy); }
.cookie-btn--accept:hover { background: #cf9038; transform: translateY(-2px); }
.cookie-btn--reject { background: transparent; color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.35); }
.cookie-btn--reject:hover { background: rgba(255,255,255,.1); color: #fff; }
@media (max-width: 768px) {
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 1rem; text-align: center; padding: 1.2rem; }
  .cookie-banner__actions { justify-content: center; }
  .cookie-btn { flex: 1; }
}

/* ===== 13. ANIMACIÓN DE ENTRADA ===== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== 14. RESPONSIVE ===== */
@media (max-width: 980px) {
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .post-card.featured { grid-row: auto; grid-column: 1 / -1; }
  .post-card.featured .post-image { min-height: 280px; }
  .footer-content { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  body { font-size: 16px; }

  .nav-toggle { display: flex; z-index: 1002; }

  .nav-menu {
    position: fixed; top: 0; right: 0; left: 0;
    width: 100%; height: 100vh; height: 100dvh;
    background: var(--white);
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 0; padding: 4.8rem 0 2rem;
    box-shadow: var(--sh-lg);
    transform: translateX(100%);
    transition: transform .35s var(--ease);
    overflow-y: auto; overflow-x: hidden; z-index: 1001;
    box-sizing: border-box;
  }
  .nav-menu.active { transform: translateX(0); }
  .nav-menu > li { width: 100%; }

  .nav-link { display: block; width: 100%; color: var(--ink); padding: .95rem 1.6rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); box-sizing: border-box; }
  .nav-link::after { display: none; }
  .nav-link--cta { margin: 1rem 1.6rem 0; text-align: center; justify-content: center; border-bottom: none; }

  /* Hamburguesa: oscuro sobre cabecera blanca (la home sobre el hero lo pone blanco aparte) */
  .nav-toggle span { background: var(--navy); }
  .nav-toggle.active span { background: var(--navy); }
  .nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

  /* Dropdown en móvil: acordeón */
  .nav-dropdown { display: flex; flex-direction: column; width: 100%; }
  .dropdown-toggle { justify-content: space-between; }
  .dropdown-menu {
    position: static !important; transform: none !important; left: auto !important; top: auto !important;
    opacity: 1; visibility: visible;
    box-shadow: none; background: var(--sand-soft); border-radius: 0;
    width: 100%; min-width: 0; padding: 0; max-height: 0; overflow: hidden;
    transition: max-height .35s var(--ease);
    box-sizing: border-box;
  }
  .dropdown-menu::before { display: none; }
  .nav-dropdown.open .dropdown-menu { max-height: 600px; padding: .4rem 0; }
  .nav-dropdown.open .dropdown-toggle i { transform: rotate(180deg); }
  .dropdown-menu li { width: 100%; }
  .dropdown-menu li a { display: block; width: 100%; padding: .7rem 1.6rem .7rem 2.4rem; white-space: normal; box-sizing: border-box; border-radius: 0; }

  body.menu-open { overflow: hidden; }

  .posts-grid { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr; text-align: center; }
  .footer-about .logo--footer { justify-content: center; }
  .footer-about p { margin: 0 auto; }
  .footer-bottom { justify-content: center; text-align: center; }
  .cta-band__inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== 15. CABECERA TRANSPARENTE SOBRE EL HERO (solo home) ===== */
.header--over-hero { background: transparent; box-shadow: none; backdrop-filter: none; }
.header--over-hero .logo { color: #fff; }
.header--over-hero .nav-link { color: rgba(255,255,255,.94); }
.header--over-hero .nav-link:hover, .header--over-hero .nav-link.active { color: #fff; }
.header--over-hero .nav-toggle span { background: #fff; }
.header--over-hero.scrolled { background: rgba(255,255,255,.96); box-shadow: var(--sh-sm); backdrop-filter: blur(10px); }
.header--over-hero.scrolled .logo { color: var(--navy); }
.header--over-hero.scrolled .nav-link { color: var(--ink); }
.header--over-hero.scrolled .nav-link:hover, .header--over-hero.scrolled .nav-link.active { color: var(--primary); }
.header--over-hero.scrolled .nav-toggle span { background: var(--navy); }
