/* Kattotalkoot – tyyli
   Paletti: pelti (sinkki), petäjä/mänty (puu), taivas, syvä havumetsän vihreä.
   Signature-elementti: aaltopeltiprofiili raidoituksena (corrugated-luokat). */

:root {
  --zinc: #aab2b8;
  --zinc-dark: #7c848b;
  --wood: #c9a877;
  --wood-dark: #8a6a43;
  --pine: #2e3d2f;
  --pine-light: #4a5f47;
  --sky: #86aecb;
  --cream: #f3ede1;
  --ink: #23261f;
  --safety: #d9772f;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: 'Karla', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}

h1, h2 {
  font-family: 'Barlow Condensed', system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
}

/* --- Signature: corrugated metal stripes, echoing the actual roof profile --- */
.corrugated {
  height: 14px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--zinc) 0px,
    var(--zinc) 6px,
    var(--zinc-dark) 6px,
    var(--zinc-dark) 8px,
    var(--zinc) 8px,
    var(--zinc) 14px
  );
}
.corrugated--top { height: 18px; }
.corrugated--bottom { height: 10px; }
.corrugated--divider {
  height: 12px;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 999px;
  overflow: hidden;
}

/* --- Hero --- */
.hero {
  background: linear-gradient(180deg, var(--pine) 0%, var(--pine-light) 100%);
  color: var(--cream);
  text-align: center;
}
.hero__inner {
  padding: 3rem 1.5rem 3.5rem;
  max-width: 640px;
  margin: 0 auto;
}
.eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  color: var(--safety);
  margin: 0 0 0.4rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  font-weight: 700;
  line-height: 0.95;
}
.address {
  margin: 0.6rem 0 0.1rem;
  font-size: 1.15rem;
}
.dates {
  margin: 0 0 1.8rem;
  color: var(--zinc);
  font-size: 0.95rem;
}
.edit-hint { opacity: 0.6; font-size: 0.85rem; }

.music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--safety);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.music-toggle:hover { transform: translateY(-1px); }
.music-toggle:active { transform: translateY(0); }
.music-toggle[aria-pressed="true"] {
  background: var(--zinc);
}
.music-toggle[aria-pressed="true"] .music-toggle__icon {
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* --- Panels --- */
main { max-width: 720px; margin: 0 auto; padding: 0 1.25rem; }
.panel { padding: 2.5rem 0.5rem; }
.panel h2 { font-size: 1.8rem; color: var(--pine); }
.panel__lead {
  margin: 0.4rem 0 1.4rem;
  max-width: 46ch;
}
.panel__lead--muted { color: var(--zinc-dark); font-size: 0.92rem; }

/* --- Upload --- */
#uploadForm { display: flex; flex-direction: column; gap: 1rem; max-width: 420px; }
.file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  border: 2px dashed var(--wood-dark);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.file-drop:hover { border-color: var(--safety); background: #fffaf3; }
.file-drop__icon { font-size: 2rem; }
.file-drop__text { font-weight: 700; color: var(--wood-dark); }
.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.btn-primary {
  background: var(--pine);
  color: var(--cream);
  border: none;
  border-radius: var(--radius);
  padding: 0.9rem 1.4rem;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--pine-light); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.upload-status { min-height: 1.4em; font-weight: 700; }
.upload-status.is-error { color: #a3401b; }
.upload-status.is-success { color: var(--pine); }
.fine-print { font-size: 0.82rem; color: var(--zinc-dark); margin-top: -0.4rem; }

/* --- Gallery --- */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-slideshow {
  background: var(--safety);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-weight: 700;
  font-family: 'Karla', sans-serif;
  cursor: pointer;
  transition: transform 0.15s ease;
  white-space: nowrap;
}
.btn-slideshow:hover { transform: translateY(-1px); }
.photo-count { font-family: 'Karla', sans-serif; text-transform: none; color: var(--zinc-dark); font-size: 1rem; font-weight: 400; letter-spacing: 0; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
}
.gallery-grid img,
.gallery-grid video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  transition: transform 0.15s ease;
  background: var(--zinc);
}
.gallery-grid img:hover,
.gallery-grid video:hover { transform: scale(1.03); }
.gallery-grid video::-webkit-media-controls { display: none; }
.gallery-empty { color: var(--zinc-dark); font-style: italic; }

footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--zinc-dark);
  font-size: 0.85rem;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 17, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}
.lightbox[hidden] { display: none; }
.lightbox img,
.lightbox video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
}
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 2.4rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }
.lightbox__bar {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  color: #fff;
}
.lightbox__play {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}
.lightbox__counter {
  font-family: 'Karla', sans-serif;
  font-size: 0.9rem;
}
