/* ── Variables ─────────────────────────────────────────── */
:root {
  /* Flexoki */
  --tx:   #100F0F;
  --tx-2: #6F6E69;
  --tx-3: #B7B5AC;
  --bg:   #FFFCF0;

  --color-bg: #fff;
  --color-text: var(--tx);
  --color-muted: var(--tx-2);
  --color-border: #e0e0e0;

  --font-sans: "Helvetica Neue", Helvetica, system-ui, -apple-system, sans-serif;
  --font-size-base: 1rem;
  --line-height: 1.6;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;

  --sidebar-width: 180px;
  --sidebar-padding: 1.25rem;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ── Site layout ───────────────────────────────────────── */
.site-wrap {
  display: flex;
  height: 100dvh;
  padding: 1.5rem;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: var(--sidebar-padding);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 3rem;
}

.site-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: color 0.15s;
}

.site-name:hover {
  color: var(--color-muted);
}

.site-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-nav a {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-muted);
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-text);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-md);
  font-size: 0.75rem;
  color: var(--tx-3);
}

/* ── Hamburger (mobile only) ───────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--color-text);
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Main content ──────────────────────────────────────── */
main {
  flex: 1;
  padding: var(--space-md);
  min-width: 0;
  overflow-y: auto;
}

/* ── Page title ────────────────────────────────────────── */
.page-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 3.5rem;
  text-align: center;
}

/* ── Gallery ───────────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-sm);
}

.gallery--3col {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  background: var(--color-border);
  aspect-ratio: 4 / 3;
}

.gallery-item a {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.gallery-item img {
  user-select: none;
  -webkit-user-drag: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-sm);
  background: linear-gradient(transparent, rgba(0,0,0,0.5));
  color: #fff;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-label {
  opacity: 1;
}

/* ── About ─────────────────────────────────────────────── */
main:has(.about) {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  max-width: 860px;
}

.about-photo {
  width: 32%;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-drag: none;
}

.about-text {
  flex: 1;
}

.about-text p {
  font-size: 0.85rem;
  line-height: 1.6;
}

.about-text p + p {
  margin-top: var(--space-sm);
}

.about-text a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Contact ───────────────────────────────────────────── */
main:has(.contact) {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact {
  font-size: 0.85rem;
  text-align: center;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.contact-links a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Lightbox ──────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}

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

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.75rem;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
}

.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-wrap {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm) var(--sidebar-padding);
  }

  .hamburger {
    display: flex;
  }

  .site-nav {
    display: none;
    padding-top: var(--space-sm);
  }

  .site-nav.is-open {
    display: block;
  }

  .sidebar-footer {
    display: none;
  }

  .gallery {
    grid-template-columns: 1fr 1fr;
  }

  .about {
    flex-direction: column;
  }

  .about-photo {
    width: 60%;
  }
}

@media (max-width: 400px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}
