/* =========================================================================
   Valdeconejos en Fiestas — système de design "Álbum de recuerdos"
   Esthétique : carnet de souvenirs / papier kraft, cadres polaroïd, doré.
   Priorité lisibilité (public âgé) : grandes polices, fort contraste,
   cibles tactiles larges. Mobile-first, 100% responsive.
   ========================================================================= */

/* ---- Polices ---- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,900;1,9..144,500&family=Caveat:wght@500;700&family=Bitter:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ---- Variables ---- */
:root {
  --paper:      #f3e9d2;   /* fond papier crème */
  --paper-2:    #eaddc0;   /* papier plus foncé */
  --kraft:      #c8a87a;   /* kraft */
  --ink:        #34291c;   /* encre brun foncé */
  --ink-soft:   #5c4a34;   /* texte secondaire */
  --gold:       #b8860b;   /* doré */
  --gold-soft:  #d8b04a;
  --olive:      #7c7b46;   /* vert olive / sauge */
  --terra:      #b1592f;   /* terre cuite accent */
  --sky:        #6f93a8;   /* bleu fané */
  --white:      #fffdf6;

  --font-display: 'Fraunces', Georgia, serif;
  --font-hand:    'Caveat', 'Segoe Script', cursive;
  --font-body:    'Bitter', Georgia, serif;

  /* Échelle typo généreuse pour lecteurs âgés */
  --fs-base: 1.22rem;      /* ~19.5px */
  --fs-lg:   1.45rem;
  --fs-xl:   2.1rem;
  --fs-2xl:  3rem;
  --radius: 4px;
  --shadow-paper: 0 2px 4px rgba(52,41,28,.12), 0 12px 28px rgba(52,41,28,.16);
  --tape: rgba(214,196,150,.65);
}

/* ---- Reset léger ---- */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.5), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(200,168,122,.25), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terra); }

/* ---- Conteneur ---- */
.wrap { width: min(1120px, 92vw); margin-inline: auto; }
.section { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.section--tight { padding: clamp(1.5rem,4vw,3rem) 0; }

/* =========================================================================
   En-tête / Navigation
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--paper) 70%, rgba(243,233,210,.85));
  border-bottom: 2px solid var(--kraft);
  backdrop-filter: blur(4px);
}
.nav {
  display: flex; align-items: center; gap: 1rem;
  width: min(1120px,92vw); margin-inline: auto;
  padding: .55rem 0; flex-wrap: wrap;
}
.brand {
  font-family: var(--font-hand);
  font-size: 2.1rem; font-weight: 700;
  color: var(--gold); line-height: 1; text-decoration: none;
  letter-spacing: .5px; margin-right: auto;
}
.brand small { display:block; font-family: var(--font-body); font-size:.7rem; letter-spacing:3px; text-transform:uppercase; color: var(--ink-soft); font-weight:600;}

.nav-toggle {
  display: none; background: var(--olive); color: var(--white);
  border: none; border-radius: var(--radius); padding: .6rem .9rem;
  font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.nav-links {
  display: flex; gap: .3rem; align-items: center; flex-wrap: wrap;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  display: block; text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  padding: .55rem .85rem; border-radius: var(--radius);
  transition: background .2s, color .2s;
}
.nav-links a:hover, .nav-links a.active { background: var(--gold); color: var(--white); }

/* Sélecteur de langue */
.lang-switch { display: flex; gap: 0; border: 2px solid var(--gold); border-radius: 999px; overflow: hidden; margin-left:.4rem; }
.lang-switch button {
  background: transparent; border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  padding: .35rem .8rem; color: var(--ink); line-height: 1;
}
.lang-switch button.active { background: var(--gold); color: var(--white); }

@media (max-width: 820px) {
  .nav-toggle { display: block; order: 3; }
  .lang-switch { order: 2; margin-left:auto; }
  .nav-links {
    order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch;
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 480px; padding-bottom: .5rem; }
  .nav-links a { font-size: 1.3rem; padding: .85rem 1rem; border-bottom: 1px dashed var(--kraft); }
}

/* =========================================================================
   Typographie de contenu
   ========================================================================= */
h1,h2,h3 { font-family: var(--font-display); line-height: 1.1; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: var(--fs-2xl); font-weight: 900; }
h2 { font-size: var(--fs-xl); font-weight: 600; }
h3 { font-size: var(--fs-lg); font-weight: 600; }
p { margin: 0 0 1.1em; }
.lead { font-size: var(--fs-lg); color: var(--ink-soft); }
.hand { font-family: var(--font-hand); color: var(--gold); }

/* Titre de section décoré */
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { display: inline-block; position: relative; }
.section-title h2::after {
  content: ""; display: block; width: 70%; height: 4px; margin: .4rem auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
}
.section-title .kicker {
  font-family: var(--font-hand); font-size: 1.7rem; color: var(--terra); display: block;
}

/* =========================================================================
   Boutons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  padding: .85rem 1.6rem; border-radius: 999px; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .2s;
  min-height: 52px; /* cible tactile */
}
.btn-primary { background: var(--gold); color: var(--white); box-shadow: var(--shadow-paper); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--gold); }
.btn-ghost:hover { background: var(--gold); color: var(--white); }

/* =========================================================================
   Cartes "papier" / polaroïd / scotch
   ========================================================================= */
.paper-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-paper); padding: clamp(1.4rem,3vw,2.2rem);
  position: relative;
}
.paper-card::before { /* scotch washi en haut */
  content:""; position:absolute; top:-14px; left:50%; transform:translateX(-50%) rotate(-2deg);
  width: 120px; height: 28px; background: var(--tape);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* Polaroïd */
.polaroid {
  background: var(--white); padding: 12px 12px 54px; border-radius: 2px;
  box-shadow: var(--shadow-paper); display: inline-block;
}
.polaroid img { border-radius: 1px; }
.polaroid figcaption {
  font-family: var(--font-hand); font-size: 1.4rem; color: var(--ink-soft);
  text-align: center; padding-top: .5rem;
}
.tilt-l { transform: rotate(-2.5deg); }
.tilt-r { transform: rotate(2.5deg); }

/* =========================================================================
   Hero / Couverture
   ========================================================================= */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(2rem,6vw,4.5rem) 0 clamp(3rem,8vw,6rem);
  background:
    linear-gradient(180deg, rgba(243,233,210,.2), rgba(200,168,122,.35)),
    var(--paper-2);
  border-bottom: 3px double var(--kraft);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; }
.hero h1 {
  font-family: var(--font-hand); font-weight: 700; color: var(--gold);
  font-size: clamp(3.4rem, 11vw, 7rem); line-height: .9; margin-bottom: .2em;
  text-shadow: 2px 3px 0 rgba(255,253,246,.8);
}
.hero .dates {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(1.6rem,4vw,2.4rem);
  color: var(--ink); letter-spacing: 1px;
}
.hero .subtitle { font-size: var(--fs-lg); color: var(--ink-soft); max-width: 34ch; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Collage photo couverture */
.collage { position: relative; min-height: 340px; }
.collage .polaroid { position: absolute; width: 62%; }
.collage .p1 { top: 0; left: 0; z-index: 2; }
.collage .p2 { top: 24%; right: 0; z-index: 3; width: 58%; }
.collage .p3 { bottom: -4%; left: 14%; z-index: 4; width: 50%; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  /* Sur mobile : collage en flux (les enfants absolus collapseraient le conteneur). */
  .collage { min-height: 0; max-width: 480px; margin-inline: auto;
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
  .collage .polaroid,
  .collage .p1, .collage .p2, .collage .p3 {
    position: static; width: 45%; min-width: 150px; }
  .collage .p1 { width: 60%; }
}

/* =========================================================================
   Programme — frise par jour
   ========================================================================= */
.day-card { margin-bottom: 2.5rem; }
.day-card h3 {
  font-family: var(--font-hand); font-size: 2.3rem; color: var(--terra);
  border-bottom: 3px solid var(--gold-soft); padding-bottom: .2rem; margin-bottom: 1.2rem;
}
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: start;
  padding: .9rem 0; border-bottom: 1px dashed var(--kraft);
}
.timeline .hour {
  font-family: var(--font-display); font-weight: 900; font-size: 1.25rem;
  color: var(--gold); background: var(--white); border-radius: var(--radius);
  padding: .25rem .4rem; text-align: center; box-shadow: var(--shadow-paper);
}
.timeline .what { font-size: var(--fs-base); }
.timeline .what strong { color: var(--ink); }

@media (max-width: 540px) {
  .timeline li { grid-template-columns: 1fr; gap: .2rem; }
  .timeline .hour { justify-self: start; }
}

/* =========================================================================
   Grilles & galerie
   ========================================================================= */
.grid { display: grid; gap: 1.6rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }
.gallery .polaroid { width: 100%; cursor: pointer; transition: transform .2s; }
.gallery .polaroid:hover { transform: scale(1.03) rotate(0) !important; z-index: 5; }
.gallery .polaroid img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
@media (max-width: 820px) { .gallery { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; max-width:380px; margin-inline:auto; } }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(28,22,14,.92); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 4vw;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 82vh; border: 10px solid var(--white); border-radius: 2px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lightbox .close { position: absolute; top: 18px; right: 24px; font-size: 3rem; color: var(--white); background:none; border:none; cursor:pointer; line-height:1; }

/* =========================================================================
   Repas / tarifs / contacts
   ========================================================================= */
.price-tag {
  display: inline-flex; flex-direction: column; align-items: center;
  background: var(--terra); color: var(--white); border-radius: 50%;
  width: 120px; height: 120px; justify-content: center;
  font-family: var(--font-display); box-shadow: var(--shadow-paper);
  transform: rotate(-6deg);
}
.price-tag .amount { font-size: 2.4rem; font-weight: 900; line-height: 1; }
.price-tag .day { font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }

.contact-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .8rem; }
.contact-list a {
  display: flex; align-items: center; gap: .8rem; text-decoration: none;
  background: var(--white); border-radius: var(--radius); padding: 1rem 1.2rem;
  box-shadow: var(--shadow-paper); color: var(--ink); font-size: var(--fs-lg);
  min-height: 60px;
}
.contact-list a strong { color: var(--terra); font-family: var(--font-display); }
.contact-list .tel { margin-left: auto; font-weight: 700; color: var(--gold); font-family: var(--font-display); }

.alert-note {
  background: rgba(184,134,11,.12); border-left: 5px solid var(--gold);
  padding: 1rem 1.3rem; border-radius: var(--radius); font-size: var(--fs-base);
}

/* =========================================================================
   Mots de bienvenue (saludos)
   ========================================================================= */
.letter {
  background: var(--white); box-shadow: var(--shadow-paper); border-radius: var(--radius);
  padding: clamp(1.6rem,4vw,2.6rem); position: relative; border-top: 6px solid var(--olive);
}
.letter { margin: 0 auto 2rem; max-width: 760px; }
/* le .wrap interne ne doit pas se ré-élargir au-delà du panneau papier */
.letter .wrap { width: 100%; max-width: none; }
.letter h3 { color: var(--olive); font-size: var(--fs-xl); }
.letter .signature { font-family: var(--font-hand); font-size: 1.8rem; color: var(--ink-soft); text-align: right; margin-top: 1rem; }
.viva { font-family: var(--font-display); font-weight: 900; color: var(--terra); font-size: 1.3rem; text-align: center; letter-spacing: .5px; }

/* Crédit photo discret */
.credit { text-align: center; font-size: .95rem; color: var(--ink-soft); font-style: italic; margin-top: 1.5rem; }

/* =========================================================================
   Pied de page
   ========================================================================= */
.site-footer {
  background: var(--ink); color: var(--paper); text-align: center;
  padding: 2.5rem 0; margin-top: 3rem;
}
.site-footer .brand { color: var(--gold-soft); }
.site-footer a { color: var(--gold-soft); }
.site-footer small { display: block; color: rgba(243,233,210,.7); margin-top: .6rem; font-size: .95rem; }

/* =========================================================================
   Utilitaires i18n & animations
   ========================================================================= */
/* Pattern A : attribut VIDE (texte dans 2 spans frères) -> show/hide par CSS.
   Pattern B : attribut REMPLI (texte injecté par JS) -> jamais masqué ici. */
[data-lang-es=""], [data-lang-fr=""] { display: none; }
body.lang-es [data-lang-es=""] { display: revert; }
body.lang-fr [data-lang-fr=""] { display: revert; }
/* variantes inline */
span[data-lang-es=""], span[data-lang-fr=""],
a[data-lang-es=""], a[data-lang-fr=""],
strong[data-lang-es=""], strong[data-lang-fr=""] { display: none; }
body.lang-es span[data-lang-es=""], body.lang-es a[data-lang-es=""], body.lang-es strong[data-lang-es=""] { display: inline; }
body.lang-fr span[data-lang-fr=""], body.lang-fr a[data-lang-fr=""], body.lang-fr strong[data-lang-fr=""] { display: inline; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Accessibilité focus */
a:focus-visible, button:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
.skip-link { position:absolute; left:-999px; top:0; background:var(--gold); color:#fff; padding:.6rem 1rem; z-index:200; }
.skip-link:focus { left:8px; top:8px; }

/* =========================================================================
   Couverture pleine photo (accueil) — panoramique du village
   ========================================================================= */
.cover-hero {
  position: relative;
  min-height: 80vh;
  display: flex; align-items: center;
  margin-top: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-paper);
  background-image:
    linear-gradient(90deg, rgba(28,19,10,.74) 0%, rgba(28,19,10,.46) 45%, rgba(28,19,10,.10) 100%),
    url('../assets/img/panorama_pueblo.jpg');
  background-size: cover;
  background-position: center;
}
.cover-hero .wrap { padding: 3rem 0; }
.cover-hero .cover-inner { max-width: 48ch; }
.cover-hero .hand { color: var(--gold-soft); text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.cover-hero h1 { color: #fff; text-shadow: 0 3px 16px rgba(0,0,0,.55); margin: .2rem 0; }
.cover-hero .dates { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.55); }
.cover-hero .subtitle { color: rgba(255,253,246,.94); text-shadow: 0 1px 8px rgba(0,0,0,.5); max-width: 42ch; }
.cover-hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.75); }
.cover-hero .btn-ghost:hover { background: rgba(255,255,255,.16); }
@media (max-width: 720px) {
  .cover-hero {
    min-height: 72vh;
    background-image:
      linear-gradient(180deg, rgba(28,19,10,.35) 0%, rgba(28,19,10,.72) 100%),
      url('../assets/img/panorama_pueblo.jpg');
  }
  .cover-hero .cover-inner { max-width: none; }
}
