/* ── Reset & base ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black: #000000;
  --white: #ffffff;
  --blue: #4169e1;
  --font-primary: "Cormorant Garamond", "Times New Roman", Georgia, serif;
}

html {
  font-size: 16px;
}

body {
  background-color: var(--white);
  color: var(--black);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* Hidden filter targets (CSS-only filtering) */
[id^="filter-"] {
  clip: rect(0, 0, 0, 0);
  height: 0;
  overflow: hidden;
  position: absolute;
  width: 0;
}

body:has(#filter-drip:target) .item:not(.tag-drip),
body:has(#filter-piped:target) .item:not(.tag-piped),
body:has(#filter-grid:target) .item:not(.tag-grid),
body:has(#filter-sketch:target) .item:not(.tag-sketch),
body:has(#filter-surreal:target) .item:not(.tag-surreal) {
  display: none;
}

body:has(#filter-drip:target) a.tag[href*="filter-drip"],
body:has(#filter-piped:target) a.tag[href*="filter-piped"],
body:has(#filter-grid:target) a.tag[href*="filter-grid"],
body:has(#filter-sketch:target) a.tag[href*="filter-sketch"],
body:has(#filter-surreal:target) a.tag[href*="filter-surreal"],
body:has(#filter-all:target) a.tag[href*="filter-all"],
body:not(:has(#filter-drip:target, #filter-piped:target, #filter-grid:target, #filter-sketch:target, #filter-surreal:target)) a.tag[href*="filter-all"] {
  color: var(--blue);
}

/* ── Header ───────────────────────────────────────────────── */
header {
  background-color: var(--white);
  border-bottom: 1px solid var(--black);
  padding: 1.75rem 2.5rem 1.5rem;
}

header .inner {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1400px;
}

.brand {
  line-height: 1.15;
  text-align: right;
}

.brand a {
  display: block;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand p {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

header nav {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
}

header nav a {
  font-size: 1rem;
  letter-spacing: 0.03em;
  padding-bottom: 0.35rem;
}

header nav a.is-active {
  border-bottom: 4px solid var(--blue);
}

header nav a:not(.is-active):hover {
  color: var(--blue);
}

@media (max-width: 768px) {
  header .inner {
    align-items: center;
    flex-direction: column;
    justify-content: flex-start;
  }

  .brand {
    order: -1;
    text-align: center;
    width: 100%;
  }

  header nav {
    justify-content: center;
    order: 1;
    width: 100%;
  }
}

/* ── Layout ─────────────────────────────────────────────────── */
.page {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr 260px;
  margin: 0 auto;
  max-width: 1400px;
  min-height: calc(100vh - 200px);
}

@media (max-width: 900px) {
  .page {
    grid-template-columns: 1fr;
  }
}

.main {
  padding: 2rem 2rem 3rem 2.5rem;
}

.prose {
  max-width: 42rem;
}

.sidebar {
  border-left: 1px solid var(--black);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding: 2rem 1.75rem 2rem 1.5rem;
}

@media (max-width: 900px) {
  .sidebar {
    border-left: none;
    border-top: 1px solid var(--black);
    padding: 2rem 2.5rem;
  }
}

.section .label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

/* ── Typography ─────────────────────────────────────────────── */
.heading {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.prose > .heading {
  margin-bottom: 2rem;
}

.title {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.meta {
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.link {
  color: var(--blue);
  display: inline-block;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.link:hover {
  text-decoration: underline;
}

.section .link {
  display: block;
}

.section .link + .link,
.section .link + nav {
  margin-top: 0.35rem;
}

.section nav .link {
  margin-top: 0;
}

.section nav .link + .link {
  margin-top: 0.35rem;
}

.copy {
  font-size: 0.8125rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  margin-top: 1.25rem;
}

.bio {
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.65;
}

.bio + .link {
  margin-top: 0.75rem;
}

.prose p {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.prose p + p {
  margin-top: 1.25rem;
}

/* ── Gallery ────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
}

.item.w2 {
  grid-column: span 2;
}

.item.w3 {
  grid-column: 1 / -1;
}

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

  .item.w3 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .item.w2,
  .item.w3 {
    grid-column: 1;
  }
}

.item > a {
  cursor: zoom-in;
  display: block;
}

.item > a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.item > a img {
  height: auto;
  width: 100%;
}

.item .title {
  margin-top: 0.6rem;
}

.item .meta {
  margin-top: 0.2rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.tag {
  border: 1px solid var(--black);
  display: inline-block;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.5rem;
  transition: color 0.15s;
}

.tag:hover {
  color: var(--blue);
}

/* ── Lightbox ───────────────────────────────────────────────── */
body:has(.lightbox:target) {
  overflow: hidden;
}

.lightbox {
  align-items: center;
  display: none;
  inset: 0;
  justify-content: center;
  padding: 2rem;
  position: fixed;
  z-index: 1000;
}

.lightbox:target {
  display: flex;
}

.lightbox .backdrop {
  background-color: rgba(255, 255, 255, 0.96);
  inset: 0;
  position: absolute;
}

.lightbox figure {
  margin: 0;
  max-height: 92vh;
  max-width: min(92vw, 960px);
  position: relative;
  z-index: 1;
}

.lightbox figure.wide {
  max-width: min(96vw, 1400px);
}

.lightbox img {
  height: auto;
  margin: 0 auto;
  max-height: calc(92vh - 5rem);
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.lightbox .close {
  color: var(--black);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  position: absolute;
  right: -0.25rem;
  top: -2.25rem;
  z-index: 2;
}

.lightbox .close:hover {
  color: var(--blue);
}

.lightbox figcaption {
  margin-top: 1rem;
  text-align: center;
}

.lightbox figcaption .meta {
  margin-top: 0.2rem;
}

@media (max-width: 600px) {
  .lightbox {
    padding: 1.25rem;
  }

  .lightbox .close {
    right: 0;
    top: -1.75rem;
  }

  .lightbox img {
    max-height: calc(92vh - 6rem);
  }
}

/* ── Poetry ─────────────────────────────────────────────────── */
.index ol {
  list-style: none;
}

.index li + li {
  margin-top: 0.85rem;
}

.index a {
  display: block;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.index a:hover {
  color: var(--blue);
}

.poem {
  scroll-margin-top: 1.5rem;
}

.index + .poem,
.poem + .poem {
  border-top: 1px solid var(--black);
  margin-top: 3.5rem;
  padding-top: 3.5rem;
}

.poem .title {
  font-size: 1.125rem;
}

.poem .meta {
  margin-top: 0.35rem;
}

.poem .verse {
  font-size: 1.0625rem;
  line-height: 1.85;
  margin-top: 1.25rem;
}

.poem .verse p + p {
  margin-top: 1.25rem;
}

.poem.italic .verse {
  font-style: italic;
}

.poem > .meta:last-child {
  margin-top: 1.5rem;
}
