/* ============================================================
   Numeric Citizen — Micro.blog Theme
   Left-sidebar layout, dark-first, with full light mode support.
   ============================================================ */

/* ── Self-hosted fonts ───────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  --bg:              #0f0f0f;
  --bg-surface:      #1a1a1a;
  --border:          #2a2a2a;
  --text:            #e2e2e2;
  --text-muted:      #888;
  --accent:          #007aff;
  --accent-hover:    #3395ff;
  --accent-visited:  #3d6fa8;
  --radius:          6px;
  --image-radius:    var(--radius); /* override in custom.css to change only image corners */
  --sidebar-width:   220px;
  --content-max:     660px;
  --font-sans:       'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-heading:    'Manrope', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:       ui-monospace, "SF Mono", "Cascadia Mono", "Fira Code", monospace;
}

@media (prefers-color-scheme: light) {
  :root:not(.nc-dark) {
    --bg:          #fafafa;
    --bg-surface:  #f3f3f3;
    --border:      #e0e0e0;
    --text:        #1a1a1a;
    --text-muted:  #666;
    --accent:         #007aff;
    --accent-hover:   #005ecb;
    --accent-visited: #1a4d88;
  }
}

/* Manual overrides (saved preference beats system preference) */
html.nc-light {
  --bg:             #fafafa;
  --bg-surface:     #f3f3f3;
  --border:         #e0e0e0;
  --text:           #1a1a1a;
  --text-muted:     #666;
  --accent:         #007aff;
  --accent-hover:   #005ecb;
  --accent-visited: #1a4d88;
}

html.nc-dark {
  --bg:          #0f0f0f;
  --bg-surface:  #1a1a1a;
  --border:      #2a2a2a;
  --text:        #e2e2e2;
  --text-muted:  #888;
  --accent:      #007aff;
  --accent-hover:#3395ff;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* ── Base ────────────────────────────────────────────────── */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* Global visited link color — overrides browser purple on all markup including Micro.blog archive */
a:visited { color: var(--accent-visited); }

/* Exclude date links from visited color — dates are navigation, not content */
.post__date:visited,
a:has(> time.dt-published):visited { color: var(--text-muted); }

/* ── Site Wrapper (sidebar + content grid) ───────────────── */
.site-wrapper {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  z-index: 1; /* sit above the canvas (z-index: 0) */
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  grid-column: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 2rem 1.25rem;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }

.sidebar__inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 100%;
}

/* Branding */
.sidebar__branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}

.sidebar__avatar-link { display: block; }

.sidebar__avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.sidebar__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.sidebar__title:hover { color: var(--accent); }

.sidebar__bio {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.sidebar__about {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: center;
}

.sidebar__about > * + * { margin-top: 0.6em; }

.sidebar__about p { margin: 0; }

.sidebar__about a {
  color: var(--accent);
  text-decoration: none;
}

.sidebar__about a:hover { color: var(--accent-hover); }

/* Nav, Pages & Categories shared link styles */
.sidebar__nav,
.sidebar__pages,
.sidebar__categories {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar__nav a,
.sidebar__pages a,
.sidebar__categories a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.175rem 0.6rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

.sidebar__nav a:hover,
.sidebar__pages a:hover,
.sidebar__categories a:hover,
.sidebar__nav a.is-active,
.sidebar__pages a.is-active,
.sidebar__categories a.is-active {
  color: var(--text);
  background: var(--bg-surface);
}

.sidebar__cat-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-radius: 999px;
  padding: 0.1em 0.45em;
  min-width: 1.4em;
  text-align: center;
  margin-left: auto;
  opacity: 0.7;
}

.sidebar__section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0.6rem 0.4rem;
  display: block;
  opacity: 0.6;
}

/* ── Site Main (content + footer) ────────────────────────── */
.site-main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 2.5rem;
  max-width: calc(var(--content-max) + 5rem);
}

.main-content {
  flex: 1;
  padding: 2.5rem 0 3rem;
}

/* Hide Micro.blog's built-in archive category nav (we show categories in the sidebar) */
.archive_categories { display: none; }

/* ── Post List ───────────────────────────────────────────── */
.post-list {
  display: flex;
  flex-direction: column;
}

/* ── Post ────────────────────────────────────────────────── */
.post {
  padding: 1.4rem 0;
  position: relative;
}

.post::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(to right, transparent, var(--accent) 50%, transparent);
}

.post:first-child { padding-top: 0.25rem; }
.post:last-of-type { border-bottom: none; }

.post__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.post__title a {
  color: var(--text);
  text-decoration: none;
}

.post__title a:hover { color: var(--accent); }

.post__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.post__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.post__date {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.post__date:hover { color: var(--accent); }

.post__permalink {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.post__permalink:hover   { color: var(--accent); }
.post__permalink:visited { color: var(--text-muted); }

.post__reading-time {
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin: 0 0 1rem;
}



.post__categories {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.post__categories a {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  transition: color 0.15s, border-color 0.15s;
}

.post__categories a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Single post */
.post--single .post__title { font-family: var(--font-heading); font-size: 1.7rem; }
.post--single .post__meta  { margin-bottom: 1.5rem; }

/* ── Post Content ────────────────────────────────────────── */
.post__content { font-size: 0.9375rem; line-height: 1.45; }

.post__content > * + * { margin-top: 1em; }

.post__content h1,
.post__content h2,
.post__content h3,
.post__content h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}

.post__content h1 { font-size: 1.5em; }
.post__content h2 { font-size: 1.25em; }
.post__content h3 { font-size: 1.1em; }
.post__content h4 { font-size: 1em; }

.post__content p { margin-top: 1em; }

.post__content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.post__content a:hover   { color: var(--accent-hover); }
.post__content a:visited { color: var(--accent-visited); }
.post__title   a:visited { color: var(--accent-visited); }

.post__content strong { font-weight: 600; }
.post__content em     { font-style: italic; }

.post__content ul,
.post__content ol {
  padding-left: 1.5rem;
  margin-top: 1em;
}

.post__content li { margin-top: 0.3em; }

.post__content blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.25rem 0;
}

.post__content blockquote > *:first-child { margin-top: 0; }
.post__content blockquote > *:last-child  { margin-bottom: 0; }

.post__content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.post__content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.post__content pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-top: 1em;
}

.post__content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875em;
  line-height: 1.6;
}

/* Archive/list: constrain images to thumbnail size */
.post--list .post__content img,
.p-summary img,
.media-gallery img,
.h-feed .h-entry img {
  max-height: 200px;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: var(--image-radius);
  display: block;
}

.post__content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--image-radius);
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.post__content video {
  max-width: 100%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--image-radius);
}

.post__content iframe {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

.post__content figure { margin: 1.5em 0; }

.post__content figcaption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* ── Image alt-text hover caption ───────────────────────── */
.post__content .nc-image-wrap {
  position: relative;
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  border-radius: var(--image-radius);
  overflow: hidden;
}

.post__content .nc-image-wrap img {
  display: block;
  margin-top: 0;
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  border-radius: 0; /* parent clips */
}

.nc-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.35rem 0.75rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.nc-image-wrap:hover .nc-image-caption {
  opacity: 1;
}

/* ── Archive List ────────────────────────────────────────── */
.archive-list {
  display: flex;
  flex-direction: column;
}

.archive-entry {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.archive-entry:last-of-type { border-bottom: none; }

.archive-entry__date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.archive-entry__title {
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}

.archive-entry__title:hover   { color: var(--accent); }
.archive-entry__title:visited { color: var(--accent-visited); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0 0;
  gap: 1rem;
}

.pagination__btn {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  transition: color 0.15s, border-color 0.15s;
}

.pagination__btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.pagination__btn--next { margin-left: auto; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  padding: 2rem 0 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  text-align: center;
}

.site-footer__content {
  margin-bottom: 0.75rem;
}

.site-footer__heading {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}


.site-footer__explore,
.site-footer__copyright {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.site-footer__copyright {
  margin-top: 0.35rem;
  opacity: 0.6;
}

.site-footer__content a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer__content a:hover    { color: var(--accent-hover); }
.site-footer__content a:visited  { color: var(--accent); }

.site-footer__credit {
  font-size: 0.8125rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.site-footer__credit a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer__credit a:hover { color: var(--accent); }

/* ── Focus ───────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Light mode: active nav item uses border color (not white) to avoid stark box */
@media (prefers-color-scheme: light) {
  :root:not(.nc-dark) .sidebar__nav a.is-active,
  :root:not(.nc-dark) .sidebar__pages a.is-active,
  :root:not(.nc-dark) .sidebar__categories a.is-active {
    background: var(--border);
  }
}
html.nc-light .sidebar__nav a.is-active,
html.nc-light .sidebar__pages a.is-active,
html.nc-light .sidebar__categories a.is-active {
  background: var(--border);
}

/* ── Theme Toggle ────────────────────────────────────────── */
.sidebar__footer {
  margin-top: auto;
  padding-top: 1rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  padding: 0;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--bg-surface);
}

/* Dark mode: show sun (click to go light) */
.theme-toggle__moon { display: none; }
.theme-toggle__sun  { display: block; }

/* Light mode: show moon (click to go dark) */
html.nc-light .theme-toggle__sun  { display: none; }
html.nc-light .theme-toggle__moon { display: block; }

@media (prefers-color-scheme: light) {
  html:not(.nc-dark) .theme-toggle__sun  { display: none; }
  html:not(.nc-dark) .theme-toggle__moon { display: block; }
}

/* ── Desktop: hide mobile-only elements ──────────────────── */
.sidebar__topbar    { display: none; }
.sidebar__hamburger { display: none; }

/* ── Mobile (≤ 700px): hamburger menu ───────────────────── */
@media (max-width: 700px) {
  .site-wrapper {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  /* Fixed top bar */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    z-index: 100;
    background: var(--bg);
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0;
    overflow: visible;
  }

  /* Top bar: mini brand + hamburger */
  .sidebar__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    height: 56px;
  }

  .sidebar__topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
  }

  .sidebar__topbar-avatar-link { display: block; flex-shrink: 0; }

  .sidebar__topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
  }

  .sidebar__topbar-title {
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar__topbar-title:hover { color: var(--accent); }

  /* Hamburger button */
  .sidebar__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
  }

  .sidebar__hamburger:hover {
    color: var(--text);
    border-color: var(--accent);
    background: var(--bg-surface);
  }

  /* Icon swap: menu → close */
  .sidebar__hamburger-icon--close { display: none; }
  .sidebar--open .sidebar__hamburger-icon--menu  { display: none; }
  .sidebar--open .sidebar__hamburger-icon--close { display: block; }

  /* Dropdown panel: hidden by default */
  .sidebar__inner {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.25rem 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    background: var(--bg);
    min-height: 0;
  }

  .sidebar--open .sidebar__inner {
    display: flex;
  }

  /* Backdrop */
  .sidebar__backdrop {
    display: none;
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
  }

  .sidebar--open ~ .sidebar__backdrop,
  .sidebar--open .sidebar__backdrop {
    display: block;
  }

  /* Push content below fixed header */
  .site-main {
    padding: calc(56px + 1.5rem) 1.25rem 0;
    max-width: 100%;
  }
}

/* ── Lightbox ────────────────────────────────────────────── */
.post__content img:not(.photos-grid-item) {
  cursor: zoom-in;
}

.nc-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

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

.nc-lightbox__img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--image-radius);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
}

/* ── Photos Page ─────────────────────────────────────────── */
.photos-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.photos-page__title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.photos-page__empty {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 2rem 0;
}

/* Segmented control */
.photos-segmented {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.photos-segmented__btn {
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1.5;
}

.photos-segmented__btn + .photos-segmented__btn {
  border-left: 1px solid var(--border);
}

.photos-segmented__btn.is-active {
  background: var(--bg-surface);
  color: var(--text);
}

.photos-segmented__btn:hover:not(.is-active) {
  color: var(--text);
}

/* Grid mode (default) */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
}

.photos-grid__item {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--image-radius);
  background: var(--bg-surface);
  text-decoration: none;
}

.photos-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.photos-grid__item:hover img {
  transform: scale(1.04);
  opacity: 0.88;
}

.photos-grid__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .photos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Masonry mode — CSS columns (cross-browser, no JS needed) */
.photos-grid--masonry {
  display: block;
  columns: 3;
  column-gap: 4px;
}

.photos-grid--masonry .photos-grid__item {
  break-inside: avoid;
  margin-bottom: 4px;
  aspect-ratio: unset;
  border-radius: var(--image-radius);
}

.photos-grid--masonry .photos-grid__item img {
  height: auto;
  object-fit: unset;
}

@media (max-width: 700px) {
  .photos-grid--masonry {
    columns: 2;
  }
}
