/* === DESIGN TOKENS — Wedding Theme === */
:root {
  /* Colors — warm cream & earth tones from invitation */
  --color-bg: #FAF6F0;
  --color-bg-alt: #F3EDE3;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F7F2EB;
  --color-text: #3D3429;
  --color-text-muted: #7A6F62;
  --color-text-faint: #A89B8C;
  --color-accent: #8B7355;
  --color-accent-hover: #6E5A42;
  --color-accent-light: rgba(139, 115, 85, 0.1);
  --color-gold: #B8995A;
  --color-gold-light: rgba(184, 153, 90, 0.12);
  --color-border: rgba(61, 52, 41, 0.1);
  --color-border-strong: rgba(61, 52, 41, 0.2);
  --color-overlay: rgba(61, 52, 41, 0.6);
  --color-white: #FFFFFF;
  --color-error: #C4534A;
  --color-success: #5A8A5E;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
  --text-lg: clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
  --text-xl: clamp(1.4rem, 1.2rem + 1vw, 1.75rem);
  --text-2xl: clamp(1.8rem, 1.5rem + 1.5vw, 2.5rem);
  --text-3xl: clamp(2.2rem, 1.8rem + 2vw, 3.5rem);
  --text-hero: clamp(3rem, 2.5rem + 3vw, 5rem);

  /* Spacing — 4px grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Misc */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(61, 52, 41, 0.06);
  --shadow-md: 0 4px 12px rgba(61, 52, 41, 0.08);
  --shadow-lg: 0 8px 24px rgba(61, 52, 41, 0.1);
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --content-width: 960px;
  --content-narrow: 680px;
}

/* === LAYOUT === */
.container { width: 100%; max-width: var(--content-width); margin: 0 auto; padding: 0 var(--space-6); }
.container--narrow { max-width: var(--content-narrow); }

/* === LOGIN SCREEN === */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
  padding: var(--space-6);
}
.login-card {
  background: var(--color-surface); border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-10);
  box-shadow: var(--shadow-lg); text-align: center; max-width: 400px; width: 100%;
}
.login-card h1 { font-family: var(--font-display); font-size: var(--text-2xl); color: var(--color-text); margin-bottom: var(--space-2); font-weight: 400; }
.login-card p { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-8); }
.login-card input[type="password"] {
  width: 100%; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md); font-size: var(--text-base); text-align: center;
  background: var(--color-bg); transition: border-color var(--transition);
  outline: none;
}
.login-card input:focus { border-color: var(--color-accent); }
.login-card .login-btn {
  width: 100%; margin-top: var(--space-4); padding: var(--space-3) var(--space-6);
  background: var(--color-accent); color: var(--color-white); border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500; letter-spacing: 0.02em;
  transition: background var(--transition);
}
.login-card .login-btn:hover { background: var(--color-accent-hover); }
.login-error { color: var(--color-error); font-size: var(--text-xs); margin-top: var(--space-2); display: none; }

/* === HERO === */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0; z-index: 0;
}
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(61,52,41,0.25) 0%, rgba(61,52,41,0.55) 100%);
}
.hero__content {
  position: relative; z-index: 2; text-align: center; color: var(--color-white);
  padding: var(--space-6);
}
.hero__names {
  font-family: var(--font-display); font-size: var(--text-hero); font-weight: 400;
  line-height: 1.1; margin-bottom: var(--space-4);
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.hero__names span { display: block; font-size: 0.4em; font-family: var(--font-body); font-weight: 300; letter-spacing: 0.1em; margin: var(--space-2) 0; }
.hero__date {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 400;
  margin-bottom: var(--space-6); opacity: 0.95;
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
}
.hero__quote {
  font-family: var(--font-display); font-size: var(--text-lg); font-style: italic;
  opacity: 0.85; max-width: 500px; margin: 0 auto;
  text-shadow: 0 1px 10px rgba(0,0,0,0.2);
}
.hero__scroll {
  position: absolute; bottom: var(--space-8); left: 50%; transform: translateX(-50%);
  z-index: 2; animation: bounce 2s infinite;
}
.hero__scroll svg { width: 28px; height: 28px; stroke: var(--color-white); opacity: 0.7; }
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* === NAV === */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 240, 0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}
.nav.scrolled { box-shadow: var(--shadow-sm); }
.nav__inner {
  max-width: var(--content-width); margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: var(--space-8);
  padding: var(--space-3) var(--space-6);
}
.nav__link {
  font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 500;
  letter-spacing: 0.02em; transition: color var(--transition);
  padding: var(--space-1) 0; position: relative;
}
.nav__link:hover, .nav__link.active { color: var(--color-accent); }
.nav__link::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 1.5px;
  background: var(--color-accent); transform: scaleX(0); transition: transform var(--transition);
}
.nav__link:hover::after, .nav__link.active::after { transform: scaleX(1); }
.nav__admin {
  font-size: var(--text-xs); color: var(--color-text-faint); margin-left: auto;
  transition: color var(--transition);
}
.nav__admin:hover { color: var(--color-accent); }

/* Mobile nav */
.nav__hamburger { display: none; padding: var(--space-2); }
.nav__hamburger svg { width: 24px; height: 24px; stroke: var(--color-text); }

@media (max-width: 768px) {
  .nav__hamburger { display: block; position: absolute; right: var(--space-4); }
  .nav__inner {
    flex-direction: column; gap: 0; padding: var(--space-3) var(--space-6);
    position: relative;
  }
  .nav__links {
    display: none; flex-direction: column; width: 100%; gap: var(--space-1);
    padding: var(--space-3) 0;
  }
  .nav__links.open { display: flex; }
  .nav__link { padding: var(--space-2) 0; }
  .nav__admin { margin-left: 0; padding: var(--space-2) 0; }
  .nav__brand { font-family: var(--font-display); font-size: var(--text-base); color: var(--color-text); }
}
@media (min-width: 769px) {
  .nav__brand { display: none; }
  .nav__links { display: contents; }
}

/* === SECTIONS === */
.section {
  padding: clamp(var(--space-16), 8vw, var(--space-24)) 0;
}
.section--alt { background: var(--color-bg-alt); }
.section__title {
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 400;
  text-align: center; margin-bottom: var(--space-3); color: var(--color-text);
}
.section__subtitle {
  text-align: center; color: var(--color-text-muted); font-size: var(--text-sm);
  margin-bottom: var(--space-12); max-width: 500px; margin-left: auto; margin-right: auto;
}
.section__divider {
  width: 60px; height: 1px; background: var(--color-gold);
  margin: 0 auto var(--space-8); opacity: 0.6;
}

/* === INTRO === */
.intro { text-align: center; max-width: var(--content-narrow); margin: 0 auto; }
.intro__text { font-size: var(--text-lg); color: var(--color-text); line-height: 1.8; }

/* === TIMELINE === */
.timeline { max-width: 600px; margin: 0 auto; position: relative; padding-left: var(--space-10); }
.timeline::before {
  content: ''; position: absolute; left: 14px; top: 0; bottom: 0;
  width: 1px; background: var(--color-border-strong);
}
.timeline__item {
  position: relative; margin-bottom: var(--space-8); padding-left: var(--space-6);
  opacity: 0; transform: translateY(10px);
  animation: fadeInUp 0.5s ease forwards;
}
.timeline__item:nth-child(1) { animation-delay: 0.1s; }
.timeline__item:nth-child(2) { animation-delay: 0.2s; }
.timeline__item:nth-child(3) { animation-delay: 0.3s; }
.timeline__item:nth-child(4) { animation-delay: 0.4s; }
.timeline__item:nth-child(5) { animation-delay: 0.5s; }
.timeline__dot {
  position: absolute; left: -38px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-gold); border: 2px solid var(--color-bg-alt);
}
.timeline__time {
  font-family: var(--font-display); font-size: var(--text-lg); color: var(--color-accent);
  margin-bottom: var(--space-1);
}
.timeline__label { font-size: var(--text-base); color: var(--color-text); font-weight: 500; }
.timeline__detail { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-1); }
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* === LOCATIONS === */
.locations { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); }
@media (max-width: 768px) { .locations { grid-template-columns: 1fr; } }
.location-card {
  background: var(--color-surface); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition);
}
.location-card:hover { box-shadow: var(--shadow-lg); }
.location-card__map {
  width: 100%; height: 220px; border: none;
}
.location-card__body { padding: var(--space-6); }
.location-card__name {
  font-family: var(--font-display); font-size: var(--text-lg); color: var(--color-text);
  margin-bottom: var(--space-2);
}
.location-card__address { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5; }
.location-card__link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-3); font-size: var(--text-sm); color: var(--color-accent);
  font-weight: 500; transition: color var(--transition);
}
.location-card__link:hover { color: var(--color-accent-hover); }
.location-card__link svg { width: 14px; height: 14px; }

/* === FAQ === */
.faq-list { max-width: var(--content-narrow); margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}
.faq-item__question {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) 0; font-size: var(--text-base); font-weight: 500;
  color: var(--color-text); text-align: left; transition: color var(--transition);
  gap: var(--space-4);
}
.faq-item__question:hover { color: var(--color-accent); }
.faq-item__icon {
  width: 20px; height: 20px; flex-shrink: 0;
  transition: transform var(--transition);
}
.faq-item.open .faq-item__icon { transform: rotate(45deg); }
.faq-item__answer {
  max-height: 0; overflow: hidden; transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s;
  padding: 0 0;
}
.faq-item.open .faq-item__answer { max-height: 300px; padding: 0 0 var(--space-5) 0; }
.faq-item__answer p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.7; }

/* === GALLERY === */
.gallery__controls {
  display: flex; align-items: center; justify-content: center; gap: var(--space-4);
  margin-bottom: var(--space-8); flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500; transition: all var(--transition);
}
.btn--primary { background: var(--color-accent); color: var(--color-white); }
.btn--primary:hover { background: var(--color-accent-hover); }
.btn--outline { border: 1px solid var(--color-border-strong); color: var(--color-text-muted); }
.btn--outline:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn--danger { background: var(--color-error); color: var(--color-white); }
.btn--small { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
.btn svg { width: 16px; height: 16px; }

.gallery__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4);
}
@media (max-width: 480px) { .gallery__grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); } }
.gallery__item {
  position: relative; border-radius: var(--radius-md); overflow: hidden;
  aspect-ratio: 1; cursor: pointer; background: var(--color-bg-alt);
}
.gallery__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery__item:hover img { transform: scale(1.05); }
.gallery__item__overlay {
  position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, transparent 50%);
  opacity: 0; transition: opacity var(--transition);
  display: flex; align-items: flex-end; padding: var(--space-3);
}
.gallery__item:hover .gallery__item__overlay { opacity: 1; }
.gallery__item__info { color: white; font-size: var(--text-xs); }

.gallery__empty {
  text-align: center; padding: var(--space-16) 0; color: var(--color-text-faint);
}
.gallery__empty svg { width: 48px; height: 48px; margin: 0 auto var(--space-4); opacity: 0.4; }
.gallery__empty p { font-size: var(--text-sm); }

/* Upload area */
.upload-area {
  border: 2px dashed var(--color-border-strong); border-radius: var(--radius-lg);
  padding: var(--space-10); text-align: center; margin-bottom: var(--space-8);
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--color-accent); background: var(--color-accent-light);
}
.upload-area svg { width: 40px; height: 40px; margin: 0 auto var(--space-3); color: var(--color-text-faint); }
.upload-area p { font-size: var(--text-sm); color: var(--color-text-muted); }
.upload-area .upload-hint { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-2); }
.upload-progress { display: none; margin-top: var(--space-3); }
.upload-progress__bar {
  height: 4px; background: var(--color-bg-alt); border-radius: 2px; overflow: hidden;
}
.upload-progress__fill {
  height: 100%; background: var(--color-accent); border-radius: 2px;
  transition: width 0.3s ease; width: 0%;
}
.upload-name-input {
  display: none; margin-top: var(--space-4);
}
.upload-name-input input {
  width: 100%; max-width: 300px; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  text-align: center; font-size: var(--text-sm); background: var(--color-surface);
  outline: none;
}
.upload-name-input input:focus { border-color: var(--color-accent); }

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.9); align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: var(--radius-md);
}
.lightbox__close {
  position: absolute; top: var(--space-4); right: var(--space-4);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 24px; opacity: 0.7; transition: opacity var(--transition);
}
.lightbox__close:hover { opacity: 1; }
.lightbox__download {
  position: absolute; bottom: var(--space-6); left: 50%; transform: translateX(-50%);
}

/* === ADMIN PANEL === */
.admin-panel {
  display: none; background: var(--color-surface); border-radius: var(--radius-lg);
  padding: var(--space-8); box-shadow: var(--shadow-md); margin-top: var(--space-8);
}
.admin-panel.visible { display: block; }
.admin-panel h3 {
  font-family: var(--font-display); font-size: var(--text-xl); margin-bottom: var(--space-6);
  color: var(--color-text);
}
.admin-tabs {
  display: flex; gap: var(--space-2); margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-2); flex-wrap: wrap;
}
.admin-tab {
  padding: var(--space-2) var(--space-4); font-size: var(--text-sm); color: var(--color-text-muted);
  font-weight: 500; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition);
}
.admin-tab.active { color: var(--color-accent); border-bottom: 2px solid var(--color-accent); }
.admin-tab:hover { color: var(--color-text); }
.admin-content { display: none; }
.admin-content.active { display: block; }
.admin-field { margin-bottom: var(--space-4); }
.admin-field label {
  display: block; font-size: var(--text-xs); color: var(--color-text-muted);
  margin-bottom: var(--space-1); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em;
}
.admin-field input, .admin-field textarea {
  width: 100%; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  background: var(--color-bg); font-size: var(--text-sm); outline: none;
  transition: border-color var(--transition);
}
.admin-field input:focus, .admin-field textarea:focus { border-color: var(--color-accent); }
.admin-field textarea { min-height: 80px; resize: vertical; }
.admin-faq-item {
  background: var(--color-bg); border-radius: var(--radius-md);
  padding: var(--space-4); margin-bottom: var(--space-3);
  border: 1px solid var(--color-border);
}
.admin-faq-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.admin-save-notice {
  display: none; padding: var(--space-3) var(--space-4); background: rgba(90,138,94,0.1);
  border-radius: var(--radius-md); color: var(--color-success); font-size: var(--text-sm);
  margin-top: var(--space-4);
}

/* === FOOTER === */
.footer {
  background: var(--color-text); color: rgba(255,255,255,0.6);
  padding: var(--space-10) 0; text-align: center;
}
.footer__names {
  font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-white);
  margin-bottom: var(--space-2); font-weight: 400;
}
.footer__date { font-size: var(--text-sm); margin-bottom: var(--space-6); }
.footer__credit { font-size: var(--text-xs); opacity: 0.5; }
.footer__credit a { text-decoration: underline; transition: opacity var(--transition); }
.footer__credit a:hover { opacity: 0.8; }

/* === LIGHTBOX NAV === */
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 28px; opacity: 0.6; transition: opacity var(--transition);
  background: rgba(0,0,0,0.3); border-radius: 50%;
}
.lightbox__nav:hover { opacity: 1; }
.lightbox__nav--prev { left: var(--space-4); }
.lightbox__nav--next { right: var(--space-4); }

/* === SCROLL ANIMATIONS === */
.reveal {
  opacity: 0; transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; }

/* === TOAST === */
.toast {
  position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--color-text); color: var(--color-white); padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md); font-size: var(--text-sm); box-shadow: var(--shadow-lg);
  opacity: 0; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 200;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .hero__names { font-size: clamp(2.2rem, 10vw, 3.5rem); }
  .section { padding: var(--space-12) 0; }
  .location-card__map { height: 180px; }
  .gallery__controls { gap: var(--space-2); }
  .admin-panel { padding: var(--space-4); }
}
