/* VigoVello · estilo minimalista en tonos pastel
   Fondos verdemar suaves, un solo color de acento (azul ría) y líneas de 1px. */
:root {
  color-scheme: light;
  --papel: #dde5e3;        /* fondo general: gris verdemar pastel */
  --superficie: #eef2f0;   /* cabecera, paneles, ventanas (claro, sin llegar a blanco) */
  --blanco: var(--superficie); /* alias: lo usa el editor */
  --papel-2: #d2dbd8;      /* hundidos, marcadores de imagen, campos */
  --borde: #c2cdca;        /* todas las líneas */
  --tinta: #24323a;        /* texto principal */
  --tinta-suave: #5b6b71;  /* texto secundario */
  --acento: #2f7286;       /* azul ría */
  --acento-fuerte: #1e5a6b;/* azul del logo */
  --acento-suave: rgba(47, 114, 134, .14);
  --sobre-acento: #f4f7f6; /* texto sobre botones de acento */
  --foto-fondo: #2b363c;   /* fondo tras las fotos en el visor */
  --sombra: 0 12px 32px rgba(36, 50, 58, .18);
  --radio: 8px;
  --cab-alto: 64px;
  --panel-ancho: 380px;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --serif: var(--sans);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--papel);
  color: var(--tinta);
  font: 15px/1.55 var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acento); text-underline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
::selection { background: var(--acento-suave); }

/* ---------- Cabecera ---------- */
.cabecera {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  height: var(--cab-alto);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px;
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
}
.marca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { flex: none; width: 36px; height: 36px; display: block; }
.marca h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.subtitulo { margin: 0; font-size: 12px; color: var(--tinta-suave); }
.controles { display: flex; align-items: center; gap: 12px; }
.filtro { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tinta-suave); }
.filtro select {
  font: 500 13px var(--sans); color: var(--tinta);
  background: var(--papel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235b6b71' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 6px 28px 6px 10px; appearance: none;
}
.filtro select option { background: var(--superficie); color: var(--tinta); }
.contador { font-size: 13px; color: var(--tinta-suave); white-space: nowrap; font-variant-numeric: tabular-nums; }
.btn-texto {
  background: none; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 6px 12px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.btn-texto:hover { border-color: var(--acento); color: var(--acento); }

/* ---------- Selector de idioma ---------- */
.idioma { position: relative; }
.btn-idioma {
  display: flex; align-items: center; gap: 7px;
  background: none; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 5px 9px 5px 7px; font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
.btn-idioma:hover, .btn-idioma[aria-expanded="true"] { border-color: var(--acento); }
.btn-idioma .chevron { color: var(--tinta-suave); }
.bandera { display: inline-flex; width: 21px; height: 14px; border-radius: 2px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(36, 50, 58, .15); }
.bandera svg { width: 100%; height: 100%; display: block; }
.menu-idioma {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 1100;
  min-width: 170px; margin: 0; padding: 4px; list-style: none;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.menu-idioma[hidden] { display: none; }
.menu-idioma button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 6px; background: none;
  font-size: 13px; text-align: left;
}
.menu-idioma button:hover, .menu-idioma button:focus-visible { background: var(--papel-2); outline: none; }
.menu-idioma button[aria-checked="true"] { color: var(--acento); font-weight: 600; }

/* ---------- Mapa ---------- */
#mapa {
  position: fixed; top: var(--cab-alto); left: 0; right: 0; bottom: 0;
  background: var(--papel);
  transition: right .2s ease;
}
body.con-panel #mapa { right: var(--panel-ancho); }
/* Mapa base con un tinte pastel verdemar: deja el protagonismo a los puntos */
.teselas-pastel { filter: grayscale(1) sepia(.35) hue-rotate(130deg) saturate(.55) contrast(.86) brightness(1.03); }
.leaflet-container { font-family: var(--sans); background: var(--papel); }
.leaflet-bar { border: 1px solid var(--borde) !important; box-shadow: none !important; border-radius: var(--radio) !important; overflow: hidden; }
.leaflet-bar a { background: var(--superficie) !important; color: var(--tinta) !important; border-bottom-color: var(--borde) !important; }
.leaflet-bar a:hover { background: var(--papel-2) !important; }
.leaflet-control-attribution { background: rgba(238, 242, 240, .85) !important; color: var(--tinta-suave); }
.leaflet-control-attribution a { color: var(--acento); }

.punto {
  fill: var(--acento); fill-opacity: .9;
  stroke: var(--superficie); stroke-opacity: 1;
  transition: fill-opacity .15s;
}
.punto:hover { fill-opacity: 1; }
.leaflet-tooltip {
  background: var(--tinta); color: var(--superficie); border: 0; border-radius: 6px;
  font-size: 12px; font-weight: 500; padding: 4px 8px; box-shadow: none;
}
.leaflet-tooltip-top::before { border-top-color: var(--tinta); }

/* Puntos cuya ubicación no está confirmada: huecos y con borde discontinuo */
.punto.punto-sin-confirmar {
  fill: var(--superficie); fill-opacity: .9;
  stroke: var(--acento); stroke-dasharray: 3 2;
}
.punto.punto-sin-confirmar:hover { fill: var(--acento-suave); fill-opacity: 1; }
.punto-propuesta { fill: var(--tinta); fill-opacity: 1; stroke: var(--superficie); }

.leyenda {
  position: fixed; left: 12px; bottom: 28px; z-index: 800;
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 12px; font-size: 12px; color: var(--tinta-suave);
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
}
.leyenda > span { display: flex; align-items: center; gap: 8px; }
.ley-punto { width: 10px; height: 10px; border-radius: 50%; background: var(--acento); display: inline-block; }
.ley-punto.ley-sin { background: transparent; border: 1.5px dashed var(--acento); }

/* ---------- Panel ---------- */
.panel {
  position: fixed; top: var(--cab-alto); right: 0; bottom: 0; z-index: 900;
  width: var(--panel-ancho);
  background: var(--superficie);
  border-left: 1px solid var(--borde);
  overflow-y: auto;
  padding: 20px 20px 32px;
}
.panel[hidden] { display: none; }
.panel-cab { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.panel-cab h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.panel-resumen { margin: 2px 0 18px; font-size: 13px; color: var(--tinta-suave); }
.btn-icono {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--superficie); border: 1px solid var(--borde); font-size: 13px; line-height: 1;
}
.btn-icono:hover { border-color: var(--acento); color: var(--acento); }

.rejilla {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.miniatura { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.miniatura img, .miniatura .sin-imagen {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radio); background: var(--papel-2);
  transition: opacity .15s;
}
.miniatura .sin-imagen { display: flex; }
.miniatura:hover img, .miniatura:hover .sin-imagen { opacity: .8; }
.miniatura .pie { display: block; margin-top: 6px; font-size: 12px; color: var(--tinta-suave); font-variant-numeric: tabular-nums; }

.sin-imagen {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px;
  padding: 12px; text-align: center;
  background: var(--papel-2); border: 1px dashed var(--borde);
  color: var(--tinta-suave);
}
.sin-imagen span { font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--tinta); }
.sin-imagen small { font-size: 11px; }

/* ---------- Capas (visor y "acerca de") ---------- */
.capa { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; }
.capa[hidden] { display: none; }
.capa-fondo { position: absolute; inset: 0; background: rgba(36, 50, 58, .55); backdrop-filter: blur(2px); }
.capa-cerrar { position: absolute; top: 12px; right: 12px; z-index: 2; }

.visor-caja {
  position: relative; margin: 0; width: min(1000px, 100%); max-height: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; overflow: hidden;
}
.visor-imagen { background: var(--foto-fondo); display: grid; place-items: center; min-height: 320px; }
.visor-imagen img { display: block; max-width: 100%; max-height: 80vh; object-fit: contain; }
.visor-imagen .sin-imagen { width: 100%; height: 100%; min-height: 420px; border: 0; border-radius: 0; background: var(--foto-fondo); }
.visor-imagen .sin-imagen span { color: #e8ece9; }
.visor-imagen .sin-imagen small { color: #a9b6b9; }
.visor-caja figcaption { padding: 56px 24px 24px; overflow-y: auto; max-height: 80vh; }
.visor-caja h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.meta { margin: 0 0 14px; font-size: 13px; color: var(--acento); font-weight: 500; }
#visor-desc { margin: 0; font-size: 14px; }
#visor-desc[hidden] { display: none; }
.aviso-ubicacion {
  display: inline-block; margin: -6px 0 14px; padding: 3px 10px;
  font-size: 12px; color: var(--tinta-suave);
  border: 1px dashed var(--borde); border-radius: 999px;
}
.aviso-ubicacion[hidden] { display: none; }
.btn-proponer { margin-top: 14px; }
.credito:empty { display: none; }
.credito { margin: 20px 0 0; padding-top: 12px; border-top: 1px solid var(--borde); font-size: 12px; color: var(--tinta-suave); }
.enlace-origen {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 13px; font-weight: 500; text-decoration: none;
}
.enlace-origen:hover { text-decoration: underline; }
.enlace-origen[hidden] { display: none; }
.visor-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--borde); background: rgba(238, 242, 240, .92);
}
.visor-nav svg { width: 14px; height: 14px; }
.visor-nav:hover { border-color: var(--acento); color: var(--acento); }
.visor-ant { left: 12px; }
.visor-sig { left: calc(100% - 300px - 48px); }
.visor-nav[hidden] { display: none; }

.acerca-caja {
  position: relative; width: min(520px, 100%);
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; padding: 28px;
}
.acerca-caja h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.acerca-caja p { font-size: 14px; color: var(--tinta); }

/* ---------- Proponer ubicación ---------- */
.propuesta {
  position: fixed; z-index: 1500; top: calc(var(--cab-alto) + 12px); left: 50%; transform: translateX(-50%);
  width: min(480px, calc(100% - 32px));
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--sombra);
}
.propuesta[hidden] { display: none; }
.propuesta > p { margin: 0 0 10px; font-size: 14px; font-weight: 500; }
.propuesta-campo { display: block; font-size: 12px; color: var(--tinta-suave); }
.propuesta-campo textarea {
  display: block; width: 100%; margin-top: 4px; padding: 7px 9px; resize: vertical;
  font: 14px var(--sans); color: var(--tinta); background: var(--papel-2);
  border: 1px solid var(--borde); border-radius: var(--radio);
}
.propuesta-nota { margin: 8px 0 0; font-size: 12px; color: var(--tinta-suave); }
.propuesta-botones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.btn-principal {
  border: 1px solid var(--acento); background: var(--acento); color: var(--sobre-acento);
  border-radius: var(--radio); padding: 6px 14px; font-size: 13px; font-weight: 600;
}
.btn-principal:hover { filter: brightness(1.08); }
#propuesta-detalle[hidden] ~ .propuesta-botones .btn-principal { opacity: .4; pointer-events: none; }
body.proponiendo #mapa { cursor: crosshair; }
body.proponiendo .leaflet-container { cursor: crosshair; }

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  :root { --cab-alto: 104px; }
  .cabecera { flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; padding: 10px 16px; }
  .logo { width: 32px; height: 32px; }
  .controles { justify-content: space-between; gap: 8px; }
  .contador { font-size: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
  .leyenda { bottom: 20px; }
  body.con-panel .leyenda { display: none; }
  .filtro span { display: none; }
  .filtro select { max-width: 130px; }
  body.con-panel #mapa { right: 0; bottom: 55vh; }
  .panel { top: auto; left: 0; width: auto; height: 55vh; padding: 16px; border-left: 0; border-top: 1px solid var(--borde); border-radius: 12px 12px 0 0; }
  .visor-caja { grid-template-columns: 1fr; overflow-y: auto; }
  .visor-imagen img { max-height: 55vh; }
  .visor-imagen .sin-imagen { min-height: 260px; }
  .visor-caja figcaption { padding: 16px 18px 20px; max-height: none; }
  .visor-nav { top: 130px; }
  .visor-sig { left: auto; right: 12px; }
}
@media (max-width: 400px) {
  .contador { display: none; }
}
