/* Article library and offline editor — aligned with the existing site. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root { --black: #0a0a0a; --white: #fff; --mid: #3a3a3a; --muted: #626262; --border: #ccc; --light: #f4f4f2; --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'DM Sans', system-ui, sans-serif; }
html { scroll-behavior: smooth; }
body { background: var(--white); color: var(--black); font: 400 1rem/1.65 var(--sans); }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
button, input, select, textarea { border-radius: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 200; padding: 12px 20px; color: var(--black); background: var(--white); }
.skip-link:focus { top: 12px; }
nav { position: sticky; top: 0; z-index: 100; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 48px; background: var(--white); border-bottom: 1px solid var(--border); }
.nav-brand { flex-shrink: 0; font: 700 1.1rem var(--serif); text-decoration: none; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 18px; }
.nav-links a { font-size: .65rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--black); }
.nav-cta { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--white); background: var(--black); padding: 8px 18px; white-space: nowrap; text-decoration: none; }
.nav-toggle { display: none; border: 1px solid var(--border); background: var(--white); padding: 8px 14px; font-size: .75rem; }
.wrap { width: min(1160px, 100%); margin-inline: auto; padding: 64px 48px; }
.kicker { font-size: .68rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; }
h1 { font-size: clamp(2.6rem, 5.5vw, 4.6rem); font-weight: 600; margin-bottom: 22px; }
h1 em, h2 em { font-weight: 400; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.55rem; font-weight: 600; }
.lede { max-width: 640px; color: var(--mid); font-size: .95rem; line-height: 1.85; }
.library-hero { background: var(--light); border-bottom: 1px solid var(--border); }
.hero-heading { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.edition-label { font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--border); padding: 7px 14px; white-space: nowrap; }
.breadcrumb { display: inline-block; font-size: .75rem; margin-bottom: 28px; color: var(--muted); }
.library-main { min-height: 460px; }
.filter-form { padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.filter-top { display: grid; grid-template-columns: 1fr 280px; gap: 24px; margin-bottom: 22px; }
.search-box { display: flex; }
.search-box input { min-width: 0; }
.search-box .btn-solid { flex-shrink: 0; padding-inline: 16px; }
.filter-bottom { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; align-items: end; gap: 20px; }
.field { min-width: 0; }
.field label { display: block; font-size: .74rem; font-weight: 600; margin-bottom: 8px; }
input:not([type='checkbox']), select, textarea { width: 100%; border: 1px solid var(--border); background: var(--white); padding: 12px 14px; min-height: 48px; font-size: .86rem; }
input[type='search'] { padding-left: 18px; }
textarea { resize: vertical; line-height: 1.75; }
.btn-solid, .btn-outline { display: inline-block; padding: 13px 22px; font-size: .7rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; text-decoration: none; min-height: 46px; text-align: center; }
.btn-solid { color: var(--white); background: var(--black); border: 1px solid var(--black); }
.btn-solid:hover { background: var(--mid); }
.btn-outline { background: transparent; border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--black); }
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0; font-size: .76rem; color: var(--muted); }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.article-card { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-top: 2px solid var(--black); padding: 28px; }
.article-card h2 { font-size: 1.75rem; margin: 20px 0 16px; overflow-wrap: anywhere; }
.article-card h2 a { text-decoration: none; }
.article-card h2 a:hover { text-decoration: underline; }
.article-meta { font-size: .72rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; overflow-wrap: anywhere; }
.article-card p { color: var(--mid); font-size: .87rem; margin-bottom: 24px; overflow-wrap: anywhere; }
.article-card .read-link { margin-top: auto; font-size: .76rem; font-weight: 600; }
.empty-state { padding: 52px 32px; border: 1px solid var(--border); background: var(--light); text-align: center; }
.empty-state h2 { margin-bottom: 14px; }
.empty-state p { color: var(--mid); font-size: .9rem; max-width: 560px; margin: 0 auto 24px; }
.notice { border-left: 3px solid var(--black); background: var(--light); padding: 18px 22px; font-size: .82rem; margin-bottom: 24px; }
.notice p + p { margin-top: 8px; }
.error-message { font-size: .82rem; color: #8b2424; margin-top: 12px; }
.reader { max-width: 840px; }
.reader h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); overflow-wrap: anywhere; }
.reader .article-meta { margin-bottom: 28px; }
.reader-summary { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 24px 0; font-family: var(--serif); font-size: 1.45rem; line-height: 1.5; margin-bottom: 32px; overflow-wrap: anywhere; }
.article-body { color: var(--mid); font-size: .97rem; line-height: 1.95; overflow-wrap: anywhere; }
.article-body p + p { margin-top: 22px; }
.article-body p { white-space: pre-wrap; }
.reader-end { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.reader-end p { font-size: .75rem; color: var(--muted); margin-bottom: 20px; }
.newsletter-strip { background: var(--light); border-top: 1px solid var(--border); }
.newsletter-strip .wrap { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding-block: 40px; }
.newsletter-strip h2 { font-size: 1.7rem; margin-bottom: 10px; }
.newsletter-strip p { font-size: .85rem; color: var(--mid); }
footer { background: var(--black); color: var(--white); padding: 28px 48px; font-size: .73rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; align-items: center; flex-wrap: wrap; }
.footer-brand { font: 700 1.1rem var(--serif); margin-bottom: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-note { font-size: .68rem; color: #aaa; border-top: 1px solid #444; padding-top: 20px; margin-top: 24px; }
/* The editor is an offline publishing tool, not an authenticated website admin. */
.editor-header { background: var(--black); color: var(--white); }
.editor-header .kicker, .editor-header .lede { color: #bbb; }
.editor-header h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 48px; }
.editor-form { display: grid; gap: 22px; }
.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.editor-form h2, .working-library h2 { font-size: 1.8rem; margin-bottom: 6px; }
.field-help { font-size: .75rem; color: var(--muted); margin-top: 7px; }
.editor-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.working-library { border-left: 1px solid var(--border); padding-left: 32px; }
.working-item { padding: 22px 0; border-bottom: 1px solid var(--border); }
.working-item h3 { font-size: 1.35rem; margin-bottom: 10px; overflow-wrap: anywhere; }
.working-item .editor-actions { margin-top: 14px; }
.working-item button { padding: 8px 12px; font-size: .65rem; min-height: 40px; }
.publish-panel { margin-top: 36px; padding: 28px; border: 1px solid var(--border); }
.publish-panel h2 { font-size: 1.6rem; margin-bottom: 14px; }
.publish-panel ol { padding-left: 20px; font-size: .8rem; color: var(--mid); margin-bottom: 22px; }
.publish-panel li + li { margin-top: 10px; }
.publish-panel code { overflow-wrap: anywhere; font-size: .8em; }
.publish-panel .editor-actions { flex-direction: column; }
.file-tools { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 24px; }
.file-tools input { font-size: .75rem; padding: 10px; }
.editor-status { font-size: .82rem; min-height: 1.5em; margin: 18px 0; }
.restore-actions { margin-top: 12px; display: flex; gap: 12px; flex-wrap: wrap; }
.preview-dialog { width: min(840px, calc(100% - 32px)); max-height: calc(100dvh - 48px); margin: auto; border: 1px solid var(--border); padding: 32px; overflow-y: auto; }
.preview-dialog::backdrop { background: #0009; }
.preview-dialog > button { float: right; margin-bottom: 24px; }
.preview-dialog .reader { padding: 0; clear: both; }
.preview-dialog h2 { font-size: 2.4rem; margin: 16px 0; overflow-wrap: anywhere; }
.preview-dialog .article-meta { margin-bottom: 24px; }
@media (max-width: 1200px) { nav { padding-inline: 24px; } .nav-links { gap: 12px; } }
@media (max-width: 1100px) {
  .nav-cta { margin-left: auto; }
  .js-nav .nav-toggle { display: block; }
  .js-nav .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); padding: 16px 24px; border-bottom: 1px solid var(--border); max-height: calc(100dvh - 64px); overflow-y: auto; }
  .js-nav .nav-links.is-open { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .js-nav .nav-links a { display: block; padding-block: 12px; }
  nav:not(.js-nav) { position: relative; height: auto; min-height: 64px; padding-block: 16px; flex-wrap: wrap; }
  nav:not(.js-nav) .nav-links { order: 3; flex-basis: 100%; flex-wrap: wrap; }
  .article-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .wrap { padding: 48px 24px; }
  .filter-top, .filter-bottom { grid-template-columns: 1fr 1fr; }
  .hero-heading { align-items: flex-start; flex-direction: column; gap: 0; }
  .edition-label { margin-bottom: 24px; }
  .editor-layout { grid-template-columns: 1fr; }
  .working-library { border-left: 0; border-top: 1px solid var(--border); padding: 32px 0 0; }
  .newsletter-strip .wrap { flex-direction: column; align-items: flex-start; }
  footer { padding-inline: 24px; }
}
@media (max-width: 600px) {
  nav { padding-inline: 16px; gap: 10px; }
  .nav-cta { display: none; }
  .nav-toggle { margin-left: auto; min-height: 42px; }
  .nav-brand { font-size: 1.05rem; }
  .wrap { padding-inline: 20px; }
  .filter-top, .filter-bottom, .article-grid, .editor-fields { grid-template-columns: 1fr; }
  .article-card { padding: 24px; }
  .results-bar { align-items: flex-start; flex-direction: column; gap: 6px; }
  .empty-state { padding: 36px 20px; }
  .preview-dialog { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
