/* ============================================================
   TOKI. — PHOTO PORTFOLIO
   ============================================================ */
:root {
  --bg: #1A3A10;
  --bg-surface: rgba(0,0,0,0.15);
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.5);
  --border: rgba(255,255,255,0.15);
  --font-display: 'Playfair Display', serif;
  --font-body: 'Source Sans 3', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 64px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  position: absolute;
  left: 0;
}

.nav-menu {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.2s;
  letter-spacing: 0.5px;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  right: 0;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.2s;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: -24px;
    right: -24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    z-index: 100;
  }
  .nav-menu.open { display: flex; }
}

/* ============================================================
   PAGE SECTION
   ============================================================ */
.page-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 16px;
}

.empty-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 80px 20px;
  font-size: 1.1rem;
}

.album-header {
  margin-bottom: 28px;
}

.album-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.album-desc {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ============================================================
   PHOTO GRID
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.photo-grid-item {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-surface);
}

.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.4s ease;
}

.photo-grid-item:hover img {
  transform: scale(1.03);
  opacity: 0.88;
}

@media (max-width: 1024px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .photo-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.open { display: flex; }

.lightbox-counter {
  position: absolute;
  top: 20px;
  left: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 24px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  padding: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 10;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 16px 12px;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 10;
  border-radius: 4px;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }

.lightbox-img-wrap {
  position: relative;
  max-width: 90vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s;
}

.lightbox-img-wrap img.loaded { opacity: 1; }

.lightbox-spinner {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.lightbox-spinner.hidden { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.lightbox-exif {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.lightbox-exif span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.lightbox-exif .exif-val { color: var(--text); font-weight: 600; }

/* ============================================================
   PHOTO DETAIL (single page)
   ============================================================ */
.photo-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

.photo-detail-back a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.photo-detail-back a:hover { color: var(--text); }

.photo-detail-view {
  position: relative;
  margin: 20px 0;
  text-align: center;
}

.photo-detail-img {
  max-height: 80vh;
  margin: 0 auto;
  object-fit: contain;
}

.photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: var(--text);
  padding: 20px 14px;
  font-size: 1.3rem;
  border-radius: 4px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.photo-nav:hover { opacity: 1; }
.photo-nav-prev { left: 8px; }
.photo-nav-next { right: 8px; }

.exif-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.exif-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exif-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.exif-val { font-weight: 600; }

@media (max-width: 640px) {
  .exif-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
}

.footer-deco {
  position: relative;
  height: 40px;
  margin-bottom: 12px;
}

.footer-leaf-left {
  position: absolute;
  left: 10%;
  bottom: 0;
  width: 60px;
  opacity: 0.3;
}

.footer-gecko {
  width: 30px;
  opacity: 0.25;
  margin: 0 auto;
}
