/* The private newspaper uses the same paper, serif, and explanation styles as the reader. */
@font-face {
  font-family: "Noto Serif KR";
  src: url("fonts/brand-serif-500.ttf?v=abd75eb3ffa8") format("truetype");
  font-weight: 500;
  font-display: swap;
}

body:not([data-view="reader"]) .top-nav #newspapers-open:not([hidden]) {
  display: inline-flex;
}

.newspaper-topbar {
  height: 57px;
  padding-inline: max(20px, env(safe-area-inset-left));
}

.newspaper-topbar .brand,
.newspaper-nav a,
.newspaper-heading h1,
.newspaper-section > h2,
.newspaper-publisher,
.newspaper-issue-date,
.newspaper-issue-count,
.newspaper-kicker,
.newspaper-page-ref,
.newspaper-status,
.newspaper-actions a,
.newspaper-start,
.newspaper-pagination {
  font-family: "Noto Serif KR", var(--serif);
  font-weight: 500;
}

.newspaper-topbar .brand { letter-spacing: -.025em; line-height: 1.2; }
.newspaper-nav { display: flex; align-items: center; gap: 18px; }
.newspaper-nav a { padding-block: 8px; text-decoration: none; white-space: nowrap; }
.newspaper-nav [aria-current] { color: var(--green); }

.newspaper-content {
  width: min(100% - 40px, 920px);
  margin-inline: auto;
  padding-block: 28px max(50px, env(safe-area-inset-bottom));
}
.newspaper-content.is-reading { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

.newspaper-heading { margin-block: 12px 24px; }
.newspaper-heading h1 {
  font-size: clamp(31px, 5vw, 51px);
  line-height: 1.18;
  text-wrap: balance;
}
.newspaper-heading h1:not([lang="en"]) {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.4;
  letter-spacing: -.025em;
}
.newspaper-heading [lang="en"] { font-family: var(--serif); }
.newspaper-kicker {
  color: var(--brass);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
.newspaper-deck { color: var(--muted); font-size: clamp(16px, 3vw, 20px); margin-top: 10px; }
.newspaper-subtitle { font-size: clamp(17px, 3vw, 22px); margin-top: 10px; }
.newspaper-byline { color: var(--muted); margin-top: 8px; }

.newspaper-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 14px; }
.newspaper-actions a { display: inline-flex; align-items: center; min-height: 38px; color: var(--green); }
.newspaper-actions .newspaper-pdf-link { border: 1px solid var(--line); border-radius: 6px; padding-inline: 11px; text-decoration: none; }
.newspaper-actions .newspaper-pdf-link:hover { background: var(--ivory); }
.newspaper-start { text-decoration: none; }
.newspaper-issues, .newspaper-article-list { list-style: none; margin: 0; padding: 0; }
.newspaper-issues { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.newspaper-issue {
  display: grid;
  min-height: 48px;
  align-content: center;
  gap: 3px;
  padding: 10px 13px;
  color: var(--ivory);
  background: var(--green);
  border-radius: 12px;
  text-decoration: none;
}
.newspaper-issue:hover { background: #0f3d32; }
.newspaper-categories .newspaper-issue {
  min-height: 112px;
  padding: 20px 22px;
  gap: 8px;
}
.newspaper-date-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.newspaper-date-list > li { border-bottom: 1px solid var(--line); }
.newspaper-date-list .newspaper-issue {
  min-height: 48px;
  padding: 11px 4px;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}
.newspaper-date-list .newspaper-issue:hover { background: var(--beige); }
.newspaper-date-list .newspaper-publisher { font-size: 17px; line-height: 1.5; }
.newspaper-date-list :is(.newspaper-issue-date,.newspaper-issue-count) { color: var(--muted); }
.newspaper-publisher { font: 500 clamp(19px, 2.5vw, 23px)/1.45 "Noto Serif KR", var(--serif); }
.newspaper-publisher[lang="en"],
.newspaper-issue-date[lang="en"],
.newspaper-issue-count[lang="en"] { font-family: var(--serif); }
.newspaper-issue-date, .newspaper-issue-count { color: #f0e3c7; }
.newspaper-issue-count { font-size: 13px; }
.newspaper-subtitle-ko { display: none; color: var(--muted); margin-top: 3px; }
.newspaper-heading.is-bilingual .newspaper-subtitle-ko { display: block; }
.newspaper-section { margin-top: 23px; }
.newspaper-section > h2 { font-size: 19px; font-weight: 500; margin-bottom: 6px; }
.newspaper-article-list { border-top: 1px solid var(--line); }
.newspaper-article-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2px 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 2px;
  text-decoration: none;
}
.newspaper-article-link:hover .newspaper-headline { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.newspaper-headline { font: 500 clamp(19px, 3vw, 23px)/1.3 var(--serif); grid-column: 1; }
.newspaper-title-ko { color: var(--muted); grid-column: 1; }
.newspaper-page-ref { color: var(--muted); font-size: 12px; grid-column: 2; grid-row: 1; white-space: nowrap; }
.newspaper-status { margin-block: 16px; color: var(--muted); }

.newspaper-pagination {
  position: fixed;
  z-index: 5;
  inset: auto 0 0;
  padding: 6px max(13px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(13px, env(safe-area-inset-left));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.newspaper-pagination-inner {
  width: min(100%, 920px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.newspaper-page-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  background: var(--ivory);
  text-decoration: none;
  white-space: nowrap;
}
.newspaper-page-link:last-child { justify-self: end; }
.newspaper-page-link[href]:hover { border-color: var(--green); }
.newspaper-page-link[rel="next"] { background: var(--green); border-color: var(--green); color: var(--ivory); }
.newspaper-page-link[aria-disabled="true"] { background: transparent; color: var(--muted); }
.newspaper-position { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.newspaper-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 13px;
  margin-block: 17px 12px;
}
.newspaper-prose {
  background: var(--ivory);
  border: 1px solid var(--line);
  padding: clamp(11px, 3vw, 28px);
  overflow-wrap: anywhere;
}
.newspaper-english ~ .newspaper-english { margin-top: .72em; }
.newspaper-korean {
  display: none;
  border-left: 2px solid var(--line);
  padding-left: 8px;
  margin-top: 5px;
  word-break: keep-all;
}
.is-bilingual .newspaper-korean { display: block; }
.newspaper-context { display: none; padding-inline-start: 10px; margin-top: 4px; }
.is-bilingual .newspaper-context { display: block; }
.newspaper-context h2 { color: var(--green); font: 600 13px/1.4 var(--sans); margin: 0 0 3px; }
.newspaper-context-line {
  margin: 0;
  color: var(--body);
  font: 400 14px/1.48 var(--sans);
  word-break: keep-all;
}
.newspaper-context-line strong { color: var(--green); font-weight: 700; margin-inline-end: 3px; }
.newspaper-context-line a { color: var(--green); text-underline-offset: 2px; }
.newspaper-context-details { margin-block: 2px 4px; }
.newspaper-context-item + .newspaper-context-item { margin-top: 5px; }
.book-reading-context { margin-block: 3px 11px; }
.book-reading-context button {
  color: var(--green);
  background: var(--beige);
  border-radius: 4px;
  font: 600 12px/1.5 var(--sans);
  padding: 5px 7px;
  min-height: 34px;
  text-align: start;
}
.book-reading-context button span { font-weight: 400; margin-inline-start: 6px; }
#book-context-body { font: 400 15px/1.7 var(--sans); overflow-wrap: anywhere; }
#book-context-body h3 { font-size: 15px; margin: 0 0 4px; }
#book-context-body section + section { margin-top: 12px; }
#book-context-body .book-context-sources { color: var(--muted); font-size: 13px; margin-top: 6px; }
.newspaper-word { font: inherit; color: inherit; background: transparent; padding: 0; border: 0; }
.newspaper-word:hover, .newspaper-word:focus-visible { text-decoration: underline; text-underline-offset: .14em; }
.newspaper-topbar a:focus-visible,
.newspaper-content :is(a, button):focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

body[data-view="newspapers"] #reading-help-dialog .focused-source { padding-block: 12px 8px; }
body[data-view="newspapers"] #reading-help-dialog .source-legend { padding-top: 6px; }
body[data-view="newspapers"] #reading-help-dialog .help-scroll { padding-block: 13px 15px; }
body[data-view="newspapers"] #reading-help-dialog .phonetics:empty { display: none; }
body[data-view="newspapers"] #reading-help-dialog .help-section { margin-top: 13px; padding-top: 10px; }
body[data-view="newspapers"] #reading-help-dialog .help-skeleton-section:not(:has(.core-row,.help-modifier)) { display: none; }
body[data-view="newspapers"] #reading-help-dialog .help-section > h3,
body[data-view="newspapers"] #reading-help-dialog .help-flow-head { margin-bottom: 6px; }
body[data-view="newspapers"] #reading-help-dialog .syntax-core { display: grid; gap: 4px; }
body[data-view="newspapers"] #reading-help-dialog .core-row { margin: 0; padding: 5px 8px; grid-template-columns: 78px minmax(0,1fr); gap: 7px; }
body[data-view="newspapers"] #reading-help-dialog .core-role b { display: inline; margin-right: 4px; font-size: 13px; }
body[data-view="newspapers"] #reading-help-dialog .core-row > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
body[data-view="newspapers"] #reading-help-dialog .core-row > div > p:first-child { font-size: 18px; line-height: 1.35; }
body[data-view="newspapers"] #reading-help-dialog .core-row .core-ko { margin-top: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
body[data-view="newspapers"] #reading-help-dialog .help-expression + .help-expression { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--line); }
.help-phrase-structure { margin-top: 12px; }
.help-phrase-structure > h4 { margin: 0 0 5px; color: var(--green); font: 600 13px/1.6 var(--sans); }
body[data-view="newspapers"] #reading-help-dialog .help-return-bar { padding-block: 8px max(8px,env(safe-area-inset-bottom)); }

@media (max-width: 540px) {
  .newspaper-content { width: calc(100% - 22px); padding-top: 12px; }
  .newspaper-issues { grid-template-columns: 1fr; }
  .newspaper-categories .newspaper-issue { min-height: 104px; padding: 18px 20px; }
  .newspaper-date-list .newspaper-publisher { font-size: 16px; }
  .newspaper-heading { margin-block: 10px 17px; }
  .newspaper-page-ref { grid-column: 1; grid-row: auto; }
}
