/* ==========================================================================
   Kimberly Wipers — journal, article, search, 404
   ========================================================================== */

/* Listing ---------------------------------------------------------------- */

.journal-page { padding-block: clamp(42px, 5vw, 72px) clamp(60px, 7vw, 100px); }
.journal-hero .page-hero__title { max-width: 18ch; }

.journal-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(26px, 4vw, 58px);
  align-items: center;
  padding-bottom: clamp(40px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(36px, 4vw, 54px);
}
.journal-feature__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--paper-2);
}
.journal-feature__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out); }
.journal-feature:hover .journal-feature__media img { transform: scale(1.03); }
.journal-feature__fallback {
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding: 30px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(176, 138, 82, .3), transparent 55%),
    linear-gradient(145deg, var(--ink-3), var(--ink));
}
.journal-feature__fallback span { font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.2; color: var(--paper); }
.journal-feature__body h2 {
  margin: 12px 0 14px;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--ink);
}
.journal-feature__body h2 a:hover { color: var(--brass-3); }
.journal-feature__body p { margin: 0 0 20px; font-size: 14px; line-height: 1.75; color: var(--muted); }
.journal-grid--listing { margin-top: 0; }

.journal-cta { padding-block: clamp(46px, 6vw, 76px); background: var(--ink); color: var(--paper); }
.journal-cta__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 26px; }
.journal-cta .display-3 { color: var(--paper); max-width: 28ch; margin-top: 12px; }

/* Article ---------------------------------------------------------------- */

.article-hero { padding-top: calc(var(--header-h) + clamp(30px, 4vw, 52px)); padding-bottom: clamp(28px, 4vw, 44px); background: var(--paper); }
.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.article-hero__meta span + span::before { content: "·"; margin-right: 8px; color: var(--brass); }
.article-hero__title {
  max-width: 22ch;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.4vw, 4rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.025em;
  color: var(--ink);
}
.article-hero__lede { max-width: 70ch; margin: 0; font-size: 16px; line-height: 1.7; color: var(--muted); }
.article-cover {
  margin: 0 auto;
  max-width: 1200px;
  padding-inline: var(--gutter);
}
.article-cover img { width: 100%; aspect-ratio: 16 / 8.2; object-fit: cover; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 240px;
  gap: clamp(30px, 5vw, 76px);
  justify-content: center;
  padding-block: clamp(40px, 5vw, 66px) clamp(50px, 6vw, 80px);
}
.article-body > .rte > p:first-of-type::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 3.4em;
  line-height: .84;
  padding: 7px 12px 0 0;
  color: var(--brass-3);
}
.article-body .rte { font-size: 16px; line-height: 1.82; }

.article-aside { position: sticky; top: calc(var(--header-h) + 28px); align-self: start; }
.toc { border-top: 1px solid var(--ink); padding-top: 14px; margin-bottom: 26px; }
.toc__label { margin: 0 0 10px; font-size: 8px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--brass-3); }
.toc a { display: block; padding: 6px 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.toc a:hover { color: var(--ink); }
.toc a.is-sub { padding-left: 12px; font-size: 10.5px; }
.share { border-top: 1px solid var(--line); padding-top: 14px; }
.share__label { margin: 0 0 9px; font-size: 8px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--brass-3); }
.share a { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 11px; color: var(--muted); }
.share a:hover { color: var(--ink); }
.share svg { width: 13px; height: 13px; }

.author-box {
  display: flex;
  gap: 16px;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.author-box__mono {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border: 1px solid var(--brass);
  font-family: var(--serif);
  font-size: 20px;
  color: var(--brass-3);
}
.author-box h3 { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink); }
.author-box p { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.article-tags .pill { text-transform: none; letter-spacing: .02em; font-size: 10.5px; }

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.article-nav a,
.article-nav div { display: flex; flex-direction: column; gap: 5px; padding: 20px 22px; background: var(--paper); }
.article-nav a:hover { background: var(--paper-2); }
.article-nav span { font-size: 8px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.article-nav strong { font-family: var(--serif); font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--ink); }
.article-nav .is-next { text-align: right; align-items: flex-end; }

.related-posts { padding-block: clamp(46px, 6vw, 78px); background: var(--paper-2); border-top: 1px solid var(--line); }
.related-posts__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.related-posts__head h2 { font-family: var(--serif); font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 400; color: var(--ink); }

/* Search ----------------------------------------------------------------- */

.search-page { padding-block: clamp(40px, 5vw, 64px) clamp(60px, 7vw, 100px); }
.search-form { display: flex; align-items: center; gap: 12px; max-width: 720px; margin: 26px 0 12px; border-bottom: 1px solid var(--ink); }
.search-form input { flex: 1; min-width: 0; padding: 12px 0; background: transparent; border: 0; outline: 0; font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2.2rem); color: var(--ink); }
.search-form input::placeholder { color: rgba(46, 56, 48, .32); }
.search-form button { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: var(--paper); border: 0; }
.search-meta { margin: 10px 0 34px; font-size: 12px; color: var(--muted); }

.empty-state { padding: clamp(40px, 6vw, 70px) 0; }
.empty-state h2 { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 400; margin-bottom: 12px; color: var(--ink); }
.empty-state p { max-width: 56ch; margin-bottom: 22px; color: var(--muted); }

/* 404 -------------------------------------------------------------------- */

.notfound {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 78vh;
  padding-top: calc(var(--header-h) + clamp(40px, 6vw, 80px));
  padding-bottom: clamp(56px, 7vw, 96px);
  background:
    radial-gradient(90% 80% at 82% 42%, rgba(176, 138, 82, .16), transparent 60%),
    linear-gradient(120deg, var(--ink) 0%, var(--ink-2) 58%, var(--ink-3) 100%);
  color: var(--paper);
  overflow: hidden;
}
.notfound__grain {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(246, 242, 233, .05) .6px, transparent .6px);
  background-size: 4px 4px;
  opacity: .5;
}
.notfound__figure {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 58%;
  z-index: 0;
  pointer-events: none;
}
.notfound__figure img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 70% center;
  opacity: .28;
  filter: grayscale(.4);
}
.notfound__figure::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--ink) 0%, rgba(13, 21, 18, .6) 38%, transparent 100%);
}
.notfound__inner { position: relative; z-index: 1; }
.notfound__content { max-width: 640px; }
.notfound__eyebrow { color: var(--brass-2); margin-bottom: 24px; }
.notfound__code {
  font-family: var(--serif);
  font-size: clamp(7rem, 17vw, 13rem);
  line-height: .78;
  letter-spacing: -.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(211, 176, 122, .55);
  margin-bottom: 26px;
}
.notfound__title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.2vw, 3.6rem);
  font-weight: 400;
  line-height: 1.06;
  margin-bottom: 16px;
  color: var(--paper);
}
.notfound__title em { font-style: italic; color: var(--brass-2); }
.notfound__lede { max-width: 50ch; margin-bottom: 30px; color: rgba(246, 242, 233, .7); font-size: 15.5px; line-height: 1.7; }
.notfound__search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 500px;
  margin-bottom: 26px;
  padding: 5px 6px 5px 18px;
  background: rgba(246, 242, 233, .06);
  border: 1px solid rgba(211, 176, 122, .35);
  color: rgba(246, 242, 233, .6);
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.notfound__search:focus-within { border-color: var(--brass-2); background: rgba(246, 242, 233, .09); }
.notfound__search input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--paper); font-family: var(--sans); font-size: 13px;
}
.notfound__search input::placeholder { color: rgba(246, 242, 233, .42); }
.notfound__search button {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--brass); border: 0; cursor: pointer;
  color: var(--ink);
  transition: background .25s var(--ease);
}
.notfound__search button:hover { background: var(--brass-2); }
.notfound__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.notfound__actions .btn--ghost-light { border-color: rgba(246, 242, 233, .28); color: var(--paper); }
.notfound__actions .btn--ghost-light:hover { border-color: var(--brass-2); color: var(--brass-2); }
.notfound__help { margin: 26px 0 0; font-size: 12.5px; color: rgba(246, 242, 233, .5); }
.notfound__help a { color: var(--brass-2); border-bottom: 1px solid rgba(211, 176, 122, .4); }
.notfound__help a:hover { color: var(--paper); }

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1024px) {
  .journal-feature { grid-template-columns: 1fr; }
  .journal-feature__media { aspect-ratio: 16 / 9; }
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; order: -1; margin-bottom: 26px; }
  .toc { margin-bottom: 0; }
}

@media (max-width: 820px) {
  .article-nav { grid-template-columns: 1fr; }
  .article-nav .is-next { text-align: left; align-items: flex-start; }
  .journal-cta__inner { align-items: flex-start; }
  .notfound__figure { width: 100%; opacity: .5; }
  .notfound__figure::after { background: linear-gradient(180deg, rgba(13, 21, 18, .4), var(--ink)); }
  .notfound__code { font-size: clamp(6rem, 30vw, 9rem); }
}

@media (max-width: 600px) {
  .article-hero__title { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
  .article-hero__lede { font-size: 14px; }
  .article-cover img { aspect-ratio: 4 / 3; }
  .article-aside { grid-template-columns: 1fr; }
  .toc { margin-bottom: 22px; }
  .related-posts .journal-grid { grid-template-columns: 1fr; }
  .notfound__actions { flex-direction: column; align-items: stretch; }
  .notfound__actions .btn { width: 100%; }
}
