:root {
  --ivory-bg: #f7f5f0;
  --ivory-card: #fffcf7;
  --teak-light: #a67358;
  --teak-base: #7a4b3a;
  --teak-dark: #4a2e24;
  --teak-overlay: rgba(122, 75, 58, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Montserrat", sans-serif;
  background-color: var(--ivory-bg);
  color: var(--teak-dark);
  line-height: 1.6;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

.bg-animation {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.floating-shape {
  position: absolute;
  background: radial-gradient(circle, var(--teak-light) 0%, transparent 70%);
  opacity: 0.15;
  border-radius: 50%;
  animation: float 20s infinite ease-in-out alternate;
}

.shape-1 {
  width: 300px;
  height: 300px;
  top: -50px;
  left: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 400px;
  height: 400px;
  right: -50px;
  bottom: -100px;
  animation-delay: -5s;
  animation-duration: 25s;
}

.shape-3 {
  width: 200px;
  height: 200px;
  top: 40%;
  left: 60%;
  animation-delay: -10s;
  animation-duration: 18s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(30px, -50px) scale(1.1);
  }
}

.invitation-wrapper {
  background-color: var(--ivory-card);
  width: 100%;
  max-width: 500px;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(74, 46, 36, 0.08);
  position: relative;
  z-index: 1;
  animation: fade-up 1s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
  border: 1px solid rgba(166, 115, 88, 0.2);
}

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-section {
  padding: 20px 20px 0;
}

.image-arch {
  width: 100%;
  height: 350px;
  border-radius: 150px 150px 16px 16px;
  background: linear-gradient(135deg, #ebe6dc, #dfd8c8);
  position: relative;
  overflow: hidden;
  border: 2px solid var(--teak-light);
}

.image-arch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content {
  padding: 40px 30px;
  text-align: center;
}

.pre-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--teak-light);
  margin-bottom: 10px;
}

h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.8rem;
  color: var(--teak-base);
  line-height: 1.1;
  margin-bottom: 20px;
  font-weight: 600;
}

.message {
  font-size: 0.95rem;
  color: var(--teak-dark);
  margin-bottom: 30px;
  font-weight: 300;
}

.details-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 35px;
  position: relative;
}

.details-wrapper::after {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 50%;
  width: 1px;
  background-color: var(--teak-light);
  opacity: 0.3;
}

.detail-item h3,
.gallery-section h3,
.directions-box h3,
.contact-box h3 {
  font-family: "Cormorant Garamond", serif;
  color: var(--teak-base);
}

.detail-item h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.detail-item p {
  font-size: 0.85rem;
  font-weight: 500;
}

.detail-item span {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--teak-light);
}

.gallery-section {
  margin-bottom: 35px;
  text-align: center;
}

.gallery-section h3 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  display: inline-block;
}

.gallery-note {
  max-width: 26rem;
  margin: 0 auto 18px;
  font-size: 0.82rem;
  color: rgba(74, 46, 36, 0.74);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  position: relative;
}

.gallery-trigger {
  background: linear-gradient(
    180deg,
    rgba(255, 252, 247, 0.98),
    rgba(235, 230, 220, 0.92)
  );
  cursor: pointer;
  padding: 0;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  text-align: left;
  appearance: none;
  border: 1px solid rgba(166, 115, 88, 0.16);
  box-shadow: 0 14px 28px rgba(74, 46, 36, 0.08);
  display: flex;
  flex-direction: column;
}

.gallery-trigger:focus-visible,
.btn:focus-visible,
.close-lightbox:focus-visible,
.contact-list a:focus-visible {
  outline: 3px solid rgba(166, 115, 88, 0.35);
  outline-offset: 4px;
}

.gallery-img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition:
    transform 0.4s ease,
    filter 0.4s ease;
}

.gallery-trigger:hover .gallery-img,
.gallery-trigger:focus-visible .gallery-img {
  transform: scale(1.04);
  filter: saturate(1.06);
}

.gallery-caption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(74, 46, 36, 0.06),
    rgba(74, 46, 36, 0.78)
  );
  color: #fff8f0;
}

.gallery-label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.84;
}

.gallery-title {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.2rem;
  line-height: 1.05;
  margin-top: 4px;
}

.gallery-index {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.84;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(30, 20, 15, 0.9);
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  border: 0;
  max-width: none;
  max-height: none;
}

.lightbox::backdrop {
  background-color: rgba(30, 20, 15, 0.9);
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--teak-light);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 30px;
  color: var(--ivory-bg);
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.3s ease;
  background: transparent;
  border: 0;
}

.close-lightbox:hover {
  color: var(--teak-light);
}

.countdown-container {
  background-color: var(--ivory-bg);
  border: 1px solid rgba(166, 115, 88, 0.2);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  justify-content: space-around;
  margin-bottom: 35px;
}

.countdown-finished {
  justify-content: center;
}

.countdown-message {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.4rem;
  color: var(--teak-base);
  font-weight: 600;
}

.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-val {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
  color: var(--teak-base);
  font-weight: 600;
  line-height: 1;
}

.time-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teak-light);
  margin-top: 5px;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  padding: 16px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 1px;
  width: 100%;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-family: "Montserrat", sans-serif;
}

.btn-nav {
  background-color: var(--teak-base);
  color: var(--ivory-card);
  box-shadow: 0 8px 20px rgba(122, 75, 58, 0.2);
}

.btn-nav:hover {
  background-color: var(--teak-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(122, 75, 58, 0.3);
}

.btn-share {
  background-color: transparent;
  color: var(--teak-base);
  border: 1px solid var(--teak-base);
}

.btn-share:hover {
  background-color: var(--teak-overlay);
}

.btn-icon {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.map-wrapper {
  border-radius: 16px;
  overflow: hidden;
  height: 200px;
  margin-bottom: 20px;
  border: 1px solid rgba(166, 115, 88, 0.2);
}

.map-embed {
  border: 0;
}

.directions-box,
.contact-box {
  text-align: left;
  background-color: var(--ivory-bg);
  padding: 25px;
  border-radius: 16px;
  border: 1px solid rgba(166, 115, 88, 0.1);
}

.directions-box h3,
.contact-box h3 {
  font-size: 1.4rem;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(166, 115, 88, 0.2);
  padding-bottom: 10px;
}

.directions-list,
.contact-list {
  list-style: none;
}

.directions-intro {
  font-size: 0.88rem;
  color: rgba(74, 46, 36, 0.82);
  margin-bottom: 16px;
}

.directions-list {
  font-size: 0.85rem;
}

.directions-list li {
  margin-bottom: 18px;
  padding-left: 20px;
  position: relative;
}

.directions-list li::before {
  content: "•";
  color: var(--teak-light);
  font-size: 1.5rem;
  position: absolute;
  left: 0;
  top: -6px;
}

.directions-list strong {
  color: var(--teak-dark);
  display: block;
  margin-bottom: 4px;
}

.contact-box {
  margin-top: 20px;
}

.contact-box p,
.contact-list {
  font-size: 0.9rem;
}

.contact-box p {
  margin-bottom: 10px;
  color: var(--teak-dark);
}

.contact-list {
  font-weight: 500;
}

.contact-list li {
  margin-bottom: 8px;
  color: var(--teak-base);
}

.contact-list a {
  color: inherit;
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .invitation-wrapper {
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 20px;
    gap: 20px;
  }

  .hero-section {
    padding: 0;
  }

  .image-arch {
    height: 100%;
    border-radius: 24px;
  }

  .content {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .gallery-img {
    height: 220px;
  }
}

@media (max-width: 767px) {
  .content {
    padding: 32px 22px 28px;
  }

  .message {
    margin-bottom: 24px;
  }

  .details-wrapper,
  .gallery-section,
  .countdown-container,
  .btn-group {
    margin-bottom: 24px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gallery-img {
    height: 220px;
  }

  .gallery-caption {
    right: 12px;
    bottom: 12px;
    left: 12px;
    padding: 12px;
  }

  .gallery-title {
    font-size: 1.15rem;
  }

  .map-wrapper,
  .contact-box,
  .directions-box {
    margin-bottom: 16px;
  }

  .directions-box,
  .contact-box {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
