
/* ── Nekochan Gallery Archive ── */

:root {
  --bg:          #1a1f2e;
  --bg-deep:     #0d1018;
  --bg-panel:    #212840;
  --bg-card:     #1e2438;
  --border:      #2e3654;
  --border-lit:  #3d4f7a;
  --accent:      #6699cc;
  --accent-lit:  #88bbee;
  --accent-warm: #c8a96e;
  --text:        #c8cfe8;
  --text-dim:    #8892aa;
  --text-bright: #e8edf8;
  --heading:     #a8c4e8;
  --link:        #7aabdd;
  --link-hover:  #aaccee;
  --thumb-size:  160px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(40,60,100,0.45) 0%, transparent 70%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255,255,255,0.012) 2px,
      rgba(255,255,255,0.012) 4px
    );
  color: var(--text);
  font-family: 'Source Sans 3', 'Lucida Grande', Verdana, sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: 'Almendra', 'Palatino Linotype', Georgia, serif;
  color: var(--heading);
  font-weight: 400;
  line-height: 1.2;
}

/* ── Navigation ── */

#site-nav {
  background: linear-gradient(180deg, #0a0d16 0%, var(--bg-deep) 100%);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

#nav-banner {
  height: 52px;
  width: auto;
  display: block;
  opacity: 0.92;
  transition: opacity 0.2s;
}
#nav-banner:hover { opacity: 1; }

.breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.breadcrumb li + li::before {
  content: "›";
  margin-right: 0.25rem;
  color: var(--border-lit);
}
.breadcrumb li.current { color: var(--text); }
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { color: var(--accent-lit); }

/* ── Main ── */

#main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.album-title {
  font-size: 2rem;
  color: var(--accent-warm);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.album-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  max-width: 70ch;
  border-left: 2px solid var(--border-lit);
  padding-left: 1rem;
}

.section-label {
  font-size: 0.75rem;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* ── Album cards ── */

.album-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.album-card a {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
}
.album-card a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}

.album-card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-deep);
}
.album-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}
.album-card a:hover .album-card-thumb img { opacity: 0.9; }

.album-card-info {
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.album-card-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  color: var(--text-bright);
  line-height: 1.3;
}
.album-card-count {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Photo grid ── */

.photo-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--thumb-size), 1fr));
  gap: 6px;
}

.photo-card {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: border-color 0.15s;
}
.photo-card:hover { border-color: var(--accent); }

.photo-thumb-link {
  display: block;
  width: 100%;
  height: 100%;
}
.photo-thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s, transform 0.3s;
}
.photo-card:hover .photo-thumb-link img {
  opacity: 0.85;
  transform: scale(1.04);
}

/* ── Pagination ── */

.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  padding: 1rem 0;
  font-size: 0.88rem;
}
.pagination a {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: 3px;
  color: var(--accent);
  transition: background 0.15s, border-color 0.15s;
}
.pagination a:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  text-decoration: none;
}
.pg-info { color: var(--text-dim); }

/* ── Photo permalink page ── */

.photo-page .photo-title {
  font-size: 1.5rem;
  color: var(--accent-warm);
  margin-bottom: 0.75rem;
}

.photo-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}
.photo-nav a {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  color: var(--accent);
}
.photo-nav a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.photo-display {
  max-width: 960px;
  margin-bottom: 1.25rem;
}
.photo-main-img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.photo-desc {
  max-width: 70ch;
  color: var(--text-dim);
  font-size: 0.92rem;
  border-left: 2px solid var(--border-lit);
  padding-left: 1rem;
  margin-bottom: 1rem;
}
.photo-fullsize-link, .photo-back {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ── Lightbox ── */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.96);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
#lightbox.active { display: flex; }

#lb-img-wrap {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
#lb-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid var(--border-lit);
  display: block;
}
#lb-caption {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

#lb-close {
  position: fixed;
  top: 1rem; right: 1.25rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  transition: border-color 0.15s, color 0.15s;
}
#lb-close:hover { border-color: var(--accent); color: var(--accent); }

#lb-prev, #lb-next {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem 0.85rem;
  border-radius: 3px;
  transition: border-color 0.15s, color 0.15s;
}
#lb-prev { left: 0.75rem; }
#lb-next { right: 0.75rem; }
#lb-prev:hover, #lb-next:hover {
  border-color: var(--accent); color: var(--accent);
}

/* ── Footer ── */

#site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  background: var(--bg-deep);
  margin-top: 4rem;
}
#site-footer a { color: var(--accent); }

/* ── Responsive ── */

@media (max-width: 640px) {
  :root { --thumb-size: 110px; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  #site-nav { padding: 0.5rem 1rem; gap: 0.75rem; }
  #nav-banner { height: 38px; }
}
