/* 탐색 (/explore): 공유된 도감의 표지 격자. 웹사이트(www.korezu.com)와 같은 미니멀한 모양: 흰 바탕, 회색 판, 가는 선. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --panel: #f3f3f6;
  --text: #131316;
  --text2: #5e5e68;
  --line: rgba(19, 19, 22, 0.11);
  --gold: #e6c300;
  --cover-shadow: drop-shadow(0 1px 1px rgba(19, 19, 22, 0.08)) drop-shadow(0 8px 14px rgba(19, 19, 22, 0.12));
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans KR", "Noto Sans JP", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --panel: #1c1c20;
    --text: #f3f3f6;
    --text2: #a6a6b0;
    --line: rgba(243, 243, 246, 0.13);
    --cover-shadow: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
:lang(ko) { word-break: keep-all; }
a { color: inherit; }
button, select { font: inherit; color: inherit; }
canvas.art { display: block; width: 100%; height: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 6px; }

.top, .explore { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; padding-top: env(safe-area-inset-top); }
/* Language (js/explore.js `languageMenu`): the same drawn dropdown, with a globe. */
.dd-language .dd-button { gap: 8px; padding-left: 12px; }
.dd-language .dd-button .icon-globe { width: 18px; height: 18px; transform: none; }
.dd.open .dd-button .icon-globe { transform: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.brand img { width: 26px; height: 26px; }

.explore { padding-bottom: 72px; }
.preview { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 10px 16px; border-radius: 14px; background: var(--panel); color: var(--text2); font-size: 0.875rem; font-weight: 600; }
.preview .icon { width: 16px; height: 16px; flex: none; }
/* Closed (private, not an admin). */
.closed { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 60vh; text-align: center; padding: 40px 0; }
.closed h1 { margin: 6px 0 0; font-size: clamp(1.6rem, 1.2rem + 2vw, 2.25rem); letter-spacing: -0.03em; }
.closed p { margin: 0; max-width: 28rem; color: var(--text2); }
.closed .closed-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--panel); }
.closed .closed-icon .icon { width: 30px; height: 30px; }

.head { padding: clamp(28px, 6vw, 64px) 0 clamp(20px, 4vw, 36px); }
.head h1 { margin: 0; font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); font-weight: 750; letter-spacing: -0.035em; line-height: 1.1; }
.head .lead { margin: 12px 0 0; max-width: 36rem; color: var(--text2); font-size: 1.0625rem; }

.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--text2); font-weight: 600; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); }
@media (hover: hover) { .tab[aria-selected="false"]:hover { background: var(--panel); color: var(--text); } }
/* Type filter: a drawn dropdown (js/explore.js `dropdown`). */
.dd { position: relative; }
.dd-button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 0.9375rem; font-weight: 600; cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.dd-button .icon { width: 18px; height: 18px; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.dd.open .dd-button { border-color: var(--text); }
.dd.open .dd-button .icon { transform: rotate(180deg); }
@media (hover: hover) { .dd-button:hover { background: var(--panel); } }
.dd-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: max-content; min-width: 100%; max-width: min(320px, 90vw);
  max-height: min(420px, 60vh); overflow-y: auto; margin: 0; padding: 6px; list-style: none; outline: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(19, 19, 22, 0.06), 0 16px 40px rgba(19, 19, 22, 0.16);
  transform-origin: top right; animation: dd-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.dd.align-left .dd-list { right: auto; left: 0; transform-origin: top left; }
.dd-option {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px 0 10px; border-radius: 12px;
  font-size: 0.9375rem; cursor: pointer; white-space: nowrap;
}
.dd-option .icon { width: 16px; height: 16px; flex: none; opacity: 0; stroke-width: 2.2; }
.dd-option[aria-selected="true"] { font-weight: 700; }
.dd-option[aria-selected="true"] .icon { opacity: 1; }
.dd-option.active { background: var(--panel); }
@media (prefers-color-scheme: dark) { .dd-list { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5); } }

.grid { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px clamp(14px, 2.4vw, 28px); }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.cover { position: relative; width: 100%; aspect-ratio: var(--cover-aspect, 0.704); margin-bottom: 10px; filter: var(--cover-shadow); transition: transform 0.18s ease; }
@media (hover: hover) { .card:hover .cover { transform: translateY(-3px); } }
.tags { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 6px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.tag-featured { background: var(--gold); color: #131316; }
.tag-featured .icon { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.tag-official { background: #131316; color: #fff; }
.tag-official .icon { width: 14px; height: 14px; stroke-width: 2; }
.title { font-weight: 650; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.type { color: var(--text2); font-size: 0.8125rem; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; color: var(--text2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.stat { display: inline-flex; align-items: center; gap: 4px; }
.icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.empty { margin: 48px 0; padding: 40px 20px; border-radius: 20px; background: var(--panel); color: var(--text2); text-align: center; }
/* Pages: 25 a page, numbers with « … » gaps, previous and next. */
.grid { transition: opacity 0.2s; }
.grid.busy { opacity: 0.45; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 44px 0 0; }
.page, .page-step {
  display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 10px; border: 1px solid transparent; border-radius: 999px;
  background: none; font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.page[aria-current="page"] { background: var(--text); color: var(--bg); }
.page-step { border-color: var(--line); }
.page-step .icon { width: 18px; height: 18px; }
.page-step:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) { .page:not([aria-current]):hover, .page-step:not(:disabled):hover { background: var(--panel); } }
.page-gap { min-width: 20px; text-align: center; color: var(--text2); }
.home-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 18px; padding: 0 24px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .cover { transition: none; } }
