:root {
  --font-cursive: "Great Vibes", cursive;
  --font-serif: "Suranna", serif;
  --font-sans-serif: "Montserrat", sans-serif;
}
body.palette-1 {
  --color-bg: #ffffff;
  --color-text: #333333;
  --color-primary: #b0b0b0;
  --color-secondary: #eaeaea;
  --color-dark: #222222;
}
body.palette-2 {
  --color-bg: #f8f5f0;
  --color-text: #588157;
  --color-primary: #a3b18a;
  --color-secondary: #e9ddcb;
  --color-dark: #344e41;
}
body.palette-3 {
  --color-bg: #fbf6f6;
  --color-text: #6d5d5d;
  --color-primary: #d4b4b4;
  --color-secondary: #f2e3e3;
  --color-dark: #5c4b4b;
}
body.palette-4 {
  --color-bg: #f0f4f8;
  --color-text: #3a4f63;
  --color-primary: #a2b9cc;
  --color-secondary: #d3e0ea;
  --color-dark: #2c3e50;
}
body.palette-5 {
  --color-bg: #faf3e8;
  --color-text: #7d5a4c;
  --color-primary: #d8a788;
  --color-secondary: #e6cba9;
  --color-dark: #6b4f43;
}
body.palette-6 {
  --color-bg: #f5f5f5;
  --color-text: #343a40;
  --color-primary: #6c757d;
  --color-secondary: #e9ecef;
  --color-dark: #212529;
}
body.palette-7 {
  --color-bg: #1a1a1a;
  --color-text: #e0e0e0;
  --color-primary: #8d6b9d;
  --color-secondary: #333333;
  --color-dark: #f0f0f0;
}
body.palette-8 {
  --color-bg: #2b0014;
  --color-text: #f0e6e6;
  --color-primary: #7d1a2f;
  --color-secondary: #5a1125;
  --color-dark: #fdf2f2;
}
body.palette-9 {
  --color-bg: #0a1f17;
  --color-text: #d9e0dd;
  --color-primary: #2d5747;
  --color-secondary: #1a382e;
  --color-dark: #e6edea;
}
html,
body {
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: var(--font-sans-serif);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
}
section {
  padding: 120px 0;
  position: relative;
  overflow: hidden;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}
h1,
h2,
footer p {
  font-family: var(--font-cursive);
  font-weight: 400;
  color: var(--color-dark);
}
h1 {
  font-size: 6rem;
  margin: 0 0.5em;
  color: white;
}
h2 {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 50px;
}
.hero {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  padding: 0;
}
.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%;
  background: url("https://zrtbdboewgbwiyxzvxhj.supabase.co/storage/v1/object/public/imgwebjuan/invitacionesBoda/DSC_7303-_1_.avif")
    no-repeat center center/cover;
  filter: brightness(0.6);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#hero-section h1 {
  color: white;
}
.title-decorator {
  height: 2px;
  width: 150px;
  background-color: white;
  margin: 15px 0;
}
.hero-content p {
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 3px;
}
.hero-content .date {
  font-size: 1.2rem;
  margin-top: 10px;
}
#invitation-section {
  background-color: var(--color-bg);
  text-align: center;
}
.invitation-text {
  max-width: 700px;
  margin: 0 auto 40px auto;
  font-size: 1.1rem;
}
.bible-verse blockquote {
  border: none;
  margin: 0 auto;
  font-size: 1.5rem;
  font-family: var(--font-cursive);
  color: var(--color-dark);
}
.bible-verse cite {
  display: block;
  margin-top: 15px;
  font-size: 1rem;
  color: var(--color-primary);
}
.vine-left,
.vine-right {
  position: absolute;
  top: 0;
  width: 200px;
  height: 100%;
  background-size: 100% auto;
  background-repeat: repeat-y;
  z-index: 1;
  opacity: 0.4;
  pointer-events: none;
}
.vine-left {
  left: -50px;
  background-image: url("https://zrtbdboewgbwiyxzvxhj.supabase.co/storage/v1/object/public/imgwebjuan/der_enredadera.png");
}
.vine-right {
  right: -50px;
  background-image: url("https://zrtbdboewgbwiyxzvxhj.supabase.co/storage/v1/object/public/imgwebjuan/der_enredadera.png");
}
#story-section,
#countdown-section,
#gallery-section {
  background-color: var(--color-secondary);
}
.timeline {
  position: relative;
  max-width: 800px;
  margin: 40px auto;
}
.timeline::after {
  content: "";
  position: absolute;
  width: 2px;
  background-color: var(--color-primary);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}
.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
}
.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}
.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
}
.timeline-item::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background-color: var(--color-secondary);
  border: 4px solid var(--color-primary);
  top: 25px;
  border-radius: 50%;
  z-index: 1;
}
.timeline-item:nth-child(odd)::after {
  right: -8px;
}
.timeline-item:nth-child(even)::after {
  left: -8px;
}
.timeline-content h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--color-dark);
}
#music-section {
  background-color: var(--color-bg);
}
.music-player {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
  background-color: var(--color-secondary);
  padding: 15px 25px;
  border-radius: 50px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}
.player-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 1.5rem;
  cursor: pointer;
}
.player-controls {
  flex-grow: 1;
}
.progress-container {
  width: 100%;
  padding: 10px 0;
  cursor: pointer;
}
.progress-bar {
  width: 100%;
  height: 4px;
  background-color: var(--color-bg);
  border-radius: 2px;
}
.progress-bar-inner {
  height: 100%;
  width: 0;
  background-color: var(--color-primary);
  border-radius: 2px;
}
.time-container {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-primary);
}
.song-selection-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
}
.song-item {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  cursor: pointer;
  border: 3px solid transparent;
}
.song-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.song-item.add-song {
  background-color: var(--color-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  color: var(--color-primary);
}
#countdown {
  display: flex;
  justify-content: center;
  gap: 40px;
  text-align: center;
}
.time-box span {
  display: block;
  font-size: 3rem;
  font-family: var(--font-serif);
  color: var(--color-dark);
}
.time-box small {
  font-size: 1rem;
  text-transform: uppercase;
}
.full-width-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  background-color: var(--color-bg);
  padding: 0;
}
.full-width-section .content-half {
  padding: 60px;
}
.full-width-section .image-half {
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
  /* Aplicamos el clip-path directamente al contenedor de la imagen */
  -webkit-clip-path: url(#torn-edge-top-bottom);
  clip-path: url(#torn-edge-top-bottom);
}

/* Es necesario añadir el SVG con la definición del clipPath en el HTML */
/* Por ejemplo, justo antes de cerrar el </body> o en un <defs> */
/* Aquí está la definición que debería ir en tu HTML, no en el CSS */
/*
<svg width="0" height="0" style="position: absolute;">
  <defs>
    <clipPath id="torn-edge-top-bottom" clipPathUnits="objectBoundingBox">
      <path d="M0,0.05 C0.05,0.08, 0.1,0.02, 0.15,0.05 L0.2,0.03 L0.25,0.06 C0.3,0.01, 0.35,0.09, 0.4,0.04 L0.45,0.06 L0.5,0.03 C0.55,0.08, 0.6,0.02, 0.65,0.06 L0.7,0.04 L0.75,0.07 C0.8,0.01, 0.85,0.08, 0.9,0.04 L0.95,0.07 L1,0.05 V1 C0.95,0.95, 0.9,1.01, 0.85,0.96 L0.8,0.99 L0.75,0.95 C0.7,1.01, 0.65,0.95, 0.6,0.98 L0.55,0.96 L0.5,0.99 C0.45,0.94, 0.4,1.01, 0.35,0.96 L0.3,0.99 L0.25,0.95 C0.2,1.01, 0.15,0.94, 0.1,0.97 L0.05,0.95 L0,0.98 V0.05 Z" />
    </clipPath>
  </defs>
</svg>
*/

.full-width-section .image-half img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* La imagen dentro ya no necesita la máscara, el contenedor la maneja */
}
.event {
  text-align: left;
}
.event ul {
  list-style: none;
  padding: 0;
}
.event li {
  font-size: 1.1rem;
  margin-bottom: 15px;
}
.event .image-half {
  order: -1;
}
.details-divider {
  border: 0;
  height: 1px;
  background-color: var(--color-secondary);
  margin: 30px 0;
}
.map-container {
  width: 100%;
  height: 250px;
  filter: grayscale(100%);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-secondary);
}
.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.contact-btn {
  display: inline-block;
  margin-top: 30px;
  padding: 12px 30px;
  background-color: var(--color-primary);
  color: var(--color-bg);
  text-decoration: none;
  border-radius: 50px;
  transition: background-color 0.3s ease;
  text-align: center;
  align-self: flex-start;
}
.contact-btn:hover {
  filter: brightness(0.9);
}
#gallery-section {
  padding-bottom: 0;
}
#gallery-section .container {
  padding-bottom: 60px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 300px;
  gap: 0;
  width: 100%;
}
.gallery-item {
  overflow: hidden;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.item-1 {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}
.item-2 {
  grid-column: 2 / 4;
  grid-row: 1 / 2;
}
footer {
  background-color: var(--color-dark);
  color: var(--color-bg);
  text-align: center;
  padding: 60px 20px;
}
footer p {
  color: var(--color-bg);
  font-size: 2.5rem;
  margin: 0;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background-color: var(--color-bg);
  padding: 40px;
  border-radius: 20px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.modal-overlay.visible .modal-content {
  transform: scale(1);
}
.close-modal-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-primary);
  cursor: pointer;
}
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}
#color-switcher {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  padding: 8px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 3000;
  display: flex;
  gap: 8px;
}
.palette-button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
  padding: 0;
}
.palette-button.selected {
  transform: scale(1.2);
  border-color: var(--color-dark);
}
.palette-button[data-palette="palette-1"] {
  background-color: #b0b0b0;
}
.palette-button[data-palette="palette-2"] {
  background-color: #a3b18a;
}
.palette-button[data-palette="palette-3"] {
  background-color: #d4b4b4;
}
.palette-button[data-palette="palette-4"] {
  background-color: #a2b9cc;
}
.palette-button[data-palette="palette-5"] {
  background-color: #d8a788;
}
.palette-button[data-palette="palette-6"] {
  background-color: #6c757d;
}
.palette-button[data-palette="palette-7"] {
  background-color: #8d6b9d;
}
.palette-button[data-palette="palette-9"] {
  background-color: #2d5747;
}
@media (max-width: 721px) {
  h1 {
    font-size: 3rem;
  }
  h2 {
    font-size: 2.5rem;
  }
  .title-decorator {
    width: 100px;
  }
  .vine-left,
  .vine-right {
    width: 80px;
    opacity: 0.3;
  }
  .vine-left {
    left: -20px;
  }
  .vine-right {
    right: -20px;
  }
  #invitation-section .container {
    padding: 0 15px;
  }
  .invitation-text {
    font-size: 1rem;
    margin-bottom: 30px;
  }
  .bible-verse blockquote {
    font-size: 1.2rem;
  }
  .bible-verse cite {
    font-size: 0.9rem;
  }
  .timeline::after {
    left: 8px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 40px;
    padding-right: 0;
  }
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    left: 0;
    text-align: left;
  }
  .timeline-item:nth-child(odd)::after,
  .timeline-item:nth-child(even)::after {
    left: 0;
  }
  .timeline-content h3 {
    font-size: 1.3rem;
  }
  .timeline-content p {
    font-size: 0.95rem;
  }
  .music-player {
    flex-direction: column;
    padding: 15px;
    border-radius: 20px;
    gap: 10px;
  }
  .song-selection-grid {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  .song-item {
    width: 60px;
    height: 60px;
  }
  .song-item.add-song {
    font-size: 1.5rem;
  }
  #countdown {
    gap: 15px;
    flex-wrap: wrap;
  }
  .time-box {
    flex-basis: 45%;
    padding: 10px 0;
  }
  .time-box span {
    font-size: 2rem;
  }
  .time-box small {
    font-size: 0.8rem;
  }
  .full-width-section {
    grid-template-columns: 1fr;
  }
  .full-width-section .image-half {
    order: -1;
    min-height: 250px;
  }
  .full-width-section .content-half {
    padding: 40px 20px;
  }
  .event h2 {
    margin-top: 0;
  }
  .event ul {
    text-align: center;
    margin-bottom: 30px;
  }
  .event li {
    font-size: 1rem;
    margin-bottom: 10px;
  }
  .map-container {
    height: 200px;
  }
  .contact-btn {
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 10px 20px;
  }
  #gallery-section .container {
    padding-bottom: 30px;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 250px;
  }
  .item-1,
  .item-2 {
    grid-column: auto;
    grid-row: auto;
  }
  footer p {
    font-size: 1.8rem;
  }
  .modal-content {
    padding: 30px 20px;
  }
}
