/* =========================================================
   XV Alejandra — Victorian Blue
   Paleta: medianoche, azul real, plata envejecida, marfil
   ========================================================= */

:root {
  --midnight: #0b1f3a;
  --royal: #1e3a5f;
  --dusk: #7b93ab;
  --silver: #c8c9cb;
  --silver-soft: #e3e1d8;
  --ivory: #f2eee3;
  --ivory-dim: #e9e4d6;
  --gold-dim: #b9a36b;

  --font-display: "Cinzel Decorative", "Cinzel", serif;
  --font-title: "Cinzel", serif;
  --font-body: "Cormorant Garamond", serif;
  --font-script: "Tangerine", cursive;

  --max-w: 720px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--midnight);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

@media (min-width: 480px) {
  body {
    font-size: 19px;
  }
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------------------------------------------------------
   Damask-style ambient background
   --------------------------------------------------------- */
.bg-texture {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(123, 147, 171, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(185, 163, 107, 0.08), transparent 60%),
    linear-gradient(180deg, #0b1f3a 0%, #0e2440 40%, #0a1a30 100%);
}

.bg-texture::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23C8C9CB' stroke-width='0.6'%3E%3Cpath d='M60 10 C75 25 75 45 60 60 C45 45 45 25 60 10Z'/%3E%3Cpath d='M60 60 C75 75 75 95 60 110 C45 95 45 75 60 60Z'/%3E%3Ccircle cx='60' cy='60' r='4'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
}

/* ---------------------------------------------------------
   Section base
   --------------------------------------------------------- */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 1.25rem;
  text-align: center;
  position: relative;
}

@media (min-width: 480px) {
  .section {
    padding: 5.5rem 1.75rem;
  }
}

.section--tight {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

/* ---------------------------------------------------------
   Ornamental dividers
   --------------------------------------------------------- */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 1.75rem auto;
  width: 100%;
  max-width: 220px;
  color: var(--gold-dim);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.divider svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   HERO
   --------------------------------------------------------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  position: relative;
}

.hero__frame {
  border: 1px solid rgba(200, 201, 203, 0.35);
  padding: 2.25rem 1.25rem;
  position: relative;
  max-width: 560px;
  width: 100%;
  opacity: 0;
  animation: frameIn 1.4s ease-out 0.3s forwards;
}

@media (min-width: 420px) {
  .hero__frame {
    padding: 2.75rem 1.75rem;
  }
}

@media (min-width: 480px) {
  .hero {
    padding: 3rem 1.5rem;
  }
  .hero__frame {
    padding: 3rem 2rem;
  }
}

.hero__frame::before,
.hero__frame::after,
.hero__frame .corner-tl,
.hero__frame .corner-br {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold-dim);
}

.hero__frame::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.hero__frame::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.corner-tl {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
}

.corner-br {
  bottom: -1px;
  left: -1px;
  border-right: none;
  border-top: none;
}

.hero__eyebrow {
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--silver);
  margin: 0 0 1.4rem;
}

@media (min-width: 420px) {
  .hero__eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.45em;
  }
}

.hero__medallion {
  width: 76px;
  height: 76px;
  margin: 0 auto 1.4rem;
  opacity: 0;
  transform: scale(0.85);
  animation: medallionIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
}

@media (min-width: 420px) {
  .hero__medallion {
    width: 92px;
    height: 92px;
    margin: 0 auto 1.6rem;
  }
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  line-height: 1.18;
  margin: 0;
  color: var(--ivory);
  text-shadow: 0 0 30px rgba(123, 147, 171, 0.35);
  opacity: 0;
  animation: riseIn 1s ease-out 1s forwards;
}

.hero__xv {
  font-family: var(--font-script);
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  color: var(--gold-dim);
  display: block;
  margin: 0.2rem 0;
  opacity: 0;
  animation: riseIn 1s ease-out 1.25s forwards;
}

.hero__sub {
  font-family: var(--font-title);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dusk);
  margin: 1.4rem 0 0;
  opacity: 0;
  animation: riseIn 1s ease-out 1.5s forwards;
}

@media (min-width: 420px) {
  .hero__sub {
    font-size: 0.95rem;
    letter-spacing: 0.25em;
  }
}

.hero__scroll {
  margin-top: 3rem;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dusk);
  opacity: 0;
  animation: riseIn 1s ease-out 2s forwards;
}

@keyframes frameIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes medallionIn {
  from { opacity: 0; transform: scale(0.85) rotate(-6deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   Section titles
   --------------------------------------------------------- */
.section__eyebrow {
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 0 0 0.6rem;
}

@media (min-width: 420px) {
  .section__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.4em;
  }
}

.section__title {
  font-family: var(--font-title);
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  font-weight: 500;
  margin: 0;
  color: var(--ivory);
  letter-spacing: 0.02em;
}

.section__lead {
  font-size: 1.2rem;
  color: var(--silver-soft);
  max-width: 540px;
  margin: 1.4rem auto 0;
}

/* ---------------------------------------------------------
   Invitation copy block
   --------------------------------------------------------- */
.invite-text {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--silver-soft);
  max-width: 520px;
  margin: 0 auto;
}

.invite-text em {
  font-style: normal;
  color: var(--ivory);
  font-size: 1.25rem;
  font-family: var(--font-title);
  letter-spacing: 0.02em;
}

@media (min-width: 420px) {
  .invite-text {
    font-size: 1.2rem;
    line-height: 1.85;
  }
  .invite-text em {
    font-size: 1.4rem;
    letter-spacing: 0.03em;
  }
}

.parents {
  margin-top: 2.2rem;
  font-family: var(--font-title);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--silver);
}

.parents__role {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dusk);
  margin-bottom: 0.5rem;
}

@media (min-width: 420px) {
  .parents__role {
    font-size: 0.7rem;
    letter-spacing: 0.35em;
  }
}

/* ---------------------------------------------------------
   Details cards (Fecha / Hora / Lugar)
   --------------------------------------------------------- */
.details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: rgba(200, 201, 203, 0.2);
  border: 1px solid rgba(200, 201, 203, 0.2);
  margin-top: 2.25rem;
}

@media (min-width: 460px) {
  .details {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 3rem;
  }
}

.detail-card {
  background: rgba(11, 31, 58, 0.6);
  padding: 1.5rem 1rem;
}

@media (min-width: 460px) {
  .detail-card {
    padding: 2rem 1rem;
  }
}

.detail-card__icon {
  width: 30px;
  height: 30px;
  margin: 0 auto 0.9rem;
  color: var(--gold-dim);
}

.detail-card__label {
  font-family: var(--font-title);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dusk);
  margin: 0 0 0.5rem;
}

@media (min-width: 420px) {
  .detail-card__label {
    font-size: 0.68rem;
    letter-spacing: 0.3em;
  }
}

.detail-card__value {
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--ivory);
  margin: 0;
  line-height: 1.4;
}

/* ---------------------------------------------------------
   Venue / map block
   --------------------------------------------------------- */
.venue {
  margin-top: 2.25rem;
  border: 1px solid rgba(200, 201, 203, 0.25);
  padding: 1.75rem 1.25rem;
  background: rgba(30, 58, 95, 0.18);
}

@media (min-width: 420px) {
  .venue {
    margin-top: 3rem;
    padding: 2.5rem 2rem;
  }
}

.venue__name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--ivory);
  margin: 0 0 0.4rem;
}

.venue__address {
  color: var(--silver-soft);
  margin: 0 0 1.6rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--midnight);
  background: var(--silver-soft);
  padding: 0.9rem 1.5rem;
  min-height: 44px;
  line-height: 1.6;
  text-decoration: none;
  border: 1px solid var(--silver-soft);
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  max-width: 100%;
}

@media (min-width: 420px) {
  .btn {
    font-size: 0.78rem;
    letter-spacing: 0.25em;
    padding: 0.95rem 2.1rem;
  }
}

.btn:hover {
  background: transparent;
  color: var(--ivory);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--ivory);
  border-color: rgba(200, 201, 203, 0.5);
}

.btn--ghost:hover {
  background: var(--ivory);
  color: var(--midnight);
}

/* ---------------------------------------------------------
   Gallery / Album section
   --------------------------------------------------------- */
.gallery-intro {
  max-width: 540px;
  margin: 0 auto;
}

.tab-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0 1.75rem;
  flex-wrap: wrap;
}

.tab-btn {
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--silver);
  background: transparent;
  border: 1px solid rgba(200, 201, 203, 0.35);
  padding: 0.7rem 1rem;
  min-height: 44px;
  cursor: pointer;
  transition: all 0.25s ease;
  flex: 1 1 auto;
  min-width: 0;
}

@media (min-width: 420px) {
  .tab-btn {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    padding: 0.75rem 1.4rem;
    flex: 0 1 auto;
  }
}

.tab-btn.is-active,
.tab-btn:hover {
  color: var(--midnight);
  background: var(--silver-soft);
  border-color: var(--silver-soft);
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

/* Upload box */
.upload-box {
  border: 1.5px dashed rgba(200, 201, 203, 0.45);
  padding: 1.85rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}

@media (min-width: 420px) {
  .upload-box {
    padding: 2.5rem 1.5rem;
  }
}

.upload-box:hover,
.upload-box.is-dragover {
  border-color: var(--gold-dim);
  background: rgba(185, 163, 107, 0.06);
}

.upload-box__icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 1rem;
  color: var(--gold-dim);
}

.upload-box__text {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--ivory);
  margin: 0 0 0.3rem;
}

.upload-box__hint {
  font-size: 0.85rem;
  color: var(--dusk);
  margin: 0;
}

input[type="file"] {
  display: none;
}

.field {
  margin-top: 1.4rem;
  text-align: left;
}

.field label {
  display: block;
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dusk);
  margin-bottom: 0.5rem;
}

@media (min-width: 420px) {
  .field label {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
  }
}

.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(200, 201, 203, 0.3);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px; /* evita zoom automático en iOS Safari al enfocar */
  padding: 0.75rem 0.9rem;
}

@media (min-width: 480px) {
  .field input[type="text"],
  .field input[type="password"] {
    font-size: 1.05rem;
  }
}

.field input:focus {
  outline: 2px solid var(--gold-dim);
  outline-offset: 1px;
}

.preview-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.preview-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid rgba(200, 201, 203, 0.3);
}

.upload-actions {
  margin-top: 1.6rem;
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.status-msg {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  min-height: 1.4em;
}

.status-msg.ok { color: #9fd9a8; }
.status-msg.err { color: #e1a3a3; }
.status-msg.loading { color: var(--dusk); }

/* Official album grid */
.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (min-width: 480px) {
  .album-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.album-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.25s ease;
  border: 1px solid rgba(200, 201, 203, 0.15);
}

.album-grid img:hover {
  opacity: 0.8;
}

.album-empty {
  color: var(--dusk);
  font-style: italic;
  padding: 2rem 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(7, 16, 30, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  border: 1px solid rgba(200, 201, 203, 0.3);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--ivory);
  cursor: pointer;
  line-height: 1;
}

/* ---------------------------------------------------------
   Video modal (presentación de bienvenida)
   --------------------------------------------------------- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(7, 16, 30, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.video-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.video-modal__box {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--midnight);
  border: 1px solid rgba(200, 201, 203, 0.35);
  padding: 0.6rem;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-modal.is-open .video-modal__box {
  transform: translateY(0) scale(1);
}

.video-modal__box::before,
.video-modal__box::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid var(--gold-dim);
}

.video-modal__box::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.video-modal__box::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.video-modal__frame {
  position: relative;
  width: 100%;
  background: #000;
  overflow: hidden;
}

.video-modal__frame video {
  width: 100%;
  height: 100%;
  display: block;
  max-height: 70vh;
}

.video-modal__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ivory);
  color: var(--midnight);
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.video-modal__caption {
  text-align: center;
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dusk);
  padding: 0.85rem 0.5rem 0.4rem;
}

.video-modal__unmute {
  display: none;
  align-items: center;
  gap: 0.5rem;
  position: absolute;
  bottom: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 31, 58, 0.85);
  border: 1px solid rgba(200, 201, 203, 0.4);
  color: var(--ivory);
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.6rem 1rem;
  cursor: pointer;
  min-height: 40px;
  z-index: 2;
}

.video-modal__unmute.is-visible {
  display: flex;
}

.video-modal__unmute svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .video-modal__frame video {
    max-height: 75vh;
  }
}


.footer {
  text-align: center;
  padding: 3.5rem 1.5rem 2.5rem;
  color: var(--dusk);
}

.footer__monogram {
  font-family: var(--font-script);
  font-size: 2.4rem;
  color: var(--gold-dim);
  margin-bottom: 0.5rem;
}

.footer__date {
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

@media (min-width: 420px) {
  .footer__date {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
  }
}

/* ---------------------------------------------------------
   Reduced motion
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero__frame,
  .hero__medallion,
  .hero__name,
  .hero__xv,
  .hero__sub,
  .hero__scroll {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
.upload-box:focus-visible {
  outline: 2px solid var(--gold-dim);
  outline-offset: 3px;
}
