/* The Ottoman Year — quiet journal layout */
:root {
  --paper: #f3eadb;
  --paper-light: #fbf7ef;
  --ink: #261b16;
  --text: #4e4037;
  --muted: #766559;
  --rule: #c7b39a;
  --rule-dark: #927961;
  --rust: #963c25;
  --focus: #246a73;
  --serif: Georgia, 'Times New Roman', Times, serif;
  --sans: 'Avenir Next', Avenir, 'Segoe UI', Helvetica, Arial, sans-serif;
  --wide: 1120px;
  --measure: 720px;
  --header-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--rust); text-underline-offset: .2em; }
a:hover { color: var(--rust); }
a:focus-visible, summary:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 99; padding: 9px 13px; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--rule-dark);
  background: var(--paper);
}
.header-inner, .footer-inner { width: min(calc(100% - 36px), var(--wide)); margin: 0 auto; }
.header-inner { min-height: calc(var(--header-height) - 1px); display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand picture { display: flex; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.brand strong { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; letter-spacing: -.015em; }
.desktop-nav { display: flex; align-items: center; gap: 24px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.desktop-nav a { text-decoration: none; }
.desktop-nav a[aria-current='page'] { color: var(--rust); }
.mobile-nav { display: none; position: relative; }

main { min-height: 66vh; }
.journal-head { width: min(calc(100% - 36px), var(--wide)); margin: 0 auto; padding: 64px 0 46px; text-align: center; border-bottom: 3px double var(--rule-dark); }
.journal-head .issue-line, .entry-number, .section-label, .kicker, .breadcrumb, .evidence-label { margin: 0; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .14em; line-height: 1.4; text-transform: uppercase; }
.journal-head h1 { margin: 12px 0 8px; font-family: var(--serif); font-size: clamp(3.2rem, 8.5vw, 6.8rem); font-weight: 400; line-height: .95; letter-spacing: -.055em; }
.journal-head > p:last-child { margin: 0; color: var(--text); font-family: var(--serif); font-size: 1.15rem; font-style: italic; }

.front-page { width: min(calc(100% - 36px), var(--wide)); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 58px; padding: 48px 0 0; }
.lead-story { padding-right: 58px; border-right: 1px solid var(--rule); }
.lead-story header { margin-bottom: 28px; }
.entry-number { color: var(--rust); }
.front-year { margin: 18px 0 3px; color: var(--rust); font-family: var(--serif); font-size: 4.2rem; line-height: .9; letter-spacing: -.05em; }
.lead-story h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.3rem, 4.8vw, 4rem); font-weight: 400; line-height: 1.03; letter-spacing: -.04em; }
.lead-story .entry-figure { width: min(100%, 600px); margin: 30px 0 28px; }
.lead-copy { color: var(--text); font-family: var(--serif); font-size: 1.13rem; line-height: 1.72; }
.lead-copy.large { color: var(--ink); font-size: clamp(1.25rem, 2vw, 1.48rem); }
.lead-copy p:first-child, .depth-copy p:first-child { margin-top: 0; }
.continue-link, .archive-link { display: inline-block; margin-top: 18px; font-size: .79rem; font-weight: 700; }

.entry-figure { margin: 0; }
.entry-figure img { width: 100%; border: 1px solid var(--rule-dark); background: var(--paper-light); }
.entry-figure.designed-card img, .depth-figure.designed-card img { border: 0; }
.entry-figure figcaption { margin-top: 10px; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.evidence-label { display: inline-block; margin-right: 9px; padding-right: 9px; border-right: 1px solid var(--rule-dark); color: var(--rust); }

.week-index { align-self: start; }
.index-heading { padding: 3px 0 18px; border-bottom: 1px solid var(--rule-dark); }
.index-heading h2 { margin: 8px 0 0; font-family: var(--serif); font-size: 1.55rem; font-weight: 400; }
.archive-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule-dark); }
.archive-list li { border-bottom: 1px solid var(--rule); }
.archive-list a { display: grid; grid-template-columns: 112px minmax(0, 1fr) 82px; align-items: center; gap: 22px; min-height: 102px; padding: 15px 0; text-decoration: none; }
.archive-year { color: var(--rust); font-family: var(--serif); font-size: 2.05rem; line-height: 1; letter-spacing: -.035em; }
.archive-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.archive-title small { display: block; margin-top: 5px; color: var(--muted); font-family: var(--sans); font-size: .75rem; font-weight: 400; line-height: 1.4; }
.archive-meta { justify-self: end; color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.has-visual { margin-left: 7px; color: var(--rust); font-size: .55rem; }
.week-index .archive-list { border-top: 0; }
.week-index .archive-list a { grid-template-columns: 62px minmax(0, 1fr); min-height: 78px; gap: 12px; }
.week-index .archive-year { font-size: 1.35rem; }
.week-index .archive-title { font-size: .92rem; }
.week-index .archive-title small, .week-index .archive-meta { display: none; }
.week-index .archive-link { margin-top: 20px; }

.signup { width: min(calc(100% - 36px), var(--wide)); margin: 72px auto; display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 70px; padding: 38px 0; border-top: 3px double var(--rule-dark); border-bottom: 3px double var(--rule-dark); }
.signup-copy h2 { max-width: 14ch; margin: 10px 0 10px; font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 2.7rem); font-weight: 400; line-height: 1.08; letter-spacing: -.025em; }
.signup-copy > p:last-child { max-width: 43ch; margin: 0; color: var(--muted); }
.signup form { align-self: center; position: relative; }
.signup-fields > label { display: block; margin-bottom: 7px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.email-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.email-row input { min-width: 0; height: 48px; padding: 0 13px; border: 1px solid var(--rule-dark); border-right: 0; border-radius: 0; background: var(--paper-light); color: var(--ink); font: inherit; }
.email-row button { min-height: 48px; padding: 0 22px; border: 1px solid var(--rust); border-radius: 0; background: var(--rust); color: white; font: 700 .75rem var(--sans); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.email-row button:hover { background: var(--ink); border-color: var(--ink); }
.signup-legal { margin: 9px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.honeypot { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.not-yet { width: min(calc(100% - 36px), 720px); margin: 64px auto; }
.not-yet h2 { margin: 9px 0 12px; font: 400 2.2rem/1.1 var(--serif); }
.not-yet p:last-child { color: var(--text); }

.page-intro, .full-archive, .year-entry, .prose-page { width: min(calc(100% - 36px), var(--wide)); margin: 0 auto; }
.page-intro { padding: 78px 0 45px; border-bottom: 3px double var(--rule-dark); }
.archive-intro { padding-bottom: 0; border-bottom: 0; }
.page-intro.narrow { max-width: var(--measure); }
.page-intro h1 { max-width: 15ch; margin: 8px 0 14px; font-family: var(--serif); font-size: clamp(3rem, 7vw, 5.4rem); font-weight: 400; line-height: .98; letter-spacing: -.045em; }
.standfirst { max-width: 46ch; margin: 0; color: var(--text); font-family: var(--serif); font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.5; }
.full-archive { padding: 48px 0 90px; }
.empty-state { color: var(--muted); font-family: var(--serif); font-size: 1.2rem; }

.year-entry { padding-bottom: 82px; }
.year-header { padding: 42px 0 48px; border-bottom: 1px solid var(--rule-dark); }
.breadcrumb { display: flex; gap: 8px; }
.year-lockup { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: end; gap: 55px; margin-top: 42px; }
.display-year { margin: 0; color: var(--rust); font-family: var(--serif); font-size: clamp(5rem, 11vw, 8rem); line-height: .8; letter-spacing: -.065em; }
.confidence { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.year-lockup h1 { max-width: 15ch; margin: 0; font-family: var(--serif); font-size: clamp(2.5rem, 5vw, 4.3rem); font-weight: 400; line-height: 1; letter-spacing: -.04em; }
.year-summary { max-width: 48ch; margin: 17px 0 0; color: var(--muted); }
.entry-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(290px, .72fr); gap: 70px; padding: 62px 0; border-bottom: 1px solid var(--rule-dark); }
.entry-grid aside { align-self: start; }
.year-aside { min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; padding: 25px; border: 1px solid var(--rule-dark); background: var(--paper-light); }
.year-aside span { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.year-aside strong { color: var(--rust); font: 400 6rem/.9 var(--serif); letter-spacing: -.06em; }
.depth { margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--rule); }
.depth-copy { margin-top: 17px; color: var(--text); font-family: var(--serif); font-size: 1.04rem; }
.depth-figure { margin: 25px 0 0; }
.depth-figure img { border: 1px solid var(--rule-dark); }
.entry-sources { padding: 58px 0 0; border-bottom: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 22px; }
.section-heading h2 { margin: 6px 0 0; font: 400 clamp(1.8rem, 3.5vw, 2.5rem)/1 var(--serif); }
.section-heading > a { font-size: .74rem; font-weight: 700; }
.sources-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); counter-reset: sources; }
.sources-list li { counter-increment: sources; display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 24px; padding: 16px 0 16px 42px; border-bottom: 1px solid var(--rule); position: relative; }
.sources-list li::before { content: counter(sources, decimal-leading-zero); position: absolute; left: 0; top: 17px; color: var(--rust); font-family: var(--serif); }
.sources-list cite { font-family: var(--serif); font-size: .94rem; font-style: normal; font-weight: 600; }
.sources-list p { margin: 4px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.source-link, .source-locator { align-self: start; justify-self: end; color: var(--muted); font-size: .75rem; }
.source-locator { text-align: right; }
.entry-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-top: 32px; }
.entry-nav > a { display: flex; flex-direction: column; padding-top: 13px; border-top: 1px solid var(--rule-dark); text-decoration: none; }
.entry-nav > a:last-child { text-align: right; }
.entry-nav span { color: var(--muted); font-size: .75rem; letter-spacing: .11em; text-transform: uppercase; }
.entry-nav strong { margin-top: 3px; font: 600 1.12rem var(--serif); }

.prose-page { max-width: var(--measure); padding: 52px 0 96px; }
.prose-page h2 { margin: 54px 0 14px; font: 400 2rem/1.1 var(--serif); letter-spacing: -.02em; }
.prose-page h2:first-child { margin-top: 0; }
.prose-page p, .prose-page li { color: var(--text); }
.prose-page li + li { margin-top: 9px; }
.prose-page ol, .prose-page ul { padding-left: 1.2rem; }
.closing-link { margin-top: 45px; font-weight: 700; }
.evidence-key { margin: 24px 0 0; border-top: 1px solid var(--rule-dark); }
.evidence-key div { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.evidence-key dt { color: var(--rust); font-family: var(--serif); font-weight: 600; }
.evidence-key dd { margin: 0; color: var(--muted); }
.bibliography-index { columns: 2; column-gap: 36px; list-style: none; padding: 0 !important; }
.bibliography-index li { break-inside: avoid; padding: 5px 0; }
.response-page { min-height: 58vh; }
.response-page .continue-link { margin-top: 30px; }
.not-found { min-height: 62vh; }
.not-found .display-year { margin-bottom: 34px; }

.site-footer { border-top: 1px solid var(--rule-dark); }
.footer-inner { min-height: 140px; display: flex; justify-content: space-between; align-items: center; gap: 35px; }
.footer-inner p { margin: 0; }
.footer-inner strong { display: block; font-family: var(--serif); font-size: 1rem; }
.footer-inner span { color: var(--muted); font-size: .75rem; }
.footer-links { display: flex; gap: 20px; font-size: .75rem; }

@media (max-width: 820px) {
  .header-inner, .footer-inner, .journal-head, .front-page, .signup, .not-yet, .page-intro, .full-archive, .year-entry, .prose-page { width: min(calc(100% - 56px), var(--wide)); }
  .desktop-nav { display: none; }
  .mobile-nav { display: block; }
  .mobile-nav summary { min-width: 48px; min-height: 48px; display: grid; place-items: center; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
  .mobile-nav[open] nav { position: absolute; z-index: 5; right: 0; top: 51px; width: min(270px, calc(100vw - 36px)); display: grid; padding: 8px; border: 1px solid var(--rule-dark); background: var(--paper-light); box-shadow: 0 13px 28px rgba(50,34,24,.14); }
  .mobile-nav nav a { min-height: 44px; display: flex; align-items: center; padding: 0 10px; border-bottom: 1px solid var(--rule); text-decoration: none; }
  .front-page { grid-template-columns: 1fr; gap: 48px; }
  .lead-story { padding-right: 0; padding-bottom: 48px; border-right: 0; border-bottom: 1px solid var(--rule-dark); }
  .week-index .archive-list a { grid-template-columns: 82px minmax(0, 1fr); }
  .week-index .archive-title small { display: block; }
  .signup { grid-template-columns: 1fr; gap: 28px; }
  .year-lockup { grid-template-columns: 1fr; gap: 28px; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-grid aside { order: -1; }
  .sources-list li { grid-template-columns: 1fr; }
  .source-link, .source-locator { justify-self: start; text-align: left; }
}

@media (max-width: 520px) {
  :root { --header-height: 64px; }
  .header-inner, .footer-inner, .journal-head, .front-page, .signup, .not-yet, .page-intro, .full-archive, .year-entry, .prose-page { width: min(calc(100% - 48px), var(--wide)); }
  .brand img { width: 36px; height: 36px; }
  .brand strong { font-size: 1rem; }
  .journal-head { padding: 43px 0 30px; }
  .journal-head h1 { font-size: 3.15rem; }
  .front-page { padding: 34px 0 0; }
  .front-year { font-size: 3.35rem; }
  .lead-story h2 { font-size: 2.45rem; }
  .signup { margin-top: 58px; margin-bottom: 58px; padding: 30px 0; }
  .email-row { grid-template-columns: 1fr; }
  .email-row input { border-right: 1px solid var(--rule-dark); border-bottom: 0; }
  .email-row button { width: 100%; }
  .page-intro { padding: 56px 0 35px; }
  .archive-intro { padding-bottom: 0; }
  .page-intro h1 { font-size: 3.15rem; }
  .archive-list a { grid-template-columns: 74px minmax(0, 1fr); min-height: 90px; gap: 13px; }
  .archive-year { font-size: 1.8rem; }
  .archive-title { font-size: 1rem; }
  .archive-title small { font-size: .75rem; }
  .archive-meta { display: none; }
  .year-header { padding: 30px 0 40px; }
  .year-lockup { margin-top: 30px; }
  .display-year { font-size: 5.5rem; }
  .year-lockup h1 { font-size: 2.65rem; }
  .entry-grid { gap: 38px; padding: 45px 0; }
  .year-aside { min-height: 230px; }
  .section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .sources-list li { padding-left: 36px; }
  .evidence-key div { grid-template-columns: 1fr; gap: 5px; }
  .bibliography-index { columns: 1; }
  .footer-inner { min-height: 165px; align-items: start; flex-direction: column; justify-content: center; gap: 16px; }
  .footer-links { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .site-header, .site-footer, .entry-nav, .mobile-nav, .signup { display: none !important; }
  body { background: white; color: black; }
  .year-entry, .prose-page { width: 100%; }
  a { color: black; text-decoration: none; }
}
