@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

/* CSS principal para la boda */
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #fff;
  color: #222;
}

/* Hero section: imagen a pantalla completa */
.hero-section {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 1) 0%,
      rgba(255, 255, 255, 0) 62%
    ),
    url("../img/intro.jpeg") center center/cover no-repeat;
  z-index: 1;
}
.countdown-container {
  display: flex;
  justify-content: center;
  height: auto;
  background-color: #ffffffb3;
  padding: 20px 12px;
  font-family: "Montserrat", sans-serif;
  font-weight: 300;
  align-items: center;
  height: 120px;
}
.countdown {
  display: flex;
  align-items: center;
  gap: clamp(10px, 4vw, 36px);
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.countdown-number {
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1.6rem, 8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 2px;
  color: #1a1a1a;
  line-height: 1;
}
.countdown-label {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(0.5rem, 2vw, 0.65rem);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #1a1a1a;
}
.countdown-separator {
  font-size: clamp(1.2rem, 5vw, 2rem);
  color: #1a1a1a;
  font-weight: 200;
  line-height: 1;
  align-self: flex-start;
  margin-top: 3px;
}
.hero-date {
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  letter-spacing: 1px;
  text-align: center;
}

/* Location section */
.location-section {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.location-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../img/lloc.jpg") center center/cover no-repeat;
  z-index: 1;
}
.location-card {
  position: relative;
  z-index: 2;
  background: #f5f0e8;
  border-radius: 8px;
  padding: 48px 40px 40px;
  max-width: 380px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.location-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 20px;
  line-height: 1.1;
}
.location-desc {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95rem;
  color: #1a1a1a;
  line-height: 1.6;
  margin: 0 0 20px;
}
.location-address {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95rem;
  color: #1a1a1a;
  line-height: 1.6;
  margin: 0 0 32px;
}
.maps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #7a9a72;
  color: #fff;
  font-family: "Courier New", Courier, monospace;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
  letter-spacing: 0.5px;
}
.maps-btn:hover {
  background: #5e7d58;
}

/* Responsive para tablets y escritorio */
@media (min-width: 600px) {
  .hero-date {
    font-size: 1.2rem;
  }
  .countdown-container {
    bottom: 60px;
    padding: 48px 12px;
  }
  .location-section {
    justify-content: flex-start;
    align-items: center;
  }
  .location-card {
    margin-left: clamp(32px, 5vw, 80px);
    width: 380px;
  }
}

/* ── Timeline section ── */
.timeline-section {
  padding: 0;
  background: #faf9f7;
  overflow: hidden;
}

.timeline-heading {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  margin: 0 0 64px;
  letter-spacing: 0.5px;
}

.timeline-wrapper {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Growing line */
.timeline-line-track {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 2px;
  pointer-events: none;
  z-index: 0;
}

.timeline-line-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, #a8be9f 0%, #7a9a72 60%, #5e7d58 100%);
  border-radius: 2px;
  transition: none;
  will-change: height;
}

.timeline-dots-svg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* Timeline items */
.timeline-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 160px;
  padding: 32px 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.timeline-item.tl-left {
  justify-content: flex-end;
  padding-right: calc(50% + 36px);
  transform: translateX(-40px);
}

.timeline-item.tl-right {
  justify-content: flex-start;
  padding-left: calc(50% + 36px);
  transform: translateX(40px);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.tl-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 260px;
}

.tl-img {
  width: 300px;
  height: 300px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(90, 120, 80, 0.12));
  transition: transform 0.4s ease;
}

.timeline-item.visible .tl-img {
  animation: floatImg 3s ease-in-out infinite;
}

.timeline-item:nth-child(even).visible .tl-img {
  animation-delay: 0.4s;
}

@keyframes floatImg {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.tl-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tl-time {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #7a9a72;
  text-transform: uppercase;
}

.tl-label {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
}

/* Dot on the line */
.tl-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #7a9a72;
  box-shadow: 0 0 0 4px rgba(122, 154, 114, 0.12);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease 0.5s, box-shadow 0.4s ease;
}

.timeline-item.visible .tl-dot {
  opacity: 1;
  box-shadow: 0 0 0 6px rgba(122, 154, 114, 0.18);
}

@media (max-width: 500px) {
  .timeline-item.tl-left {
    padding-right: calc(50% + 24px);
  }
  .timeline-item.tl-right {
    padding-left: calc(50% + 24px);
  }
  .tl-content {
    max-width: 100%;
  }
  .tl-img {
    width: 100%;
    height: auto;
    max-width: 210px;
  }
  .tl-label {
    font-size: 1.4rem;
  }
  .tl-time {
    font-size: 1.1rem;
  }
}

img.hero-logo {
  z-index: 100;
  width: 300px;
}

.hero-logo-container {
  display: flex;
  width: 100%;
  justify-content: center;
  padding-top: 20px;
}

/* ── Timeline connector into Festa Major ── */
.fm-timeline-connector {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 2px;
  z-index: 1;
  pointer-events: none;
}

.fm-connector-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, #5e7d58 0%, #7a9a72 100%);
  border-radius: 2px;
  will-change: height;
}

/* ── Festa Major section ── */
.festa-major-section {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0 60px;
}

.fm-wood-bg {
  position: absolute;
  inset: 0;
  background: url("../img/festamajor/wood.webp") center center / cover no-repeat;
  z-index: 0;
}

.fm-wood-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, #faf9f7 0%, transparent 42%);
  z-index: 1;
}

/* Scene: centred container for the board */
.fm-scene {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  padding: 0 clamp(80px, 14vw, 160px);
  box-sizing: border-box;
  overflow: visible;
}

/* Characters — centred vertically on the poster */
.fm-character {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(100px, 16vw, 190px);
  z-index: 10;
}

.fm-character img {
  width: 100%;
  display: block;
}

/* translateX moves by % of own width — the black edge of each image
   sits at ~35% from its outer side, so shifting by that % aligns it with the poster border */
.fm-xavi {
  left: 0;
  transform: translateX(-5%) translateY(-50%);
}

.fm-alba {
  right: 0;
  transform: translateX(5%) translateY(-50%);
}

/* Board frame — wooden surround */
.fm-board {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  overflow: visible;
  width: clamp(300px, 52vw, 580px);
  background: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  margin-bottom: 0;
}


/* Chincheta image — relative to .fm-scene so it clears the board's overflow:hidden */
.fm-pin-img {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(28px, 3.5vw, 44px);
  z-index: 10;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* Poster paper */
.fm-poster {
  position: relative;
  border-radius: 2px;
  overflow: visible;
  border: 2px solid #111;
  box-shadow:
    0 8px 30px rgba(0,0,0,0.3),
    0 25px 60px rgba(0,0,0,0.25);
}

/* Clip the poster content (bg image) without clipping the curl pseudoelements */
.fm-poster-bg,
.fm-poster-content {
  border-radius: 2px;
  overflow: hidden;
}

.fm-poster-bg {
  position: absolute;
  inset: 0;
  background: url("../img/festamajor/fondo.png") center center / cover no-repeat;
  opacity: 0.45;
  z-index: 1;
  pointer-events: none;
}

.fm-poster-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(36px, 6vw, 64px) clamp(28px, 5vw, 52px) clamp(36px, 6vw, 60px);
  gap: clamp(16px, 2.5vw, 26px);
  background: rgb(248, 241, 226);
  box-sizing: border-box;
}

/* Inner border frame on the poster */
.fm-poster-content::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1.5px solid rgba(80, 50, 20, 0.18);
  border-radius: 2px;
  pointer-events: none;
}

.fm-logo {
  width: 85%;
  max-width: 500px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

/* Decorative divider */
.fm-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 70%;
}

.fm-divider-line {
  flex: 1;
  height: 1.5px;
  background: #4a7a3a;
  opacity: 0.6;
}

.fm-divider-diamond {
  font-size: 0.5rem;
  color: #4a7a3a;
  opacity: 0.8;
  line-height: 1;
}

.fm-divider-bottom {
  margin-top: 4px;
}

/* Schedule */
.fm-schedule {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
}

.fm-event {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: clamp(8px, 1.5vw, 14px) 0;
}

.fm-event-sep {
  font-size: 0.6rem;
  color: #7a5a2a;
  opacity: 0.45;
  letter-spacing: 4px;
  line-height: 1;
}

.fm-time {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(0.8rem, 1.8vw, 1.05rem);
  font-weight: 300;
  letter-spacing: 4px;
  color: #5a3a10;
  text-transform: uppercase;
}

.fm-event-name {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(0.95rem, 2.2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1a1a1a;
  text-align: center;
  line-height: 1.2;
}

@media (max-width: 600px) {
  .festa-major-section {
    padding: 60px 0;
    min-height: 100dvh;
    align-items: center;
  }

  .fm-scene {
    padding: 0 28px;
    width: 100%;
    box-sizing: border-box;
  }

  .fm-logo {
    width: 300px;
  }

  .fm-board {
    width: 100%;
    box-sizing: border-box;
  }

  .fm-character {
    width: clamp(90px, 26vw, 140px);
  }


  /* Push poster content inward so text doesn't overlap characters */
  .fm-poster-content {
    padding: 44px clamp(80px, 26vw, 130px) 44px;
    gap: 22px;
  }

  .fm-poster-bg {
    opacity: 0.6;
  }

  .fm-time {
    font-size: clamp(0.75rem, 3.5vw, 0.95rem);
    letter-spacing: 3px;
  }

  .fm-event-name {
    font-size: clamp(0.95rem, 4.2vw, 1.2rem);
    letter-spacing: 1px;
  }

  .fm-logo {
    width: 300px;
  }

  .fm-pin-img {
    width: clamp(24px, 6vw, 36px);
    top: -4px;
  }
}

/* ── Festa Major entrance animations ── */

@keyframes fm-pin-drop {
  0%   { transform: translateX(-50%) translateY(-140px); opacity: 0; }
  60%  { transform: translateX(-50%) translateY(8px);    opacity: 1; }
  78%  { transform: translateX(-50%) translateY(-5px);   opacity: 1; }
  90%  { transform: translateX(-50%) translateY(3px);    opacity: 1; }
  100% { transform: translateX(-50%) translateY(0);      opacity: 1; }
}

@keyframes fm-board-in {
  0%   { opacity: 0; transform: scale(0.72); }
  70%  { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes fm-slide-up {
  0%   { opacity: 0; transform: translateY(22px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fm-line-expand {
  0%   { transform: scaleX(0); opacity: 0; }
  100% { transform: scaleX(1); opacity: 0.6; }
}

@keyframes fm-char-left {
  0%   { transform: translateX(-80px) translateY(-50%); }
  100% { transform: translateX(-5%) translateY(-50%); }
}

@keyframes fm-char-right {
  0%   { transform: translateX(80px) translateY(-50%); }
  100% { transform: translateX(5%) translateY(-50%); }
}

@keyframes fm-char-fade {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

/* Initial hidden states — elements wait until .fm-animate is added to .fm-scene */
.fm-scene .fm-pin-img       { opacity: 0; }
.fm-scene .fm-board         { opacity: 0; }
.fm-scene .fm-logo          { opacity: 0; }
.fm-scene .fm-divider-line  { transform: scaleX(0); opacity: 0; transform-origin: center; }
.fm-scene .fm-event,
.fm-scene .fm-event-sep     { opacity: 0; }
.fm-scene .fm-xavi          { opacity: 0; }
.fm-scene .fm-alba          { opacity: 0; }

/* Triggered states */
.fm-scene.fm-animate .fm-pin-img {
  animation: fm-pin-drop 0.7s cubic-bezier(0.22, 1, 0.36, 1) 1.0s both;
}

.fm-scene.fm-animate .fm-board {
  animation: fm-board-in 0.65s cubic-bezier(0.34, 1.36, 0.64, 1) 0.45s both;
}

.fm-scene.fm-animate .fm-logo {
  animation: fm-slide-up 0.5s ease-out 0.95s both;
}

.fm-scene.fm-animate .fm-divider-line {
  animation: fm-line-expand 0.45s ease-out both;
}
.fm-scene.fm-animate .fm-divider:first-of-type .fm-divider-line { animation-delay: 1.2s; }
.fm-scene.fm-animate .fm-divider-bottom .fm-divider-line        { animation-delay: 1.55s; }

.fm-scene.fm-animate .fm-event:nth-child(1) { animation: fm-slide-up 0.4s ease-out 1.3s both; }
.fm-scene.fm-animate .fm-event-sep:nth-child(2) { animation: fm-slide-up 0.4s ease-out 1.42s both; }
.fm-scene.fm-animate .fm-event:nth-child(3) { animation: fm-slide-up 0.4s ease-out 1.54s both; }
.fm-scene.fm-animate .fm-event-sep:nth-child(4) { animation: fm-slide-up 0.4s ease-out 1.66s both; }
.fm-scene.fm-animate .fm-event:nth-child(5) { animation: fm-slide-up 0.4s ease-out 1.78s both; }

.fm-scene.fm-animate .fm-xavi {
  animation:
    fm-char-left 0.35s ease-out 0.6s both,
    fm-char-fade 1.2s ease-out 0.6s both;
}
.fm-scene.fm-animate .fm-alba {
  animation:
    fm-char-right 0.35s ease-out 0.6s both,
    fm-char-fade  1.2s ease-out 0.6s both;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .fm-scene .fm-pin-img,
  .fm-scene .fm-board,
  .fm-scene .fm-logo,
  .fm-scene .fm-divider-line,
  .fm-scene .fm-event,
  .fm-scene .fm-event-sep,
  .fm-scene .fm-xavi,
  .fm-scene .fm-alba {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* FAQ / Acordeon */
.faq-section {
  padding: 60px 24px 80px;
  max-width: 860px;
  margin: 0 auto;
}

.faq-title {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 40px;
  color: #222;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 2px solid #7a9a6e;
  border-radius: 6px;
  overflow: hidden;
}

.faq-item {
  border-bottom: 2px solid #7a9a6e;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  background: #7a9a6e;
  color: #fff;
  border: none;
  padding: 16px 20px;
  text-align: left;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}

.faq-question em {
  font-style: italic;
  font-weight: 700;
}

.faq-question::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 300;
  flex-shrink: 0;
  transition: transform 0.25s;
}

.faq-question[aria-expanded="true"]::after {
  transform: rotate(45deg);
}

.faq-answer {
  background: #f0ece3;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 20px;
}

.faq-answer.open {
  max-height: 300px;
  padding: 20px;
}

.faq-answer p {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.6;
  text-align: left;
}

/* Secció formulari */
.form-section {
  background: #7a9a72;
  padding: 60px 24px 80px;
}

.form-header {
  max-width: 860px;
  margin: 0 auto 40px;
  text-align: center;
}

.form-title {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 16px;
  color: #fff;
}

.form-subtitle {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  color: #fff;
  line-height: 1.6;
  margin: 0;
  text-align: center;
}

.form-wrapper {
  max-width: 700px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  overflow-y: auto;
  max-height: 70vh;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.form-wrapper iframe {
  display: block;
  width: 100%;
  border: none;
}

/* Quote final */
.quote-section {
  padding: 80px 24px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quote-text {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 300;
  font-style: italic;
  color: #7a9a72;
  text-align: center;
  max-width: 90vw;
  margin: 0;
  line-height: 1.6;
  position: relative;
}
