/* ==========================================================================
   Nina & Juraj — Wedding Gallery
   Base styles: variables, layout, components
   ========================================================================== */

:root {
  --color-bg: #FAF8F4;
  --color-card: #FFFFFF;
  --color-primary: #73866D;
  --color-primary-dark: #566352;
  --color-accent: #C8A96A;
  --color-text: #444444;
  --color-muted: #888888;
  --color-border: #E8E4DD;

  --radius: 12px;
  --shadow-soft: 0 4px 24px rgba(68, 68, 68, 0.06);
  --shadow-hover: 0 10px 32px rgba(68, 68, 68, 0.10);

  --font-title: "Cormorant Garamond", serif;
  --font-body: "Lato", sans-serif;

  --transition: 220ms ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0 0 0.5em;
}

.muted { color: var(--color-muted); }
.small { font-size: 0.85rem; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Animations ------------------------------------------------------------ */

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

.fade-in { animation: fadeIn 700ms ease both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

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

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
}
.btn-secondary:hover {
  background: var(--color-bg);
  transform: translateY(-1px);
}
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-small {
  padding: 9px 20px;
  font-size: 0.85rem;
}

/* Cards -------------------------------------------------------------------- */

.card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  position: relative;
}

/* Decorative leaves --------------------------------------------------------- */

.decor-leaf {
  position: absolute;
  width: 140px;
  height: 280px;
  background: url("../images/decorations/leaf.svg") no-repeat center / contain;
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
}
.decor-leaf-top-left { top: -30px; left: -40px; transform: rotate(-15deg); }
.decor-leaf-bottom-right { bottom: -30px; right: -40px; transform: rotate(165deg); }

/* Navbar --------------------------------------------------------------------- */

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition);
}
.navbar.scrolled {
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}
.navbar.scrolled .navbar-brand { color: var(--color-primary-dark); }
.navbar:not(.scrolled) .navbar-brand { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.25); }

.navbar-links { display: flex; align-items: center; gap: 28px; }
.navbar-links a:not(.btn) {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: opacity var(--transition);
}
.navbar:not(.scrolled) .navbar-links a:not(.btn) { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.25); }
.navbar.scrolled .navbar-links a:not(.btn) { color: var(--color-text); }
.navbar-links a:not(.btn):hover { opacity: 0.7; }

/* Hero ------------------------------------------------------------------------ */

.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("../images/hero.jpg") center 30% / cover no-repeat;
  overflow: hidden;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(86,99,82,0.35) 0%, rgba(250,248,244,0.15) 55%, rgba(250,248,244,0.85) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  padding: 0 24px;
  animation: fadeIn 900ms ease both;
}
.hero-content h1 {
  color: #fff;
  font-size: clamp(3rem, 8vw, 5.5rem);
  margin-bottom: 0.2em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.hero-subtitle {
  font-size: 1.15rem;
  margin-bottom: 2em;
  text-shadow: 0 1px 10px rgba(0,0,0,0.2);
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.scroll-indicator span {
  display: block;
  width: 22px;
  height: 36px;
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 12px;
  position: relative;
}
.scroll-indicator span::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: #fff;
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollDot 1.6s ease infinite;
}
@keyframes scrollDot {
  0% { opacity: 1; top: 6px; }
  100% { opacity: 0; top: 18px; }
}

/* Upload section --------------------------------------------------------------- */

.upload-section { padding: 100px 0 60px; }

.upload-card {
  max-width: 620px;
  margin: 0 auto;
  padding: 56px 44px;
  text-align: center;
  overflow: hidden;
}
.upload-icon { color: var(--color-primary); margin-bottom: 14px; }
.upload-card h2 { font-size: 2rem; }
.upload-card > p.muted { margin-bottom: 32px; }

.dropzone {
  position: relative;
  z-index: 1;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 48px 24px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover {
  border-color: var(--color-primary);
  background: rgba(115, 134, 109, 0.05);
  outline: none;
}
.dropzone svg { margin: 0 auto 16px; }
.dropzone-text { font-weight: 600; margin: 0 0 4px; }

.upload-progress { margin-top: 24px; }
.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  transition: width 150ms ease;
}
#progressLabel { margin-top: 10px; margin-bottom: 0; }

.upload-success, .upload-error {
  margin-top: 24px;
  animation: fadeIn 400ms ease both;
}
.upload-success p:first-child { color: var(--color-primary-dark); font-weight: 600; }
.upload-error p:first-child { color: #a15c4a; font-weight: 600; }

/* Gallery section --------------------------------------------------------------- */

.gallery-section { padding: 60px 0 100px; }
.section-title { text-align: center; font-size: 2.2rem; margin-bottom: 40px; }

.gallery-grid {
  column-count: 2;
  column-gap: 16px;
}
@media (min-width: 640px) {
  .gallery-grid { column-count: 3; }
}
@media (min-width: 960px) {
  .gallery-grid { column-count: 4; }
}
@media (min-width: 1280px) {
  .gallery-grid { column-count: 5; }
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  animation: fadeIn 500ms ease both;
  transition: box-shadow var(--transition);
}
.gallery-item:hover { box-shadow: var(--shadow-hover); }

.gallery-item img {
  width: 100%;
  transition: transform 350ms ease;
}
.gallery-item:hover img { transform: scale(1.045); }

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(68,68,68,0) 50%, rgba(68,68,68,0.55) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px;
  color: #fff;
  font-size: 0.8rem;
}
.gallery-item:hover .gallery-item-overlay,
.gallery-item:focus-visible .gallery-item-overlay { opacity: 1; }
.gallery-item-overlay svg { width: 20px; height: 20px; }

.gallery-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--color-muted);
}
.gallery-empty p:first-child {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--color-primary-dark);
  margin-bottom: 6px;
}

.gallery-loader { display: flex; justify-content: center; padding: 32px 0; }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal ------------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 30, 28, 0.9);
}
.modal-figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 90vw;
  max-height: 78vh;
  text-align: center;
}
.modal-figure img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.modal-figure figcaption { color: #ddd; margin-top: 12px; }

.modal-close, .modal-nav {
  position: absolute;
  z-index: 2;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover, .modal-nav:hover { background: rgba(255,255,255,0.24); }
.modal-close { top: 24px; right: 24px; width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; }
.modal-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 2rem; }
.modal-prev { left: 24px; }
.modal-next { right: 24px; }
.modal-download {
  position: relative;
  z-index: 1;
  margin-top: 20px;
}

@media (max-width: 640px) {
  .modal-nav { width: 40px; height: 40px; font-size: 1.5rem; }
  .modal-prev { left: 8px; }
  .modal-next { right: 8px; }
}

/* Footer -------------------------------------------------------------------------- */

.footer {
  position: relative;
  text-align: center;
  padding: 56px 24px 40px;
  color: var(--color-muted);
  overflow: hidden;
}
.footer-leaf {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
  width: 90px;
  height: 180px;
  background: url("../images/decorations/leaf.svg") no-repeat center / contain;
  opacity: 0.08;
}
.footer-line { margin: 0; }
.footer-names {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--color-primary-dark);
  margin: 4px 0;
}
.footer-date { margin: 0; font-size: 0.85rem; }

/* Forms ------------------------------------------------------------------------------ */

input[type="text"], input[type="search"], input[type="password"], select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--transition);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(115, 134, 109, 0.15);
}

/* Utility -------------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
