/* Webmijas · estilo "pueblo blanco": cal, azul mediterráneo, terracota y buganvilla */

@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --cal: #fbf9f4;
  --white: #ffffff;
  --arena: #f3eadb;
  --anil: #0f6fa8;
  --anil-dark: #0b4f78;
  --anil-soft: #e2f2fa;
  --mar: #2bb3c8;
  --terracota: #c0603a;
  --terracota-dark: #9a4527;
  --buganvilla: #b3246b;
  --olivo: #6b7a3a;
  --ink: #1f2430;
  --muted: #5b6372;
  --line: #e6dfd2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 36, 48, .06), 0 8px 24px rgba(31, 36, 48, .07);
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cal);
  color: var(--ink);
  font: 17px/1.6 var(--font-body);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--anil); text-underline-offset: .18em; }
a:hover { color: var(--terracota-dark); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; color: var(--anil-dark); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--mar); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--anil); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

/* --- Cabecera --- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--anil-dark); }
.logo-mark { width: 40px; height: 40px; }
.logo-text { font-family: var(--font-head); font-size: 1.45rem; font-weight: 500; letter-spacing: -.02em; }
.logo-text b { color: var(--terracota); font-weight: 700; }

.header-inner { flex-wrap: wrap; }
.main-nav { order: 3; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 8px; width: calc(100% + 32px); }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; white-space: nowrap; }
.main-nav a { display: flex; align-items: center; padding: 7px 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; border-radius: 999px; }
.main-nav a:hover, .main-nav a[aria-current] { background: var(--anil-soft); color: var(--anil-dark); }
.lang-switch > summary::-webkit-details-marker { display: none; }
.flag { width: 21px; height: 15px; flex: none; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.header-search { display: none; }
.lang-switch { position: relative; margin-left: auto; }
.lang-switch > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 999px; font-weight: 700; color: var(--anil-dark); font-size: .9rem; }
.lang-switch > summary:hover { background: var(--anil-soft); }
.lang-switch ul { position: absolute; right: 0; top: calc(100% + 8px); list-style: none; margin: 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 170px; }
.lang-switch a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.lang-switch a:hover { background: var(--anil-soft); }
.lang-switch a[aria-current] { font-weight: 700; color: var(--anil); }

@media (min-width: 900px) {
  .header-inner { flex-wrap: nowrap; }
  .main-nav { order: 0; width: auto; margin: 0 0 0 12px; padding: 0; overflow: visible; }
  .nav-search { display: none; }
  .lang-switch { margin-left: 0; }
  .header-search { display: flex; margin-left: auto; align-items: center; background: var(--cal); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 14px; }
  .header-search input { border: 0; background: none; font: inherit; font-size: .9rem; width: 170px; padding: 6px 0; }
  .header-search input:focus { outline: none; }
  .header-search button { border: 0; background: var(--anil); color: #fff; border-radius: 999px; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; }
}

/* --- Migas --- */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 14px 16px 0; font-size: .88rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; color: var(--terracota); }
.breadcrumbs a { color: var(--muted); }

/* --- Hero --- */
.hero { position: relative; overflow: hidden; color: #fff; isolation: isolate; }
.hero-img { position: absolute; inset: 0; z-index: -2; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
/* Velo más oscuro a la izquierda, donde va el texto, para leerlo sobre fachadas blancas */
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .45) 45%, rgba(0, 0, 0, .1) 100%), linear-gradient(180deg, rgba(0, 0, 0, .2) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .3) 100%); }
.hero-home .hero-img img { object-position: center 70%; }
@media (max-width: 700px) { .hero::after { background: rgba(0, 0, 0, .5); } }
.hero-inner { padding: 72px 16px 88px; max-width: var(--wrap); }
.hero h1 { color: #fff; max-width: 15ch; text-shadow: 0 2px 18px rgba(0, 0, 0, .3); }
.hero .lead { font-size: 1.15rem; max-width: 56ch; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .4); }
.hero .eyebrow { color: #ffd9c2; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.hero-home .hero-inner { padding-top: 96px; padding-bottom: 120px; }
.hero-page .hero-inner { padding-top: 110px; padding-bottom: 64px; }
.hero::before { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 28px; z-index: 1; background: var(--cal); clip-path: ellipse(60% 100% at 50% 100%); }

.eyebrow { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--buganvilla); margin-bottom: .5em; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 65ch; }

.hero-search { display: flex; gap: 8px; max-width: 560px; background: #fff; padding: 6px; border-radius: 999px; box-shadow: var(--shadow); margin-top: 1.5rem; }
.hero-search input { flex: 1; min-width: 0; border: 0; font: inherit; padding: 10px 16px; border-radius: 999px; color: var(--ink); background: transparent; }
.hero-search input:focus { outline: none; }
.page-head .hero-search { border: 1px solid var(--line); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; background: var(--terracota); color: #fff; font: inherit; font-weight: 700; padding: 10px 22px; border-radius: 999px; text-decoration: none; transition: background .15s; }
.btn:hover { background: var(--terracota-dark); color: #fff; }
.btn-block { width: 100%; margin-top: 12px; }
.btn-map { background: var(--anil); }
.btn-map:hover { background: var(--anil-dark); }

/* --- Secciones --- */
.section { padding-top: 40px; padding-bottom: 40px; }
.section-tint { background: var(--arena); position: relative; }
.section-tint::before { content: ""; display: block; height: 10px; margin-top: -40px; margin-bottom: 30px; background: url("/static/img/azulejo.svg") repeat-x center / 10px 10px; opacity: .0; }
.section-title { display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ""; flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--terracota) 0 10px, transparent 10px 16px); opacity: .45; }
.page-head { padding-top: 28px; }

/* --- Núcleos --- */
.areas { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.area-card a { display: block; text-decoration: none; color: inherit; }
.arch { aspect-ratio: 4 / 5; border-radius: 999px 999px var(--radius) var(--radius); overflow: hidden; background: var(--anil-soft); box-shadow: var(--shadow); border: 6px solid #fff; }
.arch img, .arch .placeholder { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.area-card a:hover img { transform: scale(1.04); }
.area-card .tag { margin-top: 14px; }
.area-card h3 { font-size: 1.5rem; margin: 6px 0; }
.area-card p { color: var(--muted); font-size: .97rem; }
.urbs { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.urbs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; background: #fff; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 600; color: var(--anil-dark); }
.urbs a:hover { border-color: var(--terracota); color: var(--terracota-dark); }

/* --- Etiquetas y chips --- */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--terracota-dark); background: #fbe9df; padding: 3px 10px; border-radius: 999px; text-decoration: none; }
.chips ul { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; background: #fff; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.chip small { color: var(--muted); font-weight: 500; }
.chip:hover { border-color: var(--anil); color: var(--anil); }
.chip[aria-current] { background: var(--anil); border-color: var(--anil); color: #fff; }
.chip[aria-current] small { color: #d6ecf8; }
.chip-poi .i { color: var(--buganvilla); }

/* --- Tarjetas (comercios y lugares de interés intercalados) --- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-flow: dense; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(31, 36, 48, .08), 0 16px 32px rgba(31, 36, 48, .1); }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.card-media { aspect-ratio: 4 / 3; background: var(--anil-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.card h3 { margin: 4px 0 0; font-size: 1.22rem; }
.card-area { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: .88rem; margin: 0; }
/* Blog */
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.post-date { font-size: .82rem; font-weight: 700; color: var(--terracota-dark); }
.post .eyebrow a { color: inherit; text-decoration: none; }
.card-summary { color: var(--ink); font-size: .95rem; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-featured { outline: 2px solid #f2c7ae; }
.card-poi { background: linear-gradient(160deg, #fff 0%, #fdf3ee 100%); }
.card-poi .eyebrow { margin: 0; }
.card-poi .tag { background: #f8e1ee; color: var(--buganvilla); }
.card-poi .card-media { border-radius: 999px 999px 0 0; margin: 10px 10px 0; }
@media (min-width: 700px) {
  .card-wide { grid-column: span 2; }
  .card-wide .card-link { flex-direction: row; }
  .card-wide .card-media { flex: 0 0 52%; aspect-ratio: auto; min-height: 260px; margin: 12px; border-radius: 999px 999px var(--radius) var(--radius); }
  .card-wide .card-body { justify-content: center; padding: 28px 28px 28px 8px; }
  .card-wide h3 { font-size: 1.7rem; }
  .card-wide .card-summary { -webkit-line-clamp: 5; font-size: 1.02rem; }
}
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--mar), var(--anil)); }
.placeholder .i { width: 56px; height: 56px; opacity: .9; }
.ph-village { background: url("/static/img/village.svg") center / cover; }
.card-poi .placeholder { background: linear-gradient(135deg, #e48a62, var(--buganvilla)); }

/* --- Ficha --- */
.place-head { padding-top: 22px; }
.place-head h1 { margin-top: 10px; }
.place-area { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.open-state { display: inline-block; font-weight: 700; font-size: .9rem; padding: 4px 12px; border-radius: 999px; }
.open-state.is-open { background: #e6f2dd; color: #3f6a1f; }
.open-state.is-closed { background: #f6e3e3; color: #933; }
.place-hero { margin: 10px auto 0; }
.place-hero img { width: 100%; max-height: 560px; object-fit: cover; border-radius: 28px 28px var(--radius) var(--radius); box-shadow: var(--shadow); }
.place-hero figcaption, .gallery figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.place-grid { display: grid; gap: 32px; padding-top: 32px; padding-bottom: 48px; }
@media (min-width: 960px) { .place-grid { grid-template-columns: minmax(0, 1fr) 360px; } }
.place-info { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; align-self: start; border-top: 5px solid var(--anil); }
@media (min-width: 960px) { .place-info { position: sticky; top: 88px; } }
.place-poi .place-info { border-top-color: var(--buganvilla); }
.place-info h2 { font-size: 1.3rem; }
.place-info h3 { display: flex; align-items: center; gap: 6px; font-size: 1.05rem; margin-top: 18px; }
.info-row { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; font-size: .95rem; overflow-wrap: anywhere; }
.info-row .i { color: var(--terracota); margin-top: 3px; }
.info-row strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hours { width: 100%; border-collapse: collapse; font-size: .92rem; }
.hours th, .hours td { text-align: left; padding: 5px 0; border-bottom: 1px dashed var(--line); font-weight: 500; }
.hours td { text-align: right; }
.hours tr.today { color: var(--anil); font-weight: 700; }
.hours tr.today th, .hours tr.today td { font-weight: 700; }

.prose { max-width: 70ch; font-size: 1.05rem; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { margin: 1.5em 0; padding: .5em 1.2em; border-left: 4px solid var(--terracota); background: #fff; border-radius: 0 10px 10px 0; }
.prose img { border-radius: var(--radius); }
.prose-wrap { display: grid; gap: 28px; }
@media (min-width: 960px) { .prose-wrap { grid-template-columns: minmax(0, 1fr) 380px; } }

.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }

/* --- Mapa --- */
.map-box { position: relative; min-height: 220px; border-radius: var(--radius); overflow: hidden; background: var(--anil-soft) url("/static/img/village.svg") center / cover; display: grid; place-items: center; text-align: center; padding: 24px; margin-top: 16px; }
.map-box::before { content: ""; position: absolute; inset: 0; background: rgba(251, 249, 244, .55); }
/* Solo el aviso previo (botón y texto): una vez cargado, el interior es de Leaflet */
.map-box:not(.is-loaded) > * { position: relative; }
.map-notice { font-size: .82rem; color: var(--anil-dark); margin: 8px 0 0; }
.map-box.is-loaded { display: block; padding: 0; height: 420px; background: none; text-align: left; }
.map-box.is-loaded::before { display: none; }
.place-info .map-box.is-loaded { height: 260px; }
.map-popup a { font-weight: 700; }
/* Juntas blancas entre teselas con escalado de pantalla fraccionario (125 %, 150 %…) en
   Chromium: cada tesela solapa medio píxel con la siguiente. Sin plus-lighter, que en el
   solape sumaría brillo y dibujaría la junta. */
.map-box.leaflet-container img.leaflet-tile { mix-blend-mode: normal; width: 256.5px !important; height: 256.5px !important; }

/* --- 404 --- */
.not-found { text-align: center; padding-bottom: 80px; }
.not-found .lead { margin: 0 auto 1.5em; }
.big-404 { font-family: var(--font-head); font-size: clamp(5rem, 18vw, 10rem); color: var(--terracota); line-height: 1; margin: 0; opacity: .85; }
.empty { color: var(--muted); font-size: 1.1rem; }

/* --- Pie --- */
.site-footer { background: var(--arena); color: var(--ink); margin-top: 56px; position: relative; padding-bottom: 24px; }
.site-footer .wave { height: 26px; background: var(--cal); clip-path: ellipse(60% 100% at 50% 0); }
.footer-grid { display: grid; gap: 28px; padding-top: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { color: var(--anil-dark); font-size: 1.1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: var(--anil-dark); text-decoration: none; }
.site-footer a:hover { color: var(--terracota-dark); text-decoration: underline; }
.site-footer p { font-size: .95rem; }
.copy { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; font-size: .85rem; color: var(--muted); }
.langs { columns: 2; }
.langs a { display: inline-flex; align-items: center; gap: 8px; }

/* --- Lightbox --- */
.lightbox { position: fixed; inset: 0; background: rgba(10, 20, 45, .9); display: grid; place-items: center; z-index: 200; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 90vh; max-width: 95vw; width: auto; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .map-box, .hero-search { display: none !important; } .hero { color: var(--ink); } }

/* Ajustes: etiquetas a su ancho */
.card-body .tag, .card-body .eyebrow, .area-card .tag, .place-head .tag { align-self: flex-start; }
.map-notice { background: rgba(255, 255, 255, .85); padding: 2px 10px; border-radius: 8px; }
