/* ============================================
   CAT FAMILY — Shared Base Styles
   ============================================ */

/* Pretendard (Korean variable font) */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

/* ── Material Symbols ── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 24;
}

/* ── Body Base ── */
body {
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  background-color: #F9F9F9;
  color: #1A1C1C;
}

/* ── Scroll Lock ── */
body.scroll-locked { overflow: hidden !important; }

/* ── Scrollbar Hiding ── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Masonry Grid — Responsive ── */
.masonry-grid { columns: 2; column-gap: 1rem; }
.masonry-item { break-inside: avoid; margin-bottom: 1rem; }
@media (min-width: 768px)  { .masonry-grid { columns: 3; column-gap: 1.5rem; } .masonry-item { margin-bottom: 1.5rem; } }
@media (min-width: 1280px) { .masonry-grid { columns: 4; } }
@media (min-width: 1536px) { .masonry-grid { columns: 5; } }

/* ── Drop Cap ── */
.drop-cap::first-letter {
  float: left;
  font-family: 'Newsreader', serif;
  font-size: 4.5rem;
  line-height: 1;
  padding-right: 0.75rem;
  font-style: italic;
  color: #000000;
}

/* ── Bottom Nav ── */
#bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 0.5rem;
  transition: color 0.2s, opacity 0.2s;
  color: #474747;
  text-decoration: none;
}
#bottom-nav .nav-item.active {
  color: #000000;
  border-top: 1px solid #000000;
}
#bottom-nav .nav-item:not(.active):hover { color: #000000; }

/* ── Hide Bottom Nav on Desktop ── */
@media (min-width: 1024px) { #bottom-nav { display: none !important; } }

/* ── Dark Mode Nav ── */
@media (prefers-color-scheme: dark) {
  .dark #bottom-nav .nav-item { color: #8E8E8E; }
  .dark #bottom-nav .nav-item.active { color: #ffffff; border-top-color: #ffffff; }
  .dark #bottom-nav .nav-item:not(.active):hover { color: #ffffff; }
}

/* ── Desktop Header Nav Links ── */
.desktop-nav-link {
  color: rgba(0,0,0,0.4);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: 'Pretendard', 'Inter', sans-serif;
  font-weight: 400;
  transition: color 0.2s;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.desktop-nav-link:hover { color: #000; }
.desktop-nav-link.active { color: #000; border-bottom-color: #000; }

/* ── Header: backdrop-filter → ::before (fixes mix-blend-multiply stacking context) ── */
header {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  position: relative;
}
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(249, 249, 249, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 0;
  pointer-events: none;
}
.dark header::before {
  background: rgba(26, 26, 26, 0.82);
}
header > * {
  position: relative;
  z-index: 1;
}

/* ── Bottom Sheet Animation ── */
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.bottom-sheet-enter { animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* ── Detail Page: Desktop Side Panel Override ── */
@media (min-width: 1024px) {
  #detail-overlay {
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    background: rgba(0,0,0,0.08) !important;
    backdrop-filter: none !important;
  }
  #detail-sheet {
    flex-shrink: 0;
    width: 520px !important;
    max-height: 100vh !important;
    height: 100vh !important;
    border-left: 1px solid rgba(0,0,0,0.06);
    box-shadow: -24px 0 80px rgba(0,0,0,0.1);
  }
  .bottom-sheet-enter { animation: none !important; }
}

/* ── FAQ Accordion ── */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 200px;
  opacity: 1;
  padding-bottom: 2rem;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-icon { transition: transform 0.3s ease; }

/* ============================================
   Nav Drawer
   ============================================ */
#nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#nav-overlay.open {
  background: rgba(0,0,0,0.65);
  pointer-events: all;
}
#nav-drawer {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(85vw, 420px);
  background: #0A0A0A;
  color: #fff;
  padding: 2rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}
#nav-overlay.open #nav-drawer { transform: translateX(0); }

#nav-drawer-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 0;
  margin-bottom: 2rem;
  transition: color 0.2s;
  line-height: 1;
}
#nav-drawer-close:hover { color: #fff; }
#nav-drawer-close .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 24;
}

#nav-drawer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
#nav-drawer-logo-wrap img {
  height: 30px;
  width: auto;
  filter: invert(1) brightness(0.75);
}
#nav-drawer-logo-wrap span {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
}

#nav-drawer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}
#nav-drawer-links li { border-bottom: 1px solid rgba(255,255,255,0.06); }
#nav-drawer-links a {
  display: block;
  padding: 1.1rem 0;
  font-size: 1.875rem;
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.25s, padding-left 0.25s;
}
#nav-drawer-links a:hover,
#nav-drawer-links a.active { color: #fff; padding-left: 0.5rem; }

#nav-drawer-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
#nav-drawer-footer p {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  line-height: 2;
  font-family: 'Pretendard', 'Inter', sans-serif;
}

/* ============================================
   Cart Panel
   ============================================ */
#cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#cart-overlay.open {
  background: rgba(0,0,0,0.45);
  pointer-events: all;
}
#cart-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(90vw, 420px);
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -20px 0 80px rgba(0,0,0,0.12);
}
#cart-overlay.open #cart-panel { transform: translateX(0); }

#cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
#cart-header h2 {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 300;
  color: #000;
  letter-spacing: -0.01em;
}
#cart-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(0,0,0,0.3);
  padding: 0;
  transition: color 0.2s;
  line-height: 1;
}
#cart-close:hover { color: #000; }
#cart-close .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 24;
}

#cart-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 0.75rem;
  text-align: center;
}
#cart-empty-icon {
  display: block;
  font-size: 52px;
  color: rgba(0,0,0,0.1);
  font-variation-settings: 'FILL' 0, 'wght' 100, 'GRAD' 0, 'opsz' 48;
  margin-bottom: 0.5rem;
  font-family: 'Material Symbols Outlined';
}
#cart-empty-title {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-size: 1.375rem;
  font-weight: 300;
  color: rgba(0,0,0,0.35);
}
#cart-empty-sub {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.22);
  font-family: 'Pretendard', 'Inter', sans-serif;
}

/* ============================================
   Like Button
   ============================================ */
.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: #474747;
  transition: color 0.2s;
}
.like-btn:hover { color: #000; }
.like-btn.liked { color: #52350f; }
.like-btn.liked .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 200, 'GRAD' 0, 'opsz' 24;
}
.like-btn .material-symbols-outlined { font-size: 18px; }
.like-count {
  font-size: 10px;
  letter-spacing: 0.05em;
  font-family: 'Pretendard', 'Inter', sans-serif;
}

/* ============================================
   Filter Buttons
   ============================================ */
.filter-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 5px;
  white-space: nowrap;
  font-family: 'Pretendard', 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #474747;
  font-weight: 300;
  transition: color 0.2s;
  border-bottom: 1px solid transparent;
}
.filter-btn:hover { color: #000; }
.filter-btn.active {
  color: #000;
  font-weight: 500;
  border-bottom-color: #000;
}

/* ============================================
   Community Feed — Desktop Grid
   ============================================ */
@media (min-width: 1024px) {
  .community-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3.5rem;
    align-items: start;
  }
}
