/* ===================================
   Henderson 40th Anniversary
   Theme System & Layout (TK-001)
   =================================== */

/* --- Theme Tokens --- */
:root {
  /* Colors — ruby/cream palette */
  --color-cream: oklch(0.965 0.012 75);
  --color-cream-fallback: #f5f0e8;
  --color-ruby: oklch(0.42 0.19 18);
  --color-ruby-fallback: #8b1a2d;
  --color-ruby-light: oklch(0.55 0.15 18);
  --color-ruby-light-fallback: #b8344a;
  --color-text: #3d2c2c;
  --color-text-light: #6b5454;
  --color-white: #ffffff;
  --color-overlay: rgba(0, 0, 0, 0.85);

  /* Typography */
  --font-body: 'Playfair Display', Georgia, serif;
  --font-cursive: 'Great Vibes', cursive;

  /* Card styling */
  --card-shadow: 0 2px 12px rgba(61, 44, 44, 0.1);
  --card-radius: 12px;
  --card-bg: var(--color-cream-fallback);

  /* Layout */
  --max-width: 1100px;
  --grid-gap: 2rem;
  --section-padding: 2rem;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-cream-fallback);
  background-color: var(--color-cream);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3 {
  color: var(--color-ruby-fallback);
  color: var(--color-ruby);
  line-height: 1.3;
}

h1 {
  font-family: var(--font-cursive);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

a {
  color: var(--color-ruby-fallback);
  color: var(--color-ruby);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-ruby-light-fallback);
  color: var(--color-ruby-light);
}

/* --- Password Overlay --- */
.password-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-overlay);
  padding: var(--section-padding);
}

.password-overlay.hidden {
  display: none;
}

.password-box {
  background: var(--color-white);
  padding: 3rem 2.5rem;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.password-box h2 {
  margin-bottom: 0.5rem;
}

.password-box p {
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.password-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.password-input:focus {
  outline: none;
  border-color: var(--color-ruby-fallback);
  border-color: var(--color-ruby);
}

.password-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: var(--color-ruby-fallback);
  background: var(--color-ruby);
  color: var(--color-white);
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.password-btn:hover {
  background: var(--color-ruby-light-fallback);
  background: var(--color-ruby-light);
}

.password-error {
  color: #c0392b;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  display: none;
}

.password-error.visible {
  display: block;
}

/* --- Page Layout --- */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-padding);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
  align-items: start;
}

/* --- Card Styling --- */
.card {
  background: var(--color-white);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0z' fill='none'/%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23f5f0e8' stroke-width='0.5'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
}

/* --- Invitation Card --- */
.invitation-card {
  text-align: center;
}

.invitation-card .card-content {
  position: relative;
  z-index: 1;
}

/* Ruby gem decorations */
.gem-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gem {
  width: 24px;
  height: 32px;
  background: var(--color-ruby-fallback);
  background: var(--color-ruby);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: shimmer 3s ease-in-out infinite;
}

.gem:nth-child(2) {
  animation-delay: 0.5s;
  width: 20px;
  height: 28px;
}

.gem:nth-child(3) {
  animation-delay: 1s;
}

.gem:nth-child(4) {
  animation-delay: 1.5s;
  width: 20px;
  height: 28px;
}

.gem:nth-child(5) {
  animation-delay: 2s;
}

@keyframes shimmer {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.couple-names {
  font-family: var(--font-cursive);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  color: var(--color-ruby-fallback);
  color: var(--color-ruby);
  font-weight: 400;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.occasion {
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  color: var(--color-text-light);
}

.event-details {
  list-style: none;
  text-align: left;
  padding: 0;
  margin-top: 1.5rem;
}

.event-details li {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(139, 26, 45, 0.1);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.event-details li:last-child {
  border-bottom: none;
}

.event-details .label {
  font-weight: 700;
  min-width: 5rem;
  color: var(--color-ruby-fallback);
  color: var(--color-ruby);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- RSVP Card --- */
.rsvp-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.toggle-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.toggle-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-ruby-fallback);
  border-color: var(--color-ruby);
  border-radius: 8px;
  background: transparent;
  color: var(--color-ruby-fallback);
  color: var(--color-ruby);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background: rgba(139, 26, 45, 0.05);
}

.toggle-btn.active {
  background: var(--color-ruby-fallback);
  background: var(--color-ruby);
  color: var(--color-white);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-ruby-fallback);
  border-color: var(--color-ruby);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-fields {
  display: none;
}

.form-fields.visible {
  display: block;
}

.submit-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--color-ruby-fallback);
  background: var(--color-ruby);
  color: var(--color-white);
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.submit-btn:hover {
  background: var(--color-ruby-light-fallback);
  background: var(--color-ruby-light);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.confirmation-message,
.return-visitor-message {
  text-align: center;
  padding: 2rem 1rem;
}

.confirmation-message h3,
.return-visitor-message h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.confirmation-message p,
.return-visitor-message p {
  color: var(--color-text-light);
}

/* --- Photo Carousel --- */
.carousel-section {
  margin-top: var(--grid-gap);
  width: 100%;
  overflow: hidden;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  position: relative;
  aspect-ratio: 16 / 7;
  background: #2c1a1a;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
  color: var(--color-ruby-fallback);
  color: var(--color-ruby);
}

.carousel-btn:hover {
  background: var(--color-white);
}

.carousel-btn--prev {
  left: 1rem;
}

.carousel-btn--next {
  right: 1rem;
}

.carousel-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--color-white);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.carousel-dot.active {
  background: var(--color-white);
}

/* --- Countdown --- */
.countdown-section {
  text-align: center;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.countdown-display {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.countdown-unit {
  text-align: center;
}

.countdown-unit .number {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--color-ruby-fallback);
  color: var(--color-ruby);
  line-height: 1;
}

.countdown-unit .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin-top: 0.25rem;
}

.countdown-message {
  font-size: 1.25rem;
  color: var(--color-ruby-fallback);
  color: var(--color-ruby);
  font-style: italic;
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .page-content {
    padding: 1rem;
  }

  .card {
    padding: 2rem 1.5rem;
  }

  .toggle-group {
    flex-direction: column;
  }

  .countdown-display {
    gap: 1rem;
  }

  .carousel-section {
    border-radius: 8px;
  }
}
