/* ============================================================
   dagfoto — Kirby thema
   Geïnspireerd op schlijper.nl
   ============================================================ */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Light.woff2') format('woff2');
  font-weight: 300;
  font-display: optional;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: optional;
}

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

:root {
  --bg:       #ffffff;
  --fg:       #111111;
  --muted:    #888888;
  --border:   rgba(0, 0, 0, 0.10);
  --nav-h:    2.5rem;
  --font:     'Inter', sans-serif;
}

/* Pas font-size hier aan om alles te schalen */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 300;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── NAV ─────────────────────────────────────────────────── */

#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

#nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border-radius: 0.2rem;
  transition: color 0.15s, background 0.15s;
}

#nav a:first-child   { justify-self: start; }
#nav a.site-name     { justify-self: center; font-size: 0.8rem; font-weight: 400;
                        letter-spacing: 0.10em; color: var(--fg); }
#nav a:last-child    { justify-self: end; }

#nav a:hover         { color: var(--fg); background: rgba(0,0,0,0.06); }
#nav a.active        { color: var(--fg); background: rgba(0,0,0,0.08); }
#nav a.site-name:hover { background: none; }

/* ── MAIN ────────────────────────────────────────────────── */

main {
  flex: 1;
  padding-top: var(--nav-h);
  display: flex;
  flex-direction: column;
}

/* ── TODAY VIEW ──────────────────────────────────────────── */

.today-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-link { display: flex; justify-content: center; line-height: 0; }

.today-view {
  justify-content: center;
}

.today-view picture,
.today-view img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - var(--nav-h) - 3rem);
  object-fit: contain;
  display: block;
}

/* ── SINGLE VIEW ─────────────────────────────────────────── */

.single-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-nav {
  width: 100%;
  flex: 1;
  display: grid;
  grid-template-columns: var(--nav-h) 1fr var(--nav-h);
  align-items: start;
}

.nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--nav-h);
  height: var(--nav-h);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  position: sticky;
  top: calc(var(--nav-h) + 0.5rem);
  align-self: start;
  margin-top: 0.5rem;
}

.nav-arrow:hover    { color: var(--fg); }
.nav-arrow.disabled { pointer-events: none; opacity: 0; }

.single-picture { display: block; width: 100%; line-height: 0; }

.single-picture img {
  width: 100%;
  height: auto;
  max-height: calc(100dvh - var(--nav-h) - 3rem);
  object-fit: contain;
  display: block;
}

/* ── PHOTO META ──────────────────────────────────────────── */

.photo-meta {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.meta-date     { color: var(--fg); white-space: nowrap; }
.meta-caption  { flex: 1; text-align: center; font-style: normal; }
.meta-location { white-space: nowrap; text-align: right; }

/* ── PHOTO CONTENT ───────────────────────────────────────── */

.photo-content {
  max-width: 540px;
  padding: 0 1rem 2.5rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}

/* ── ARCHIVE ─────────────────────────────────────────────── */

.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0.875rem 0.625rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.archive-label { color: var(--fg); }
.archive-count { color: var(--muted); }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 2px;
  padding: 2px;
}

@media (min-width: 600px) {
  .archive-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (min-width: 1000px) {
  .archive-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

.archive-item {
  display: block;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: rgba(0,0,0,0.06);
  line-height: 0;
}

.archive-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.archive-item:hover img { transform: scale(1.04); }

.archive-overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 1.125rem 0.4375rem 0.375rem;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.2s;
}

.archive-item:hover .archive-overlay { opacity: 1; }

/* ── EMPTY STATES ────────────────────────────────────────── */

.empty-site {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 2;
}

.empty-site a { color: var(--fg); }

/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 480px) {
  .photo-meta    { flex-wrap: wrap; }
  .meta-caption  { text-align: left; flex-basis: 100%; order: 3; }
  .archive-grid  { grid-template-columns: repeat(3, 1fr); gap: 1px; padding: 1px; }
}

.today-view img,
.single-picture img {
  aspect-ratio: attr(width) / attr(height);
}

/* -- FOOTER ------ */
footer {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 0.5rem 0.25rem;
  font-size: 0.65rem;
  color: var(--muted);
  font-family: var(--font);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  z-index: 10;
}

footer a {
  color: #0047AB;
  text-decoration: none;
  -webkit-text-fill-color: #0047AB;
}

footer a:hover {
  text-decoration: underline;
}

a.heart svg {
  transform: rotate(90deg);
  display: inline-block;
}
