/* Riposta – readers' site. Classic broadsheet layout: serif type, thin rules, black on white. */

:root {
  --ink: #121212;
  --ink-soft: #363636;
  --muted: #6b6b6b;
  --rule: #dfdfdf;
  --rule-strong: #121212;
  --paper: #ffffff;
  --paper-tint: #f7f7f5;
  --accent: #b3121b;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --display: "Playfair Display", "Source Serif 4", Georgia, serif;
  --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --page: 1200px;
  --gutter: clamp(14px, 3vw, 24px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
.headline, .article__title, .comment__body, .list-header h1 { overflow-wrap: anywhere; hyphens: auto; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 12px; font-family: var(--sans); z-index: 10;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ----- Preview banner (editors' site) ----- */
.preview-banner {
  background: #fff4c2; border-bottom: 1px solid #e5d27a;
  font-family: var(--sans); font-size: 14px; text-align: center; padding: 10px var(--gutter);
}
.preview-banner a { text-decoration: underline; }

/* ----- Masthead ----- */
.topbar {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .02em;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0 0;
}
.topbar__date { display: inline-block; }
.topbar__date::first-letter { text-transform: uppercase; }
.topbar__tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.topbar__search { display: flex; gap: 6px; }
.topbar__search input {
  font: inherit; font-weight: 400; border: 1px solid var(--rule); border-radius: 3px;
  padding: 6px 10px; width: 180px; background: var(--paper);
}
.topbar__search button {
  font: inherit; background: var(--ink); color: #fff; border: 0; border-radius: 3px; padding: 6px 12px; cursor: pointer;
}

.topbar__account { display: flex; align-items: center; gap: 14px; }
.topbar__account form { margin: 0; }
.topbar__account a, .topbar__account .linkish { font-weight: 600; }
.topbar__nick { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkish {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}

.masthead { text-align: center; padding: 14px 0 12px; }
.masthead__logo { display: inline-block; }
.masthead__logo img { max-height: 76px; width: auto; margin: 0 auto; }
.wordmark {
  font-family: var(--display); font-weight: 900; font-size: clamp(44px, 8vw, 84px);
  line-height: 1; letter-spacing: -.01em; color: var(--ink);
}
.masthead__logo:hover { text-decoration: none; }
.masthead__tagline {
  margin: 8px 0 0; font-family: var(--sans); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}

.sections-nav {
  border-top: 1px solid var(--rule-strong);
  border-bottom: 3px double var(--rule-strong);
}
.sections-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: center; gap: 4px 26px; flex-wrap: wrap;
}
.sections-nav a {
  display: block; padding: 10px 0; font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: .02em;
}
.sections-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--ink); text-decoration: none; }

/* ----- Shared article bits ----- */
.kicker {
  display: inline-block; font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.headline { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 8px; letter-spacing: -.005em; }
.summary { color: var(--ink-soft); margin: 0 0 8px; font-size: 16px; line-height: 1.45; }
.meta { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.meta strong { color: var(--ink); font-weight: 600; }

.story { padding: 18px 0; }
.story__image { margin-bottom: 10px; overflow: hidden; background: var(--paper-tint); }
.story__image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.story .headline { font-size: 20px; }

/* ----- Front page ----- */
.front { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 32px; padding-top: 22px; }
.front__lead { padding-right: 32px; border-right: 1px solid var(--rule); }
.lead-story .headline { font-size: clamp(28px, 3.4vw, 40px); }
.lead-story .summary { font-size: 19px; }
.lead-story .story__image img { aspect-ratio: 16 / 9; }

.front__side h2, .section-block__title {
  font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  margin: 0 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--ink);
}
.latest { list-style: none; margin: 0; padding: 0; }
.latest li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.latest time { display: block; font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.latest a { font-weight: 600; font-size: 16px; line-height: 1.3; }

.row-3 {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px;
  border-top: 1px solid var(--rule-strong); margin-top: 18px;
}
.row-3 > .story + .story { position: relative; }
.row-3 > .story + .story::before {
  content: ""; position: absolute; left: -16px; top: 18px; bottom: 18px; border-left: 1px solid var(--rule);
}
.row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; }
.row-4 .headline { font-size: 18px; }

.section-block { margin-top: 34px; }
.section-block__title { display: flex; justify-content: space-between; align-items: baseline; }
.section-block__title a { font-size: 12px; letter-spacing: .04em; text-transform: none; font-weight: 600; }

.empty-front {
  text-align: center; padding: 80px 0; color: var(--muted); font-family: var(--sans);
}

/* ----- Article page ----- */
.article { max-width: 720px; margin: 0 auto; padding: 36px 0 24px; }
.article__header { margin-bottom: 22px; }
.article__title { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.1; margin: 4px 0 14px; }
.article__lead { font-size: 21px; line-height: 1.45; color: var(--ink-soft); margin: 0 0 18px; }
.byline {
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline;
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--rule); padding-top: 12px;
}
.byline a { color: var(--ink); font-weight: 700; }
.article__figure { margin: 0 0 28px; }
.article__figure img { width: 100%; }
.article__figure figcaption { font-family: var(--sans); font-size: 13px; color: var(--muted); padding-top: 8px; }
.article__figure .credit { text-transform: uppercase; font-size: 11px; letter-spacing: .04em; margin-left: 4px; }

.article-body { font-size: 20px; line-height: 1.7; }
.article-body p { margin: 0 0 1.1em; }
.article-body h2 { font-size: 26px; line-height: 1.25; margin: 1.6em 0 .5em; }
.article-body h3 { font-size: 21px; line-height: 1.3; margin: 1.4em 0 .4em; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  margin: 1.4em 0; padding: 0 0 0 22px; border-left: 3px solid var(--accent);
  font-size: 24px; line-height: 1.45; font-style: italic;
}
.article-body ul, .article-body ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.article-body li { margin-bottom: .35em; }
.article-body li[data-list="bullet"] { list-style-type: disc; }

.article__footer { border-top: 1px solid var(--rule); margin-top: 32px; padding-top: 16px; }
.author-box { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); }
.author-box strong { color: var(--ink); }

.related { border-top: 3px double var(--ink); margin-top: 40px; padding-top: 6px; }
.related h2 {
  font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 10px 0 0;
}

/* ----- Lists (section, author, search) ----- */
.list-header { padding: 32px 0 16px; border-bottom: 1px solid var(--ink); }
.list-header h1 { font-family: var(--serif); font-size: 38px; margin: 0; }
.list-header p { font-family: var(--sans); color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.list-item {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) 220px; gap: 24px;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.list-item__date { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.list-item .headline { font-size: 22px; }
.list-item img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.list-empty { padding: 48px 0; color: var(--muted); font-family: var(--sans); }

.search-form { display: flex; gap: 8px; margin-top: 16px; max-width: 560px; }
.search-form input {
  flex: 1; font: inherit; font-size: 18px; padding: 10px 12px; border: 1px solid var(--ink); border-radius: 0;
}
.search-form button {
  font-family: var(--sans); font-weight: 700; background: var(--ink); color: #fff; border: 0; padding: 0 20px; cursor: pointer;
}

.pagination {
  display: flex; justify-content: center; gap: 18px; padding: 28px 0; font-family: var(--sans); font-size: 14px;
}
.pagination a { font-weight: 700; }

/* ----- Static pages ----- */
.page { max-width: 720px; margin: 0 auto; padding: 40px 0; }
.page h1 { font-size: 40px; margin: 0 0 18px; }
.page p, .page li { font-size: 19px; line-height: 1.65; }
.page h2 { font-size: 24px; line-height: 1.3; margin: 1.6em 0 .4em; }

/* ----- Footer ----- */
.site-footer { background: var(--ink); color: #e9e9e9; margin-top: 64px; padding: 36px 0 28px; font-family: var(--sans); }
.site-footer__top {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  border-bottom: 1px solid #3a3a3a; padding-bottom: 20px;
}
.site-footer .wordmark { color: #fff; font-size: 36px; }
.site-footer img { max-height: 42px; width: auto; }
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; font-size: 13px; }
.site-footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 16px; font-size: 12px; color: #a8a8a8; }

/* ----- Errors ----- */
.error-page { text-align: center; padding: 90px 0; }
.error-page h1 { font-size: 64px; margin: 0; }
.error-page p { font-family: var(--sans); color: var(--muted); }

/* ----- Notices (after login, errors) ----- */
.notices { list-style: none; margin: 18px 0 0; padding: 0; font-family: var(--sans); font-size: 14px; }
.notice { padding: 10px 14px; border-left: 3px solid var(--ink); background: var(--paper-tint); margin-bottom: 8px; }
.notice--success { border-color: #1d6b3a; }
.notice--error { border-color: var(--accent); }

/* ----- Attachments ----- */
.attachments { margin: 30px 0 0; border-top: 1px solid var(--rule); padding-top: 14px; font-family: var(--sans); }
.attachments h2 { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }
.attachments ul { list-style: none; margin: 0; padding: 0; }
.attachments li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 15px;
}
.attachments__icon {
  font-size: 10px; font-weight: 800; letter-spacing: .06em; color: #fff; background: var(--accent);
  padding: 4px 6px; border-radius: 2px;
}
.attachments__name { font-weight: 600; overflow-wrap: anywhere; }
.attachments__size { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; white-space: nowrap; }
.attachments__links { display: flex; gap: 14px; }
.attachments__links a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }

/* ----- Comments ----- */
.comments { border-top: 3px double var(--ink); margin-top: 40px; padding-top: 6px; }
.comments h2 {
  font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 10px 0 6px;
}
.comments__count { color: var(--muted); }
.comments__note, .comments__cta { font-family: var(--sans); font-size: 15px; color: var(--ink-soft); margin: 14px 0; }
.comments__note--warn { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--paper-tint); }
.comments__cta a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.comment__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  font-family: var(--sans); font-size: 13px; color: var(--muted);
}
.comment__nick { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.comment__delete { margin: 0 0 0 auto; }
.comment__body { margin: 6px 0 0; font-size: 17px; line-height: 1.55; }
.comment--deleted .comment__removed { margin: 0; font-family: var(--sans); font-size: 14px; color: var(--muted); font-style: italic; }
.comment:target { background: #fff9db; box-shadow: -10px 0 0 #fff9db, 10px 0 0 #fff9db; }

.comment-form { margin-top: 20px; font-family: var(--sans); }
.comment-form label { display: block; font-size: 14px; margin-bottom: 6px; }
.comment-form textarea {
  width: 100%; font-family: var(--serif); font-size: 17px; line-height: 1.5; padding: 10px 12px;
  border: 1px solid var(--ink); border-radius: 0; resize: vertical; min-height: 110px; background: var(--paper);
}
.comment-form__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.comment-form__hint { font-size: 12px; color: var(--muted); }

/* ----- Buttons and forms (reader accounts, comments) ----- */
.btn-solid {
  font-family: var(--sans); font-size: 15px; font-weight: 700; background: var(--ink); color: #fff;
  border: 0; padding: 12px 20px; min-height: 44px; cursor: pointer;
}
.btn-solid:hover { background: #000; }
.btn-solid--block { width: 100%; }
.btn-solid--danger { background: var(--accent); }
.btn-solid--danger:hover { background: #8c0e15; }
.form-error { color: var(--accent); font-family: var(--sans); font-size: 14px; font-weight: 600; margin-top: 6px; }
.form-error--box { border-left: 3px solid var(--accent); background: #fdf1f1; padding: 10px 14px; margin: 0 0 16px; }

.account-page { max-width: 460px; margin: 0 auto; padding: 36px 0 12px; }
.account-page--wide { max-width: 620px; }
.account-page h1 { font-size: clamp(28px, 5vw, 36px); margin: 0 0 8px; }
.account-page__intro { font-family: var(--sans); color: var(--ink-soft); font-size: 15px; margin: 0 0 22px; }
.account-page__alt { font-family: var(--sans); font-size: 15px; margin-top: 20px; }
.account-page__alt a, .account-page__small a { text-decoration: underline; text-underline-offset: 3px; }
.account-page__small { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.account-form { font-family: var(--sans); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field input {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--ink); border-radius: 0; background: var(--paper);
}
.field__help, .field__help ul { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.field__help ul { padding-left: 18px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.account-facts {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px;
  font-family: var(--sans); font-size: 15px; margin: 18px 0 8px;
}
.account-facts dt { color: var(--muted); }
.account-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.account-facts .warn { color: var(--accent); }
.account-facts .muted { color: var(--muted); font-weight: 400; }
.account-section { border-top: 1px solid var(--rule); margin-top: 28px; padding-top: 6px; }
.account-section h2 { font-family: var(--sans); font-size: 18px; margin: 14px 0 12px; }
.account-section p { font-family: var(--sans); font-size: 15px; color: var(--ink-soft); }

/* ----- Responsive ----- */
@media (max-width: 960px) {
  .front { grid-template-columns: 1fr; }
  .front__lead { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 12px; }
  .front__side { padding-top: 18px; }
  .latest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .row-3 { gap: 0 24px; }
  .row-3 > .story + .story::before { left: -12px; }
  .row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-item { grid-template-columns: minmax(0, 1fr) 180px; }
  .list-item__date { grid-column: 1 / -1; }
  .article { padding-top: 28px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar { flex-direction: column; gap: 10px; align-items: stretch; padding-top: 10px; }
  .topbar__date { text-align: center; }
  .topbar__tools { flex-direction: column; align-items: stretch; gap: 8px; }
  .topbar__search input { flex: 1; width: auto; min-height: 40px; font-size: 16px; }
  .topbar__search button { min-height: 40px; }
  .topbar__account { justify-content: center; gap: 22px; }
  .topbar__account a, .topbar__account .linkish { padding: 6px 0; }
  .masthead { padding: 10px 0 8px; }
  .masthead__logo img { max-height: 56px; }
  .sections-nav ul {
    justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; gap: 20px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .sections-nav ul::-webkit-scrollbar { display: none; }
  .sections-nav a { white-space: nowrap; padding: 12px 0; }
  .latest { display: block; }
  .row-3, .row-4 { grid-template-columns: 1fr; }
  .row-3 > .story + .story::before { display: none; }
  .row-3 > .story + .story, .row-4 > .story + .story { border-top: 1px solid var(--rule); }
  .story .headline { font-size: 19px; }
  .list-header { padding-top: 22px; }
  .list-header h1 { font-size: 30px; }
  .list-item { grid-template-columns: 1fr; gap: 10px; }
  .list-item__image { order: -1; }
  .list-item .headline { font-size: 20px; }
  .article { padding-top: 20px; }
  .article-body { font-size: 18px; line-height: 1.65; }
  .article-body blockquote { font-size: 20px; padding-left: 16px; }
  .article__lead { font-size: 18px; }
  .article__figure { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
  .article__figure figcaption { padding-left: var(--gutter); padding-right: var(--gutter); }
  .attachments li { grid-template-columns: auto minmax(0, 1fr); }
  .attachments__links { grid-column: 2; }
  .comment__body { font-size: 16px; }
  .comment-form__foot .btn-solid { width: 100%; }
  .search-form input { font-size: 16px; min-width: 0; }
  .pagination { gap: 12px; flex-wrap: wrap; }
  .pagination a { padding: 8px 4px; }
  .page h1 { font-size: 30px; }
  .page p, .page li { font-size: 17px; }
  .site-footer { margin-top: 44px; }
  .site-footer__top { flex-direction: column; align-items: flex-start; }
  .site-footer nav ul { gap: 4px 18px; }
  .site-footer nav a { display: inline-block; padding: 6px 0; }
  .error-page { padding: 60px 0; }
}
@media (max-width: 380px) {
  .wordmark { font-size: 40px; }
  .attachments__size { display: block; margin-left: 0; }
  .comment__delete { margin-left: 0; }
}
@media (min-width: 1440px) {
  :root { --page: 1280px; }
  .article { max-width: 760px; }
}

@media print {
  .topbar, .sections-nav, .site-footer, .related, .preview-banner, .comments, .notices { display: none; }
}
