@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f0eb;
  --card-bg:   #faf8f5;
  --border:    #ddd5c8;
  --text:      #2a1f15;
  --muted:     #7a6a5a;
  --accent:    #8b5e2a;
  --accent2:   #6b4218;
  --header-bg: #5c3a1a;
  --header-fg: #f5f0eb;
  --shadow:    rgba(60,40,10,0.08);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Opción "Foto": fondo por familia (su propia fotografía, difuminada) ── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(245, 240, 235, 0.74), rgba(245, 240, 235, 0.84)),
    var(--family-bg, none);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  filter: blur(16px) saturate(1.08);
  transform: scale(1.12);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
html.bg-photo body::before {
  opacity: 1;
}

/* ── Selector de fondo (piedra / foto) ── */
.bg-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: none; /* visible solo para el administrador (acceso con ?admin) */
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f5f0eb;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.bg-toggle--visible {
  display: inline-flex;
}
.bg-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.34);
}
.bg-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
  body::before { transition: none; }
  .bg-toggle { transition: none; }
}

a { color: var(--accent); }
a:hover { color: var(--accent2); }

/* ── Site header ── */
.site-header {
  position: relative;
  color: var(--header-fg);
  padding: 0;
  background:
    radial-gradient(120% 140% at 18% -10%, rgba(140,92,42,0.55) 0%, rgba(140,92,42,0) 55%),
    linear-gradient(135deg, #6b4520 0%, #5c3a1a 45%, #432a12 100%);
  box-shadow: 0 6px 24px -6px rgba(40,24,8,0.55), inset 0 -1px 0 rgba(0,0,0,0.25);
}
.site-header-inner { max-width: 960px; margin: 0 auto; padding: 0.75rem 1.5rem; display: flex; align-items: center; gap: 1.1rem; }
.header-logo-link { flex-shrink: 0; display: block; }
.header-logo { height: 60px; width: auto; flex-shrink: 0; display: block; background: #f5f0eb; padding: 0.5rem 0.8rem; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,0.18); }
.header-text { display: flex; flex-direction: column; min-width: 0; }
.header-titles { text-decoration: none; color: inherit; display: block; }
.header-titles:hover { color: inherit; }
.site-title { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em; }
.site-subtitle { font-size: 0.78rem; opacity: 0.62; margin-top: 0.08rem; }

@media (max-width: 600px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.85rem 1.25rem;
    padding-right: 4rem;
  }
  .header-text { width: 100%; display: flex; flex-direction: column; gap: 0.45rem; }
  .header-title-block { display: flex; flex-direction: column; }
  .header-logo { height: 50px; }
  .site-title { font-size: 1.5rem; }
}
.collector-link { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(245,240,235,0.35); transition: border-color 0.18s ease, opacity 0.18s ease; }
.collector-link:hover { color: inherit; opacity: 1; border-bottom-color: rgba(245,240,235,0.85); }

/* ── Page container ── */
.page { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ── Breadcrumb ── */
.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); margin-bottom: 1.8rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--muted); }

/* ── Home ── */
/* ── Hero banner ── */
.hero {
  position: relative;
  width: 100%;
  min-height: 340px;
  background: url('/eugi-landscape.jpg') center 55% / cover no-repeat;
  display: flex;
  align-items: flex-end;
  margin-bottom: 2.5rem;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(20,10,4,0.25) 0%,
    rgba(20,10,4,0.55) 60%,
    rgba(20,10,4,0.82) 100%
  );
}
.hero-inner {
  position: relative;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
}
.page-heading {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  background: linear-gradient(
    90deg,
    #f5d98a 0%,
    #e8b84b 15%,
    #fffbe6 30%,
    #e8c96a 45%,
    #f0a840 60%,
    #fffbe6 75%,
    #e8b84b 88%,
    #f5d98a 100%
  );
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: title-color-shift 5s linear infinite;
  text-shadow: none;
}
@keyframes title-color-shift {
  0%   { background-position: 0% center; }
  100% { background-position: 250% center; }
}
.intro-text {
  font-size: 0.95rem;
  color: rgba(245,240,235,0.82);
  line-height: 1.75;
  max-width: 58ch;
}
.intro-text strong { color: #fff; }
.geo-context {
  font-size: 0.82rem;
  color: rgba(245,240,235,0.68);
  line-height: 1.65;
  max-width: 58ch;
  margin-top: 0.75rem;
}
.geo-context strong { color: rgba(245,240,235,0.9); }

/* ── Collector popup ── */
.collector-trigger {
  font: inherit;
  color: #fff;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(245, 217, 138, 0.7);
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.collector-trigger:hover { color: #f5d98a; }

.collector-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 4, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 2rem;
  z-index: 1000;
  animation: popup-fade 0.25s ease;
}
.collector-popup-overlay[hidden] { display: none; }
@keyframes popup-fade { from { opacity: 0; } to { opacity: 1; } }

.collector-popup {
  position: relative;
  width: min(440px, 100%);
  max-height: 88vh;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(40, 25, 8, 0.35);
  margin-right: max(0px, calc((100vw - 960px) / 2));
  animation: popup-slide 0.3s ease;
  overflow: hidden;
}
@keyframes popup-slide {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}
.collector-popup-scroll { max-height: 88vh; overflow-y: auto; }
.collector-popup-close {
  position: absolute;
  top: 0.55rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent2);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.collector-popup-close:hover { background: #fff; }
.collector-popup-figure { margin: 0; }
.collector-popup-photo { width: 100%; display: block; }
.collector-popup-caption {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.5rem 1.5rem 0;
  font-style: italic;
}
.collector-popup-credit { display: block; font-style: normal; font-size: 0.72rem; }
.collector-popup-body { padding: 0.75rem 1.5rem 1.75rem; }
.collector-popup-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.collector-popup-body h3 {
  font-size: 1.5rem;
  line-height: 1.15;
  margin-bottom: 0.2rem;
  color: var(--text);
}
.collector-popup-dates {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1rem;
}
.collector-popup-body p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 0.85rem;
}
.collector-popup-link {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--accent2);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}
.collector-popup-link:hover { color: var(--accent); }
body.popup-open { overflow: hidden; }

@media (max-width: 720px) {
  .collector-popup-overlay { justify-content: center; padding: 1rem; }
  .collector-popup { margin-right: 0; width: 100%; }
}

/* ── Mobile family menu (home) ── */
.nav-toggle { display: none; }
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 4, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 1150;
  animation: popup-fade 0.2s ease;
}
.nav-overlay[hidden] { display: none; }
.family-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--card-bg);
  z-index: 1200;
  box-shadow: -8px 0 30px rgba(40, 25, 8, 0.3);
  display: flex;
  flex-direction: column;
  animation: menu-slide 0.28s ease;
}
.family-menu[hidden] { display: none; }
@keyframes menu-slide {
  from { transform: translateX(100%); }
  to   { transform: none; }
}
.family-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--header-bg);
  color: var(--header-fg);
}
.family-menu-title {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.family-menu-close {
  background: none;
  border: none;
  color: var(--header-fg);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}
.family-menu-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  overflow-y: auto;
  flex: 1;
}
.family-menu-list a {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.72rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(60, 40, 10, 0.06);
}
.family-menu-list a:hover { background: #f0e8de; }
.fm-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 1.6rem;
}
@media (max-width: 600px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    position: fixed;
    top: 0.85rem;
    right: 1rem;
    z-index: 1100;
    width: 44px;
    height: 44px;
    padding: 0 9px;
    background: rgba(92, 58, 26, 0.94);
    border: none;
    border-radius: 9px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }
  .nav-toggle span {
    display: block;
    height: 2.5px;
    width: 100%;
    background: var(--header-fg);
    border-radius: 2px;
  }
  body.popup-open .nav-toggle { display: none; }
}

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.7rem; margin-bottom: 1rem; }
.group-card { display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 2px; text-decoration: none; color: var(--text); transition: background 0.12s, border-left-color 0.12s; overflow: hidden; }
.group-card:hover { background: #f0e8de; border-left-color: var(--accent2); color: var(--text); }
.group-card-img { width: 100%; aspect-ratio: 4/3; background-size: cover; background-position: center; background-color: #e8e0d6; flex-shrink: 0; transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease; overflow: hidden; }
.group-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.group-card-img--empty { background-image: repeating-linear-gradient(45deg, #d8cfc4 0, #d8cfc4 1px, transparent 0, transparent 50%); background-size: 8px 8px; }
.group-card:hover .group-card-img { opacity: 0.94; transform: scale(1.08); }
.group-card-body { padding: 0.9rem 1.1rem; }
.group-num { font-size: 0.7rem; color: var(--accent); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.3rem; }
.group-name-es { font-size: 1rem; font-weight: 700; margin-bottom: 0.15rem; }
.group-name-others { font-size: 0.78rem; color: var(--muted); }

/* ── Language selector ── */
.group-header { margin-bottom: 1.8rem; }
.group-tag { font-size: 0.68rem; color: var(--accent); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.35rem; }
.group-title { font-size: 1.8rem; font-weight: 700; color: var(--accent2); line-height: 1.2; margin-bottom: 0.3rem; }
.group-title-others { display: flex; flex-direction: column; gap: 0.1rem; }
.gtitle-eu, .gtitle-fr { display: block; font-size: 0.88rem; color: var(--muted); }

.qr-box { background: #f0ebe3; border: 1px solid var(--border); border-radius: 3px; padding: 1rem 1.3rem; margin-bottom: 1.8rem; }
.qr-box-inner { display: flex; align-items: flex-start; gap: 1.2rem; flex-wrap: wrap; }
.qr-img { display: block; border: 1px solid var(--border); border-radius: 2px; flex-shrink: 0; }
.qr-text { display: flex; flex-direction: column; gap: 0.2rem; }
.qr-lang-line { display: block; }
.qr-lang-es { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.qr-lang-eu { font-size: 0.78rem; color: var(--muted); }
.qr-lang-fr { font-size: 0.78rem; color: var(--muted); }
.qr-url { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.qr-url code { background: rgba(0,0,0,0.06); padding: 0.1rem 0.35rem; border-radius: 2px; font-size: 0.82rem; word-break: break-all; }

.lang-list { display: flex; flex-direction: column; gap: 0.65rem; max-width: 380px; margin-bottom: 1.2rem; }
.lang-btn { display: block; padding: 1.2rem 1.5rem; background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 3px; text-decoration: none; color: var(--text); transition: background 0.12s, border-color 0.12s; }
.lang-btn:hover { background: #f0e8de; border-color: var(--accent); color: var(--text); }
.lang-name { font-size: 1.25rem; font-weight: 700; display: block; margin-bottom: 0.15rem; }
.lang-sub { font-size: 0.8rem; color: var(--muted); }

.photo-count { font-size: 0.8rem; color: var(--muted); }

/* ── Content page ── */
.lang-chip { display: inline-block; padding: 0.18rem 0.65rem; border-radius: 2px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 1.2rem; }
.content-title { font-size: 1.9rem; font-weight: 700; color: var(--accent2); margin-bottom: 1.3rem; line-height: 1.2; }
.content-text { font-size: 1rem; line-height: 1.82; color: var(--text); max-width: 68ch; margin-bottom: 1.2rem; }

.lang-switch { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.5rem; }
.lang-switch-label { margin-right: 0.2rem; }
.lang-switch-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--border); }
.lang-switch-link:hover { color: var(--accent2); border-color: var(--accent2); }

/* ── Página del coleccionista ── */
.collector-dates { font-size: 0.9rem; color: var(--muted); font-style: italic; margin-top: -0.9rem; margin-bottom: 1.6rem; }
.collector { display: flex; gap: 2rem; align-items: flex-start; margin-bottom: 1.6rem; }
.collector-figure { flex-shrink: 0; width: 220px; margin: 0; }
.collector-photo { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; border: 1px solid var(--border); box-shadow: 0 4px 16px -6px var(--shadow); background: #e8e0d6; }
.collector-photo--empty { display: flex; align-items: center; justify-content: center; text-align: center; background: repeating-linear-gradient(45deg, #ede6dc 0, #ede6dc 1px, #f3ede4 0, #f3ede4 9px); color: var(--muted); font-size: 0.82rem; letter-spacing: 0.04em; }
.collector-caption { margin-top: 0.55rem; font-size: 0.82rem; color: var(--muted); text-align: center; font-style: italic; }
.collector-credit { display: block; margin-top: 0.2rem; font-size: 0.72rem; font-style: normal; opacity: 0.8; }
.collector-bio { flex: 1; min-width: 0; }
.collector-bio .content-text:last-child { margin-bottom: 0; }
.collector-pending { color: var(--muted); font-style: italic; }
@media (max-width: 600px) {
  .collector { flex-direction: column; gap: 1.2rem; align-items: center; }
  .collector-figure { width: 180px; }
  .collector-bio { width: 100%; }
}

/* ── Gallery ── */
.gallery-heading { font-size: 0.88rem; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 1.2rem; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.4rem; margin-bottom: 1.5rem; }

/* Scroll-reveal: cards start invisible and nudged down */
.gallery-item {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.gallery-item.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Honour prefers-reduced-motion: skip the transform, just fade */
@media (prefers-reduced-motion: reduce) {
  .gallery-item {
    transform: none;
    transition: opacity 0.2s ease;
  }
}

/* Shimmer keyframes */
@keyframes photo-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
/* Fade-in for images once they paint */
@keyframes photo-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.photo-box {
  aspect-ratio: 4 / 3;
  background: linear-gradient(90deg, #d4cbbf 25%, #e6ddd3 50%, #d4cbbf 75%);
  background-size: 200% 100%;
  animation: photo-shimmer 1.6s ease-in-out infinite;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  padding: 0;
}
.photo-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.07) 10px, rgba(255,255,255,0.07) 20px);
  z-index: 0;
}

/* Clickable photo boxes */
.photo-box[data-lb-src] {
  cursor: zoom-in;
}

/* Zoom-in icon hint — tells visitors the image is tappable/clickable */
.photo-box[data-lb-src]::after {
  content: '';
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background-color: rgba(92, 58, 26, 0.62);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f0eb' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='5.5'/%3E%3Cline x1='14.4' y1='14.4' x2='20' y2='20'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 58%;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

/* Reveal on hover / keyboard focus (pointer devices) */
.photo-box[data-lb-src]:hover::after,
.photo-box[data-lb-src]:focus-within::after {
  opacity: 1;
}

/* Always-visible badge on touch/mobile (no fine pointer) */
@media (hover: none), (pointer: coarse) {
  .photo-box[data-lb-src]::after {
    opacity: 0.82;
  }
}

/* Image fills the box; fades in once the browser has painted it */
.photo-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  z-index: 1;
  display: block;
  animation: photo-fadein 0.35s ease;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Magnifier effect — image zooms gently inside its frame on hover */
.photo-box[data-lb-src]:hover img,
.photo-box[data-lb-src]:focus-within img {
  transform: scale(1.14);
}
@media (prefers-reduced-motion: reduce) {
  .group-card-img, .photo-box img { transition: none; }
  .group-card:hover .group-card-img,
  .photo-box[data-lb-src]:hover img { transform: none; }
}

/* No-photo cards don't need the shimmer — they never load an image */
.photo-nophoto {
  animation: none;
  background: #e8e0d6;
}

/* Description overlay at the bottom — works with or without image */
.photo-desc {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.28rem 0.5rem;
  background: rgba(20, 12, 4, 0.54);
  color: rgba(245, 240, 235, 0.95);
  font-size: 0.62rem;
  text-align: center;
  line-height: 1.3;
  z-index: 3;
  border-radius: 0 0 2px 2px;
}

/* Fallback number (shown when image fails to load) */
.photo-num {
  font-size: 1.7rem;
  font-weight: 700;
  color: rgba(90,70,45,0.55);
  z-index: 2;
  position: relative;
  line-height: 1;
}

.photo-nophoto {
  background: linear-gradient(135deg, #e8e2d9 0%, #ddd5c8 100%);
}
.photo-nophoto .photo-num { font-size: 0.82rem; color: rgba(90,70,45,0.45); }
.photo-nophoto .photo-desc {
  background: rgba(20, 12, 4, 0.18);
  color: rgba(70, 50, 25, 0.72);
}

/* Placeholder content block: icon + number + label */
.photo-placeholder-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  z-index: 2;
  padding-bottom: 1.5rem;
}

.photo-placeholder-icon {
  width: 2.8rem;
  height: 3.2rem;
  display: block;
  flex-shrink: 0;
}

.photo-placeholder-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(90, 70, 45, 0.60);
  letter-spacing: 0.04em;
  line-height: 1;
}

.photo-placeholder-label {
  font-size: 0.58rem;
  color: rgba(90, 70, 45, 0.45);
  letter-spacing: 0.03em;
  font-style: italic;
  text-align: center;
  line-height: 1.3;
}

/* Runtime fallback: hidden until the img fires onerror */
.photo-placeholder-fallback { display: none; }
img.photo-img-error { display: none !important; }
img.photo-img-error ~ .photo-placeholder-fallback { display: flex; }

/* Próximamente placeholder */
.photo-proximamente { background: #ede8e0; animation: none; }
.photo-proximamente-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(90, 65, 35, 0.5);
  z-index: 2;
  position: relative;
}

/* Trilingual caption — all 3 languages always shown */
.caption { margin-top: 0.5rem; font-size: 0.75rem; line-height: 1.55; }
.cap-eu { font-style: italic; display: block; color: #3b5a7a; }
.cap-es { display: block; color: var(--text); }
.cap-fr { display: block; color: var(--muted); }
.cap-credit { display: block; color: var(--muted); font-size: 0.68rem; margin-top: 0.25rem; opacity: 0.75; }

/* ── Lightbox ── */
.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10, 6, 2, 0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1.5rem;
  overscroll-behavior: contain;
}
.lb-overlay.is-open {
  display: flex;
}
.lb-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(90vw, 860px);
  width: 100%;
  max-height: 90vh;
}
.lb-img-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 10rem);
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.lb-caption {
  margin-top: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}
.lb-caption .cap-eu { font-style: italic; color: #8fb3d4; font-size: 0.82rem; display: block; margin-bottom: 0.2rem; }
.lb-caption .cap-es { color: rgba(245,240,235,0.9); font-size: 0.88rem; display: block; margin-bottom: 0.15rem; }
.lb-caption .cap-fr { color: rgba(200,190,175,0.75); font-size: 0.8rem; display: block; }
.lb-caption .cap-credit { color: rgba(180,165,145,0.65); font-size: 0.72rem; display: block; margin-top: 0.4rem; }
.lb-close {
  position: fixed;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: rgba(245,240,235,0.7);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  z-index: 9001;
  transition: color 0.12s;
}
.lb-close:hover { color: rgba(245,240,235,1); }

/* ── Shared ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 2.2rem 0; }

/* ── Navegación entre familias (anterior / siguiente) ── */
.family-nav { display: flex; gap: 0.8rem; margin-bottom: 1.5rem; }
.family-nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1.15rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 4px var(--shadow);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.family-nav-link:hover {
  background: #f0e8de;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 5px 14px var(--shadow);
}
.family-nav-prev { align-items: flex-start; text-align: left; }
.family-nav-next { align-items: flex-end; text-align: right; }
.family-nav-dir { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.family-nav-name { font-size: 0.95rem; color: var(--text); }
@media (max-width: 520px) {
  .family-nav { flex-direction: column; }
  .family-nav-next { align-items: flex-start; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .family-nav-link { transition: none; }
}

.back-link { font-size: 0.85rem; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--border); }
.back-link:hover { color: var(--accent2); border-color: var(--accent2); }
.site-footer-text { font-size: 0.78rem; color: var(--muted); line-height: 1.7; }
.site-legal { max-width: 960px; margin: 0 auto; padding: 1.6rem 1.5rem 2.4rem; text-align: center; }
.site-legal a { font-size: 0.74rem; letter-spacing: 0.06em; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; transition: color 0.18s ease, border-color 0.18s ease; }
.site-legal a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
  .group-grid { grid-template-columns: 1fr; }
  .content-title { font-size: 1.5rem; }
  .group-title { font-size: 1.4rem; }
  .lb-img { max-height: calc(90vh - 8rem); }
}

@media print {
  .cap-credit { opacity: 1; color: #111; }
}

/* ── Kintondare / Interreg POCTEFA logo ── */
.kintondare-logo-wrap {
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}
.kintondare-logo {
  max-height: 76px;
  width: auto;
  display: block;
  margin: 0;
  border-radius: 4px;
  opacity: 0.88;
  transition: opacity 0.18s ease;
}
.kintondare-logo:hover { opacity: 1; }
@media print {
  .kintondare-logo-wrap { margin-bottom: 0.6rem; }
}

.header-kintondare-logo {
  opacity: 0.96;
}

/* ── Cookie consent banner ── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 16px var(--shadow);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.cookie-text {
  flex: 1;
  font-size: 0.81rem;
  color: var(--muted);
  line-height: 1.65;
  min-width: 200px;
}
.cookie-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.44rem 1.25rem;
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease;
}
.cookie-btn:hover { background: var(--accent2); }
@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; align-items: flex-start; gap: 0.65rem; }
}
@media print {
  .cookie-banner { display: none; }
}
