/* Almanac — a micro.blog theme
   Swiss-style, photo-first, every snippet led by its date.
   Override anything here from Design → Edit CSS (custom.css loads after this file). */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #5c5c5c;
  --panel: #f1f1f1;
  --rule: #111111;
  --accent: #D7261E;
  --accent-text: var(--accent);
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wrap: 1200px;
  --gutter: 32px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --ink: #f2f2ee;
    --muted: #a7a7a1;
    --panel: #1f1f1d;
    --rule: #f2f2ee;
    --accent-text: color-mix(in srgb, var(--accent) 70%, #ffffff);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10;
}
.skip-link:focus { left: 8px; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 40px var(--gutter) 72px;
}

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 32px;
  padding-bottom: 16px;
  border-bottom: 6px solid var(--rule);
}
.masthead-title { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.masthead-name { font-size: 22px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; }
.masthead-tagline { font-size: 22px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; }
.masthead-title:hover .masthead-name { color: var(--accent-text); }
.masthead-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; font-weight: 700; }
.masthead-nav a { text-decoration: none; padding: 4px 0; }
.masthead-nav a:hover { text-decoration: underline; }

/* ---------- Month strip ---------- */

.strip { padding: 20px 0 28px; border-bottom: 1px solid var(--rule); }
.strip-head {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.strip-total { color: var(--accent-text); display: inline-flex; align-items: center; gap: 6px; }
.strip-total i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }
.strip-months { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.strip-month > a, .strip-month > span {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--ink);
}
.strip-bar {
  width: 100%; height: 56px; background: var(--panel);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; padding: 6px 0;
}
.strip-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.strip-bar b { font-size: 13px; font-weight: 900; color: var(--accent-text); margin-top: auto; margin-bottom: auto; }
.strip-month a:hover .strip-bar { outline: 2px solid var(--accent); outline-offset: -2px; }
.strip-label { font-size: 11px; font-weight: 700; }
.strip-year { font-size: 10px; font-weight: 700; color: var(--muted); margin-top: -4px; }

/* ---------- Year mark ---------- */

.year-mark {
  margin: 48px 0 0;
  font-size: clamp(88px, 15vw, 168px);
  font-weight: 900;
  font-stretch: 62%;
  font-variation-settings: "wdth" 62;
  line-height: 0.8;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
}

/* ---------- Entry (one snippet in a list) ---------- */

.entry {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.entry-meta { flex: 0 0 220px; display: flex; flex-direction: column; min-width: 0; }
.entry-day {
  font-size: clamp(104px, 13vw, 168px);
  font-weight: 900;
  font-stretch: 62%;
  font-variation-settings: "wdth" 62;
  line-height: 0.82;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--ink);
}
.entry-mon { font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 10px; }
.entry-wk, .entry-time { color: var(--accent-text); }
.entry-title { margin: 20px 0 0; font-size: 22px; font-weight: 800; line-height: 1.15; }
.entry-title a { text-decoration: none; }
.entry-caption { margin-top: 20px; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.entry-caption p { margin: 0 0 0.6em; }
.entry-caption p:last-child { margin-bottom: 0; }

.entry-body { flex: 999 1 520px; min-width: 0; }
.entry-hero { display: block; }
.entry-hero img {
  display: block;
  width: auto; max-width: 100%;
  height: auto; max-height: 85vh;
  background: var(--panel);
}
.entry-more { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 4px; text-decoration: none; }
.entry-more span { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--panel); }
.entry-more img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry-more-count {
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; color: var(--accent-text);
}

.entry--text .entry-body { padding-top: 6px; }
.entry--text .entry-title { margin: 0 0 12px; font-size: clamp(26px, 3vw, 36px); }
.entry-text {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.3;
  font-weight: 500;
  max-width: 34ch;
  overflow-wrap: anywhere;
}
.entry-text p { margin: 0 0 0.6em; }
.entry-text img { display: block; margin: 12px 0; }

/* ---------- Single post ---------- */

.single-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px;
  padding: 28px 0 24px; border-bottom: 1px solid var(--rule);
}
.single-day {
  font-size: clamp(140px, 22vw, 260px);
  font-weight: 900; font-stretch: 62%; font-variation-settings: "wdth" 62;
  line-height: 0.78; letter-spacing: -0.04em; text-decoration: none; color: var(--ink);
}
.single-date { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; }
.single-mon { font-size: clamp(22px, 3vw, 32px); font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1; }
.single-wk { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-text); }
.single-title { margin: 28px 0 0; font-size: clamp(30px, 4vw, 48px); font-weight: 900; line-height: 1.05; }
.single-body { margin-top: 28px; font-size: 20px; line-height: 1.55; max-width: 100%; overflow-wrap: anywhere; }
.single-body > p, .single-body > ul, .single-body > ol, .single-body > blockquote { max-width: 680px; }
.single-body img { display: block; width: auto; max-width: 100%; height: auto; max-height: 90vh; margin: 0 0 16px; }
.single-body blockquote { margin: 0 0 1em; padding-left: 20px; border-left: 4px solid var(--accent); }
.single-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; }
.single-cats a, .arch-cats a {
  font-size: 14px; font-weight: 700; text-decoration: none;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 6px 14px;
}
.single-cats a:hover, .arch-cats a:hover { background: var(--ink); color: var(--bg); }
.conversation { margin-top: 40px; max-width: 680px; }

/* ---------- Pager & footer ---------- */

.pager {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px 0; font-size: 15px; font-weight: 700;
}
.pager a { text-decoration: none; padding: 8px 0; }
.pager a:hover { text-decoration: underline; }
.pager--single { border-top: 1px solid var(--rule); margin-top: 40px; }

.colophon {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  margin-top: 24px; padding-top: 16px; border-top: 6px solid var(--rule);
  font-size: 14px; font-weight: 700;
}

/* ---------- List pages (categories, pages, archive, photos) ---------- */

.list-head { padding: 32px 0 24px; border-bottom: 1px solid var(--rule); }
.list-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-text); }
.page-title {
  margin: 8px 0 0;
  font-size: clamp(56px, 9vw, 120px);
  font-weight: 900; font-stretch: 62%; font-variation-settings: "wdth" 62;
  line-height: 0.85; letter-spacing: -0.02em;
}
.page-body { margin-top: 28px; font-size: 20px; line-height: 1.55; max-width: 680px; overflow-wrap: anywhere; }
.page-body img { display: block; margin: 16px 0; }

.term-list { list-style: none; margin: 0; padding: 0; }
.term-list li { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 22px; font-weight: 700; }
.term-list a { text-decoration: none; }
.term-list span { color: var(--accent-text); }

.arch-cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 0; }
.arch-cats span { color: var(--accent-text); margin-left: 4px; }
.arch-cats a:hover span { color: inherit; }

.arch-year { margin-top: 24px; }
.arch-year-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 20px; margin-bottom: 20px; }
.arch-year-head .year-mark { margin-top: 24px; }
.arch-count { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-text); padding-bottom: 8px; }
.arch-months {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); column-gap: 20px;
}
.arch-month { border-top: 1px solid var(--rule); padding: 10px 0 20px; scroll-margin-top: 20px; }
.arch-month:target h3 { color: var(--accent-text); }
.arch-month h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.arch-month h3 span { color: var(--accent-text); }
.arch-month.is-empty h3 { color: var(--muted); font-weight: 400; }
.arch-days { display: flex; flex-wrap: wrap; gap: 4px; }
.day-chip {
  position: relative; width: 44px; height: 44px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); color: var(--ink); text-decoration: none;
  font-size: 14px; font-weight: 800;
}
.day-chip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.day-chip.has-photo span {
  position: absolute; left: 0; bottom: 0; padding: 1px 4px;
  background: var(--bg); color: var(--ink); font-size: 11px; line-height: 1.3;
}
.day-chip:hover { outline: 2px solid var(--accent); outline-offset: 1px; color: var(--ink); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; margin-top: 24px; }
.photo-tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--panel); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.photo-tile:hover img { transform: scale(1.03); }
.photo-date {
  position: absolute; left: 0; bottom: 0; padding: 4px 8px;
  background: var(--bg); color: var(--ink);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.photo-date b { font-weight: 900; }

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .wrap { padding-top: 24px; }
  .masthead-name, .masthead-tagline { font-size: 18px; }
  .strip-bar { height: 44px; gap: 3px; }
  .strip-bar i { width: 7px; height: 7px; }
  .strip-label { font-size: 10px; }
  .strip-months { gap: 2px; }
  .year-mark { margin-top: 36px; }
  .entry { gap: 16px; padding: 22px 0; }
  .entry-meta { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 14px; }
  .entry-day { font-size: 96px; }
  .entry-mon { margin-top: 0; }
  .entry-title, .entry-caption { flex: 1 1 100%; margin-top: 8px; }
  .entry-body { flex-basis: 100%; }
  .entry-more { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .arch-months { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .photo-tile img { transition: none; }
}
