:root {
  color-scheme: dark;
  --ink: #0b0c09;
  --ink-soft: #14150f;
  --paper: #ded0b4;
  --paper-bright: #f1e7d3;
  --moss: #84925e;
  --moss-bright: #aab77b;
  --ember: #c9843b;
  --line: rgba(222, 208, 180, 0.22);
  --max: 1180px;
  font-family: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .12;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--paper-bright);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: .98;
}
h1 { font-size: clamp(3.2rem, 8vw, 7.8rem); max-width: 10ch; margin-bottom: 1.5rem; }
h2 { font-size: clamp(2.7rem, 5vw, 5.6rem); margin-bottom: 1.25rem; }
h3 { color: var(--paper-bright); font-size: 1.25rem; line-height: 1.2; margin-bottom: .75rem; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--paper); color: var(--ink); padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header {
  position: fixed;
  z-index: 50;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 2rem), 980px);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .65rem .5rem 1.25rem;
  border: 1px solid rgba(241, 231, 211, .22);
  border-radius: 999px;
  background: rgba(11, 12, 9, .78);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .32);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; font-weight: 700; }
nav { display: flex; align-items: center; gap: 1.75rem; }
nav a { text-decoration: none; font-size: .93rem; font-weight: 600; }
nav a:hover { color: var(--paper-bright); }
.menu-button { display: none; border: 0; background: transparent; padding: .75rem; }
.menu-button span:not(.sr-only) { display: block; width: 25px; height: 1px; background: var(--paper); margin: 6px 0; }

.hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  align-content: end;
  padding: 11rem max(1rem, calc((100vw - var(--max))/2)) 7.5rem;
  isolation: isolate;
}
.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("assets/cabeceira-xincana-sen-texto.webp") center / cover no-repeat;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(5,6,4,.94) 0%, rgba(5,6,4,.76) 42%, rgba(5,6,4,.18) 72%), linear-gradient(0deg, var(--ink) 0%, transparent 48%);
}
.hero-copy { width: min(720px, 100%); }
.hero-date { display: flex; align-items: baseline; gap: .55rem; color: var(--paper-bright); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 2.4vw, 2rem); margin-bottom: 1.15rem; }
.hero-date span { color: var(--ember); font-size: 1.25em; }
.eyebrow { color: var(--moss-bright); text-transform: uppercase; letter-spacing: .15em; font-weight: 700; font-size: .78rem; margin-bottom: 1rem; }
.lede { max-width: 620px; color: var(--paper-bright); font-size: clamp(1.08rem, 2vw, 1.35rem); line-height: 1.55; }
.hero-actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 2rem; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: .85rem 1.4rem; text-decoration: none; font-weight: 700; }
.button-primary { background: var(--paper); color: var(--ink); }
.button-primary:hover { background: var(--paper-bright); }
.text-link { text-underline-offset: .3em; }
.event-strip {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  width: min(calc(100% - 2rem), var(--max));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(0,0,0,.3);
}
.event-strip div { padding: 1.25rem 1.6rem; border-right: 1px solid rgba(11,12,9,.2); }
.event-strip div:last-child { border-right: 0; }
.event-strip span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; opacity: .68; }
.event-strip strong { font-family: Georgia, serif; font-size: 1.18rem; }

.section { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; padding: 8rem 0; }
.intro { padding-top: 11rem; display: grid; grid-template-columns: 80px 1fr 1fr; gap: 2.5rem; align-items: start; }
.section-number { color: var(--ember); font-family: Georgia, serif; font-size: 1.2rem; padding-top: .6rem; }
.intro h2 { max-width: 8ch; }
.intro-copy { max-width: 550px; font-size: 1.12rem; }
.intro-copy p:first-child { color: var(--paper-bright); font-size: 1.32rem; }

/* Galería 2025 */
.gallery-section { border-top: 1px solid var(--line); }
.gallery-heading { max-width: 720px; }
.gallery-grid {
  width: min(100%, 900px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
}
.gallery-item {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(241,231,211,.14);
  padding: 0;
  margin: 0;
  background: #080906;
  cursor: zoom-in;
  overflow: hidden;
  border-radius: 2px;
  transform: translateZ(0);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  z-index: 0;
}
.gallery-item:hover, .gallery-item:focus-visible {
  transform: scale(1.035);
  border-color: rgba(241,231,211,.5);
  box-shadow: 0 16px 38px rgba(0,0,0,.48);
  z-index: 3;
}
.gallery-item::after {
  content: "+";
  position: absolute;
  right: .85rem;
  bottom: .85rem;
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(11,12,9,.76);
  border: 1px solid rgba(241,231,211,.32);
  color: var(--paper-bright);
  font-size: 1.2rem;
  transition: transform .2s ease, background .2s ease;
}
.gallery-item img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; transition: transform .35s ease, opacity .35s ease; }
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.09); opacity: .9; }
.gallery-item:hover::after, .gallery-item:focus-visible::after { transform: scale(1.08); background: var(--ember); color: var(--ink); }
.gallery-item:focus-visible { outline: 2px solid var(--paper-bright); outline-offset: 4px; }
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
.gallery-lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.gallery-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(1100px, calc(100vw - 2rem));
  max-height: calc(100svh - 2rem);
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0,0,0,.65);
  border: 1px solid rgba(241,231,211,.24);
}
.gallery-close {
  position: fixed;
  z-index: 202;
  right: 1.25rem;
  top: 1.25rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 1px solid rgba(241,231,211,.42);
  background: rgba(11,12,9,.88);
  color: white;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.gallery-close:hover { background: var(--ember); color: var(--ink); }
.gallery-nav {
  position: fixed;
  z-index: 202;
  top: 50%;
  transform: translateY(-50%);
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(241,231,211,.42);
  background: rgba(11,12,9,.78);
  color: var(--paper-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.gallery-prev { left: clamp(.65rem, 3vw, 2.5rem); }
.gallery-next { right: clamp(.65rem, 3vw, 2.5rem); }
.gallery-nav:hover,
.gallery-nav:focus-visible {
  background: var(--ember);
  color: var(--ink);
  border-color: var(--ember);
  transform: translateY(-50%) scale(1.07);
}
.gallery-nav:focus-visible { outline: 2px solid var(--paper-bright); outline-offset: 3px; }

.steps { border-top: 1px solid var(--line); }
.section-heading { max-width: 720px; margin-bottom: 3rem; }
.section-heading > p:last-child { max-width: 560px; font-size: 1.1rem; }
.step-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step-grid li { padding: 2rem 1.5rem 2.5rem; border-right: 1px solid var(--line); }
.step-grid li:last-child { border-right: 0; }
.step-index { display: inline-block; color: var(--ember); font-family: Georgia, serif; margin-bottom: 3.5rem; }
.step-grid p { color: #c0b69f; }
.note { display: flex; align-items: flex-start; gap: 1rem; margin-top: 2rem; padding: 1.4rem 1.6rem; background: rgba(132,146,94,.13); border-left: 3px solid var(--moss); }
.note span { color: var(--ember); }
.note p { margin: 0; }

.prizes { width: 100%; display: grid; grid-template-columns: minmax(320px, .95fr) 1.05fr; padding: 0; background: var(--paper); color: #27261f; }
.prize-art { min-height: 700px; overflow: hidden; background: var(--paper); display: flex; align-items: center; justify-content: center; padding: clamp(2rem, 5vw, 4.5rem); }
.prize-art img { width: min(100%, 640px); height: auto; object-fit: contain; box-shadow: 0 18px 48px rgba(0,0,0,.16); }
.prize-copy { padding: clamp(3rem, 7vw, 8rem); display: flex; flex-direction: column; justify-content: center; }
.prize-copy .eyebrow { color: #58613f; }
.prize-copy h2 { color: var(--ink); font-size: clamp(4rem, 9vw, 9rem); }
.prize-copy > p:not(.eyebrow) { max-width: 620px; font-size: 1.25rem; }
.prize-copy .small { font-size: .92rem !important; opacity: .72; }

.participate { text-align: center; padding-block: 9rem; }
.participate h2 { max-width: 900px; margin-inline: auto; }
.participate > p:not(.eyebrow) { max-width: 650px; margin: 0 auto 2rem; font-size: 1.15rem; }
.status { display: inline-flex; gap: .7rem; align-items: center; border: 1px solid var(--line); padding: .8rem 1.1rem; color: var(--paper-bright); }
.status span { width: 9px; height: 9px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 16px var(--ember); }

.faq { border-top: 1px solid var(--line); display: grid; grid-template-columns: .85fr 1.15fr; gap: 5rem; }
.faq-list { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; color: var(--paper-bright); font-family: Georgia, serif; font-size: 1.28rem; padding: 1.5rem 2.5rem 1.5rem 0; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: .25rem; color: var(--ember); font-family: sans-serif; }
details[open] summary::after { content: "−"; }
details p { color: #c0b69f; padding: 0 2.5rem 1.5rem 0; max-width: 650px; }

.site-footer { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; border-top: 1px solid var(--line); padding: 2.5rem 0 2rem; }
.footer-main {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  grid-template-areas:
    "title partners"
    "meta partners";
  column-gap: clamp(2.5rem, 7vw, 6rem);
  row-gap: .8rem;
  align-items: center;
}
.site-footer p { margin: 0; }
.footer-title { grid-area: title; max-width: 390px; }
.footer-partners {
  grid-area: partners;
  display: flex;
  align-items: flex-start !important;
  gap: 2rem;
}

.partner {
  display: grid;
  grid-template-rows: 1rem auto;
  align-content: start;
  align-items: start;
  justify-items: start;
  row-gap: .55rem;
  flex: 0 0 auto;
}

.partner span {
  display: block;
  height: 1rem;
  margin: 0;
  color: #9f9787;
  font-size: .66rem;
  font-weight: 700;
  line-height: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.partner img {
  display: block !important;
  height: auto !important;
  object-fit: contain;
  object-position: left center;
  flex: none;
}
.partner .logo-concello { width: 138px !important; max-width: 138px !important; max-height: 91px !important; }
.partner .logo-pidopapas { width: 175px !important; max-width: 175px !important; max-height: 46px !important; }
.footer-meta { grid-area: meta; color: var(--moss-bright); text-align: left; font-size: .86rem; }

@media (max-width: 850px) {
  .site-header { min-height: 58px; top: .75rem; }
  .menu-button { display: block; }
  nav { display: none; position: absolute; top: calc(100% + .6rem); left: 0; right: 0; background: rgba(11, 12, 9, .96); padding: 1.25rem; flex-direction: column; align-items: stretch; border: 1px solid var(--line); border-radius: 1.2rem; box-shadow: 0 16px 45px rgba(0,0,0,.4); }
  nav.open { display: flex; }
  .hero { padding-top: 9rem; padding-bottom: 9rem; }
  .hero::before { background: linear-gradient(90deg, rgba(5,6,4,.9), rgba(5,6,4,.5)), linear-gradient(0deg, var(--ink), transparent 60%); }
  .event-strip { grid-template-columns: 1fr; transform: translate(-50%, 58%); }
  .event-strip div { padding: .75rem 1.1rem; border-right: 0; border-bottom: 1px solid rgba(11,12,9,.18); display: flex; justify-content: space-between; gap: 1rem; }
  .intro { padding-top: 13rem; grid-template-columns: 45px 1fr; }
  .intro-copy { grid-column: 2; }
  .gallery-grid { width: min(100%, 720px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-grid { grid-template-columns: 1fr 1fr; }
  .step-grid li:nth-child(2) { border-right: 0; }
  .step-grid li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .prizes { grid-template-columns: 1fr; }
  .prize-art { min-height: auto; max-height: none; padding: 2rem 1.25rem 0; }
  .faq { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-main {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "partners" "meta";
    gap: 1.6rem;
  }
  .footer-partners { gap: 2rem; }
  .footer-meta { text-align: left; }

}

@media (max-width: 520px) {
  .brand span { font-size: .9rem; }
  h1 { font-size: clamp(3rem, 15vw, 5rem); }
  h2 { font-size: clamp(2.6rem, 13vw, 4.2rem); }
  .hero-art { background-position: 61% center; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .section { padding-block: 6rem; }
  .intro { padding-top: 12rem; grid-template-columns: 1fr; gap: 1rem; }
  .intro-copy { grid-column: 1; }
  .section-number { display: none; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .step-grid { grid-template-columns: 1fr; }
  .step-grid li { border-right: 0; border-bottom: 1px solid var(--line); }
  .step-grid li:last-child { border-bottom: 0; }
  .step-index { margin-bottom: 1.75rem; }
  .prize-copy { padding: 4rem 1.25rem; }
  .prize-copy h2 { font-size: 4.4rem; }
  .footer-partners { flex-direction: row; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
  .partner .logo-concello { width: 118px !important; max-width: 118px !important; }
  .partner .logo-pidopapas { width: 150px !important; max-width: 150px !important; }
  .gallery-nav { width: 2.8rem; height: 2.8rem; font-size: 2rem; background: rgba(11,12,9,.88); }
  .gallery-prev { left: .45rem; }
  .gallery-next { right: .45rem; }
  .gallery-lightbox img { max-width: calc(100vw - 5.8rem); }
}

@media (max-width: 390px) {
  .gallery-grid { grid-template-columns: 1fr; max-width: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body.lightbox-open { overflow: hidden; }
