/* Latent Light — Ghost Theme */

/* ── Local fonts ───────────────────────────────────────── */
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-v37-latin-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-v15-latin-300.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-v15-latin-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:      #111110;
  --surface: #1a1916;
  --ink:     #e8e4dc;
  --mid:     #8a8680;
  --faint:   #2c2a27;
  --rule:    #252422;
  --hdr:     clamp(54px, 5vw, 72px);

  --serif:  'Lora', 'Georgia', 'Times New Roman', serif;
  --sans:   'Outfit', 'Helvetica Neue', Helvetica, sans-serif;

  --max:    clamp(1100px, 72vw, 1800px);
  --pad:    clamp(1.4rem, 4vw, 3rem);
  --gap:    clamp(1.8rem, 3vw, 2.6rem);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: clamp(16px, 0.4vw + 12px, 26px);
  scroll-behavior: smooth;

  scrollbar-gutter: stable;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ── Utilities ───────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.u-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
}
.u-date {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--mid);
}

/* ── HEADER ──────────────────────────────────────────────── */
.site-header {
  height: var(--hdr);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--pad);
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(17,17,16,0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-title {
  font-family: var(--serif);
  font-size: clamp(1rem, 1.2vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink);
  white-space: nowrap;
  justify-self: start;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav ul li { list-style: none; }
.site-nav ul li a {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  transition: color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.site-nav ul li a:hover,
.site-nav ul li a[aria-current="page"],
.site-nav ul li.nav-current > a { color: var(--ink); }

.site-header__right {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  justify-self: end;
}
.site-nav__archive {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  transition: color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__archive:hover { color: var(--ink); }

.site-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0 8px;
}
.site-burger span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--mid);
  transition: transform 0.25s, opacity 0.25s, background 0.15s;
  transform-origin: center;
}
.site-burger:hover span { background: var(--ink); }
.site-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-mobile-nav {
  display: none;
  position: fixed;
  top: var(--hdr);
  left: 0;
  right: 0;
  background: rgba(17,17,16,0.98);
  border-bottom: 1px solid var(--rule);
  padding: 1.4rem var(--pad);
  z-index: 199;
  flex-direction: column;
  gap: 1.2rem;
}
.site-mobile-nav.is-open { display: flex; }

.site-mobile-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.site-mobile-nav ul li { list-style: none; }

.site-mobile-nav a,
.site-mobile-nav ul li a {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  transition: color 0.15s;
  text-decoration: none;
}
.site-mobile-nav a:hover,
.site-mobile-nav ul li a:hover { color: var(--ink); }

/* ── WRAPPER ─────────────────────────────────────────────── */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--gap) var(--pad) 0;
}

/* ── DATE STRIP ──────────────────────────────────────────── */
.date-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  margin: 1.4rem 0 var(--gap);
}

/* ── FEATURED POST ───────────────────────────────────────── */
.post-featured {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: var(--gap);
  padding-bottom: var(--gap);
  border-bottom: 1px solid var(--rule);
}

.post-featured__img {
  overflow: hidden;
  background: var(--surface);
}
.post-featured__img img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s ease;
}

.post-featured__body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.post-featured__title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  font-weight: 400;
  line-height: 1.14;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: color 0.15s;
}
.post-featured:hover .post-featured__title { color: var(--mid); }

.post-featured__excerpt {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--mid);
}

/* ── CARD GRID ───────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap) 2rem;
  margin-bottom: var(--gap);
  padding-bottom: var(--gap);
  border-bottom: 1px solid var(--rule);
}

/* ── CARD ────────────────────────────────────────────────── */
.card { display: flex; flex-direction: column; gap: 0.85rem; }

.card__img {
  overflow: hidden;
  background: var(--surface);
}
.card__img img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s ease;
}
.card:hover .card__img img { opacity: 0.85; }

.card__body { display: flex; flex-direction: column; gap: 0.25rem; padding-top: 0.7rem; }
.card__meta,
.post-featured__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  overflow: hidden;
}
.u-date--author {
  opacity: 0.75;
}

.card__title {
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.3vw, 1.2rem);
  font-weight: 400;
  line-height: 1.22;
  color: var(--ink);
  transition: color 0.15s;
}
.card:hover .card__title { color: var(--mid); }

.card__excerpt {
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--mid);
}

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--gap) 0;
}
.pagination__info { font-size: 0.75rem; letter-spacing: 0.15em; color: var(--mid); }
.pagination__btn {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0 0.12rem;
  display: inline-block;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.pagination__btn:hover { color: var(--ink); border-color: var(--mid); }

/* ═══════════════════════════════════════════════════════════
   SINGLE POST
═══════════════════════════════════════════════════════════ */

.post-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--pad) 1.6rem;
}
.post-header__meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
  overflow: hidden;
}
.post-header__sep {
  font-size: 0.82rem;
  color: var(--mid);
  opacity: 0.35;
  user-select: none;
}
.post-header__author {
  font-style: normal;
  opacity: 0.75;
  white-space: nowrap;
}
.post-header__title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 400;
  line-height: 1.12;
  color: var(--ink);
  letter-spacing: -0.015em;
  max-width: 820px;
}

.post-header__gear {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}
.post-header__gear span {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
  opacity: 0.8;
}

.post-header__excerpt {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--mid);
  max-width: 640px;
  margin-top: 1.1rem;
}

/* ── PAGE template (About, Imprint etc.) ─────────────────── */
.page-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem var(--pad) 5rem;
}
.page-header__title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.12;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.page-hero {
  margin: 0 0 2rem;
}
.page-hero img {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: cover;
}
.page-body p {
  font-family: var(--serif);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.88;
  color: var(--ink);
  margin-bottom: 1.6rem;
}
.page-body h2 {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 400;
  color: var(--ink);
  margin: 2.5rem 0 0.9rem;
}
.page-body a {
  color: var(--ink);
  border-bottom: 1px solid var(--faint);
  transition: border-color 0.15s;
}
.page-body a:hover { border-color: var(--mid); }

/* ── Post hero image ─────────────────────────────────────── */
.post-hero {
  max-width: var(--max);
  margin: 0 auto 2.5rem;
  padding: 0 var(--pad);
}
.post-hero img {
  width: 100%;
  height: auto;
  display: block;
}
.post-hero figcaption {
  margin: 0.5rem 0 0;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  opacity: 0.7;
  line-height: 1.5;
}

/* ── Post body — text column narrow, images wide ─────────── */
.post-body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) 4rem;
}

.post-body > p,
.post-body > h2,
.post-body > h3,
.post-body > blockquote,
.post-body > ul,
.post-body > ol,
.post-body > hr {
  max-width: 680px;
  margin-left: 0;
  margin-right: auto;
}

.post-body p {
  font-family: var(--serif);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.88;
  color: var(--ink);
  margin-bottom: 1.6rem;
}
.post-body h2 {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 400;
  color: var(--ink);
  margin: 2.8rem auto 1rem 0;
  line-height: 1.2;
}
.post-body h3 {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 400;
  color: var(--ink);
  margin: 2.2rem auto 0.8rem 0;
}
.post-body blockquote {
  border-left: 2px solid var(--faint);
  padding: 0.4rem 0 0.4rem 1.4rem;
  margin: 2rem auto 2rem 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--mid);
}
.post-body a {
  color: var(--ink);
  border-bottom: 1px solid var(--faint);
  transition: border-color 0.15s;
}
.post-body a:hover { border-color: var(--mid); }

/* ── Ghost required card width classes ───────────────────── */
.kg-width-wide {
  width: 100%;
  max-width: calc(var(--max) + 8rem);
  margin-left: auto;
  margin-right: auto;
}
.kg-width-full {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* ── Images — full content width, responsive ─────────────── */
.post-body .kg-image-card,
.post-body figure {
  margin: 2rem 0;
  width: 100%;
}

.post-body .kg-image-card .kg-image,
.post-body .kg-image-card img,
.post-body figure img {
  width: 100%;
  height: auto;
  display: block;
}

.post-body .kg-image-card figcaption,
.post-body figcaption {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-align: left;
  margin-top: 0.5rem;
  opacity: 0.7;
  line-height: 1.5;
}

/* Pre-paint caption hiding — prevents FOUC when main.js splits "text // meta" */
.js-cap-pending .post-body figcaption,
.js-cap-pending .page-body figcaption,
.js-cap-pending #post-hero figcaption {
  visibility: hidden;
}

/* ── Caption tech-meta line (analog gear tag) ────────────── */
.cap-meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
}
.cap-meta--inline {
  display: inline;
  margin-top: 0;
  margin-left: 0;
  letter-spacing: 0.12em;
}
.cap-meta--inline::before {
  content: "·";
  display: inline-block;
  margin: 0 0.55em;
  opacity: 0.6;
  letter-spacing: 0;
}

/* ── Gallery — 2 col, gap ────────────────────────────────── */
.post-body .kg-gallery-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 2rem 0;
  width: 100%;
}
.post-body .kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 560px) {
  .post-body .kg-gallery-container {
    grid-template-columns: 1fr;
  }
}

.post-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.4rem var(--pad);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.post-footer__tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.post-footer__tag {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.1rem;
  transition: opacity 0.15s, border-color 0.15s;
}
.post-footer__tag:hover { opacity: 1; border-color: var(--mid); }
/* ── SITE FOOTER ─────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.site-footer p, .site-footer a {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--mid);
  transition: color 0.15s;
}
.site-footer a:hover { color: var(--ink); }

.site-footer__nav { display: flex; align-items: center; gap: 1.2rem; }
.site-footer__nav ul {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  list-style: none;
  margin: 0; padding: 0;
  line-height: 1;
  vertical-align: middle;
}
.site-footer__nav ul li {
  display: flex;
  align-items: center;
  list-style: none;
  line-height: 1;
}
.site-footer__nav ul li::before { display: none; }
.site-footer__nav ul li a,
.site-footer__rss-link {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--mid);
  transition: color 0.15s;
  text-decoration: none;
  text-transform: uppercase;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.site-footer__nav ul li a:hover,
.site-footer__rss-link:hover { color: var(--ink); }
.site-footer__sep {
  font-size: 0.8rem;
  color: var(--mid);
  opacity: 0.3;
  user-select: none;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

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

@media (max-width: 1100px) {
  .post-body {
    padding-left: var(--pad);
    padding-right: var(--pad);
  }
}

@media (max-width: 860px) {
  .site-header {
    display: flex;
    gap: 1rem;
  }
  .site-nav { display: none; }
  .site-nav__archive { display: none; }
  .site-burger { display: flex; }
  .site-header__right { margin-left: auto; }

  .post-body > p,
  .post-body > h2,
  .post-body > h3,
  .post-body > blockquote,
  .post-body > ul,
  .post-body > ol {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  :root {
    
    --pad: 1rem;
    --gap: 1.4rem;
  }

  
  .post-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  
  .site-title { font-size: 1rem; }

  
  .post-body .kg-gallery-container {
    grid-template-columns: 1fr;
  }

  
  .post-header { padding-top: 1.4rem; }

  
  .site-footer__inner {
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
  }
}

@supports (padding: env(safe-area-inset-left)) {
  .site-header {
    padding-left: calc(var(--pad) + env(safe-area-inset-left));
    padding-right: calc(var(--pad) + env(safe-area-inset-right));
  }
  .wrap,
  .post-header,
  .post-body,
  .post-footer,
  .site-footer__inner {
    padding-left: calc(var(--pad) + env(safe-area-inset-left));
    padding-right: calc(var(--pad) + env(safe-area-inset-right));
  }
  .site-mobile-nav {
    padding-bottom: calc(1.4rem + env(safe-area-inset-bottom));
  }
}

/* ── READING PROGRESS ─────────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 1.5px;
  background: var(--mid);
  opacity: 0.5;
  z-index: 300;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── ACCESSIBILITY ───────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}
.skip-link:focus { left: 0; z-index: 9999; }

:focus-visible {
  outline: 2px solid var(--mid);
  outline-offset: 2px;
}

/* ── LIGHTBOX ────────────────────────────────────────────── */
.lb {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 9, 0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.lb--open {
  opacity: 1;
  pointer-events: auto;
}

.lb__area {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(2.5rem, 5vh, 3.5rem) clamp(0.5rem, 3vw, 2rem) clamp(0.5rem, 2vh, 1rem);
}

.lb__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform: scale(0.97);
  transition: transform 0.25s ease;
}
.lb--open .lb__img { transform: scale(1); }

.lb__prev,
.lb__next {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20%;
  min-width: 44px;
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
}
.lb__prev { left: 0; justify-content: flex-start; padding-left: 1.2rem; }
.lb__next { right: 0; justify-content: flex-end;  padding-right: 1.2rem; }
.lb__prev::after,
.lb__next::after {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--mid);
  border-bottom: 1px solid var(--mid);
  opacity: 0;
  transition: opacity 0.2s;
}
.lb__prev::after { transform: rotate(45deg); }
.lb__next::after { transform: rotate(-135deg); }
.lb__prev:hover::after,
.lb__next:hover::after { opacity: 0.5; }

.lb__close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  z-index: 3;
  background: none;
  border: none;
  color: var(--mid);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  opacity: 0.5;
  -webkit-tap-highlight-color: transparent;
}
.lb__close:hover { opacity: 1; }

.lb__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  background: rgba(10, 10, 9, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.lb__panel--open { max-height: 55vh; }
.lb__panel-inner {
  padding: 1.2rem var(--pad) 1.4rem;
  overflow-y: auto;
  max-height: 55vh;
  -webkit-overflow-scrolling: touch;
}
.lb__panel-text {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0.85;
  line-height: 1.65;
  margin: 0;
}

.lb__footer {
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
  transition: opacity 0.2s ease;
}
.lb--expanded .lb__footer { opacity: 0; }

.lb__bottom {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0.85rem var(--pad) calc(0.85rem + env(safe-area-inset-bottom, 0px));
  height: calc(0.8rem * 1.55 + 1.7rem + 1px);
}

.lb__cap {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0.72;
  line-height: 1.55;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.lb__cap--clickable {
  cursor: pointer;
}
.lb__cap--clickable:hover {
  opacity: 0.95;
}
.lb__meta {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.5;
  line-height: 1.55;
  white-space: nowrap;
  flex: 0 0 auto;
}
.lb__meta::before {
  content: "·";
  display: inline-block;
  margin-right: 0.9em;
  opacity: 0.55;
  letter-spacing: 0;
}
@media (max-width: 720px) {
  .lb__meta { display: none !important; }
}
.lb__expand {
  background: none;
  border: none;
  color: var(--ink);
  opacity: 0.6;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.8rem 0.35rem;
  margin: -0.8rem 0;
  min-width: 44px;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0;
}
.lb__expand:hover { opacity: 0.9; }
.lb--expanded .lb__expand {
  transform: rotate(180deg);
  opacity: 0.75;
}
.lb__counter {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--ink);
  opacity: 0.28;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 2.75rem;
}
/* ── TAG CLOUD ───────────────────────────────────────────── */
.tag-cloud {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem var(--pad) 2rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  align-items: baseline;
}
.tag-cloud__tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.15s;
  padding: 0.25rem 0;
}
.tag-cloud__tag:hover { color: var(--ink); }

/* ── ARCHIVE ─────────────────────────────────────────────── */
.archive-list {
  max-width: 100%;
  margin: 0 auto;
  padding-bottom: 4rem;
}

/* ── ERROR PAGE ──────────────────────────────────────────── */
.error-page {
  min-height: 65vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.4rem;
  padding: var(--pad);
}
.error-page__title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--ink);
}
.error-page__back {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.12rem;
  transition: color 0.15s, border-color 0.15s;
}
.error-page__back:hover { color: var(--ink); border-color: var(--mid); }

.archive-empty {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  opacity: 0.5;
  padding: 2rem 0;
}
.archive-year {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 400;
  color: var(--ink);
  padding: 2.5rem 0 0.8rem;
  margin-bottom: 0;
  letter-spacing: -0.01em;
}
.archive-year:first-child { padding-top: 0.5rem; }
.archive-item {
  border-bottom: 1px solid var(--rule);
}
.archive-item__link {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 0;
  transition: opacity 0.15s;
}
.archive-item__link:hover { opacity: 0.7; }
.archive-item__date {
  flex-shrink: 0;
  white-space: nowrap;
}
.archive-item__title {
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
}
.archive-item__tag { flex-shrink: 0; }

@media (max-width: 600px) {
  .archive-item__link {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.75rem 0;
  }
  .archive-item__tag { display: none; }
}

/* ── Post prev/next navigation ───────────────────────────── */
.post-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--pad) 3rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--rule);
}
.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  transition: opacity 0.15s;
  max-width: 48%;
  cursor: pointer;
  padding: 0.6rem 0;
  -webkit-tap-highlight-color: transparent;
}
.post-nav__item:hover { opacity: 0.7; }
.post-nav__item--next { text-align: right; margin-left: auto; }
.post-nav__label { letter-spacing: 0.15em; }
.post-nav__title {
  font-family: var(--serif);
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 600px) {
  .post-nav {
    gap: 1rem;
    padding: 1.5rem var(--pad) 2.25rem;
  }
  .post-nav__item {
    max-width: calc(50% - 0.5rem);
    flex: 1 1 0;
  }
  .post-nav__title {
    font-size: 0.9rem;
  }
}
