@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Archivo:wght@400;500;600&display=swap');

:root {
  --ink: #15140f;
  --surface: #1e1d17;
  --surface-2: #262419;
  --paper: #ede6d6;
  --muted: #a79c87;
  --sage: #7a9e8e;
  --gold: #c9a227;
  --border: #33311f;
  --radius: 3px;
  --max-w: 470px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Archivo', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--sage); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: rgba(21, 20, 15, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: var(--paper);
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--paper);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav panel */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 40;
}
.nav-backdrop.visible { opacity: 1; pointer-events: auto; }

.nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(78vw, 320px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 41;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-panel.visible { transform: translateX(0); }

.nav-panel a {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  color: var(--paper);
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}
.nav-panel a:hover { color: var(--sage); text-decoration: none; }

/* Main layout */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 16px 100px;
}

.page-title {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  margin: 8px 0 20px;
}

/* Instagram-style feed grid */
.home-main {
  max-width: 935px;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

@media (max-width: 600px) {
  .feed-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
  }
}

.feed-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: none;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
}
.feed-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feed-tile .multi-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.empty-state {
  grid-column: 1 / -1;
}

/* Lightbox (post detail) */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}
.lightbox-backdrop.visible { display: flex; }

.lightbox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(21, 20, 15, 0.6);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox .carousel .carousel-track {
  height: 60vh;
  max-height: 500px;
  background: var(--ink);
}
.lightbox .carousel .carousel-track img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lightbox img.single-media {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: var(--ink);
  display: block;
}

.lightbox-body {
  padding: 16px 18px 20px;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-track img {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(21, 20, 15, 0.55);
  color: var(--paper);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.carousel-arrow:hover { background: rgba(21, 20, 15, 0.8); }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(237, 230, 214, 0.4);
}
.carousel-dots .dot.active { background: var(--gold); }

.post-body {
  padding: 14px 16px 16px;
}

.post-caption { margin: 0 0 8px; }

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.post-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.88rem;
  border: 1px solid var(--sage);
  padding: 5px 10px;
  border-radius: var(--radius);
}
.post-link:hover { background: var(--sage); color: var(--ink); text-decoration: none; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="url"],
.field textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--border);
  color: var(--paper);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}
.field textarea { resize: vertical; min-height: 70px; }

.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--paper);
  font-size: 0.9rem;
  cursor: pointer;
}

button.btn {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--paper);
}
button.btn.primary {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--ink);
  font-weight: 600;
}
button.btn:hover { filter: brightness(1.1); }

/* Store / Blog grids */
.grid {
  display: grid;
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.card-body { padding: 14px 16px; }
.card-body h3 { font-family: 'Fraunces', serif; font-weight: 500; margin: 0 0 6px; }
.card-body p { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; }
.card-body .price { color: var(--gold); font-weight: 600; }

.blog-entry {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.blog-entry:last-child { border-bottom: none; }
.blog-entry .date { color: var(--muted); font-size: 0.8rem; }
.blog-entry h3 { font-family: 'Fraunces', serif; margin: 6px 0; font-weight: 500; }

/* Admin login + panel */
.login-box {
  max-width: 360px;
  margin: 80px auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.login-box h2 { font-family: 'Fraunces', serif; margin-top: 0; }
.error-text { color: #c96a5a; font-size: 0.88rem; margin-top: 8px; }
.delete-link {
  color: #c96a5a;
  background: none;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}
.delete-link:hover { text-decoration: underline; }
