/*
Theme Name: jjpeg
Theme URI: https://jjpeg.co
Author: jabarshi
Description: A dense, monochrome, Tumblr-lite photography theme. Edge-to-edge masonry image wall, filmstrip lightbox, category collections, light/dark. Upload a photo and tag its category — it drops straight into the wall.
Version: 1.14.0
Requires at least: 6.4
Tested up to: 6.9.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: jjpeg
*/

:root {
  --bg: #0b0b0b; --panel: #141414; --fg: #ededea; --muted: #6f6d68;
  --muted-2: #4a4945; --line: #1f1f1d; --hair: #2a2a27;
  --font: 'Archivo', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: 4px;
}
html[data-theme="light"] {
  --bg: #f3f1ea; --panel: #e9e6dd; --fg: #16150f; --muted: #86837a;
  --muted-2: #aaa79c; --line: #ddd9cf; --hair: #cfcbbf;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: var(--font); }
body { -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--fg); color: var(--bg); }

/* ---------- TOP BAR ---------- */
.jj-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; height: 52px; gap: 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 0.5px solid var(--line);
}
.jj-brand { display: flex; align-items: baseline; gap: 12px; flex-shrink: 0; }
.jj-logo { font-weight: 800; font-size: 17px; letter-spacing: -0.04em; }
.jj-logo span { color: var(--muted); }
.jj-count { font-family: var(--mono); font-size: 10px; color: var(--muted-2); letter-spacing: .05em; }
.jj-filters { display: flex; gap: 2px; align-items: center; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.jj-filters::-webkit-scrollbar { display: none; }
.jj-filters a {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: 6px 10px; white-space: nowrap; border-radius: 2px;
  transition: color .15s, background .15s;
}
.jj-filters a:hover { color: var(--fg); }
.jj-filters a.is-active { background: var(--fg); color: var(--bg); }
.jj-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.jj-right a { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.jj-right a:hover { color: var(--fg); }
.jj-mode {
  background: transparent; border: 0.5px solid var(--hair); color: var(--fg);
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- COLLECTION HEADER ---------- */
.jj-collhead {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  padding: 22px 16px 16px; border-bottom: 0.5px solid var(--line);
}
.jj-collhead h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.jj-collhead .jj-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; margin-top: 8px; }
.jj-collhead .jj-desc { font-size: 13.5px; color: var(--muted); margin-top: 6px; max-width: 520px; }
.jj-collhead .jj-back { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.jj-collhead .jj-back:hover { color: var(--fg); }

/* ---------- WALL (masonry) ---------- */
.jj-wall { padding: var(--gutter); }
.jj-wall-inner { column-count: 3; column-gap: var(--gutter); }
@media (max-width: 1200px) { .jj-wall-inner { column-count: 3; } }
@media (max-width: 900px)  { .jj-wall-inner { column-count: 3; } }
@media (max-width: 640px)  { .jj-wall-inner { column-count: 2; } }
@media (max-width: 420px)  { .jj-wall-inner { column-count: 1; } }

.jj-tile { break-inside: avoid; margin-bottom: var(--gutter); position: relative; cursor: zoom-in; overflow: hidden; background: var(--panel); line-height: 0; }
.jj-tile img { width: 100%; height: auto; display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.jj-tile:hover img { transform: scale(1.025); }
.jj-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.78), transparent);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 8px;
  line-height: 1.25; pointer-events: none; opacity: 0; transition: opacity .2s ease;
}
.jj-tile:hover .jj-cap { opacity: 1; }
.jj-cap-t { font-size: 12.5px; font-weight: 600; color: #fff; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jj-cap-m { font-family: var(--mono); font-size: 9.5px; color: rgba(255,255,255,.62); text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.jj-cap-n { font-family: var(--mono); font-size: 9.5px; color: rgba(255,255,255,.45); }

/* ---------- EMPTY STATE ---------- */
.jj-empty { padding: 80px 20px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.jj-empty a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- FOOTER ---------- */
.jj-foot {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 20px 16px; border-top: 0.5px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); letter-spacing: .06em;
}
.jj-foot a:hover { color: var(--fg); }
.jj-foot .jj-soc { display: flex; gap: 16px; }

/* ---------- LIGHTBOX ---------- */
.jj-lb {
  position: fixed; inset: 0; z-index: 200; display: none; flex-direction: column;
  background: rgba(6,6,6,.97); backdrop-filter: blur(4px);
}
.jj-lb.is-open { display: flex; animation: jj-lbin .22s ease; }
@keyframes jj-lbin { from { opacity: 0; } to { opacity: 1; } }
.jj-lb-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; flex-shrink: 0; font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,.55); letter-spacing: .08em; }
.jj-lb-top button { background: none; border: none; color: rgba(255,255,255,.7); cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.jj-lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; min-height: 0; padding: 0 12px; }
.jj-lb-stage img { max-width: 100%; max-height: 66vh; object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.jj-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.4); border: 0.5px solid rgba(255,255,255,.2); color: #fff; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; transition: background .15s; z-index: 2; }
.jj-lb-nav:hover { background: rgba(0,0,0,.75); }
.jj-lb-prev { left: 12px; } .jj-lb-next { right: 12px; }
.jj-lb-cap { flex-shrink: 0; padding: 12px 20px 8px; text-align: center; }
.jj-lb-cap-t { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
.jj-lb-cap-m { font-family: var(--mono); font-size: 10.5px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .14em; margin-top: 5px; }
.jj-strip { flex-shrink: 0; display: flex; gap: 4px; overflow-x: auto; padding: 6px 16px 18px; scrollbar-width: none; }
.jj-strip::-webkit-scrollbar { display: none; }
.jj-strip.is-centered { justify-content: center; }
.jj-strip button { flex: 0 0 auto; height: 46px; padding: 0; line-height: 0; cursor: pointer; background: none; border: 1px solid transparent; opacity: .45; transition: opacity .15s; }
.jj-strip button:hover { opacity: .8; }
.jj-strip button.is-active { border-color: #fff; opacity: 1; }
.jj-strip img { height: 100%; width: auto; object-fit: cover; }

.admin-bar .jj-bar { top: 32px; }
@media (max-width: 782px) { .admin-bar .jj-bar { top: 46px; } }
@media (max-width: 640px) { .jj-hide-sm { display: none !important; } }

/* ---------- HARDENED PAGE + SINGLE PHOTO FALLBACKS ---------- */
.jj-page,
.jj-single-photo { min-height: calc(100svh - 52px); }
.jj-page-inner,
.jj-single-photo-inner {
  width: min(calc(100% - 32px), 980px);
  margin: 0 auto;
  padding: clamp(56px, 10vw, 120px) 0;
}
.jj-page-head h1 {
  margin: 8px 0 28px;
  font-size: clamp(44px, 9vw, 110px);
  line-height: .82;
  letter-spacing: -.08em;
}
.jj-page-content {
  max-width: 720px;
  color: color-mix(in srgb, var(--fg) 82%, var(--muted));
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.35;
  letter-spacing: -.025em;
}
.jj-page-content a { text-decoration: underline; text-underline-offset: 3px; }
.jj-page-content > *:first-child { margin-top: 0; }
.jj-page-content > *:last-child { margin-bottom: 0; }
.jj-single-photo-inner { width: min(calc(100% - 32px), 1400px); }
.jj-single-photo .jj-back { display: inline-block; margin-bottom: 18px; }
.jj-single-frame {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  gap: clamp(16px, 3vw, 40px);
  align-items: end;
}
.jj-single-frame img {
  width: 100%;
  max-height: 78svh;
  object-fit: contain;
  background: var(--panel);
}
.jj-single-frame figcaption h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 5vw, 72px);
  line-height: .9;
  letter-spacing: -.06em;
}
.jj-single-notes { margin-top: 36px; }
.jj-tile:focus-visible,
.jj-mode:focus-visible,
.jj-lb button:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}
@media (max-width: 780px) {
  .jj-single-frame { grid-template-columns: 1fr; }
  .jj-page-inner,
  .jj-single-photo-inner { padding-top: 44px; }
}

/* ---------- MOBILE HEADER REPAIR v1.3 ----------
   Desktop keeps the original single-line bar. Mobile gets a deliberate
   two-row header so filters don't crush the logo or hang awkwardly.
-------------------------------------------------- */
@media (max-width: 760px) {
  .jj-bar {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand right"
      "filters filters";
    align-items: center;
    gap: 10px 12px;
    padding: 10px 10px 8px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-bottom: 0.5px solid var(--line);
    box-shadow: 0 10px 28px rgba(0,0,0,.16);
    backdrop-filter: blur(16px) saturate(1.08);
  }

  .jj-brand {
    grid-area: brand;
    min-width: 0;
  }

  .jj-logo {
    font-size: 22px;
    line-height: .9;
    letter-spacing: -.07em;
  }

  .jj-right {
    grid-area: right;
    justify-self: end;
    gap: 8px;
  }

  .jj-mode {
    width: 30px;
    height: 30px;
    background: color-mix(in srgb, var(--panel) 70%, transparent);
    border-color: color-mix(in srgb, var(--fg) 18%, transparent);
  }

  .jj-filters {
    grid-area: filters;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    margin-inline: -1px;
    padding: 0 0 2px;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
  }

  .jj-filters a {
    scroll-snap-align: start;
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 0.5px solid var(--line);
    background: color-mix(in srgb, var(--panel) 62%, transparent);
    color: color-mix(in srgb, var(--fg) 58%, var(--muted));
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: .12em;
  }

  .jj-filters a.is-active {
    border-color: var(--fg);
    background: var(--fg);
    color: var(--bg);
  }

  .admin-bar .jj-bar {
    top: 46px;
  }

  .jj-wall {
    padding-top: 6px;
  }
}

@media (max-width: 420px) {
  .jj-logo {
    font-size: 20px;
  }
  .jj-bar {
    padding-inline: 8px;
  }
  .jj-filters {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }
}

/* ---------- MOBILE IMMERSIVE HEADER v1.4 ----------
   Hide while scrolling down, reveal on scroll up. Keeps the photo wall feeling
   full-bleed while making filters one small upward gesture away.
-------------------------------------------------- */
@media (max-width: 760px) {
  .jj-bar {
    top: env(safe-area-inset-top, 0px);
    transition:
      transform .28s cubic-bezier(.2,.7,.2,1),
      background .22s ease,
      box-shadow .22s ease,
      padding .22s ease;
    will-change: transform;
  }

  .jj-bar.is-hidden {
    transform: translateY(calc(-100% - env(safe-area-inset-top, 0px) - 8px));
  }

  .jj-bar.is-compact {
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    box-shadow: 0 12px 34px rgba(0,0,0,.22);
  }

  .jj-bar:focus-within,
  .jj-bar:hover {
    transform: translateY(0);
  }

  .jj-filters {
    position: relative;
    -webkit-mask-image: linear-gradient(
      90deg,
      transparent 0,
      #000 16px,
      #000 calc(100% - 42px),
      transparent 100%
    );
    mask-image: linear-gradient(
      90deg,
      transparent 0,
      #000 16px,
      #000 calc(100% - 42px),
      transparent 100%
    );
  }

  /* Physical gradient fallback for browsers that render masks oddly. */
  .jj-filters::after {
    content: "";
    position: sticky;
    right: -1px;
    flex: 0 0 34px;
    width: 34px;
    height: 32px;
    margin-left: -34px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--bg) 82%);
  }

  .admin-bar .jj-bar {
    top: 46px;
  }

  .admin-bar .jj-bar.is-hidden {
    transform: translateY(calc(-100% - 54px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .jj-bar {
    transition: none !important;
  }
}

/* ---------- SHIP-READINESS v1.6 ---------- */
.jj-tile {
  content-visibility: auto;
  contain-intrinsic-size: 1px 620px;
}
html.jj-is-transitioning .jj-wall,
html.jj-is-transitioning .jj-collhead {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
}
.jj-wall,
.jj-collhead {
  transition: opacity .18s ease, transform .18s ease;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
  .jj-tile:hover img {
    transform: none !important;
  }
}

/* ---------- BLOG / POST / ABOUT PAGES v1.7 ---------- */
.jj-right a.is-active { color: var(--fg); }

.jj-blog-head {
  padding: 48px clamp(20px, 5vw, 64px) 30px;
  border-bottom: .5px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.jj-blog-head h1,
.jj-post-head h1,
.jj-about-copy h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -.065em;
  line-height: .88;
}
.jj-blog-head .dek {
  max-width: 520px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  text-wrap: pretty;
}
.jj-blog-head .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: right;
  white-space: nowrap;
}
.jj-blog-list { border-bottom: .5px solid var(--line); }
.jj-blog-entry {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) 210px;
  gap: clamp(18px, 4vw, 36px);
  align-items: start;
  padding: 30px clamp(20px, 5vw, 64px);
  border-bottom: .5px solid var(--line);
  transition: background .15s ease, opacity .15s ease, transform .15s ease;
}
.jj-blog-entry:last-child { border-bottom: 0; }
.jj-blog-entry:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }
.jj-blog-entry-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .04em;
}
.jj-blog-entry-date .num {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: .14em;
}
.jj-blog-entry-date .loc {
  display: block;
  margin-top: 7px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 9.5px;
}
.jj-blog-entry h2 {
  margin: 0;
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.04;
}
.jj-blog-entry .excerpt {
  max-width: 620px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14.5px;
  text-wrap: pretty;
}
.jj-blog-entry .read {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.jj-blog-entry:hover .read { color: var(--fg); }
.jj-blog-entry-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--panel);
}
.jj-blog-entry-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.jjpeg-pager {
  padding: 36px clamp(20px, 5vw, 64px) 64px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.jjpeg-pager a,
.jjpeg-pager .current,
.jjpeg-pager .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  margin: 0 6px 6px 0;
  padding: 6px 10px;
  border: .5px solid var(--line);
  border-radius: 0;
  color: var(--muted);
}
.jjpeg-pager .current { color: var(--bg); background: var(--fg); border-color: var(--fg); }

.jj-post-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 0;
}
.jj-crumb {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.jj-crumb a:hover { color: var(--fg); }
.jj-post-head {
  text-align: center;
  padding: 52px 0 0;
}
.jj-post-head .kicker,
.jj-post-head .byline {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.jj-post-head .kicker { margin-bottom: 18px; }
.jj-post-head .byline { margin-top: 22px; }
.jj-post-head .sub {
  max-width: 600px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 17px;
  text-wrap: pretty;
}
.jj-post-lead {
  width: min(calc(100% - 48px), 1120px);
  margin: 44px auto 0;
  background: var(--panel);
}
.jj-post-lead img {
  width: 100%;
  max-height: 76vh;
  object-fit: cover;
}
.jj-entry-content {
  max-width: 640px;
  margin: 42px auto 0;
  padding: 0 20px;
}
.jj-entry-content p {
  margin: 0 0 22px;
  color: color-mix(in srgb, var(--fg) 82%, var(--muted));
  font-size: 16.5px;
  line-height: 1.7;
  text-wrap: pretty;
}
.jj-entry-content > p:first-of-type::first-letter {
  float: left;
  padding: 4px 10px 0 0;
  color: var(--fg);
  font-size: 58px;
  line-height: .78;
  font-weight: 700;
}
.jj-entry-content h2,
.jj-entry-content h3 {
  margin: 42px 0 14px;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.05;
}
.jj-entry-content img { max-width: 100%; height: auto; display: block; }
.jj-entry-content figure,
.jj-entry-content .wp-block-image,
.jj-entry-content .wp-block-gallery { margin: 34px 0; }
.jj-entry-content figcaption,
.jj-entry-content .wp-element-caption {
  margin-top: 10px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: left;
}
.jj-entry-content blockquote {
  margin: 30px 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--hair);
  color: var(--fg);
  font-size: 19px;
  font-weight: 500;
}
.jj-entry-content a { color: var(--fg); border-bottom: .5px solid var(--hair); }
.jj-postnav {
  max-width: 640px;
  margin: 50px auto 0;
  padding: 28px 20px 64px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: .5px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.jj-postnav a:hover { color: var(--fg); }

.jj-about-screen {
  min-height: calc(100svh - 52px);
  display: grid;
  align-items: center;
}
.jj-about-grid {
  width: min(calc(100% - 40px), 1240px);
  margin: 0 auto;
  padding: clamp(44px, 8vw, 86px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: clamp(34px, 7vw, 74px);
  align-items: center;
}
.jj-about-copy h1 { max-width: 9ch; }
.jj-about-content {
  max-width: 680px;
  margin-top: 28px;
}
.jj-about-content > p:first-child {
  margin: 0 0 28px;
  color: var(--fg);
  font-size: clamp(24px, 3.3vw, 36px);
  line-height: 1.16;
  letter-spacing: -.045em;
  font-weight: 650;
  text-wrap: pretty;
}
.jj-about-content p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.68;
  text-wrap: pretty;
}
.jj-about-content a { color: var(--fg); border-bottom: .5px solid var(--hair); }
.jj-about-links {
  margin-top: 30px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.jj-about-links a { color: var(--fg); border-bottom: .5px solid var(--hair); padding-bottom: 2px; }
.jj-about-links a:hover { border-color: var(--fg); }
.jj-about-portrait { margin: 0; }
.jj-about-portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--panel);
}
.jj-about-portrait figcaption {
  margin-top: 10px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.jj-about-specs {
  margin-top: 28px;
  border-top: .5px solid var(--line);
}
.jj-about-specs div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: .5px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
}
.jj-about-specs span {
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10px;
}
.jj-about-specs strong {
  color: var(--fg);
  font-weight: 400;
  text-align: right;
}

html.jj-is-transitioning .jj-blog-list,
html.jj-is-transitioning .jj-blog-head {
  opacity: 0;
  transform: translateY(4px);
}
.jj-blog-list,
.jj-blog-head { transition: opacity .18s ease, transform .18s ease; }

@media (max-width: 820px) {
  .jj-blog-head { flex-direction: column; align-items: flex-start; }
  .jj-blog-head .meta { text-align: left; }
  .jj-blog-entry { grid-template-columns: 1fr; gap: 14px; }
  .jj-blog-entry-thumb { order: -1; aspect-ratio: 16 / 9; }
  .jj-about-grid { grid-template-columns: 1fr; align-items: start; }
  .jj-post-lead { width: calc(100% - 20px); }
}


/* ---------- ABOUT + DESKTOP GUTTER TUNING v1.9 ---------- */
@media (min-width: 761px) {
  :root { --gutter: 16px; }
}
.jj-about-screen {
  align-items: start;
}
.jj-about-grid {
  align-items: start;
}
.jj-about-side {
  align-self: start;
}
@media (max-width: 760px) {
  .jj-right a {
    display: inline-flex !important;
    align-items: center;
    min-height: 30px;
    padding: 0 2px;
    font-size: 10px;
    color: var(--muted);
  }
  .jj-right a.is-active {
    color: var(--fg);
  }
}

/* ---------- MOBILE HEADER GAP FIX + FILM STRIP GUTTERS v1.10 ----------
   Mobile: pin the header to the actual viewport top. Some mobile contexts
   report/admin-inject top offsets that create an ugly floating gap on reveal.
   Desktop wall: tighter horizontal gutters, slightly larger vertical gutters.
-------------------------------------------------- */
@media (max-width: 760px) {
  .jj-bar,
  .admin-bar .jj-bar {
    top: 0 !important;
  }

  .jj-bar.is-hidden,
  .admin-bar .jj-bar.is-hidden {
    transform: translateY(calc(-100% - 8px)) !important;
  }
}

@media (min-width: 761px) {
  :root {
    --gutter: 6px;
    --gutter-x: 6px;
    --gutter-y: 11px;
  }

  .jj-wall {
    padding: var(--gutter-x);
  }

  .jj-wall-inner {
    column-gap: var(--gutter-x);
  }

  .jj-tile {
    margin-bottom: var(--gutter-y);
  }
}

/* ---------- DESKTOP UNIFORM GUTTER v1.11 ---------- */
@media (min-width: 761px) {
  :root {
    --gutter: 8px;
    --gutter-x: 8px;
    --gutter-y: 8px;
  }
}

/* ---------- MOBILE ABOUT PROFILE LAYOUT v1.12 ----------
   On phones, keep the About opening designed: copy + portrait share the first
   viewport, while the longer body keeps readable width below.
-------------------------------------------------- */
@media (max-width: 760px) {
  .jj-about-grid {
    width: calc(100% - 20px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(116px, 38vw);
    grid-template-areas:
      "copy side";
    gap: 14px;
    align-items: start;
    padding: 22px 0 44px;
  }

  .jj-about-copy {
    grid-area: copy;
    min-width: 0;
  }

  .jj-about-side {
    grid-area: side;
    min-width: 0;
    position: sticky;
    top: 12px;
  }

  .jj-about-copy h1 {
    font-size: clamp(38px, 15vw, 64px);
    line-height: .82;
    letter-spacing: -.09em;
  }

  .jj-about-content {
    display: contents;
  }

  .jj-about-content > p:first-child {
    font-size: clamp(18px, 5.2vw, 24px);
    line-height: 1.12;
    letter-spacing: -.045em;
    margin: 18px 0 0;
  }

  .jj-about-content > p:not(:first-child),
  .jj-about-content > ul,
  .jj-about-content > ol,
  .jj-about-content > blockquote,
  .jj-about-content > h2,
  .jj-about-content > h3 {
    grid-column: 1 / -1;
    max-width: 68ch;
  }

  .jj-about-content > p:not(:first-child) {
    font-size: 15.5px;
    line-height: 1.62;
    margin: 18px 0 0;
  }

  .jj-about-portrait img {
    aspect-ratio: 3 / 4;
    object-fit: cover;
  }

  .jj-about-portrait figcaption {
    font-size: 8.5px;
    line-height: 1.25;
    letter-spacing: .08em;
  }

  .jj-about-specs {
    margin-top: 14px;
  }

  .jj-about-specs div {
    display: grid;
    gap: 3px;
    padding: 8px 0;
    font-size: 10px;
  }

  .jj-about-specs span {
    font-size: 8px;
  }

  .jj-about-specs strong {
    text-align: left;
    line-height: 1.25;
  }
}

@media (max-width: 390px) {
  .jj-about-grid {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 34vw);
    gap: 10px;
  }
}

/* ---------- BLOG DROP-CAP REMOVAL v1.13 ---------- */
.jj-entry-content > p:first-of-type::first-letter {
  float: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
}

/* ---------- MOBILE ABOUT OPTION 3 REFINEMENT v1.14 ----------
   Keep the bespoke split opening, but stop the image following the reader.
   Also make the image less vertical so it behaves like a profile/mood panel,
   not a towering crop.
-------------------------------------------------- */
@media (max-width: 760px) {
  .jj-about-side {
    position: static;
    top: auto;
  }

  .jj-about-portrait img {
    aspect-ratio: 4 / 3;
  }

  .jj-about-portrait figcaption {
    display: none;
  }
}
