/* photoblogger — minimal monospace photo blog */

:root {
  --fg: #2a2a2a;
  --bg: #ffffff;
  --muted: #888888;
  --accent: #3060a8;
  --border: #dcdcdc;
  --surface: #f6f6f6;
  --text-width: 44em;
  --frame-width: min(100%, 1200px);
  --body-pad: clamp(0.75rem, 2vw, 2rem);
  --tile-size: 220px;
  --tile-gap: 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #d8d8d8;
    --bg: #141414;
    --muted: #8a8a8a;
    --accent: #79b8ff;
    --border: #2a2a2a;
    --surface: #1b1b1b;
  }
}

* { box-sizing: border-box; }

html {
  color: var(--fg);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

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

a:hover { text-decoration: none; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem clamp(0.75rem, 3vw, 2rem);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

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

.site-title { font-weight: 600; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.site-nav a { padding: 0 0.75rem; }

.site-nav a + a { border-left: 1px solid var(--border); }

main {
  padding: var(--body-pad);
  display: flex;
  justify-content: center;
}

article {
  width: 100%;
  max-width: var(--frame-width);
}

h2 { font-size: 1rem; margin-top: 1.5rem; }
h3 { font-size: 0.95rem; margin-top: 1.25rem; }

p { margin: 0 0 1rem; }

blockquote {
  border-left: 2px solid var(--border);
  padding: 0.25rem 0 0.25rem 0.8rem;
  color: var(--muted);
  margin: 0 0 1rem;
  font-style: italic;
}

code {
  font-size: 0.92em;
  background: var(--border);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

pre {
  font-size: 0.92em;
  background: var(--border);
  padding: 0.7rem 0.9rem;
  border-radius: 3px;
  overflow-x: auto;
  margin: 0 0 1rem;
}

pre code { background: transparent; padding: 0; border-radius: 0; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.photo-figure {
  margin: 1.5rem auto;
  padding: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  width: fit-content;
  max-width: 100%;
}

.photo-figure img {
  display: block;
  max-width: 100%;
  height: auto;
}

nav.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 1.5rem auto;
  padding: 0 clamp(1rem, 15vw, 10rem);
  font-size: 0.85rem;
}

nav.page-nav .page-nav-prev,
nav.page-nav .page-nav-next {
  flex: 1 1 0;
  min-width: 0;
}

nav.page-nav .page-nav-next { text-align: right; }

nav.page-nav a {
  color: var(--muted);
  text-decoration: none;
}

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

.photo-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 2rem;
  padding: 0.9rem 1.1rem;
  margin: 1.5rem auto 0;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
}

.photo-meta-body { min-width: 0; }

.photo-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.photo-description {
  margin: 0;
  max-width: var(--text-width);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
}
.photo-description p { margin: 0 0 0.5rem; }
.photo-description p:last-child { margin-bottom: 0; }
.photo-description img { max-width: 100%; height: auto; }
.photo-description code,
.photo-description pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.photo-tags {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}

.photo-tags li { margin: 0; }

.photo-tags a {
  color: var(--muted);
  text-decoration: none;
}

.photo-tags a:hover { color: var(--accent); text-decoration: underline; }

.photo-meta-side {
  color: var(--muted);
  text-align: right;
  line-height: 1.7;
  white-space: nowrap;
}

.photo-meta-side time { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .photo-meta { grid-template-columns: 1fr; }
  .photo-meta-side { text-align: left; }
  nav.page-nav { padding: 0; }
}

article.tag-index h1,
article.tag-list h1 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  text-transform: lowercase;
}

article.tag-index p.count,
article.tag-list .count {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

ul.photo-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--tile-size)), 1fr));
  gap: var(--tile-gap);
}

ul.photo-grid li { margin: 0; }

ul.photo-grid .tile {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--border);
  color: var(--fg);
  text-decoration: none;
}

ul.photo-grid .tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 200ms ease-out;
}

ul.photo-grid .tile:hover img,
ul.photo-grid .tile:focus-visible img {
  transform: scale(1.03);
}

ul.photo-grid .tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

ul.photo-grid .tile .title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

article.tag-list ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  max-width: none;
  columns: 2;
  column-gap: 2rem;
}

article.tag-list ul li {
  break-inside: avoid;
  padding: 0.2rem 0;
}

article.tag-list ul a {
  color: var(--fg);
  text-decoration: none;
}

article.tag-list ul a:hover { color: var(--accent); }

article.tag-list ul .count {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

.site-footer {
  margin-top: 3rem;
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  font-size: 0.8rem;
}

.site-footer p { margin: 0.25rem 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }