:root {
  --color-bg:       #FAF7F2;
  --color-text:     #3A3632;
  --color-text-dim: #8A8279;
  --color-accent:   #8B7355;
  --color-accent-l: #C4AD8F;
  --color-accent-xl:#DDD2C0;
  --color-gold:     #B8975A;
  --color-white:    #FFFFFF;
  --font-script:  'Great Vibes', cursive;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Raleway', 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.panel__label,
.panel__btn,
.section-subtitle {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 400;
}

.panel__label,
.section-subtitle { color: var(--color-text-dim); }

.menu-btn,
.panel__logout-btn {
  border: 1px solid var(--color-accent-xl);
  border-radius: 2px;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
}

.menu-btn {
  position: fixed;
  top: 1.2rem;
  left: 1.2rem;
  z-index: 100;
  padding: 0.5rem 1.2rem;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(8px);
  font-weight: 400;
  color: var(--color-accent);
}

.menu-btn:hover {
  background: var(--color-white);
  border-color: var(--color-accent-l);
}

.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(58, 54, 50, 0.3);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}

.panel-overlay.open { opacity: 1; pointer-events: auto; }

.panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 201;
  width: min(380px, 85vw);
  height: 100%;
  background: var(--color-bg);
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.panel.open { transform: translateX(0); }

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--color-accent-xl);
}

.panel__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.panel__close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--color-text-dim);
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

.panel__close:hover { color: var(--color-text); }
.panel__body { padding: 2.5rem 2rem; flex: 1; }
.panel__footer { padding: 0.8rem 2rem; text-align: center; font-size: 0.65rem; color: var(--color-text-dim); opacity: 0.5; }

.panel__label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

.panel__input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-accent-xl);
  border-radius: 2px;
  font-size: 1rem;
  letter-spacing: 0.1em;
  outline: none;
  background: var(--color-white);
  transition: border-color 0.3s;
}

.panel__input:focus { border-color: var(--color-accent); }

.panel__btn {
  width: 100%;
  margin-top: 1.2rem;
  padding: 0.85rem;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: 2px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.3s;
}

.panel__btn:hover { background: var(--color-text); }
.panel__btn:disabled { opacity: 0.5; cursor: wait; }

.panel__error {
  color: #b5453a;
  font-size: 0.8rem;
  margin-top: 0.8rem;
  min-height: 1.2em;
}

.panel__logout {
  display: none;
  margin-top: 2rem;
}

.panel__logout.visible { display: block; }

.panel__logout-btn {
  background: none;
  color: var(--color-text-dim);
  padding: 0.6rem 1.5rem;
  width: 100%;
}

.panel__logout-btn:hover { border-color: var(--color-accent); color: var(--color-text); }

.banner {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: #F3EDE4;
}

.banner__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.25;
  filter: saturate(0.6);
}

.banner::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 160px rgba(58, 54, 50, 0.12);
  pointer-events: none;
}

.banner__content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  max-width: 700px;
}

.banner__names {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.8rem, 11vw, 8rem);
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0;
  animation: fadeUp 1.2s 0.3s ease forwards;
}

.banner__amp {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.32em;
  color: var(--color-gold);
  vertical-align: middle;
  margin: 0 0.1em;
}

.banner__announcement,
.banner__info {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
}

.banner__announcement {
  font-size: clamp(1.2rem, 3.5vw, 1.7rem);
  letter-spacing: 0.1em;
  margin-top: 1rem;
  opacity: 0;
  animation: fadeUp 1s 0.7s ease forwards;
}

.banner__spacer { height: 0.8rem; }

.banner__info {
  font-size: clamp(1rem, 2.8vw, 1.35rem);
  letter-spacing: 0.15em;
  margin-top: 0.2rem;
}

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

#protected-content:empty { display: none; }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 300;
  text-align: center;
  margin-bottom: 0.2em;
  letter-spacing: 0.02em;
}

.section-subtitle {
  text-align: center;
  font-size: 0.8rem;
  margin-bottom: 3rem;
}

.gallery-section { background: var(--color-white); padding: clamp(2rem, 6vw, 5rem) 0; }

.gallery-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.gallery-tab {
  background: none;
  border: 1px solid var(--color-text-dim);
  color: var(--color-text-dim);
  padding: 0.4rem 1.2rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.3s;
}

.gallery-tab:hover:not(:disabled) { color: var(--color-text); border-color: var(--color-text); }
.gallery-tab.active { background: var(--color-text); color: var(--color-white); border-color: var(--color-text); }
.gallery-tab.disabled { opacity: 0.45; cursor: default; position: relative; }
.gallery-tab__note { display: block; font-size: 0.65rem; font-style: italic; margin-top: 0.15rem; }

.gallery-grid {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.gallery-grid.active { display: grid; }

.gallery-grid a { display: block; overflow: hidden; border-radius: 2px; aspect-ratio: 1; }
.gallery-grid a:nth-child(4n + 1) { grid-row: span 2; aspect-ratio: auto; }

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.4s;
  filter: saturate(0.85);
}

.gallery-grid a:hover img { transform: scale(1.05); filter: saturate(1); }

.program-section { background: var(--color-bg); padding: clamp(2rem, 6vw, 5rem) 0; }

.program-note {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-text-dim);
  margin-bottom: 2.5rem;
}

.timeline {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding-left: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--color-accent-l) 10%, var(--color-accent-l) 90%, transparent);
}

.timeline-item { position: relative; margin-bottom: 2.2rem; }
.timeline-item:last-child { margin-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -3rem;
  top: 0.45rem;
  width: 7px;
  height: 7px;
  background: var(--color-gold);
  border-radius: 50%;
  transform: translateX(-3px);
}

.timeline-item__time { font-family: var(--font-script); font-size: 1.7rem; color: var(--color-gold); line-height: 1; }
.timeline-item__title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; margin: 0.15rem 0 0.2rem; }
.timeline-item__subtitle,
.timeline-item__place,
.timeline-item__toggle,
.timeline-item__desc { font-size: 0.9rem; }

.timeline-item__row { display: flex; align-items: center; flex-wrap: wrap; }
.timeline-item__sep { margin: 0 0.4em; color: var(--color-text-dim); }
.timeline-item__subtitle a { color: inherit; }
.timeline-item__subtitle a:hover,
.timeline-item__place a:hover,
.timeline-item__toggle:hover { text-decoration: underline; }
.timeline-item__place { color: var(--color-accent); }
.timeline-item__place a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3em; }
.map-icon { width: 0.9em; height: 0.9em; flex-shrink: 0; }

.timeline-item__toggle { background: none; border: none; color: var(--color-accent); cursor: pointer; padding: 0; }
.toggle-arrow { font-size: 0.7em; }
.timeline-item__details.open .toggle-arrow { display: inline-block; transform: rotate(180deg); }
.timeline-item__details.open .timeline-item__toggle { color: var(--color-text-dim); }
.timeline-item__desc { color: var(--color-text-dim); display: none; padding-left: 0.8em; margin-top: 0.2em; text-align: justify; }
.timeline-item__details.open .timeline-item__desc { display: block; }

footer {
  text-align: center;
  padding: 0.5rem;
  color: var(--color-text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.4);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  line-height: 1;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover { color: #fff; }

.lightbox__close { top: 1.2rem; right: 1.5rem; font-size: 2rem; }
.lightbox__prev,
.lightbox__next { top: 50%; transform: translateY(-50%); font-size: 3rem; padding: 1rem; z-index: 1; }
.lightbox__prev { left: 0.5rem; }
.lightbox__next { right: 0.5rem; }

.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease, transform 0.8s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 600px) {
  .banner__names { font-size: clamp(2.4rem, 11vw, 4.5rem); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.35rem; }
}
