:root {
  --cream-50:  #faf6ef;
  --cream-100: #f5ede0;
  --cream-200: #ece0cb;
  --cream-300: #dcc9a8;
  --cream-400: #c4a880;
  --ink-700:   #5a4a36;
  --ink-800:   #3d3122;
  --ink-900:   #2a2116;
  --accent:    #8a6a3b;
  --accent-soft: #b89770;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Lora', Georgia, serif;
  color: var(--ink-800);
  background: var(--cream-50);
  background-image:
    radial-gradient(ellipse at top left, rgba(220,201,168,0.35), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(196,168,128,0.25), transparent 55%);
  background-attachment: fixed;
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.32 0 0 0 0 0.2 0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

main, nav, section, footer { position: relative; z-index: 2; }

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--ink-900);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* === Navbar === */
.navbar-custom {
  background: rgba(250, 246, 239, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(196,168,128,0.2);
  padding: 0.9rem 0;
}
.navbar-custom .navbar-brand {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--ink-900);
  letter-spacing: 0.02em;
}
.navbar-custom .nav-link {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  color: var(--ink-700) !important;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0.4rem;
  position: relative;
  transition: color 0.3s ease;
  text-decoration: none;
}
.navbar-custom .nav-link:hover { color: var(--accent) !important; }
.navbar-custom .nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: all 0.3s ease;
}
.navbar-custom .nav-link:hover::after { width: 70%; left: 15%; }

/* Ichthys */
.ichthys {
  display: inline-block;
  color: var(--accent);
  width: 60px;
  height: auto;
}

/* === Hero === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1rem 4rem;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 2.5rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.hero-side-img {
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  filter: grayscale(100%) sepia(8%);
  opacity: 0;
  animation: fadeIn 1.8s ease 1s forwards;
  box-shadow: 0 30px 60px -30px rgba(58,46,30,0.35);
}
.hero-side-img.left  { transform: rotate(-2deg); }
.hero-side-img.right { transform: rotate(2deg); animation-delay: 1.2s; }

.hero-center { opacity: 0; animation: fadeUp 1.2s ease 0.3s forwards; }
.hero-ichthys { margin: 0 auto 1.5rem; opacity: 0; animation: fadeUp 1.2s ease 0.2s forwards; }

.hero-eyebrow {
  font-family: 'Lora', serif;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.8rem;
  color: var(--ink-700);
  margin-bottom: 1.5rem;
}
.hero-name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(3.5rem, 11vw, 8rem);
  line-height: 0.95;
  color: var(--ink-900);
  margin: 0;
}
.hero-event {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1rem, 2vw, 1.3rem);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.25rem 0 1.75rem;
  padding-left: 0.5em;
}
.hero-date {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: var(--ink-800);
}
.hero-date .line { width: 50px; height: 1px; background: var(--cream-400); }
.hero-verse {
  margin-top: 2.5rem;
  font-style: italic;
  color: var(--ink-700);
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1rem;
  opacity: 0;
  animation: fadeUp 1.4s ease 1.4s forwards;
}
.hero-verse cite {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* === Sections === */
.section { padding: 7rem 0; position: relative; }
.section-label {
  font-family: 'Lora', serif;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 1rem;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}
.ornament {
  color: var(--accent-soft);
  letter-spacing: 0.6rem;
  font-size: 1.1rem;
  text-align: center;
  margin: 1rem auto 2.5rem;
}
.divider {
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--accent-soft), transparent);
  margin: 0 auto;
}

/* === Einladungstext === */
.invitation-text {
  background: rgba(255, 252, 246, 0.6);
  border: 1px solid rgba(196,168,128,0.25);
  border-radius: 2px;
  padding: 3.5rem 3rem;
  text-align: center;
  position: relative;
}
.invitation-text::before,
.invitation-text::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 1px;
  background: var(--accent-soft);
  left: 50%;
  transform: translateX(-50%);
}
.invitation-text::before { top: 1.5rem; }
.invitation-text::after  { bottom: 1.5rem; }
.invitation-text p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  line-height: 1.7;
  color: var(--ink-800);
  margin-bottom: 1.25rem;
}
.invitation-text .signature {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.6rem;
  color: var(--accent);
  margin-top: 2rem;
}

/* === Ablauf === */
.schedule-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid rgba(196,168,128,0.25);
  align-items: baseline;
}
.schedule-item:last-child { border-bottom: none; }
.schedule-time {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.6rem;
  color: var(--accent);
  font-weight: 500;
}
.schedule-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--ink-900);
  margin-bottom: 0.35rem;
}
.schedule-desc { color: var(--ink-700); font-size: 0.95rem; }
.schedule-meta {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.5rem;
}

.pre-event {
  background: rgba(245, 237, 224, 0.5);
  border-left: 3px solid var(--accent-soft);
  padding: 1.75rem 2rem;
  margin-top: 0.75rem;
  border-radius: 2px;
}
.pre-event-intro {
  margin-top: 3.5rem;
  margin-bottom: 0;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-800);
  text-align: center;
}
.pre-event h4 {
  font-style: italic;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--ink-900);
}
.pre-event p { margin: 0; color: var(--ink-700); font-size: 0.95rem; }

/* === Locations === */
.location-card {
  background: rgba(255, 252, 246, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(196,168,128,0.25);
  border-radius: 2px;
  padding: 2.5rem 2rem;
  height: 100%;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.location-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.location-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px -20px rgba(138,106,59,0.25);
  border-color: var(--accent-soft);
}
.location-card:hover::before { opacity: 1; }
.location-number {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 3rem;
  color: var(--cream-300);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.location-card h3 { font-size: 1.7rem; margin-bottom: 0.3rem; }
.location-meta {
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.location-address {
  color: var(--ink-700);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  font-style: italic;
}
.location-address strong { font-style: normal; color: var(--ink-900); font-weight: 500; }
.sketch-map {
  margin-top: auto;
  background: var(--cream-100);
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.sketch-map svg { width: 100%; height: 100%; display: block; }
.map-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--cream-300);
  padding-bottom: 2px;
  transition: all 0.3s ease;
}
.map-link:hover { color: var(--ink-900); border-color: var(--accent); }

/* === Memory strip === */
.memory-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  margin: 4rem 0 0;
}
.memory-strip > div {
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  filter: grayscale(100%) sepia(8%);
  border-radius: 2px;
  box-shadow: 0 15px 35px -20px rgba(58,46,30,0.4);
  transition: transform 0.5s ease;
}
.memory-strip > div:nth-child(odd)  { transform: rotate(-1.5deg); }
.memory-strip > div:nth-child(even) { transform: rotate(1.5deg); }
.memory-strip > div:hover {
  transform: rotate(0) scale(1.04);
  filter: grayscale(80%) sepia(8%);
}

/* === Upload === */
.upload-zone {
  background: rgba(255, 252, 246, 0.6);
  border: 2px dashed var(--cream-300);
  border-radius: 4px;
  padding: 4rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover {
  background: rgba(255, 252, 246, 0.9);
  border-color: var(--accent);
  transform: scale(1.01);
}
.upload-icon { font-size: 3rem; color: var(--accent-soft); margin-bottom: 1rem; }
.upload-zone h4 { font-style: italic; font-size: 1.6rem; margin-bottom: 0.5rem; }
.upload-zone p { color: var(--ink-700); font-size: 0.95rem; margin-bottom: 1.5rem; }

.uploader-input {
  background: rgba(255,252,246,0.7);
  border: 1px solid var(--cream-300);
  border-radius: 2px;
  font-family: 'Lora', serif;
  padding: 0.7rem 1rem;
  max-width: 320px;
  margin: 0 auto 1.25rem;
  display: block;
  text-align: center;
}
.uploader-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,252,246,1);
}

.btn-cream {
  background: var(--ink-900);
  color: var(--cream-50);
  border: none;
  padding: 0.85rem 2.5rem;
  font-family: 'Lora', serif;
  font-size: 0.82rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  border-radius: 0;
  transition: all 0.3s ease;
}
.btn-cream:hover {
  background: var(--accent);
  color: var(--cream-50);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -10px rgba(58,46,30,0.4);
}

.upload-status {
  margin-top: 1.5rem;
  font-style: italic;
  color: var(--ink-700);
}
.upload-status .ok { color: #4a6b3a; }
.upload-status .err { color: #7a3a3a; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}
.preview-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid var(--cream-200);
  position: relative;
  animation: fadeUp 0.5s ease forwards;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .badge-state {
  position: absolute;
  bottom: 4px; left: 4px;
  background: rgba(255,255,255,0.9);
  color: var(--ink-900);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}
.preview-item.uploading { opacity: 0.5; }

.upload-note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-700);
  opacity: 0.75;
}

/* === Gallery === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.gallery-tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 2px;
  background: var(--cream-100);
  border: 1px solid rgba(196,168,128,0.2);
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
  padding: 0;
  cursor: pointer;
  width: 100%;
  font: inherit;
  color: inherit;
}
.gallery-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px -15px rgba(58,46,30,0.3);
  border-color: var(--accent-soft);
}
.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-tile:hover img { transform: scale(1.05); }
.gallery-meta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1rem 0.75rem 0.6rem;
  background: linear-gradient(to top, rgba(42,33,22,0.7), transparent);
  color: var(--cream-50);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-tile:hover .gallery-meta { opacity: 1; }

/* Tile-Fallback (HEIC nicht ladbar) */
.tile-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--cream-100);
  color: var(--accent);
  padding: 1rem;
}
.gallery-tile.load-failed .tile-fallback { display: flex; }
.tile-fallback-label {
  font-family: 'Lora', serif;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}
.tile-fallback-hint {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-700);
}

/* Lightbox-Fallback */
.lightbox-fallback {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--cream-100);
  max-width: 500px;
  padding: 2rem;
  gap: 0.5rem;
}
.lightbox-fallback svg { color: var(--accent-soft); margin-bottom: 1rem; }
.lightbox-fallback-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.5rem;
  margin: 0;
}
.lightbox-fallback-subtitle {
  font-size: 0.95rem;
  opacity: 0.8;
  margin: 0.5rem 0 1rem;
  line-height: 1.6;
}
.lightbox-fallback-name {
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  opacity: 0.6;
  margin: 0 0 1.5rem;
  word-break: break-all;
}
.lightbox-fallback-link {
  text-decoration: none;
  display: inline-block;
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 10, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  display: flex;
  opacity: 1;
  animation: lightboxIn 0.3s ease;
}
@keyframes lightboxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-stage {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img {
  max-width: min(1200px, calc(100vw - 6rem));
  max-height: calc(100vh - 8rem);
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
  border-radius: 2px;
  background: var(--cream-50);
}
.lightbox-img.loaded { opacity: 1; }

.lightbox-spinner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 2px solid rgba(245, 237, 224, 0.2);
  border-top-color: var(--cream-200);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(250, 246, 239, 0.1);
  border: 1px solid rgba(250, 246, 239, 0.2);
  color: var(--cream-50);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 50%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox-close {
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  font-size: 1.75rem;
  font-family: serif;
  line-height: 1;
  padding-bottom: 2px;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
}
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(250, 246, 239, 0.2);
  border-color: var(--accent-soft);
}

.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--cream-100);
  background: rgba(20, 16, 10, 0.5);
  border: 1px solid rgba(250, 246, 239, 0.15);
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}
.lightbox-counter {
  color: var(--accent-soft);
}
.lightbox-time::before {
  content: '·';
  margin-right: 1rem;
  opacity: 0.5;
}

@media (max-width: 600px) {
  .lightbox { padding: 1rem; }
  .lightbox-close { top: 0.75rem; right: 0.75rem; width: 40px; height: 40px; }
  .lightbox-nav  { width: 44px; height: 44px; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .lightbox-img  { max-width: calc(100vw - 1rem); max-height: calc(100vh - 6rem); }
  .lightbox-caption {
    bottom: 0.75rem;
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
  }
}

/* === Footer === */
footer {
  text-align: center;
  padding: 4rem 1rem 3rem;
  border-top: 1px solid rgba(196,168,128,0.2);
  margin-top: 4rem;
}
footer .ornament { margin-bottom: 1.5rem; }
footer p { font-style: italic; color: var(--ink-700); margin: 0; }

@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side-img { display: none; }
}
@media (max-width: 768px) {
  .section { padding: 5rem 0; }
  .schedule-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .schedule-time { font-size: 1.3rem; }
  .invitation-text { padding: 2.5rem 1.5rem; }
  .invitation-text p { font-size: 1.15rem; }
  .memory-strip { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .memory-strip > div:nth-child(4),
  .memory-strip > div:nth-child(5) { display: none; }
}
