/* alexandrahalic.com — strict black/white/greyscale, light + dark */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --border: #e2e2e2;
  --overlay: rgba(0, 0, 0, 0.55);
  --tile-bg: #f2f2f2;
  --scrim: rgba(0, 0, 0, 0.92);
  --transition: 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e;
    --fg: #f2f2f2;
    --muted: #9a9a9a;
    --border: #2a2a2a;
    --overlay: rgba(255, 255, 255, 0.12);
    --tile-bg: #1a1a1a;
    --scrim: rgba(0, 0, 0, 0.96);
  }
}

:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
  --border: #2a2a2a;
  --overlay: rgba(255, 255, 255, 0.12);
  --tile-bg: #1a1a1a;
  --scrim: rgba(0, 0, 0, 0.96);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; }

.site-header {
  padding: 32px 16px 20px;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.site-header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Recovered asset is a white logo (logo-white.svg): invert it for light
   backgrounds so it stays visible, and leave it alone in dark mode. */
.site-logo { height: 72px; filter: invert(1); }

@media (min-width: 640px) {
  .site-logo { height: 92px; }
}
:root[data-theme="dark"] .site-logo { filter: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-logo { filter: none; }
}

.site-logo-fallback {
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#theme-toggle {
  position: absolute;
  right: 0;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
}

.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

.site-description {
  color: var(--muted);
  max-width: 520px;
  margin: 14px auto 10px;
  font-size: 14px;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .site-description { max-width: 700px; }
}

.social-links a {
  color: var(--fg);
  text-decoration: none;
  margin: 0 8px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.gallery-nav {
  margin: 6px 0 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.gallery-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
}

.gallery-nav a.current {
  color: var(--fg);
  background: var(--tile-bg);
}

/* Masonry via CSS columns: each photo keeps its natural aspect ratio and
   flows into whichever column has room next, rather than every tile being
   cropped to a uniform square. Column-count breakpoints mirror the old
   grid-template-columns ones (3 / 4 / 5) so overall density is unchanged. */
.photo-grid {
  column-count: 3;
  column-gap: 3px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3px;
}

@media (min-width: 640px) {
  .photo-grid { column-count: 4; column-gap: 4px; padding: 0 4px; }
}

@media (min-width: 960px) {
  .photo-grid { column-count: 5; column-gap: 6px; padding: 0 6px; }
}

.photo-tile {
  position: relative;
  overflow: hidden;
  background: var(--tile-bg);
  cursor: pointer;
  break-inside: avoid; /* keeps a tile from splitting across two columns */
  margin-bottom: 3px;
}

@media (min-width: 640px) { .photo-tile { margin-bottom: 4px; } }
@media (min-width: 960px) { .photo-tile { margin-bottom: 6px; } }

.photo-tile img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition);
}

.photo-tile:hover img { transform: scale(1.06); }

.tile-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  color: #fff;
  font-size: 14px;
}

.photo-tile:hover .tile-overlay { opacity: 1; }

.like-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  padding: 10px;
  margin: 4px;
}

.like-btn svg { width: 18px; height: 18px; }
.like-btn.liked svg { fill: #fff; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 16px 60px;
}

.legal-links { margin-top: 8px; }
.legal-links a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 8px;
  border-bottom: 1px solid var(--border);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox[hidden] { display: none; }

.lightbox img,
.lightbox video {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.play-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.play-badge svg { width: 12px; height: 12px; }

.lightbox-close, .lightbox-nav {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 12px;
}

.lightbox-close { top: 12px; right: 16px; }
.lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); }

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 640px;
  margin: 0 auto;
  background: var(--fg);
  color: var(--bg);
  padding: 14px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  z-index: 900;
}

.cookie-banner[hidden] { display: none; }

.cookie-banner button {
  background: var(--bg);
  color: var(--fg);
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
}
