/* --- Theme variables --- */
:root {
  --bg:         #f5f2ed;
  --text:       #2a2520;
  --text-dim:   #756d64;
  --text-muted: #a09890;
  --border:     #ccc8c2;
  --card-bg:    #e0dbd4;
  --accent:     #d35400;
  --heading:    #1a1714;
}
html.theme-dark {
  --bg:         #111;
  --text:       #ddd;
  --text-dim:   #999;
  --text-muted: rgba(255,255,255,0.45);
  --border:     #333;
  --card-bg:    #222;
  --accent:     #d35400;
  --heading:    #fff;
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 2.5rem 1.5rem 5rem;
  max-width: 1100px;
  margin: 0 auto;
  transition: background 0.2s, color 0.2s;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
h1 {
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--heading);
}
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 1rem;
}
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--text-dim); }
.footer-contact { display: flex; gap: 0.75rem; margin-left: auto; }
.footer-contact a { color: var(--text-muted); text-decoration: none; font-size: 0.75rem; }
.footer-contact a:hover { color: var(--text-dim); }

/* --- Site brand (persistent header identity) --- */
.site-masthead {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.site-logo {
  height: 28px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  flex-shrink: 0;
}
.site-name {
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--heading);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-name:hover { color: var(--accent); }
.page-title {
  width: 100%;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-dim);
  display: flex;
  align-items: center;
}

/* --- Site navigation (header page links) --- */
.site-nav { display: flex; gap: 1rem; font-size: 0.82rem; align-items: baseline; }
.site-nav a { color: var(--text-dim); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }

/* --- Theme toggle button --- */
.theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.theme-btn:hover { color: var(--text); border-color: var(--text-dim); }

/* --- Back link (album pages) --- */
.site-back {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 400;
  font-size: 1.1rem;
  margin-right: 0.5rem;
}
.site-back:hover { color: var(--accent); }

/* --- Download button (album pages) --- */
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  transition: background 0.15s, border-color 0.15s;
}
.dl-btn:hover { color: var(--text); }

/* --- Header actions group --- */
.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

/* --- Album grid (root index) --- */
.albums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
@media (max-width: 720px) { .albums { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .albums { grid-template-columns: 1fr; } }

.album-card { text-decoration: none; color: inherit; display: block; }
.album-cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  background: var(--card-bg);
  margin-bottom: 0.75rem;
  transition: opacity 0.15s;
}
.album-card:hover .album-cover { opacity: 0.88; }
.album-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--heading);
  margin-bottom: 0.2rem;
}
.album-meta { font-size: 0.78rem; color: var(--text-dim); }
.album-card:hover .album-title { color: var(--accent); }

/* --- Prose content (about, imprint pages) --- */
.prose { max-width: 680px; line-height: 1.7; }
.prose h2 { font-size: 1.1rem; font-weight: 500; margin: 2rem 0 0.5rem; color: var(--heading); }
.prose h3 { font-size: 0.95rem; font-weight: 500; margin: 1.5rem 0 0.4rem; color: var(--heading); }
.prose p  { margin-bottom: 1rem; }
.prose a  { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.25rem; }
.prose strong { font-weight: 500; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.about-layout { display: flex; gap: 2.5rem; align-items: flex-start; flex-wrap: wrap; }
.about-photo { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; flex-shrink: 0; background: var(--card-bg); }

/* --- Masonry gallery (album pages) --- */
.gallery { column-count: 2; column-gap: 12px; }
@media (max-width: 540px) { .gallery { column-count: 1; } }
.gallery figure {
  break-inside: avoid;
  margin: 0 0 12px;
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
  background: var(--card-bg);
}
.gallery figure:hover img { opacity: 0.88; }
.gallery img { display: block; width: 100%; height: auto; transition: opacity 0.15s; }

/* --- Lightbox --- */
#lb {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#lb.open { display: flex; }
#lb-img {
  max-width: 92vw; max-height: 92vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  user-select: none;
}
#lb-close {
  position: fixed; top: 1.2rem; right: 1.5rem;
  background: none; border: none;
  color: #fff; font-size: 2rem; line-height: 1;
  cursor: pointer; opacity: 0.7; padding: 0.3rem 0.5rem;
}
#lb-close:hover { opacity: 1; }
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.08); border: none;
  color: #fff; font-size: 1.8rem; line-height: 1;
  cursor: pointer; padding: 1rem 0.9rem; border-radius: 3px;
  opacity: 0.6; transition: opacity 0.15s, background 0.15s;
  user-select: none;
}
.lb-nav:hover { opacity: 1; background: rgba(255,255,255,0.15); }
#lb-prev { left: 1rem; }
#lb-next { right: 1rem; }
#lb-counter {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  font-size: 0.8rem; color: rgba(255,255,255,0.45); letter-spacing: 0.06em;
}
