/* Posada Mellante — casa de costa cántabra: cal, mar y el sol del logo */
:root {
  --mar: #004253;        /* azul mar del logo: titulares, secciones oscuras */
  --mar-hondo: #00303d;
  --ola: #1e7f8a;        /* turquesa oscurecido para enlaces (contraste AA) */
  --agua: #30a7a2;       /* turquesa del logo, solo decorativo */
  --sol: #e9be65;        /* amarillo del logo: acción principal */
  --cal: #f3f4f0;        /* fondo, pared encalada */
  --cal-2: #e7eae4;
  --tinta: #1d2f35;      /* texto */
  --gris: #56676c;
  --linea: #cdd5d2;
  --wa: #25d366;
  --wrap: 1200px;
  --head-h: 76px;
  --display: 'Sofia Sans Condensed', 'Arial Narrow', sans-serif;
  --text: 'Literata', Georgia, serif;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); }
body {
  margin: 0;
  background: var(--cal);
  color: var(--tinta);
  font: 400 17px/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ola); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--mar); }
p { margin: 0 0 1.1em; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; color: var(--mar); line-height: 1.02; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(44px, 6vw, 76px); font-weight: 800; }
h2 { font-size: clamp(34px, 4vw, 52px); }
h3 { font-size: 28px; }
h4 { font-size: 22px; }
strong { font-weight: 600; }
ul, ol { padding-left: 1.2em; margin: 0 0 1.1em; }
table { border-collapse: collapse; width: 100%; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--mar); color: #fff; padding: 10px 14px; z-index: 1000; }
.skip-link:focus { left: 10px; top: 10px; }
:focus-visible { outline: 2px solid var(--ola); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.measure { max-width: 68ch; }
.lead { font-size: 20px; line-height: 1.6; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  font: 700 18px/1 var(--display); letter-spacing: .01em; text-decoration: none;
  padding: 15px 24px; border-radius: var(--radius); border: 2px solid transparent; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-sol { background: var(--sol); color: var(--mar); }
.btn-sol:hover { background: #f1cd84; color: var(--mar); }
.btn-ghost { border-color: rgba(255,255,255,.75); color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--mar); }
.btn-sea { background: var(--mar); color: #fff; }
.btn-sea:hover { background: var(--mar-hondo); color: #fff; }
.btn-line { border-color: var(--mar); color: var(--mar); }
.btn-line:hover { background: var(--mar); color: #fff; }
.btn-wa { background: var(--wa); color: #08321a; }
.btn-wa:hover { background: #1fbe5b; color: #08321a; }
.icon { flex: none; }

/* ---------- Cabecera ---------- */
#site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(243, 244, 240, .96);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--linea);
}
.nav-row { display: flex; align-items: center; gap: 28px; min-height: var(--head-h); }
.logo img { height: 56px; width: auto; }
#site-header nav { margin-left: auto; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.menu a {
  font: 600 18px/1 var(--display); color: var(--mar); text-decoration: none;
  padding: 8px 0; border-bottom: 2px solid transparent; display: block;
}
.menu a:hover { border-bottom-color: var(--agua); }
.menu a[aria-current="page"] { border-bottom-color: var(--mar); }
.nav-wa { padding: 10px 16px; font-size: 17px; }
.nav-toggle { display: none; }

/* ---------- Cabecera de página ---------- */
.page-head { position: relative; min-height: 340px; display: flex; align-items: flex-end; color: #fff; background: var(--mar); overflow: hidden; }
.page-head-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,32,40,.78) 0%, rgba(0,32,40,.25) 55%, rgba(0,32,40,.05) 100%); }
.page-head .wrap { position: relative; z-index: 1; width: 100%; padding-bottom: 40px; padding-top: 80px; }
.page-head h1 { color: #fff; margin: 0; }
.page-head p { font-size: 20px; margin: 10px 0 0; font-style: italic; opacity: .92; }
.page-head--plain { min-height: 220px; }

/* ---------- Secciones ---------- */
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section-dark { background: var(--mar); color: #e6eff0; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark a:not(.btn) { color: var(--sol); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.split-7-5 { grid-template-columns: 7fr 5fr; }

/* ---------- Portada ---------- */
.hero { position: relative; height: calc(100svh - var(--head-h)); min-height: 520px; max-height: 920px; overflow: hidden; background: var(--mar); color: #fff; }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.4s ease; }
.hero-slide.is-active { opacity: 1; animation: drift 10s ease-out both; }
@keyframes drift { from { transform: scale(1.07); } to { transform: scale(1); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,30,38,.82) 0%, rgba(0,30,38,.35) 45%, rgba(0,30,38,0) 75%); z-index: 1; }
.hero-text { position: absolute; z-index: 2; left: 0; right: 0; bottom: 64px; }
.hero-text h1 { color: #fff; font-size: clamp(64px, 11vw, 168px); line-height: .86; letter-spacing: -.02em; margin: 0 0 22px; }
.hero-text h1 span { display: block; }
.hero-text p { font-size: clamp(18px, 1.8vw, 22px); max-width: 34ch; margin: 0 0 28px; color: #f1f5f4; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-controls { position: absolute; z-index: 3; right: 24px; bottom: 64px; display: flex; gap: 10px; }
.hero-arrow { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.7); background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s, color .2s; }
.hero-arrow:hover { background: #fff; color: var(--mar); }
/* Entrada del titular: el único momento animado de la página */
.hero-text h1 span, .hero-text p, .hero-actions { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.hero-text h1 span:nth-child(2) { animation-delay: .12s; }
.hero-text p { animation-delay: .3s; }
.hero-actions { animation-delay: .42s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.intro h2 { max-width: 15ch; }
.facts { margin: 0; border-top: 2px solid var(--mar); }
.facts div { display: grid; grid-template-columns: 12.5rem 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--linea); }
.facts dt { font: 800 28px/1.05 var(--display); color: var(--mar); }
.facts dd { margin: 0; color: var(--gris); font-size: 16px; line-height: 1.5; }

.rooms-teaser { display: grid; grid-template-columns: 1.15fr 1fr; background: var(--mar); color: #e6eff0; }
.rooms-teaser-img { min-height: 520px; background-size: cover; background-position: center; }
.rooms-teaser-body { padding: 80px clamp(24px, 6vw, 88px); align-self: center; }
.rooms-teaser h2 { color: #fff; }
.price-from { list-style: none; padding: 0; margin: 28px 0 32px; }
.price-from li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.18); }
.price-from b { font: 800 30px/1 var(--display); color: var(--sol); white-space: nowrap; }
.price-from small { display: block; font-size: 14px; opacity: .75; }

.pueblo { position: relative; background: var(--mar-hondo) url('../img/2024/03/portada_pueblo.webp') center / cover no-repeat; color: #fff; padding: 140px 0; overflow: hidden; }
.pueblo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,30,38,0) 30%, rgba(0,30,38,.78) 62%); }
.pueblo .wrap { position: relative; min-height: 380px; }
.pueblo-text { margin-left: 54%; }
.pueblo-text h2 { color: #fff; }
.pueblo-text a { color: var(--sol); }
.postcards { position: absolute; left: 24px; top: 0; width: 48%; height: 100%; }
.postcard {
  position: absolute; width: min(300px, 62%); margin: 0; background: #fff; padding: 10px 10px 34px;
  box-shadow: 0 2px 4px rgba(0,0,0,.18), 0 16px 30px rgba(0,0,0,.35);
}
.postcard figcaption { position: absolute; left: 0; right: 0; bottom: 7px; text-align: center; color: var(--mar); font: italic 400 15px/1 var(--text); }
.postcard-1 { top: -30px; left: 2%; transform: rotate(-7deg); }
.postcard-2 { top: 40px; left: 36%; transform: rotate(5deg); z-index: 1; }
.postcard-3 { top: 220px; left: 12%; transform: rotate(-2deg); z-index: 2; }

.visit .split { align-items: stretch; }
.contact-list { list-style: none; margin: 0 0 28px; padding: 0; }
.contact-list li { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--linea); align-items: flex-start; }
.contact-list .icon { color: var(--agua); margin-top: 4px; }
.contact-list b { display: block; font: 700 20px/1.2 var(--display); color: var(--mar); }
.contact-list a { color: var(--tinta); }

/* Mapa con consentimiento */
.map-frame { position: relative; min-height: 420px; height: 100%; background: var(--cal-2); border-radius: var(--radius); overflow: hidden; }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-consent { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 28px; background: var(--cal-2) url('../img/thumbs/2024/03/05-Posada-desde-dron-1.jpg') center / cover; }
.map-consent::before { content: ""; position: absolute; inset: 0; background: rgba(231,234,228,.88); }
.map-consent > * { position: relative; }
.map-consent p { max-width: 36ch; margin: 0; font-size: 15px; color: var(--gris); }
.map-link { font-size: 15px; }

/* ---------- Habitaciones ---------- */
.prices { margin-top: 96px; }
.price-table { font-size: 17px; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 0 var(--linea); }
.price-table th, .price-table td { padding: 18px 22px; text-align: right; border-bottom: 1px solid var(--linea); }
.price-table thead th { background: var(--mar); color: #fff; font: 700 20px/1.1 var(--display); vertical-align: bottom; }
.price-table thead th small { display: block; font: italic 400 14px/1.3 var(--text); opacity: .8; margin-top: 4px; }
.price-table th[scope="row"], .price-table thead th:first-child { text-align: left; }
.price-table th[scope="row"] { font-weight: 600; color: var(--mar); }
.price-table td { font: 700 24px/1 var(--display); color: var(--tinta); font-variant-numeric: tabular-nums; }
.price-table tbody tr:last-child > * { border-bottom: 0; }
.price-notes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; margin-top: 32px; color: var(--gris); font-size: 16px; }
.price-notes h3 { font-size: 22px; }
.price-notes ul { list-style: none; padding: 0; margin: 0; }
.price-notes li { padding: 6px 0; }
.price-notes li b { color: var(--tinta); font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* Carrusel */
.carousel { position: relative; }
.carousel-track { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--cal-2); border-radius: var(--radius); }
.carousel-item { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.carousel-item.is-active { opacity: 1; z-index: 1; }
.carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.carousel-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.carousel-nav > button { background: none; border: 0; color: var(--mar); cursor: pointer; padding: 6px; display: grid; place-items: center; }
.carousel-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.carousel-dots button { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--mar); padding: 0; background: transparent; cursor: pointer; }
.carousel-dots button.is-active { background: var(--mar); }

/* ---------- Servicios ---------- */
.services { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 32px; border-top: 2px solid var(--mar); }
.services li { padding: 22px 0; border-bottom: 1px solid var(--linea); font: 700 23px/1.15 var(--display); color: var(--mar); }
.services li span { display: block; font: 400 15px/1.5 var(--text); color: var(--gris); margin-top: 6px; }

/* ---------- Galerías ---------- */
.gallery { columns: 3; column-gap: 20px; margin: 40px 0; }
.gallery-item { break-inside: avoid; margin: 0 0 20px; }
.gallery-item a { display: block; overflow: hidden; border-radius: var(--radius); background: var(--cal-2); }
.gallery-item img { width: 100%; transition: transform .5s ease; }
.gallery-item a:hover img { transform: scale(1.035); }
.gallery-item figcaption { font-size: 15px; color: var(--gris); padding-top: 8px; font-style: italic; }

/* ---------- Contacto ---------- */
.contact-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 40px; }
.contact-card { background: #fff; border-radius: var(--radius); padding: 24px; border: 1px solid var(--linea); }
.contact-card h2 { font-size: 24px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.contact-card h2 .icon { color: var(--agua); }
.contact-card p { margin: 0 0 12px; }
.contact-card p:last-child { margin: 0; }
.contact-card .big { font: 800 32px/1 var(--display); color: var(--mar); text-decoration: none; }

/* ---------- Blog ---------- */
.post-card { display: grid; grid-template-columns: 340px 1fr; gap: 40px; align-items: center; padding: 32px 0; border-bottom: 1px solid var(--linea); }
.post-card img { border-radius: var(--radius); }
.post-card h2 { font-size: 34px; }
.post-card h2 a { color: var(--mar); text-decoration: none; }
.post-meta { color: var(--gris); font-size: 15px; font-style: italic; margin-bottom: 12px; display: block; }
.article { max-width: 720px; margin: 0 auto; }
.article .post-image { border-radius: var(--radius); margin-bottom: 40px; width: 100%; }
.article p { font-size: 19px; line-height: 1.7; }

/* ---------- Legal ---------- */
.legal { max-width: 760px; font-size: 16px; }
.legal h2 { font-size: 32px; margin-top: 1.6em; }
.legal h3 { font-size: 24px; margin-top: 1.6em; }

/* ---------- Pie ---------- */
#site-footer { background: var(--cal-2); padding: 0 0 32px; }
.waves { display: block; width: 100%; height: 44px; fill: none; stroke-width: 5; stroke-linecap: round; }
.footer-waves { margin-bottom: 56px; background: var(--cal); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 48px; font-size: 16px; }
.footer-grid h2 { font-size: 22px; margin-bottom: 12px; }
.footer-brand img { height: 60px; width: auto; margin-bottom: 14px; }
.footer-brand p { color: var(--gris); max-width: 32ch; }
.footer-grid a { color: var(--tinta); }
.social a { margin-right: 14px; }
.footer-legal { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--linea); font-size: 14px; color: var(--gris); }
.footer-legal p { margin: 0; }
.footer-legal a { color: var(--gris); margin-left: 18px; }
.footer-legal a:first-child { margin-left: 0; }

.mobile-bar { display: none; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,24,30,.94); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; color: #fff; }
.lightbox img { max-width: 90vw; max-height: 84vh; margin: 0 auto; }
.lightbox figcaption { margin-top: 12px; font-style: italic; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; cursor: pointer; font-size: 52px; line-height: 1; padding: 10px 18px; opacity: .8; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: 8px; right: 8px; font-size: 44px !important; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .menu { gap: 18px; }
  .menu a { font-size: 17px; }
  .nav-wa span { display: none; }
  .nav-wa { padding: 10px 12px; }
}
@media (max-width: 900px) {
  :root { --head-h: 64px; }
  .logo img { height: 46px; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer;
    font: 700 18px/1 var(--display); color: var(--mar); padding: 10px 4px;
  }
  .nav-wa { display: none; }
  .menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; background: var(--cal); border-bottom: 1px solid var(--linea);
    padding: 8px 24px 20px; box-shadow: 0 16px 24px -16px rgba(0,40,50,.3);
  }
  .menu.is-open { display: flex; }
  .menu a { font-size: 24px; padding: 12px 0; border-bottom: 1px solid var(--linea); }
  .menu a[aria-current="page"] { color: var(--ola); border-bottom-color: var(--linea); }
  .section { padding: 64px 0; }
  .split, .split-7-5, .rooms-teaser, .price-notes { grid-template-columns: 1fr; gap: 40px; }
  .rooms-teaser { gap: 0; }
  .rooms-teaser-img { min-height: 300px; }
  .rooms-teaser-body { padding: 48px 24px; }
  .services { grid-template-columns: repeat(2, 1fr); }
  .gallery { columns: 2; }
  .pueblo { padding: 72px 0; }
  .pueblo::before { background: rgba(0,30,38,.62); }
  .pueblo .wrap { min-height: 0; }
  .postcards { display: none; }
  .pueblo-text { margin-left: 0; max-width: 60ch; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .post-card { grid-template-columns: 1fr; gap: 20px; }
  /* Barra fija de contacto en móvil */
  .mobile-bar {
    display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--mar); box-shadow: 0 -4px 14px rgba(0,0,0,.2); padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-bar a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 15px; color: #fff; text-decoration: none; font: 700 19px/1 var(--display); }
  .mobile-bar a + a { background: var(--wa); color: #08321a; }
  body { padding-bottom: 56px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .hero { min-height: 480px; height: calc(88svh - var(--head-h)); }
  .hero-text { bottom: 96px; }
  .hero-controls { left: 18px; right: auto; bottom: 28px; }
  .hero-arrow { width: 42px; height: 42px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .page-head { min-height: 260px; }
  .page-head .wrap { padding-bottom: 28px; }
  .page-head p { font-size: 17px; }
  .facts div { grid-template-columns: 1fr; gap: 4px; }
  .services { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: 1fr; }
  .price-table th, .price-table td { padding: 14px 12px; }
  .price-table td { font-size: 21px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-legal a { margin: 0 14px 0 0; }
  .lead { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
