/* Styles for invitations filled from the admin panel (see js/invite.js). */

/* Hide the sample wording until the wedding details are filled in.
   The animation reveals the page anyway if the script fails to run. */
html.has-wedding:not(.wedding-ready) body {
  visibility: hidden;
  animation: invite-reveal 0s 2.5s forwards;
}
@keyframes invite-reveal { to { visibility: visible; } }

.invite-language {
  position: fixed; top: 18px; left: 18px; z-index: 10000;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(58, 15, 24, 0.82);
  border: 1px solid rgba(226, 199, 147, 0.35);
  color: var(--gold-300);
  font-size: 14px;
  backdrop-filter: blur(6px);
}
.invite-language select {
  appearance: none; border: 0; background: transparent;
  color: inherit; font: inherit; cursor: pointer; padding-right: 2px;
}
.invite-language select option { color: #2a1712; }
.invite-language select:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 3px; }

.parents-grid[hidden] { display: none; }

/* ===== GALLERY ===== */
#gallery {
  padding: 100px 20px;
  background: var(--cream);
  text-align: center;
  position: relative;
}
#gallery[hidden], .side-nav__dot[hidden], .lightbox[hidden], .lightbox__btn[hidden] { display: none; }
.gallery-content { max-width: 1100px; margin: 0 auto; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 40px;
}
.gallery-item {
  position: relative; display: block; width: 100%;
  aspect-ratio: 4 / 5; padding: 0; border: 0; overflow: hidden;
  border-radius: 14px; cursor: zoom-in; background: var(--cream-dark);
  box-shadow: 0 14px 34px -18px rgba(42, 9, 16, 0.45);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s var(--ease-out-soft);
}
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.06); }
.gallery-item:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 3px; }
.gallery-caption {
  position: absolute; inset: auto 0 0 0;
  padding: 28px 14px 12px;
  background: linear-gradient(transparent, rgba(42, 9, 16, 0.75));
  color: var(--cream-50);
  font-family: var(--font-display); font-style: italic; font-size: 16px;
  text-align: left;
}
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 28px; }
  .gallery-item { border-radius: 10px; }
  .gallery-caption { font-size: 14px; padding: 22px 10px 8px; }
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26, 5, 9, 0.94);
  padding: 60px 16px;
}
.lightbox__figure { margin: 0; max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox__img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7); }
.lightbox__caption { margin-top: 14px; color: var(--gold-200); font-family: var(--font-display); font-style: italic; font-size: 18px; }
.lightbox__btn {
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(58, 15, 24, 0.85); color: var(--gold-300);
  border: 1px solid rgba(226, 199, 147, 0.35); cursor: pointer; font-size: 18px;
}
.lightbox__btn:hover { background: var(--maroon-700); }
.lightbox__btn:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 3px; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 768px) {
  .lightbox__prev, .lightbox__next { top: auto; bottom: 18px; transform: none; }
  .lightbox__prev { left: calc(50% - 58px); }
  .lightbox__next { right: calc(50% - 58px); }
}

/* ===== VIDEOS ===== */
#videos {
  padding: 100px 20px;
  background: linear-gradient(160deg, var(--maroon-900) 0%, var(--maroon-700) 55%, var(--maroon-800) 100%);
  text-align: center; position: relative; overflow: hidden;
}
#videos[hidden] { display: none; }
#videos .section-title { color: var(--cream-50); }
#videos .section-eyebrow { color: var(--gold-300); }
.videos-bg-pattern {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 20%, rgba(226, 199, 147, 0.14) 0%, transparent 65%);
}
.videos-content { position: relative; max-width: 1100px; margin: 0 auto; }
.videos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 40px; }
.videos-grid--single { grid-template-columns: minmax(0, 820px); justify-content: center; }
.video-card { margin: 0; }
.video-card video {
  width: 100%; aspect-ratio: 16 / 9; display: block; background: #1c0509;
  border-radius: 14px; border: 1px solid rgba(226, 199, 147, 0.3);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
}
.video-card figcaption {
  margin-top: 12px; color: var(--gold-200);
  font-family: var(--font-display); font-style: italic; font-size: 18px;
}
@media (max-width: 768px) {
  #videos { padding: 80px 16px; }
  .videos-grid { grid-template-columns: 1fr; gap: 18px; margin-top: 28px; }
}

/* YouTube: thumbnail with play button, replaced by the player on tap */
.video-youtube, .video-youtube__frame {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0;
  border-radius: 14px; border: 1px solid rgba(226, 199, 147, 0.3); overflow: hidden;
  background: #1c0509; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6); cursor: pointer;
}
.video-youtube img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease-out-soft); }
.video-youtube:hover img { transform: scale(1.04); }
.video-youtube:focus-visible { outline: 3px solid var(--gold-300); outline-offset: 3px; }
.video-youtube__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(58, 15, 24, 0.85); color: var(--gold-300); font-size: 24px;
  border: 1px solid rgba(226, 199, 147, 0.5); padding-left: 5px;
  transition: transform 0.3s var(--ease-out-soft);
}
.video-youtube:hover .video-youtube__play { transform: translate(-50%, -50%) scale(1.08); }

.music-toggle[hidden] { display: none; }

/* ===== EVENT SCHEDULE ===== */
.events-grid:not(.events-single) > .event-card:last-child:nth-child(odd) { grid-column: 1 / -1; width: 100%; max-width: 520px; justify-self: center; }
.event-note {
  margin: 18px auto 0; max-width: 360px;
  font-family: var(--font-sans); font-style: italic; font-size: 17px; line-height: 1.6;
  color: var(--text-medium);
}

/* ===== RSVP DEADLINE ===== */
.rsvp-deadline {
  display: inline-block; margin: 6px auto 0; padding: 8px 20px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
  color: #fff; font-family: var(--font-body); font-size: 13px; letter-spacing: 0.08em;
}
.rsvp-deadline[hidden], .rsvp-closed[hidden], .rsvp-form-wrap[hidden] { display: none; }
.rsvp-closed {
  max-width: 520px; margin: 40px auto 0; padding: 44px 32px;
  border-radius: 20px; text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.65));
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.35);
}
.rsvp-closed__icon {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--blush-gradient); color: #fff; font-size: 24px;
}
.rsvp-closed__title { font-family: var(--font-serif); font-size: 28px; color: var(--green-dark); margin-bottom: 10px; }
.rsvp-closed__text { font-family: var(--font-sans); font-size: 18px; line-height: 1.7; color: var(--text-medium); }

/* ===== WISHES WALL ===== */
#wishes {
  padding: 100px 20px; text-align: center; position: relative; overflow: hidden;
  background: var(--cream);
}
#wishes[hidden], .rsvp-wall-consent[hidden], .wishes-empty[hidden], .wishes-more[hidden], .rsvp-modal__note[hidden] { display: none; }
.wishes-bg-pattern {
  position: absolute; inset: 0; opacity: 0.05; pointer-events: none;
  background-image: repeating-linear-gradient(45deg, var(--gold) 0px, var(--gold) 1px, transparent 1px, transparent 22px);
}
.wishes-content { position: relative; max-width: 1100px; margin: 0 auto; }
.wishes-grid { columns: 3 280px; column-gap: 20px; margin-top: 40px; text-align: left; }
.wish-card {
  break-inside: avoid; margin: 0 0 20px; padding: 28px 26px 22px; position: relative;
  border-radius: 18px; border: 1px solid var(--glass-border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  box-shadow: var(--shadow-soft);
}
.wish-card:nth-child(3n + 2) { background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), color-mix(in srgb, var(--peach) 22%, white)); }
.wish-card__mark {
  position: absolute; top: 4px; right: 18px;
  font-family: var(--font-serif); font-size: 64px; line-height: 1; color: var(--gold); opacity: 0.35;
}
.wish-card blockquote {
  margin: 0 0 16px; font-family: var(--font-sans); font-style: italic;
  font-size: 19px; line-height: 1.65; color: var(--text-dark); white-space: pre-line; overflow-wrap: anywhere;
}
.wish-card figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.wish-card strong { font-family: var(--font-serif); font-size: 16px; color: var(--green-dark); }
.wish-card time { font-family: var(--font-body); font-size: 11px; letter-spacing: 0.08em; color: var(--text-light); text-transform: uppercase; }
.wishes-empty { margin-top: 36px; font-family: var(--font-sans); font-style: italic; font-size: 20px; color: var(--text-medium); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.wishes-more { margin-top: 12px; cursor: pointer; background: transparent; }
.rsvp-wall-consent {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; line-height: 1.5; color: var(--text-medium); text-align: left;
}
.rsvp-wall-consent input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--green); flex: none; }
.rsvp-modal__note { font-family: var(--font-body); font-size: 13px; color: var(--text-medium); margin: 0 0 10px; }
@media (max-width: 768px) {
  #wishes { padding: 80px 16px; }
  .wishes-grid { margin-top: 28px; }
  .wish-card blockquote { font-size: 17px; }
}

/* Sections switched off in the admin panel */
section[hidden] { display: none !important; }

/* Wide letter-spacing pulls apart the joined letters of Indian scripts; keep it for English only. */
html.has-wedding:not([lang="en"]) :is(.gate-label, .gate-tap-text, .eyebrow, .section-eyebrow, .countdown-label, .event-type, .event-detail-label, .timeline-date, .rsvp-field label, .rsvp-field__legend, .scroll-cue__text, .quote-source) { letter-spacing: 0.03em; }
