@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@600&family=Barlow:wght@300;400&display=swap');

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

:root {
  --sidebar-width: 220px;
}

body {
  background: #fff;
  color: #000;
  font-family: 'Barlow', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 13px;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 28px 24px 28px 28px;
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  z-index: 50;
  background: #fff;
}

.sidebar-logo {
  margin-bottom: 16px;
}

.sidebar-logo a {
  display: block;
  text-decoration: none;
}

.sidebar-logo img {
  width: 100%;
  max-width: 72px;
  display: block;
}

.sidebar-author {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.7;
  color: #000;
  margin-bottom: 28px;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.sidebar-nav a {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  transition: opacity 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  opacity: 0.5;
}

.nav-parent {
  display: flex;
  align-items: center;
}

.nav-parent > a { flex: 1; }

.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 13px;
  font-weight: 300;
  padding: 0 0 0 4px;
  line-height: 1;
}

.nav-sub-group {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.nav-sub-group.open { display: flex; }

.sidebar-icons {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
  align-items: center;
}

.sidebar-icons a {
  color: #000;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.sidebar-icons svg {
  width: 18px;
  height: 18px;
  fill: #000;
}

/* section label between grid groups */
.section-label {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  padding: 0 4px 10px;
}

/* ── MAIN ── */
.main {
  margin-left: var(--sidebar-width);
  padding: 28px 0 80px;
}

.main-title {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 28px 24px;
}

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

.grid-item {
  overflow: hidden;
  cursor: pointer;
  background: #f0f0f0;
  aspect-ratio: 3 / 4;
}

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

.grid-item img.loaded {
  opacity: 1;
}

.grid-item:hover img {
  transform: scale(1.02);
}

.photo-grid.no-crop .grid-item {
  aspect-ratio: unset;
  background: none;
}

.photo-grid.no-crop .grid-item img {
  height: auto;
  object-fit: unset;
}

/* ── FEED (home single column alt) ── */
.photo-feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 4px;
}

.feed-item {
  overflow: hidden;
  cursor: pointer;
  background: #f0f0f0;
  aspect-ratio: 3 / 4;
}

.feed-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.feed-item img.loaded {
  opacity: 1;
}

.feed-item:hover img {
  transform: scale(1.02);
}

/* ── HOME FEATURED ── */
.home-featured {
  padding: 0 28px;
  max-width: 520px;
}

.home-featured img {
  width: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.home-featured img.loaded {
  opacity: 1;
}

.home-featured-caption {
  margin-top: 12px;
}

.home-featured-name {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.home-featured-sn {
  font-size: 11px;
  color: #aaa;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

.home-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 36px 28px 0;
  border-top: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
  padding: 14px 0;
}

.home-section-link {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
  text-decoration: none;
  transition: color 0.2s ease;
}

.home-section-link:hover {
  color: #000;
}

/* ── GALLERY HEADER ── */
.gallery-header {
  padding: 0 28px 24px;
}

.gallery-header h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.gallery-header p {
  font-size: 11px;
  color: #888;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── LIGHTBOX + CAROUSEL ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.97);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 80vw;
  max-height: 88vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  font-size: 24px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
}

.lightbox-close:hover { color: #000; }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 48px;
  color: #ccc;
  cursor: pointer;
  padding: 0 16px;
  line-height: 1;
  transition: color 0.15s;
  user-select: none;
}

.lightbox-prev:hover,
.lightbox-next:hover { color: #000; }

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

/* ── OBJECT ENTRIES ── */
.object-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 20px;
  padding: 0 28px;
}

.drawing-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 24px;
  padding: 0 28px;
}

.object-card {
  cursor: pointer;
}

.object-card:hover .object-thumb img {
  opacity: 0.85;
}

.object-thumb img {
  width: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.object-thumb img.loaded {
  opacity: 1;
}

.object-card-name {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 10px;
}

.object-card-sn {
  font-size: 11px;
  color: #aaa;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

/* Object detail modal */
.object-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
}

.object-modal.open {
  display: flex;
}

.modal-inner {
  background: #fff;
  padding: 40px;
  max-width: 900px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #333;
  line-height: 1;
}

.modal-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-media.no-video {
  grid-template-columns: 1fr;
  max-width: 560px;
  margin: 0 auto;
}

.modal-media img,
.modal-media video {
  width: 100%;
  display: block;
}

.modal-info {
  margin-top: 20px;
}

.modal-name {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modal-sn {
  font-size: 11px;
  color: #aaa;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

@media (max-width: 760px) {
  .object-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 12px;
    padding: 0 16px;
  }

  .modal-inner { padding: 24px 20px; }

  .modal-media,
  .modal-media.no-video {
    grid-template-columns: 1fr;
  }
}

/* ── MOBILE HEADER — hidden on desktop ── */
.mobile-header { display: none; }
.mobile-nav { display: none; }

@media (max-width: 760px) {
  .sidebar { display: none; }

  .main { margin-left: 0; padding-top: 0; }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e8e8e8;
  }

  .mobile-logo {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .mobile-logo a { color: #000; text-decoration: none; }

  .mobile-logo img { width: 32px; display: block; }

  .mobile-menu-btn {
    background: none;
    border: none;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: 'Barlow', sans-serif;
  }

  .mobile-nav {
    display: none;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid #e8e8e8;
  }

  .mobile-nav.open { display: flex; }

  .mobile-nav a {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #000;
    text-decoration: none;
  }

  .main-title { padding: 18px 20px 16px; font-size: 20px; }

  .photo-feed,
  .photo-grid { grid-template-columns: repeat(2, 1fr); padding: 0 2px; gap: 2px; }
}
