/* ---------------------------------------------------
   Krisztina & Balázs — dizájn a meghívó alapján:
   krém papír + cappuccino barna, egy elegáns szerif
   betűtípus, tükrözve a meghívó ritkított feliratait.
--------------------------------------------------- */

:root {
  --bg: #ECE3D6;          /* háttér a "kártya" mögött */
  --paper: #FBF7F1;       /* a meghívó papírjának színe */
  --ink: #5A4433;         /* fő szövegszín, cappuccino barna */
  --ink-soft: #8B7360;    /* másodlagos szöveg */
  --line: #CBB79E;        /* elválasztók, keretek */
  --accent: #8C6A4E;      /* gombok, hangsúly */
  --accent-dark: #6E5138;
  --error: #A6483C;
  --white: #FFFFFF;
  --radius: 2px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 24px;
}

.card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  max-width: 640px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(90, 68, 51, 0.12);
  padding: 56px 44px 48px;
}

@media (max-width: 520px) {
  .card { padding: 40px 22px 36px; }
}

.corner-art {
  position: absolute;
  width: 190px;
  height: 190px;
  color: var(--ink);
  opacity: 0.07;
  pointer-events: none;
  z-index: -1;
}

.corner-art svg { width: 100%; height: 100%; display: block; }

.corner-art--bl { left: -20px; bottom: -16px; }
.corner-art--br { right: -20px; bottom: -16px; transform: scaleX(-1); }

@media (max-width: 520px) {
  .corner-art { width: 130px; height: 130px; }
}

.floral-swag {
  width: 100%;
  margin: 6px auto 0;
  color: var(--ink-soft);
  position: relative;
  z-index: 1;
}

.floral-swag svg { width: 100%; height: auto; display: block; }

/* ---------- Hero / fejléc ---------- */

.hero { text-align: center; }

.monogram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.monogram-letter {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
}

.monogram-rule {
  width: 34px;
  height: 1px;
  background: var(--line);
}

.names {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: 12px;
  font-size: 2.6rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  margin: 10px 0 6px;
  color: var(--ink);
}

.names .amp {
  font-style: italic;
  color: var(--ink-soft);
}

@media (max-width: 520px) {
  .names {
    flex-direction: column;
    row-gap: 2px;
    font-size: 2.25rem;
    span {
      width: 100%;
    }
  }
}

.meta {
  margin: 0 0 28px;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* ---------- Karusszel (kiemelt fotók) ---------- */

.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 380px;
  overflow: hidden;
  background: var(--paper);
}

.carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
  transition: opacity 1.4s ease-in-out;
}

.carousel img.is-active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(28, 20, 14, 0.35);
  color: var(--white);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.carousel-nav:hover { background: rgba(28, 20, 14, 0.55); }

.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

/* ---------- Elválasztó ---------- */

.divider {
  text-align: center;
  color: var(--line);
  margin: 32px 0;
  position: relative;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: var(--line);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.divider span {
  display: inline-block;
  background: var(--paper);
  padding: 0 12px;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.intro {
  text-align: center;
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1.5;
  max-width: 46ch;
  margin: 0 auto 32px;
}

/* ---------- Panelek (belépés / app) ---------- */

.panel h2 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-align: center;
  margin: 0 0 18px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 380px;
  margin: 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

.field input {
  font-family: inherit;
  font-size: 1.1rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
}

.field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  font-family: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }

.btn-primary:disabled {
  background: var(--line);
  cursor: not-allowed;
}

.btn-text {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--line);
  align-self: center;
}

.btn-text:hover { background: rgba(140, 106, 78, 0.08); }

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-error {
  font-size: 0.95rem;
  color: var(--error);
  margin: 0;
}

.form-error.success {
  color: var(--accent-dark);
}

/* ---------- Bejelentkezett nézet ---------- */

.welcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto 36px;
}

.welcome {
  margin: 0;
  font-size: 1.15rem;
}

.upload-block, .gallery-block {
  max-width: 440px;
  margin: 0 auto 40px;
}

.hint {
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-align: center;
  margin: 0 0 14px;
}

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 16px;
  cursor: pointer;
  text-align: center;
  color: var(--ink-soft);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone:hover, .dropzone:focus-within {
  border-color: var(--accent);
  background: rgba(140, 106, 78, 0.05);
}

.selected-files {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-align: center;
}

.category {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.category-option {
  position: relative;
  cursor: pointer;
}

.category-option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.category-option span {
  display: block;
  padding: 8px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.category-option input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

.category-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 16px;
}

.filter-chip {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.filter-chip:hover { border-color: var(--accent); }

.filter-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

.filter-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.progress {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

/* ---------- Galéria ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

@media (max-width: 420px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--line);
  cursor: pointer;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none; /* a kattintás mindig a nagyítót nyissa meg, ne a videó saját vezérlőjét */
}

.gallery-item .uploader-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 30px 4px 6px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--white);
  background: linear-gradient(to top, rgba(58, 42, 30, 0.75), transparent);
}

.gallery-item .zoom-badge {
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(58, 42, 30, 0.55);
  color: var(--white);
}

.gallery-item .zoom-badge svg {
  width: 13px;
  height: 13px;
}

#load-more-btn { margin: 18px auto 0; }
#load-more-btn:not([hidden]) { display: block; }

#gallery-end {
  text-align: center;
  margin: 18px 0 0;
}

/* ---------- Lightbox (nagyított nézet) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(28, 20, 14, 0.92);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox:not([hidden]) {
  display: flex;
}

.lightbox-content {
  max-width: 100%;
  max-height: 100%;
  display: flex;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.18); }

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.18); }

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

@media (max-width: 520px) {
  .lightbox-nav { width: 38px; height: 38px; font-size: 1.3rem; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

/* ---------- Megerősítő ablak (admin törlés) ---------- */

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(28, 20, 14, 0.55);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-overlay:not([hidden]) {
  display: flex;
}

.confirm-box {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  padding: 28px 26px;
  max-width: 340px;
  width: 100%;
  text-align: center;
}

.confirm-message {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.4;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-danger {
  background: var(--error);
  color: var(--white);
}

.btn-danger:hover { background: #8A3A30; }

.admin-hint {
  max-width: 440px;
  margin: -20px auto 24px;
  font-style: italic;
}

.zoom-badge.zoom-badge--danger {
  background: rgba(166, 72, 60, 0.72);
}

/* ---------- Lábléc ---------- */

.footer {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}
