/* Sidewalk — A City Journal
   Editorial design system: Literata (display serif) + Work Sans (UI/body)
   Warm paper palette, ink black, terracotta accent. */

@font-face {
  font-family: "Literata";
  src: url("/artifacts/city-journal--v1--s1--glm-5.2--ui-ux-pro-max--2026-09-17T03-56-59-168Z/assets/literata.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("/artifacts/city-journal--v1--s1--glm-5.2--ui-ux-pro-max--2026-09-17T03-56-59-168Z/assets/work-sans.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Serif Display";
  src: url("/artifacts/city-journal--v1--s1--glm-5.2--ui-ux-pro-max--2026-09-17T03-56-59-168Z/assets/dm-serif.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("/artifacts/city-journal--v1--s1--glm-5.2--ui-ux-pro-max--2026-09-17T03-56-59-168Z/assets/oswald.ttf") format("truetype");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color tokens — warm paper editorial */
  --paper:        #f6f1e7;
  --paper-2:      #efe7d8;
  --ink:          #1a1714;
  --ink-2:        #3a342c;
  --muted:        #6c6356;
  --rule:         #d9cfbb;
  --card:         #fffdf8;
  --accent:       #b4452a;   /* terracotta */
  --accent-ink:   #7e2f1c;
  --on-accent:    #ffffff;
  --mark-bg:      #1a1714;
  --mark-ink:     #f6f1e7;
  --shadow:       0 1px 2px rgba(26,23,20,.08), 0 12px 28px -16px rgba(26,23,20,.30);

  --font-display: "Literata", Georgia, "Times New Roman", serif;
  --font-deco:    "DM Serif Display", "Literata", Georgia, serif;
  --font-ui:      "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "Oswald", "Work Sans", sans-serif;

  --maxw: 1180px;
  --gutter: clamp(16px, 5vw, 56px);
  --radius: 4px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(circle at 12% -8%, rgba(180,69,42,.05), transparent 42%),
    radial-gradient(circle at 92% 0%, rgba(58,52,44,.04), transparent 38%);
  background-attachment: fixed;
  min-height: 100vh;
}

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

a { color: var(--accent-ink); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  z-index: 1000;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* Masthead ------------------------------------------------------------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.05);
}
.masthead__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.masthead__brand { display: flex; align-items: center; gap: 14px; }
.masthead__mark {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.masthead__kicker {
  margin: 0;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.masthead__title {
  font-family: var(--font-deco);
  font-weight: 400;
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1;
  margin: 0;
  letter-spacing: -.01em;
}
.masthead__nav { display: flex; align-items: center; gap: 6px; }
.masthead__nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: var(--radius);
  letter-spacing: .01em;
}
.masthead__nav a:hover { color: var(--accent-ink); background: rgba(180,69,42,.07); }

.saved-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, transform .12s ease;
}
.saved-filter:hover { background: var(--ink); color: var(--paper); }
.saved-filter[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.saved-filter[aria-pressed="true"]:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.saved-filter .icon-bookmark { flex-shrink: 0; }
.saved-filter__count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(26,23,20,.12);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.saved-filter[aria-pressed="true"] .saved-filter__count { background: rgba(255,255,255,.28); }
.saved-filter__count[data-empty] { display: none; }

.masthead__date {
  margin: 0;
  text-align: center;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 10px;
  color: var(--muted);
  padding: 6px var(--gutter) 10px;
}

/* Page layout --------------------------------------------------------- */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) 64px;
}

/* Intro */
.intro { padding: clamp(36px, 7vw, 72px) 0 clamp(28px, 4vw, 40px); max-width: 46ch; }
.intro__eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .24em;
  font-size: 12px;
  color: var(--accent-ink);
  font-weight: 600;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.intro__eyebrow::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--rule);
}
.intro__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0 0 16px;
  color: var(--ink);
}
.intro__lede {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--ink-2);
  margin: 0;
  max-width: 54ch;
}

/* Controls ------------------------------------------------------------ */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  align-items: end;
  padding: 20px 0 22px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 30px;
}
.controls__label {
  display: block;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 600;
}
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(26,23,20,.08); }
.field__icon { color: var(--muted); flex-shrink: 0; }
.field__input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  padding: 2px 0;
}
.field__input::placeholder { color: var(--muted); }

.select-wrap { position: relative; }
.select {
  appearance: none;
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 11px 40px 11px 14px;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.select:focus-visible { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(26,23,20,.08); outline: none; }
.select__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.controls__hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.controls__result {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

/* Stories grid ------------------------------------------------------- */
.stories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 28px;
  margin-bottom: 40px;
}
.stories__loading {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--muted);
  font-size: 12px;
}

/* Card */
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:nth-child(1) { grid-column: 1 / -1; flex-direction: row; }
.card:nth-child(1) .card__media { flex: 1.1; min-height: 260px; }
.card:nth-child(1) .card__img { height: 100%; min-height: 260px; }
.card:nth-child(1) .card__text { flex: 1; padding: clamp(20px,3vw,36px); display: flex; flex-direction: column; justify-content: center; }
.card:nth-child(1) .card__title { font-size: clamp(24px,3.2vw,38px); }
.card:nth-child(1) .card__summary { font-size: 17px; }

.card:hover { transform: translateY(-3px); border-color: var(--ink-2); box-shadow: 0 4px 8px rgba(26,23,20,.06), 0 18px 36px -18px rgba(26,23,20,.36); }

.card__media {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--paper-2);
  cursor: pointer;
  overflow: hidden;
}
.card__img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform .5s ease, filter .3s ease;
}
.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26,23,20,0) 55%, rgba(26,23,20,.32));
  opacity: .85;
  transition: opacity .25s ease;
}
.card__media:hover .card__img { transform: scale(1.04); }
.card__media:hover::after { opacity: 1; }

.card__category {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  font-weight: 600;
  color: var(--paper);
  background: rgba(26,23,20,.82);
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}

.card__text { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.18;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--ink);
}
.card__summary { margin: 0; color: var(--ink-2); font-size: 15px; }
.card__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  padding-top: 4px;
  border-top: 1px solid var(--rule);
  margin-top: 2px;
}
.card__foot p { margin: 8px 0 0; }
.card__open {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent-ink);
  cursor: pointer;
  margin-top: 2px;
  transition: gap .18s ease, color .18s ease;
}
.card__open svg { transition: transform .18s ease; }
.card__open:hover { color: var(--accent); }
.card__open:hover svg { transform: translateX(3px); }

/* Empty state --------------------------------------------------------- */
.empty-state { display: none; padding: 48px 0; }
.empty-state[data-active] { display: block; }
.empty-state__box {
  border: 1.5px dashed var(--rule);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}
.empty-state__box svg { color: var(--rule); }
.empty-state__title { font-family: var(--font-display); font-weight: 600; font-size: 24px; color: var(--ink); margin: 12px 0 8px; }
.empty-state__text { margin: 0 0 20px; }

/* Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: background-color .18s ease, color .18s ease, transform .12s ease, border-color .18s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn:active { transform: translateY(1px); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.btn--save { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--save .icon-bookmark { transition: fill .18s ease; fill: transparent; }
.btn--save[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn--save[aria-pressed="true"] .icon-bookmark { fill: var(--on-accent); }
.btn--save[aria-pressed="true"]:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* Detail dialog ------------------------------------------------------- */
.detail {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
.detail[data-open], .detail[data-closing] { display: block; }
.detail__scrim {
  position: absolute;
  inset: 0;
  background: rgba(26,23,20,.55);
  opacity: 0;
  transition: opacity .22s ease;
  backdrop-filter: blur(2px);
}
.detail[data-open] .detail__scrim { opacity: 1; }
.detail[data-closing] .detail__scrim { opacity: 0; }
.detail__panel {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(760px, 100%);
  max-height: 100vh;
  background: var(--paper);
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 0;
  transform: translateY(12px);
  opacity: 0;
  transition: transform .26s ease, opacity .22s ease;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.5);
}
.detail[data-open] .detail__panel { transform: translateY(0); opacity: 1; }
.detail[data-closing] .detail__panel { transform: translateY(8px); opacity: 0; }

.detail__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 28px);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.detail__close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: background-color .18s ease;
}
.detail__close:hover { background: rgba(180,69,42,.08); color: var(--accent-ink); }
.detail__category {
  margin: 0;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
}

.detail__media {
  height: clamp(200px, 38vw, 320px);
  background: var(--paper-2);
  overflow: hidden;
}
.detail__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail__media figcaption { display: none; }

.detail__body { padding: clamp(24px, 5vw, 48px) clamp(16px, 5vw, 56px) 40px; max-width: 62ch; margin: 0 auto; }
.detail__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -.015em;
  margin: 0 0 18px;
  color: var(--ink);
}
.detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.detail__meta p { margin: 0; }
.detail__byline::before { content: "By "; opacity: .8; }
.detail__summary {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0 0 28px;
}
.detail__prose p {
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.75;
  color: var(--ink);
  margin: 0 0 1.15em;
}
.detail__prose p.lead:first-letter {
  font-family: var(--font-deco);
  font-size: 3.4em;
  line-height: .8;
  float: left;
  padding: 8px 12px 0 0;
  color: var(--accent);
}

.detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

/* Colophon ------------------------------------------------------------ */
.colophon {
  margin-top: 40px;
  padding: 28px 0 0;
  border-top: 1px solid var(--rule);
}
.colophon__line { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.colophon__small { font-size: 12px; color: var(--muted); }

/* Responsive ---------------------------------------------------------- */
@media (max-width: 880px) {
  .masthead__inner { flex-wrap: wrap; gap: 10px; }
  .masthead__nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .masthead__nav a { padding: 8px 10px; }
}

@media (max-width: 720px) {
  :root { --gutter: 18px; }
  .controls { grid-template-columns: 1fr; gap: 14px; }
  .stories { grid-template-columns: 1fr; gap: 22px; }
  .card:nth-child(1) { flex-direction: column; }
  .card:nth-child(1) .card__media,
  .card:nth-child(1) .card__img { min-height: 220px; }
  .card:nth-child(1) .card__title { font-size: clamp(24px, 6vw, 30px); }
  .detail__panel { width: 100%; max-height: 100vh; border-radius: 0; }
  .detail__media { height: 220px; }
  .masthead__nav a:first-of-type, .masthead__nav a:nth-of-type(2) { display: none; }
  .saved-filter { margin-left: auto; }
}
@media (max-width: 460px) {
  .masthead__title { font-size: 30px; }
  .masthead__mark { width: 38px; height: 38px; }
  .saved-filter__label { display: none; }
  .saved-filter { padding: 9px 11px; }
}

/* Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
  .card:hover { transform: none; }
  .card__media:hover .card__img { transform: none; }
  .detail__panel { transform: none; }
}

/* Body scroll lock when detail open */
body[data-lock] { overflow: hidden; }
