/* CSS Variables for Theme */
:root {
  --bg-light: #f8f5f0;
  --bg-white: #ffffff;
  --bg-dark: #5a4a42;
  --accent-primary: #d2b48c;
  --accent-secondary: #c0a078;
  --text-dark: #333;
  --text-light: #f0f0f0;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Lato', sans-serif;
  --shadow-light: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* General Styles */
body {
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--bg-dark);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

h1 {
  font-size: 4em;
  margin-bottom: 15px;
}

h2 {
  font-size: 3em;
  margin-bottom: 50px;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -15px;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--accent-primary);
  border-radius: 2px;
}

p {
  font-size: 1.15em;
  margin-bottom: 25px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Navbar */
.navbar {
  background-color: transparent;
  padding: 20px 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar .logo {
  font-family: var(--font-heading);
  font-size: 2em;
  color: var(--text-light);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.navbar.scrolled .logo {
  color: var(--bg-dark);
  text-shadow: none;
}

.navbar .logo:hover {
  color: var(--accent-primary);
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.nav-links li {
  margin-left: 40px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.3s ease, transform 0.2s ease;
  position: relative;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.navbar.scrolled .nav-links a {
  color: var(--bg-dark);
  text-shadow: none;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background-color: var(--accent-primary);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Header/Hero Section */
.hero-header {
  text-align: center;
  padding: 180px 0 80px;
  color: white;
  position: relative;
  overflow: hidden;
  background-image: url('../photos/9.jpg');
  background-size: cover;
  background-position: center;
  will-change: background-position; /* Performance hint for the browser */
}

.hero-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.hero-header h1,
.hero-header p {
  position: relative;
  z-index: 2;
  color: var(--text-light);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-header h1 {
  font-size: 4.5em;
  margin-bottom: 20px;
}

.hero-header p {
  font-size: 1.8em;
}

.hero-header .button {
  margin-top: 40px;
  position: relative; /* To ensure z-index works */
  z-index: 2; /* To place it above the dark overlay */
}

/* Sections */
section {
  padding: 100px 0;
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

section.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Invitation Text Section */
#invitation-text {
  background-color: var(--bg-light);
}

#invitation-text p {
  font-size: 1.2em;
  line-height: 1.8;
  color: #555;
  margin-bottom: 2em; /* Space between paragraphs */
  max-width: 650px; /* Constrain line width for readability */
}

#invitation-text .invitation-closing {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.3em;
  color: var(--bg-dark);
  margin-top: 2em;
  margin-bottom: 0;
  line-height: 1.6;
}

/* Details Section */
#details {
  background-color: var(
    --bg-white
  ); /* Changed to white to differentiate from adjacent sections */
  overflow: hidden; /* Prevents horizontal scroll from overlapping cards */
}

.details-container {
  display: flex;
  flex-direction: column;
  gap: 100px;
}

.detail-block {
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-block.reverse {
  flex-direction: row-reverse;
}

.detail-block:not(.reverse) .detail-content {
  margin-right: -80px;
}

.detail-block.reverse .detail-content {
  margin-left: -80px;
}

.detail-content {
  flex-basis: 45%;
  background: var(--bg-white);
  padding: 40px;
  border-radius: 12px; /* Use a consistent, slightly larger radius */
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08); /* A more subtle, professional shadow */
  z-index: 10;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

/* --- Desktop border-radius logic for seamless look --- */
.detail-block:not(.reverse) .detail-content {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.detail-block.reverse .detail-content {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.detail-content h3 {
  font-size: 2.2em;
  margin-bottom: 15px;
  color: var(--accent-primary);
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Professional SVG Icon Implementation --- */
.detail-content h3::before {
  content: '';
  width: 40px;
  height: 40px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  margin-right: 15px; /* Space between icon and text */
  flex-shrink: 0; /* Prevent icon from shrinking */
}

.icon-calendar::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23c0a078' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3e%3c/rect%3e%3cline x1='16' y1='2' x2='16' y2='6'%3e%3c/line%3e%3cline x1='8' y1='2' x2='8' y2='6'%3e%3c/line%3e%3cline x1='3' y1='10' x2='21' y2='10'%3e%3c/line%3e%3c/svg%3e");
}
.icon-location::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23c0a078' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3e%3c/path%3e%3ccircle cx='12' cy='10' r='3'%3e%3c/circle%3e%3c/svg%3e");
}
.icon-transport::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23c0a078' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M19 17h2v-5.14a2.43 2.43 0 0 0-1-1.95l-5-3.57A2.43 2.43 0 0 0 13.14 6H5a2 2 0 0 0-2 2v9h2'%3e%3c/path%3e%3ccircle cx='7' cy='17' r='2'%3e%3c/circle%3e%3ccircle cx='17' cy='17' r='2'%3e%3c/circle%3e%3c/svg%3e");
}

.detail-content p {
  font-size: 1.1em;
  line-height: 1.8;
  max-width: none; /* Override global p styles */
  margin-left: 0;
}

.detail-content iframe {
  width: 100%;
  height: 250px;
  border: 0;
  border-radius: 8px;
  margin-top: 20px;
  box-shadow: var(--shadow-light);
}

.location-info {
  background-color: var(--bg-light);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: left;
  border: 1px solid #e0d9cf;
}

.venue-name {
  font-family: var(--font-body);
  font-size: 1.3em;
  font-weight: 700;
  color: var(--bg-dark);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
}

.venue-name::before {
  content: '';
  width: 24px;
  height: 24px;
  margin-right: 12px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235a4a42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M4 22h16'/%3e%3cpath d='M2 11h20'/%3e%3cpath d='M6 11V7a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v4'/%3e%3cpath d='M6 22V11'/%3e%3cpath d='M10 22V11'/%3e%3cpath d='M14 22V11'/%3e%3cpath d='M18 22V11'/%3e%3c/svg%3e");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.venue-address {
  font-size: 1em;
  line-height: 1.6;
  color: #555;
  margin: 0;
  padding-left: 36px; /* Align with text of venue-name */
}

.wedding-date {
  font-size: 1.2em;
  font-weight: 500;
  color: var(--bg-dark);
  margin-bottom: 25px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}

.time-schedule {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 10px 0;
}

.schedule-item {
  background-color: var(--bg-light);
  border: 1px solid #e0d9cf;
  border-radius: 8px;
  padding: 15px 20px;
  text-align: center;
  width: 130px;
  position: relative;
  padding-top: 50px; /* Space for icon */
}

.schedule-item::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.8;
}

.schedule-item.reception-time::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235a4a42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M13 4h3a2 2 0 0 1 2 2v14'/%3e%3cpath d='M2 20h3'/%3e%3cpath d='M13 20h9'/%3e%3cpath d='M10 4v16'/%3e%3cpath d='m18 10-3 3 3 3'/%3e%3c/svg%3e");
}

.schedule-item.ceremony-time::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235a4a42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2'%3e%3c/path%3e%3cpath d='M7 2v20'%3e%3c/path%3e%3cpath d='M21 15V2v0a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3z'%3e%3c/path%3e%3c/svg%3e");
}

.schedule-label {
  font-size: 1em;
  color: var(--bg-dark);
  font-weight: 500;
  display: block;
  margin-bottom: 5px;
}

.schedule-time {
  font-family: var(--font-heading);
  font-size: 1.8em;
  font-weight: 700;
  color: var(--accent-primary);
  display: block;
  line-height: 1;
}

.highlight-red {
  background-color: #fbe0e2; /* 柔和的紅色背景 */
  color: #9e2a2b; /* 搭配的深紅色文字，確保可讀性 */
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 500;
}

.map-link {
  display: inline-flex;
  align-items: center;
  background-color: #e8f0fe; /* Google-like blue background */
  color: #1a73e8; /* Google-like blue text */
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s, box-shadow 0.3s;
  border: 1px solid #d2e3fc;
}

.map-link:hover {
  background-color: #d2e3fc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: #1765cc;
}

.map-link::after {
  content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'%3e%3c/path%3e%3cpolyline points='15 3 21 3 21 9'%3e%3c/polyline%3e%3cline x1='10' y1='14' x2='21' y2='3'%3e%3c/line%3e%3c/svg%3e");
  margin-left: 8px;
}

.transport-method {
  margin: 25px 0;
  text-align: left;
  border-left: 3px solid var(--accent-secondary);
  padding-left: 20px;
}

.transport-title {
  font-family: var(--font-body);
  font-size: 1.2em;
  font-weight: 700;
  color: var(--bg-dark);
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  letter-spacing: 1px;
}

.transport-title::before {
  content: '';
  width: 22px;
  height: 22px;
  margin-right: 10px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.transport-title.public-transport::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235a4a42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M4 15.5A3.5 3.5 0 0 1 7.5 12h9a3.5 3.5 0 0 1 3.5 3.5v0A3.5 3.5 0 0 1 16.5 19h-9A3.5 3.5 0 0 1 4 15.5v0Z'/%3e%3cpath d='M15 12V6a2 2 0 0 0-2-2H11a2 2 0 0 0-2 2v6'/%3e%3cpath d='M8 19v2'/%3e%3cpath d='M16 19v2'/%3e%3cpath d='M12 12V4'/%3e%3c/svg%3e");
}

.transport-title.by-car::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235a4a42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M19 17h2v-5.14a2.43 2.43 0 0 0-1-1.95l-5-3.57A2.43 2.43 0 0 0 13.14 6H5a2 2 0 0 0-2 2v9h2'/%3e%3ccircle cx='7' cy='17' r='2'/%3e%3ccircle cx='17' cy='17' r='2'/%3e%3c/svg%3e");
}

.transport-title.more-info::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235a4a42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='12' cy='12' r='10'%3e%3c/circle%3e%3cline x1='12' y1='16' x2='12' y2='12'%3e%3c/line%3e%3cline x1='12' y1='8' x2='12.01' y2='8'%3e%3c/line%3e%3c/svg%3e");
}

.transport-detail {
  margin: 0;
  line-height: 1.7;
  color: #555;
}

.transport-detail .info-link {
  display: inline-flex;
  align-items: center;
  background-color: #f1f3f4;
  color: #3c4043;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s, box-shadow 0.3s;
  margin-right: 10px;
  margin-top: 10px;
}

.transport-detail .info-link:hover {
  background-color: #e8eaed;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.transport-detail .info-link::after {
  content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'%3e%3c/path%3e%3cpolyline points='15 3 21 3 21 9'%3e%3c/polyline%3e%3cline x1='10' y1='14' x2='21' y2='3'%3e%3c/line%3e%3c/svg%3e");
  margin-left: 6px;
  opacity: 0.8;
}

.detail-image {
  flex-basis: 55%;
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
  transition: transform 0.4s ease;
}

.detail-block:not(.reverse) .detail-image img {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.detail-block.reverse .detail-image img {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.detail-image img:hover {
  transform: scale(1.05);
}

.button {
  display: inline-block;
  padding: 18px 45px;
  background-color: var(--accent-primary);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 50px;
  font-size: 1.3em;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.button:hover {
  background-color: var(--accent-secondary);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-size: 1em;
  letter-spacing: 0.5px;
}

/* Countdown Section */
#countdown {
  background-image: url('../photos/11.jpg');
  background-size: cover;
  background-position: center;
  will-change: background-position; /* Performance hint for the browser */
  position: relative;
  color: var(--text-light);
  padding: 60px 0;
  text-align: center;
  /* It will now fade in like other sections */
}

#countdown::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(40, 30, 25, 0.65); /* Dark overlay for text readability */
  z-index: 1;
}

#countdown h2 {
  color: var(--text-light);
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
}

.timer-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  /* Removed card-like styles for a minimalist look */
  background-color: transparent;
  padding: 0;
  box-shadow: none;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.timer-box {
  /* Redesigned as a typographic element, not a box */
  background-color: transparent;
  padding: 0 30px; /* Controls spacing between units */
  width: 160px; /* Set a fixed width to prevent layout shifts */
  box-sizing: border-box; /* Ensures width includes padding */
  font-size: 3.5em;
  font-weight: 400;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--accent-primary); /* Number color */
  font-family: var(--font-heading); /* Elegant font for numbers */
  line-height: 1.1;
}

/* Vertical separator line */
.timer-box:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-60%); /* Adjust vertical alignment */
  height: 45px;
  width: 1px;
  background-color: rgba(
    255,
    255,
    255,
    0.3
  ); /* Lighter separator for dark bg */
}

.timer-box .label {
  font-family: var(--font-body);
  font-size: 0.3em; /* Relative to parent font-size */
  font-weight: 400;
  margin-top: 15px;
  text-transform: uppercase;
  letter-spacing: 3px; /* Wider spacing for a refined look */
  color: rgba(255, 255, 255, 0.7); /* Lighter label color */
}

.timer-expired-message {
  font-family: var(--font-heading);
  font-size: 2.5em;
  color: var(--text-light);
  width: 100%;
  text-align: center;
}

/* Gallery Section */
.gallery-section {
  background-color: var(--bg-light);
  /* Remove default padding to allow full-width scroll */
  padding-top: 100px;
  padding-bottom: 100px;
  padding-left: 0;
  padding-right: 0;
  /* Height will be set by JS to create a scroll "track" */
}

.gallery-subtitle {
  font-size: 1.1em;
  color: #666;
  margin-top: -30px;
  margin-bottom: 50px;
  padding-left: 20px; /* Add padding back for text elements */
  padding-right: 20px;
}

.photo-scroll-container {
  /* This will become a sticky container, filling the viewport's height */
  height: 100vh;
  overflow: hidden; /* Hide horizontal overflow; we control it with JS */
  overflow-y: hidden;
  padding: 50px 20px;
  box-sizing: border-box; /* Ensure padding is included in height */
  display: flex; /* Center the inner content vertically */
  align-items: center;
}

.photo-scroll-inner {
  display: flex;
  gap: 8px;
  /* The transform will be applied by JavaScript */
  will-change: transform;
}

.scroll-photo {
  height: 65vh;
  width: auto;
  box-shadow: var(--shadow-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  /* Prevent browser from canceling pointer events too eagerly on touch-drag */
  touch-action: manipulation;
}

.scroll-photo:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-medium);
}

/* Lightbox Modal */
.lightbox {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

/* RSVP Section */
#rsvp {
  background-color: var(--bg-dark);
  color: var(--text-light);
  background-image: url('../photos/4.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Parallax effect */
  position: relative;
}

#rsvp::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(40, 30, 25, 0.7); /* Darker wood-tone overlay */
  z-index: 1;
}

#rsvp h2,
#rsvp p {
  color: var(--text-light);
  position: relative;
  z-index: 2;
}

#rsvp .button {
  position: relative;
  z-index: 2;
}

#rsvp h2::after {
  background-color: var(--accent-primary);
}

/* Lightbox Content */
.lightbox-content {
  margin: auto;
  display: block;
  max-width: 85%;
  max-height: 85%;
  animation: zoom 0.6s;
}

@keyframes zoom {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 30px;
  transition: 0.6s ease;
  user-select: none;
  background-color: rgba(0, 0, 0, 0.3);
}

.lightbox-prev {
  left: 0;
  border-radius: 0 3px 3px 0;
}

.lightbox-next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 3em;
  }

  h2 {
    font-size: 2.5em;
  }

  .navbar .container {
    flex-direction: column;
  }

  .nav-links {
    margin-top: 15px;
  }

  .nav-links li {
    margin: 0 15px;
  }

  .hero-header {
    padding: 120px 0 40px;
  }

  .hero-header h1 {
    font-size: 3.5em;
  }

  .hero-header p {
    font-size: 1.2em;
  }

  .hero-header .button {
    margin-top: 30px;
  }

  .detail-block,
  .detail-block.reverse {
    flex-direction: column;
    gap: 0; /* Ensure tight stacking on mobile */
  }

  .detail-image {
    height: 300px; /* Adjust height for mobile */
  }

  /* --- Mobile border-radius logic: remove all radius --- */
  .detail-image img {
    border-radius: 0;
  }

  .detail-content {
    /* Disable hover effects on mobile */
    transition: none;
    transform: none;
    padding-bottom: 0;
  }

  .detail-content:hover {
    transform: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08); /* Revert to default shadow */
  }

  .detail-image img:hover {
    transform: none; /* Disable image hover scale on mobile */
  }

  .detail-block:not(.reverse) .detail-content,
  .detail-block.reverse .detail-content {
    margin: 0; /* Remove desktop overlap */
    width: 100%;
    border-radius: 0;
  }

  .location-info {
    border-radius: 0;
    margin-bottom: 0;
    border: none;
  }

  .detail-content iframe {
    border-radius: 0;
    margin-top: 0;
  }

  .details-container {
    gap: 0; /* Remove gap between detail blocks on mobile */
  }

  .timer-box {
    font-size: 2.2em; /* 縮小字體以適應螢幕 */
    width: 80px; /* 縮小寬度以確保所有方塊在同一行 */
    padding: 0 5px; /* 縮小間距 */
  }

  .timer-box:not(:last-child)::after {
    height: 30px; /* 稍微縮短分隔線 */
  }

  .button {
    padding: 12px 30px;
    font-size: 1em;
  }

  section {
    padding: 60px 0;
  }

  #invitation-text p {
    font-size: 1.1em;
    line-height: 1.7;
  }

  #invitation-text .invitation-closing {
    font-size: 1.2em;
  }

  .gallery-section {
    padding-top: 60px;
    padding-bottom: 60px;
    height: auto !important; /* Override JS inline style on resize */
  }

  .photo-scroll-container {
    /* Revert to standard horizontal swipe on mobile */
    height: auto;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    position: relative !important; /* Override JS inline style on resize */
    display: block; /* Revert from flex to allow normal block layout with scroll */
  }

  /* Hide scrollbar for a cleaner look on mobile */
  .photo-scroll-container::-webkit-scrollbar {
    display: none;
  }
  .photo-scroll-container {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
  }

  .photo-scroll-inner {
    /* 增加 padding 讓第一張與最後一張照片能對齊中央 */
    /* 計算: (100vw - 最寬照片寬度 85vw) / 2 = 7.5vw */
    padding: 0 7.5vw;
  }

  .scroll-photo {
    scroll-snap-align: center;
    /* 1. 設定一個統一且動態的高度 */
    /* 此高度基於最寬的照片(橫式)不超過螢幕寬度的85%來計算 (85vw * 2/3) */
    height: calc(85vw * 2 / 3);
    /* 2. 寬度設為自動，將由高度與長寬比決定 */
    width: auto;
    object-fit: cover; /* 確保圖片填滿空間且不變形 */
  }

  .scroll-photo:hover {
    /* 在行動裝置上移除 hover 放大效果 */
    transform: none;
    box-shadow: var(--shadow-light); /* 恢復成預設陰影 */
  }

  .scroll-photo[src*='/horizontal/'] {
    /* 3. 為橫式照片設定 3:2 的長寬比 */
    aspect-ratio: 3 / 2;
  }

  .scroll-photo[src*='/vertical/'] {
    /* 4. 為直式照片設定 2:3 的長寬比 */
    aspect-ratio: 2 / 3;
  }
}
