/*
 * Canela Text is a licensed commercial typeface (Colophon Foundry) — it can't be
 * pulled from a free CDN. Drop the licensed woff2/woff files into /fonts/ named
 * as below (or adjust the paths) and this @font-face block will pick them up.
 * Until then, every element below falls back to the serif stack.
 */
@font-face {
  font-family: "Canela Text";
  src: url("fonts/CanelaText-Regular.woff2") format("woff2"),
       url("fonts/CanelaText-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Canela Text";
  src: url("fonts/CanelaText-Medium.woff2") format("woff2"),
       url("fonts/CanelaText-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f1e9;
  --text: #2c2620;
  --text-muted: #7a6f63;
  --block-bg: #e9e2d5;
  --block-bg-hover: #e0d8c8;
  --radius: 7px;
  --header-pad-y: clamp(14px, 3vw, 30px);
  --header-pad-x: clamp(14px, 4vw, 48px);
  --font: "Canela Text", Georgia, "Times New Roman", serif;
  --menu-font-size: 14px;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: clamp(12px, 2.5vw, 22px);
  left: clamp(12px, 3vw, 28px);
  right: clamp(12px, 3vw, 28px);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 3vw, 32px);
  padding: clamp(10px, 1.8vw, 15px) var(--header-pad-x);
  white-space: nowrap;
  flex-wrap: nowrap;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2)),
    rgba(246, 241, 233, 0.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  backdrop-filter: blur(20px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    inset 0 -1px 2px rgba(120, 100, 78, 0.07),
    0 10px 30px rgba(58, 46, 34, 0.10),
    0 2px 8px rgba(58, 46, 34, 0.06);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header,
  .menu-block {
    background: rgba(246, 241, 233, 0.94);
  }
}

.brand {
  font-family: var(--font);
  font-weight: 500;
  font-size: clamp(15px, 3.6vw, 24px);
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.menu-trigger {
  flex: 0 0 auto;
  border: none;
  background: none;
  padding: 4px 2px;
  margin: 0;
  font-family: inherit;
  font-size: var(--menu-font-size);
  font-weight: 500;
  color: var(--text);
  opacity: 0.85;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.menu-trigger:hover {
  opacity: 1;
}

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

.gallery {
  column-count: 3;
  column-gap: 10px;
  padding: clamp(84px, 11vw, 112px) 10px clamp(90px, 12vw, 120px);
}

@media (max-width: 720px) {
  .gallery {
    column-count: 2;
    column-gap: 8px;
    padding: clamp(78px, 20vw, 100px) 8px 110px;
  }
}

@media (min-width: 1400px) {
  .gallery {
    column-count: 4;
  }
}

.grid-item {
  position: relative;
  display: block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--block-bg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (max-width: 720px) {
  .grid-item {
    margin-bottom: 8px;
  }
}

.grid-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.grid-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.video-item:not(.has-thumb) {
  aspect-ratio: 4 / 5;
}

.play-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(246, 241, 233, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.play-badge svg {
  width: 8px;
  height: 8px;
  margin-left: 1px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

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

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 6px;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: clamp(12px, 3vw, 28px);
  right: clamp(12px, 3vw, 28px);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(246, 241, 233, 0.12);
  color: #f6f1e9;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(246, 241, 233, 0.22);
}

/* ---------- Menu dropdown ---------- */

.menu-panel {
  position: fixed;
  top: clamp(66px, 11vw, 92px);
  right: clamp(14px, 3vw, 28px);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.menu-block {
  display: block;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.22)),
    rgba(246, 241, 233, 0.42);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    inset 0 -1px 2px rgba(120, 100, 78, 0.07),
    0 8px 24px rgba(58, 46, 34, 0.12),
    0 2px 6px rgba(58, 46, 34, 0.06);
  color: var(--text);
  font-size: var(--menu-font-size);
  font-weight: 500;
  padding: 12px 22px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-10px) scaleY(0.85);
  transform-origin: top;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out, background 0.2s ease;
}

.menu-block:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.3)),
    rgba(246, 241, 233, 0.52);
}

.menu-block.show {
  opacity: 1;
  transform: translateY(0) scaleY(1);
}

@media (prefers-reduced-motion: reduce) {
  .grid-item,
  .menu-block,
  .lightbox {
    transition: none !important;
  }
}
