/* ============================================================
   Photoblog — clintmcmahon.com
   Minimal editorial design
   ============================================================ */

/* ---- Typeface ---------------------------------------------
   Inter, self-hosted. The variable file carries both a weight axis and an
   optical-size axis, so headings get slightly tighter, more display-like
   letterforms than captions do — that is what font-optical-sizing: auto below
   is for. Subset to Latin plus the punctuation and arrows this site actually
   uses: 66 KB, about half the weight of one photograph.
   ------------------------------------------------------------ */

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Helvetica, Arial, sans-serif;

  /* Type scale. Six steps that are visibly different from each other, rather
     than the fourteen near-identical ones this file used to carry. */
  --fs-xs:    0.75rem;    /* 12px — counts, pill numbers */
  --fs-sm:    0.8125rem;  /* 13px — nav, footer, meta, labels */
  --fs-base:  1rem;       /* 16px — captions, comments: anything you read */
  --fs-lg:    1.125rem;   /* 18px — the about page */
  --fs-md:    1.25rem;    /* 20px — section headings */
  --fs-title: 1.75rem;    /* 28px — a photo's title */
  --fs-h1:    2rem;       /* 32px — archive and tag page titles */

  /* Greys. Four, down from twelve. --muted is the lightest grey that still
     clears WCAG AA on white (4.5:1), so no text falls below it. */
  --bg:       #fff;
  --bg-sunk:  #f0f0f0;   /* the well a photo sits in before it loads */
  --bg-blur:  rgba(255, 255, 255, 0.96);  /* sticky bars */
  --ink:      #111;
  --ink-2:    #444;
  --muted:    #767676;
  --rule:     #e5e5e5;
  --rule-2:   #ccc;

  /* Spacing scale — the vertical rhythm was previously ad hoc (0.6/1.4/3/4rem). */
  --space-1: 0.5rem;
  --space-2: 0.875rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  /* The photograph's frame. Wider than the old fixed 1000px so a big display shows a
     big picture, but held back from the edges so it reads as a print on a wall rather
     than a background. Height does the real work — see .pb-image. */
  --stage: min(94vw, 1080px);

  /* How tall a photograph may stand. Used twice: to cap the image, and to work out
     how wide its frame should be — see --ar below. */
  --frame-h: min(78vh, 1000px);

  --measure: 65ch;        /* captions stop here instead of running 170 characters wide */
}

/* Dark is not an inversion: the greys are re-picked so photographs sit on a near-black
   mat the way prints do in a gallery, and every text colour still clears AA against it.
   No toggle — the research is unanimous that the system preference is what people expect. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0e0e0f;
    --bg-sunk:  #1a1a1c;
    --bg-blur:  rgba(14, 14, 15, 0.94);
    --ink:      #ededed;
    --ink-2:    #bdbdbd;
    --muted:    #8f8f8f;
    --rule:     #262628;
    --rule-2:   #3d3d40;
  }
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Fixed header ----------------------------------------- */

.pb-header {
  padding: 1.4rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
}

.pb-site-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}
.pb-site-name:hover { color: var(--muted); }

.pb-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.weather-widget {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.weather-icon {
  font-size: var(--fs-base);
}

.weather-temp {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.weather-loc {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.pb-header-byline {
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}

.pb-header-byline-link {
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s;
}
.pb-header-byline-link:hover { color: var(--ink); }

/* ---- Main layout ------------------------------------------ */

.pb-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Almost no padding on top: the photograph is the first thing on the page. */
  padding: var(--space-1) var(--space-4) var(--space-5);
}

/* ---- Image rows ------------------------------------------- */

/* The image frame is the one container that shrinks: it takes the photograph's own
   aspect ratio, so when the height cap bites, the frame narrows with the picture
   instead of leaving it letterboxed inside a wider box. Text, pager, responses and
   footer all stay pinned at the full 1080. */
.pb-rows {
  width: 100%;
  max-width: min(var(--stage), calc(var(--frame-h) * var(--ar, 99)));
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Each row is a horizontal strip — one or more images side by side */
.pb-row {
  display: flex;
  gap: 4px;
  width: 100%;
}

.pb-image {
  flex: 1;
  min-width: 0;
  display: block;
  width: 0;        /* forces equal flex distribution regardless of natural size */
  height: auto;
  /* A vertical frame filling a 1000px column stands 1250px tall (4:5) or 1500px (2:3),
     which is taller than the window — you land on a wall of photo with no caption in
     sight. Capping the height and letting object-fit letterbox inside the flex slot
     shrinks tall frames to fit while leaving everything wider than 5:4 untouched,
     including the older small photos that rely on width:0 to fill the column. */
  max-height: var(--frame-h);
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.55s ease;
}
.pb-image.is-loaded { opacity: 1; }

.pb-masonry {
  columns: 2;
  column-gap: 4px;
  margin-top: 4px;
}

/* No height cap and no object-fit here. A capped box keeps its full column width
   while contain shrinks the picture inside it, so every image taller than the cap
   floated in a pool of empty space instead of filling its column. Grid images fill
   their column and take whatever height their aspect ratio asks for — that is what
   makes a masonry grid read as tight. */
.pb-masonry-img {
  width: 100%;
  height: auto;
  display: block;
  break-inside: avoid;
  margin-bottom: 4px;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.pb-masonry-img.is-loaded { opacity: 1; }

/* The date above the title, quiet: it labels the photograph without competing. */
.pb-date {
  display: block;
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-1);
}

/* ---- Metadata row below image ----------------------------- */

.pb-meta {
  width: 100%;
  max-width: var(--stage);
  margin-top: var(--space-3);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.pb-caption-area {
  flex: 1;
  min-width: 0;
}

.pb-title {
  font-size: var(--fs-title);
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.018em;   /* large Inter sets loose by default */
  color: var(--ink);
  margin: 0 0 0.6rem;
  max-width: var(--measure);
}

/* Full column width, matching the photo above it — deliberately not capped to a
   reading measure, which left the text ending halfway across the frame. */
.pb-caption {
  font-size: var(--fs-base);
  color: var(--ink-2);
  line-height: 1.65;
  margin: 0;
  width: 100%;
}
.pb-caption p { margin: 0 0 0.5em; }

.pb-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* The "View on Mastodon" pill lands on its own line directly beneath the tag
   bubbles, so it needs the same breathing room the tags get from the caption. */
.pb-caption-area .u-syndication {
  margin-top: 0.75rem;
}

/* ---- Navigation ------------------------------------------- */

.pb-meta + 

/* ---- Pager ------------------------------------------------
   Prev/next carrying a thumbnail of where they lead. Award-winning photo sites
   nearly all show the next frame rather than the word "next" — you browse because
   you can see what is coming, not because you read a label.
   ------------------------------------------------------------ */

.pb-pager {
  width: 100%;
  max-width: var(--stage);
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
}

.pb-pager-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  min-width: 0;
}

.pb-pager-link--next {
  grid-column: 3;
  flex-direction: row-reverse;
  text-align: right;
  justify-self: end;
}

.pb-pager-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--bg-sunk);
  filter: grayscale(1);
  opacity: 0.75;
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.pb-pager-link:hover .pb-pager-thumb {
  filter: grayscale(0);
  opacity: 1;
}

.pb-pager-text { min-width: 0; }

.pb-pager-dir {
  display: block;
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.pb-pager-name {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.18s;
}
.pb-pager-link:hover .pb-pager-name { color: var(--ink); }

.pb-pager-center {
  grid-column: 2;
  display: flex;
  gap: var(--space-3);
}

.pb-pager-center a {
  font-size: var(--fs-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s;
}
.pb-pager-center a:hover { color: var(--ink); }

/* ---- Focus ------------------------------------------------
   Nothing in this stylesheet drew a focus ring, so keyboard users had no idea
   where they were. :focus-visible keeps it off mouse clicks.
   ------------------------------------------------------------ */

a:focus-visible,
button:focus-visible,
img:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Webmentions and Mastodon replies share the one container width. */
.pb-responses {
  width: 100%;
  max-width: var(--stage);
}

/* ---- Comments --------------------------------------------- */

/* Comments are switched off by a stub partial, which still left the container's
   margin and rule painting an empty band between the pager and the webmentions.
   :has() lets it collapse when nothing renders inside, and come back if it does. */
.pb-comments:not(:has(*)) {
  display: none;
}

.pb-comments {
  width: 100%;
  max-width: var(--stage);
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.pb-comments-heading {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 1.75rem;
}

.pb-comment-list {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
}

.pb-comment-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid #f2f2f2;
}

.pb-comment-meta {
  font-size: var(--fs-sm);
  margin-bottom: 0.3rem;
}

.pb-comment-author {
  font-weight: 500;
  color: var(--ink);
}

.pb-comment-time {
  color: var(--muted);
  margin-left: 0.5rem;
}

.pb-comment-body {
  font-size: var(--fs-base);
  color: var(--ink-2);
  line-height: 1.65;
}

.pb-no-comments {
  font-size: var(--fs-base);
  color: var(--muted);
  margin: 0 0 2rem;
}

/* ---- Comment form ----------------------------------------- */

.pb-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 420px;
}

.pb-input,
.pb-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.45rem 0;
  font-size: var(--fs-base);
  font-family: inherit;
  color: var(--ink);
  outline: none;
  resize: none;
  transition: border-color 0.2s;
}
.pb-input:focus,
.pb-textarea:focus {
  border-color: var(--ink);
}
.pb-input::placeholder,
.pb-textarea::placeholder {
  color: #ccc;
}

.pb-textarea {
  min-height: 80px;
}

.pb-submit {
  align-self: flex-start;
  background: none;
  border: 1px solid var(--rule);
  padding: 0.45rem 1.4rem;
  font-size: var(--fs-sm);
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.pb-submit:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ---- Footer nav ------------------------------------------- */

/* The auto side margins matter: the footer partial sits inside .pb-main on some
   pages and directly in <body> on others, and only .pb-main centers its children. */
.pb-footer {
  width: 100%;
  max-width: var(--stage);
  margin: 3rem auto 0;
  padding: 1.75rem 0 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  border-top: 1px solid var(--rule);
}

.pb-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.pb-footer-nav--elsewhere {
  gap: 1.5rem;
}

.pb-footer-link {
  font-size: var(--fs-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s;
}
.pb-footer-link:hover { color: var(--ink); }

.pb-footer-nav--elsewhere .pb-footer-link { color: var(--muted); }
.pb-footer-nav--elsewhere .pb-footer-link:hover { color: var(--ink); }

/* The page you are on: present, but not offering to take you where you already are. */
.pb-footer-link.is-current {
  color: var(--ink);
  cursor: default;
}

.pb-footer-colophon {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ---- Header nav link (about page back arrow) -------------- */

.pb-header-nav {
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.07em;
  text-align: right;
  text-decoration: none;
  transition: color 0.2s;
}
.pb-header-nav:hover { color: var(--ink); }

/* ---- About page ------------------------------------------- */

.pb-about {
  width: 100%;
  max-width: 600px;
  padding-top: 0.5rem;
}

.pb-about-heading {
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: -0.02em;
  
  color: var(--ink);
  margin: 0 0 2.5rem;
}

.pb-about-body {
  font-size: var(--fs-lg);
  line-height: 1.8;
  color: var(--ink-2);
}

.pb-about-body p {
  margin: 0 0 1.4em;
}

.pb-about-body a {
  color: var(--ink);
  text-decoration-color: #ddd;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.pb-about-body a:hover { text-decoration-color: var(--ink); }

/* ---- Lightbox ----------------------------------------------
   Click any photo to view it large; step through the set with
   arrows, swipe, or the keyboard.
   ------------------------------------------------------------ */

.pb-image,
.pb-masonry-img {
  cursor: zoom-in;
}

body.pb-lightbox-open {
  overflow: hidden;
}

.pb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, 0);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, background 0.3s ease, visibility 0s linear 0.3s;
  touch-action: none;
}

.pb-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  background: rgba(8, 8, 8, 0.95);
  transition: opacity 0.3s ease, background 0.3s ease;
}

.pb-lightbox-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 5.5rem;
}

.pb-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.pb-lightbox-img.is-visible {
  opacity: 1;
  transform: scale(1);
}

.pb-lightbox-close,
.pb-lightbox-prev,
.pb-lightbox-next {
  position: absolute;
  z-index: 1;
  background: none;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease, opacity 0.18s ease;
}
.pb-lightbox-close:hover,
.pb-lightbox-prev:hover,
.pb-lightbox-next:hover {
  color: #fff;
}
.pb-lightbox-close svg,
.pb-lightbox-prev svg,
.pb-lightbox-next svg {
  width: 100%;
  height: 100%;
}

.pb-lightbox-close {
  top: 1.25rem;
  right: 1.5rem;
  width: 1.4rem;
  height: 1.4rem;
}

.pb-lightbox-prev,
.pb-lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
}
.pb-lightbox-prev { left: 1.25rem; }
.pb-lightbox-next { right: 1.25rem; }

.pb-lightbox--single .pb-lightbox-prev,
.pb-lightbox--single .pb-lightbox-next {
  display: none;
}

.pb-lightbox-info {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  pointer-events: none;
}

.pb-lightbox-caption {
  margin: 0;
  font-size: var(--fs-base);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}

.pb-lightbox-counter {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .pb-lightbox-stage { padding: 3.5rem 1rem; }
  .pb-lightbox-close {
    top: 0.9rem;
    right: 0.9rem;
  }
  .pb-lightbox-prev { left: 0.6rem; }
  .pb-lightbox-next { right: 0.6rem; }
  .pb-lightbox-info { bottom: 1rem; max-width: 90%; }
}

/* ---- Keyboard hint ---------------------------------------- */

.pb-keys {
  position: fixed;
  bottom: 1.75rem;
  right: 2.5rem;
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  color: #ddd;
  pointer-events: none;
  user-select: none;
}

/* ---- Responsive ------------------------------------------- */

@media (max-width: 640px) {
  .pb-header {
    padding: 1.1rem 1.25rem;
    grid-template-columns: 1fr auto;
  }
  .pb-header-byline { display: none; }
  .pb-main {
    padding: 0.5rem 1.25rem 3rem;
  }
  .pb-meta {
    flex-direction: column;
    gap: 0.75rem;
  }
    
  .pb-meta + 
  .pb-keys { display: none; }

  .pb-pager {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
  .pb-pager-center {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    margin-top: var(--space-2);
  }
  .pb-pager-link--next { grid-column: 2; }
  .pb-pager-thumb { width: 48px; height: 48px; }

  /* The header is two grid columns on a phone; at 13px with 0.15em tracking the
     wordmark wrapped to two lines. */
  .pb-site-name {
    font-size: var(--fs-xs);
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  .pb-footer {
    gap: 0.75rem;
    padding: 1.5rem 0 2.5rem;
  }
  .pb-footer-nav { gap: 1.1rem; }
  .pb-footer-nav--elsewhere { gap: 1rem; }
}

/* ================================================================
   Archive grid + tag pages
   ================================================================ */

/* ---- Sticky archive nav ------------------------------------ */

.pb-archive-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-blur);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.pb-year-nav {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 0 2.5rem;
  scrollbar-width: none;
}
.pb-year-nav::-webkit-scrollbar { display: none; }

.pb-year-nav-total {
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
  margin-right: 1rem;
  padding: 0.75rem 0;
  flex-shrink: 0;
}

.pb-year-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
  flex-shrink: 0;
}
.pb-year-link:hover { color: var(--ink-2); }
.pb-year-link.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.pb-year-count {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: #ccc;
  transition: color 0.15s;
}
.pb-year-link:hover .pb-year-count,
.pb-year-link.is-active .pb-year-count { color: var(--muted); }

/* ---- Tag strip -------------------------------------------- */

.pb-tag-strip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 2.5rem;
  overflow-x: auto;
  border-top: 1px solid #f2f2f2;
  scrollbar-width: none;
}
.pb-tag-strip::-webkit-scrollbar { display: none; }

.pb-tag-strip--standalone {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-blur);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  border-top: none;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.pb-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: 100px;
  border: 1px solid var(--rule);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pb-tag-pill:hover { border-color: var(--ink-2); color: var(--ink); }
.pb-tag-pill.is-active { background: #111; border-color: var(--ink); color: #fff; }

.pb-tag-pill-count {
  font-size: var(--fs-xs);
  color: var(--muted);
  transition: color 0.15s;
}
.pb-tag-pill.is-active .pb-tag-pill-count { color: rgba(255,255,255,0.5); }
.pb-tag-pill:hover .pb-tag-pill-count { color: var(--muted); }

/* ---- Archive main ----------------------------------------- */

.pb-archive-main {
  padding-bottom: 5rem;
}

.pb-year-section {
  margin-bottom: 0.5rem;
}

.pb-year-heading {
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  
  color: var(--ink);
  padding: 1.75rem 2.5rem 0.65rem;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.pb-year-total {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ---- Photo grid ------------------------------------------- */

.pb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.pb-grid-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-sunk);
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.pb-grid-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.45s ease;
  will-change: transform, opacity;
}
.pb-grid-img.is-loaded { opacity: 1; }
.pb-grid-item:hover .pb-grid-img { transform: scale(1.05); }

.pb-grid-item--error { background: #e8e8e8; }

.pb-grid-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.18) 45%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.22s ease;
  display: flex;
  align-items: flex-end;
  padding: 0.65rem 0.75rem;
}
.pb-grid-item:hover .pb-grid-overlay { opacity: 1; }

.pb-grid-overlay-inner {
  width: 100%;
}

.pb-grid-date {
  display: block;
  font-size: var(--fs-xs);
  letter-spacing: 0.07em;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
  line-height: 1.4;
}

.pb-grid-tag {
  display: block;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.15rem;
  text-transform: lowercase;
}

/* ---- Tag page header -------------------------------------- */

.pb-tag-page-header {
  padding: 1.75rem 2.5rem 0.25rem;
}

.pb-tag-page-back {
  font-size: var(--fs-xs);
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
  transition: color 0.15s;
}
.pb-tag-page-back:hover { color: var(--ink); }

.pb-tag-page-title {
  font-size: var(--fs-h1);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.2rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.pb-tag-page-count {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 0 0 0.5rem;
}

/* ---- Archive responsive ----------------------------------- */

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

@media (max-width: 640px) {
  .pb-year-nav { padding: 0 1.25rem; }
  .pb-tag-strip { padding: 0.5rem 1.25rem; }
  .pb-year-heading { padding: 1.25rem 1.25rem 0.5rem; }
  .pb-grid { grid-template-columns: repeat(2, 1fr); gap: 2px; }
  .pb-tag-page-header { padding: 1.25rem 1.25rem 0; }
  .pb-tag-page-title { font-size: var(--fs-title); }
}
