/* =====================================================
   MAPA VIVO · CANTABRIA
   Diseño basado en las referencias V2
   National Geographic × Airbnb × Komoot
   ===================================================== */

:root {
  --verde:#2F3E34; --verde-osc:#243029; --verde-claro:#4A5F4E;
  --musgo:#5F7A6B; --oro:#C2A46F; --oro-osc:#A8884F;
  --marfil:#F5F2EA; --marfil-2:#EFEADD; --crema:#FAF8F2;
  --arena:#D6C3A3; --texto:#2A2620; --muted:#7A7265;
  --linea:#E2DBCC; --white:#fff;
  --serif:'Cormorant Garamond', Georgia, serif;
  --sans:'Jost', system-ui, sans-serif;
  --shadow-sm:0 4px 16px rgba(36,48,41,.07);
  --shadow:0 12px 40px rgba(36,48,41,.12);
  --shadow-lg:0 28px 70px rgba(36,48,41,.18);
  --r-sm:12px; --r:18px; --r-lg:26px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--sans); color: var(--texto); background: var(--marfil); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

h1,h2,h3,h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; color: var(--verde); }
h1 { font-size: clamp(48px,6.5vw,86px); line-height: .94; }
h2 { font-size: clamp(28px,3.6vw,42px); line-height: 1.05; }
h3 { font-size: clamp(19px,2vw,24px); }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; color: var(--oro); }
.eyebrow.dark { color: var(--musgo); }

.container { width: min(1280px, calc(100% - 48px)); margin: auto; }
.section { padding: 72px 0; }
.section-head { margin-bottom: 32px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.ver-todo { font-size: 14px; color: var(--musgo); font-weight: 500; white-space: nowrap; transition: color .2s; }
.ver-todo:hover { color: var(--oro); }

/* NAV */
.nav { position: sticky; top: 0; z-index: 100; background: var(--crema); border-bottom: 1px solid var(--linea); height: 72px; display: flex; align-items: center; padding: 0 32px; gap: 28px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand .leaf { width: 30px; height: 30px; flex-shrink: 0; }
.brand-name strong { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--verde); letter-spacing: .04em; display: block; line-height: 1; }
.brand-name small { font-size: 9px; letter-spacing: .35em; color: var(--musgo); text-transform: uppercase; }
.nav-links { display: flex; gap: 26px; margin-left: 20px; }
.nav-links a { font-size: 14px; color: var(--texto); transition: color .2s; }
.nav-links a:hover { color: var(--musgo); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.nav-icon { width: 22px; height: 22px; color: var(--verde); }
.nav-badge { position: absolute; top: -5px; right: -5px; background: var(--oro); color: white; font-size: 9px; font-weight: 700; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; }
.nav-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--oro); }
.nav-saludo {
  font-size: 14px; font-weight: 500; color: var(--verde);
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--linea); background: var(--crema);
  transition: background .2s, border-color .2s;
  white-space: nowrap;
}
.nav-saludo:hover { background: var(--marfil-2); border-color: var(--oro); }
.nav-burger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 42px; background: none; border: none; cursor: pointer; padding: 0; margin-left: auto; }
.nav-burger span { display: block; width: 24px; height: 2px; background: var(--verde); border-radius: 2px; transition: all .25s; margin: 0 auto; }
.nav-burger.abierto span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.abierto span:nth-child(2) { opacity: 0; }
.nav-burger.abierto span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* HERO */
.hero { position: relative; min-height: 88vh; display: flex; align-items: center; overflow: hidden; color: white; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; animation: kenburns 26s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.05); } to { transform: scale(1.14); } }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(20,28,22,.86) 0%, rgba(20,28,22,.45) 46%, rgba(20,28,22,.08) 75%), linear-gradient(to bottom, transparent 60%, rgba(20,28,22,.5) 100%); }
.hero-fade { position: absolute; inset: auto 0 0; height: 140px; background: linear-gradient(transparent, var(--marfil)); z-index: 2; pointer-events: none; }
.hero-inner { position: relative; z-index: 3; width: min(1280px, calc(100% - 48px)); margin: auto; display: grid; grid-template-columns: 1.3fr .85fr; gap: 40px; align-items: center; }
.hero-copy { max-width: 560px; }
.hero-copy .eyebrow { color: rgba(255,255,255,.78); margin-bottom: 18px; }
.hero h1 { color: white; margin-bottom: 20px; }
.hero-copy > p { font-size: clamp(16px,1.6vw,19px); color: rgba(255,255,255,.85); max-width: 420px; margin-bottom: 30px; line-height: 1.55; }
.hero-cta { display: inline-flex; align-items: center; gap: 10px; background: var(--verde); color: white; padding: 15px 28px; border-radius: 999px; font-size: 15px; font-weight: 500; transition: background .25s, transform .15s; box-shadow: 0 8px 28px rgba(20,28,22,.4); }
.hero-cta:hover { background: var(--verde-claro); transform: translateY(-2px); }
.hero-stats { display: flex; gap: 32px; margin-top: 38px; flex-wrap: wrap; }
.hero-stat { display: flex; align-items: center; gap: 9px; }
.hero-stat .hs-icon { font-size: 17px; }
.hero-stat .hs-num { font-size: 19px; font-weight: 600; color: white; }
.hero-stat .hs-label { font-size: 12px; color: rgba(255,255,255,.7); }

.hero-weather { background: rgba(28,38,30,.62); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-lg); padding: 24px 26px; color: white; }
.hw-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-size: 14px; color: rgba(255,255,255,.85); }
.hw-main { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.hw-temp { font-size: 52px; font-weight: 300; line-height: 1; font-family: var(--sans); }
.hw-icon { font-size: 38px; }
.hw-desc { font-size: 13px; color: rgba(255,255,255,.7); }
.hw-meta { display: flex; gap: 18px; font-size: 12px; color: rgba(255,255,255,.65); margin-top: 8px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.hw-signals { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.hw-signal { display: flex; gap: 12px; align-items: flex-start; }
.hw-signal .sig-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.hw-signal strong { display: block; font-size: 13px; font-weight: 500; color: white; }
.hw-signal span { font-size: 12px; color: rgba(255,255,255,.6); }
.hw-link { margin-top: 18px; font-size: 13px; color: var(--oro); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }

/* MOOD */
.mood-section { background: var(--crema); border-radius: var(--r-lg); margin-top: -50px; position: relative; z-index: 5; padding: 32px 36px; box-shadow: var(--shadow); }
.mood-section h3 { font-size: 22px; margin-bottom: 22px; }
.mood-grid { display: grid; grid-template-columns: repeat(8,1fr); gap: 12px; }
.mood-item { display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; transition: transform .2s; }
.mood-item:hover { transform: translateY(-3px); }
.mood-circle { width: 60px; height: 60px; border-radius: 50%; background: var(--marfil-2); display: grid; place-items: center; font-size: 24px; transition: background .25s, box-shadow .25s; }
.mood-item:hover .mood-circle { background: var(--arena); box-shadow: 0 8px 22px rgba(194,164,111,.32); }
.mood-label { font-size: 12px; color: var(--texto); font-weight: 500; }

/* CARRUSEL HOY */
.hoy-section { padding-top: 52px; }
.hoy-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px,1fr); gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.hoy-card { scroll-snap-align: start; cursor: pointer; }
.hoy-img { position: relative; height: 170px; border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.hoy-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.16,.6,.3,1); }
.hoy-card:hover .hoy-img img { transform: scale(1.06); }
.hoy-tag { position: absolute; bottom: 10px; right: 10px; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 4px 9px; border-radius: 6px; background: var(--verde); color: white; }
.hoy-tag.manana { background: var(--arena); color: var(--verde-osc); }
.hoy-tag.buendia { background: rgba(95,122,107,.92); color: white; }
.hoy-tag.agenda { background: rgba(47,62,52,.92); color: white; }
.hoy-card h4 { font-family: var(--serif); font-size: 18px; margin-bottom: 3px; }
.hoy-loc { font-size: 13px; color: var(--muted); }
.hoy-time { font-size: 12px; color: var(--musgo); font-weight: 500; margin-top: 2px; }
.hoy-link { font-size: 13px; color: var(--oro-osc); font-weight: 600; margin-top: 8px; }
a.hoy-card { display: block; }
a.hoy-card:hover .hoy-link { color: var(--verde); }

/* MAPA + HISTORIA */
.mapa-historia { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: start; }
.mapa-vivo-box { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); background: var(--marfil-2); }
.mapa-vivo-box h3 { padding: 22px 26px 0; }
.mapa-canvas { position: relative; margin-top: 14px; }
.mapa-canvas img { width: 100%; display: block; }
.mapa-fallback { width: 100%; aspect-ratio: 3/2; display: grid; place-items: center; background: linear-gradient(135deg,#cdd9c4,#a9c19d); color: var(--verde-osc); text-align: center; padding: 30px; }
.mapa-pin { position: absolute; transform: translate(-50%,-50%); width: 36px; height: 36px; border-radius: 50%; background: var(--verde); color: white; display: grid; place-items: center; font-size: 16px; border: 2.5px solid white; box-shadow: 0 4px 14px rgba(36,48,41,.4); cursor: pointer; transition: transform .25s cubic-bezier(.34,1.56,.64,1), background .2s; animation: pinDrop .5s cubic-bezier(.34,1.56,.64,1) both; }
.mapa-pin .pin-icon { line-height: 1; }
.mapa-pin:hover { transform: translate(-50%,-50%) scale(1.25); background: var(--oro); z-index: 10; }
@keyframes pinDrop { from { opacity: 0; transform: translate(-50%,-160%) scale(.6); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
.mapa-legend { display: flex; gap: 16px; padding: 16px 26px; flex-wrap: wrap; background: var(--crema); }
.mapa-legend span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }

.historia-col { display: flex; flex-direction: column; gap: 22px; }
.historia-card, .diario-card { background: var(--crema); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--linea); }
.historia-card h3 { font-size: 21px; margin-bottom: 16px; }
.historia-img { height: 150px; border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.historia-img img { width: 100%; height: 100%; object-fit: cover; }
.historia-card p { font-size: 14px; color: var(--texto); line-height: 1.6; margin-bottom: 14px; }
.historia-link { font-size: 13px; color: var(--musgo); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--linea); border-radius: 999px; transition: all .2s; }
.historia-link:hover { background: var(--verde); color: white; border-color: var(--verde); }
.diario-card { display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: center; }
.diario-thumb { width: 90px; height: 90px; border-radius: var(--r); overflow: hidden; }
.diario-thumb img { width: 100%; height: 100%; object-fit: cover; }
.diario-body h3 { font-size: 18px; margin-bottom: 8px; }
.diario-body p { font-size: 13px; margin-bottom: 8px; color: var(--texto); line-height: 1.55; }
.diario-link { font-size: 12px; color: var(--musgo); font-weight: 600; }

/* PROYECTOS CON RAÍZ */
.proyectos-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px,1fr); gap: 22px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.proy-buscador { margin-bottom: 26px; }
.proy-search-box { position: relative; max-width: 460px; margin-bottom: 16px; }
.proy-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .55; }
#proyBuscar { width: 100%; padding: 13px 18px 13px 44px; border: 1px solid var(--linea); border-radius: 999px; background: var(--crema); font-family: 'Jost', sans-serif; font-size: 15px; color: var(--tinta); transition: all .2s; }
#proyBuscar:focus { outline: none; border-color: var(--oro); background: #fff; box-shadow: 0 2px 12px rgba(194,164,111,.15); }
.proy-filtros { display: flex; gap: 9px; flex-wrap: wrap; }
.proy-filtro { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--linea); background: transparent; color: var(--verde); font-family: 'Jost', sans-serif; font-size: 13px; cursor: pointer; transition: all .2s; white-space: nowrap; }
.proy-filtro:hover { border-color: var(--oro); }
.proy-filtro.activo { background: var(--verde); color: #fff; border-color: var(--verde); }
.proy-vacio { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 15px; }
.proy-vacio button { background: none; border: none; color: var(--oro-osc); font-weight: 600; cursor: pointer; text-decoration: underline; font-size: 15px; }
.proyecto-card { scroll-snap-align: start; position: relative; background: var(--crema); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--linea); transition: transform .4s cubic-bezier(.16,.6,.3,1), box-shadow .4s; }
/* Enlace que cubre la ficha (menos el pie con el botón) para ir a la web */
.proyecto-link-overlay { position: absolute; inset: 0 0 62px 0; z-index: 1; cursor: pointer; }
.proyecto-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; position: relative; z-index: 2; }
.btn-raiz { font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--verde); background: #fff; border: 1px solid var(--linea); border-radius: 999px; padding: 8px 14px; cursor: pointer; transition: all .2s; white-space: nowrap; }
.btn-raiz:hover { background: var(--verde); color: #fff; border-color: var(--verde); transform: translateY(-1px); }
.btn-raiz.echada { background: var(--oro); color: var(--verde-osc); border-color: var(--oro); }
.btn-raiz:disabled { cursor: default; }
.proyecto-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.proyecto-img { height: 160px; overflow: hidden; position: relative; }
.proyecto-estado {
  position: absolute; top: 12px; left: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  padding: 5px 11px; border-radius: 999px;
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  z-index: 2;
}
.proyecto-estado.adherido { background: rgba(47,62,52,.9); color: #fff; }
.proyecto-estado.recomendado { background: rgba(194,164,111,.95); color: var(--verde-osc); }
/* Corazón de favorito sobre la foto */
.btn-fav { position: absolute; top: 12px; right: 12px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255,255,255,.85); backdrop-filter: blur(8px); color: var(--verde); display: grid; place-items: center; cursor: pointer; transition: all .2s; box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.btn-fav svg { width: 19px; height: 19px; transition: fill .2s; }
.btn-fav:hover { transform: scale(1.12); background: #fff; }
.btn-fav.activo { color: #d64545; }
.btn-fav.activo svg { fill: #d64545; }
.btn-fav.aviso { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.proyecto-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.16,.6,.3,1); }
.proyecto-card:hover .proyecto-img img { transform: scale(1.06); }
.proyecto-body { padding: 18px 20px 20px; }
.proyecto-body h4 { font-family: var(--serif); font-size: 19px; margin-bottom: 3px; }
.proyecto-loc { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.proyecto-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.proyecto-tag { font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 4px 9px; border-radius: 5px; background: var(--marfil-2); color: var(--musgo); }
.proyecto-sello { display: flex; gap: 3px; }
.proyecto-sello .leaf { font-size: 14px; filter: saturate(1.1); }
.proyecto-sello .leaf.empty { opacity: .25; filter: grayscale(1); }

.territorio-section { background: var(--crema); border-block: 1px solid var(--linea); }

/* FOOTER */
footer { background: var(--verde-osc); color: white; padding: 56px 24px 36px; text-align: center; margin-top: 40px; }
.footer-brand { font-family: var(--serif); font-size: 30px; color: var(--oro); margin-bottom: 8px; }
.footer-sub { font-size: 13px; color: rgba(255,255,255,.55); line-height: 1.8; }
.footer-sub a { color: rgba(255,255,255,.55); }
.footer-divider { width: 40px; height: 1px; background: rgba(255,255,255,.18); margin: 22px auto; }
.footer-links { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,.6); transition: color .2s; }
.footer-links a:hover { color: var(--oro); }
.footer-copy { font-size: 12px; color: rgba(255,255,255,.32); }

/* TABBAR MÓVIL */
.tabbar { display: none; }

/* SCROLL REVEAL */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 1s cubic-bezier(.16,.6,.3,1), transform 1s cubic-bezier(.16,.6,.3,1); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-reveal-delay="1"] { transition-delay: .08s; }
[data-reveal][data-reveal-delay="2"] { transition-delay: .16s; }
[data-reveal][data-reveal-delay="3"] { transition-delay: .24s; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-weather { max-width: 380px; }
  .mood-grid { grid-template-columns: repeat(4,1fr); }
  .mapa-historia { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nav-burger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--crema);
    border-bottom: 1px solid var(--linea);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    margin-left: 0;
    padding: 8px 0;
  }
  .nav-links.abierto { display: flex; }
  .nav-links a { padding: 15px 24px; font-size: 16px; border-bottom: 1px solid var(--linea); }
  .nav-links a:last-child { border-bottom: none; }
  .nav { padding: 0 20px; }
}
@media (max-width: 768px) {
  .hero { min-height: 78vh; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; background: var(--crema); border-top: 1px solid var(--linea); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); }
  .tabbar a.center { margin-top: -22px; }
  .tabbar a.center .tb-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--verde); color: white; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(36,48,41,.35); }
  .tabbar .tb-icon { font-size: 20px; }
  body { padding-bottom: 70px; }
}
@media (max-width: 560px) {
  .mood-grid { grid-template-columns: repeat(4,1fr); gap: 16px 8px; }
  .section { padding: 48px 0; }
  .container { width: calc(100% - 32px); }
  .hero-stats { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
