:root {
  --tm-bg: #f3f4f5;
  --tm-paper: #ffffff;
  --tm-text: #292e31;
  --tm-muted: #6e757b;
  --tm-faint: #969da3;
  --tm-line: #dfe3e6;
  --tm-line-dark: #c8cdd1;
  --tm-accent: #a85b2a;
  --tm-accent-dark: #88451f;
  --tm-accent-soft: #f6ede7;
  --tm-serif: "Noto Serif", ui-serif, Georgia, "Times New Roman", serif;
  --tm-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tm-page: 1040px;
  --tm-reading: 700px;
}

body.editorial-page {
  background: var(--tm-bg);
  color: var(--tm-text);
  font-family: var(--tm-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.editorial-page main {
  max-width: var(--tm-page);
  padding: 24px 18px 64px;
}

body.editorial-page .page,
body.editorial-page .shell {
  overflow: hidden;
  background: var(--tm-paper);
  border: 1px solid var(--tm-line);
  border-radius: 6px;
  box-shadow: 0 12px 38px rgba(22, 28, 32, 0.055);
}

/* Shared publication masthead */
.site-masthead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(290px, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 22px 28px 18px;
  border-top: 4px solid var(--tm-accent);
  border-bottom: 1px solid var(--tm-line);
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  margin: 0;
  background: var(--tm-paper);
  box-shadow: none;
}

.masthead-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--tm-text);
  text-decoration: none;
}

.masthead-brand:hover .masthead-title {
  color: var(--tm-accent-dark);
}

.masthead-logo {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: block;
  object-fit: contain;
  border: 1px solid var(--tm-line);
  border-radius: 50%;
  background: #fff;
  padding: 5px;
}

.masthead-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.masthead-title {
  font-family: var(--tm-serif);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  transition: color 0.15s ease;
}

.masthead-description {
  font-family: var(--tm-sans);
  font-size: 12px;
  line-height: 1.4;
  color: var(--tm-muted);
}

.masthead-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin: 0;
  font-family: var(--tm-sans);
}

.masthead-nav a {
  position: relative;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--tm-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.masthead-nav a:hover {
  background: transparent;
}

.masthead-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 1px;
  height: 1px;
  background: var(--tm-accent);
  transition: right 0.15s ease;
}

.masthead-nav a:hover::after,
.masthead-nav a[aria-current="page"]::after {
  right: 0;
}

.masthead-nav a[aria-current="page"] {
  color: var(--tm-accent-dark);
}

/* Shared publication footer */
.site-footer {
  display: grid;
  grid-template-columns: 1.1fr 1fr auto;
  align-items: end;
  gap: 24px;
  padding: 26px 28px 28px;
  border-top: 1px solid var(--tm-line);
  background: #fbfbfa;
  color: var(--tm-muted);
  font-family: var(--tm-sans);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
}

.site-footer .email-protected {
  display: block;
  margin-top: 4px;
}

.site-footer .email-reveal,
.site-footer .email-link {
  display: inline;
  border: 0;
  border-bottom: 1px solid var(--tm-line-dark);
  border-radius: 0;
  background: transparent;
  color: var(--tm-muted);
  padding: 0;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.site-footer .email-reveal:hover,
.site-footer .email-link:hover {
  border-bottom-color: currentColor;
  color: var(--tm-text);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand strong {
  color: var(--tm-text);
  font-family: var(--tm-serif);
  font-size: 17px;
  line-height: 1.2;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin: 0;
}

.site-footer a {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--tm-muted);
  padding: 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-footer a:hover {
  background: transparent;
  color: var(--tm-text);
  border-bottom-color: currentColor;
}

.footer-copy {
  white-space: nowrap;
  text-align: right;
}

/* Homepage */
.home-page .top {
  display: none;
}

.home-page .content {
  padding: 0 28px 30px;
}

.home-intro {
  max-width: 780px;
  margin: 0 auto;
  padding: 54px 0 42px;
  text-align: center;
}

.home-kicker,
.editorial-kicker {
  margin: 0 0 12px;
  color: var(--tm-accent);
  font-family: var(--tm-sans);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-page .lede {
  max-width: 760px;
  margin: 0;
  color: var(--tm-text);
  font-family: var(--tm-serif);
  font-size: clamp(27px, 4.4vw, 43px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.035em;
  text-align: center;
}

.home-page .intro-summary {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--tm-muted);
  font-family: var(--tm-serif);
  font-size: 16px;
  line-height: 1.72;
  text-align: center;
}

.home-page .divider {
  margin: 0 0 28px;
  background: var(--tm-line);
}

.home-page .nav-label,
.archive-page .section-title,
.guide-page .guide-section > h2 {
  color: var(--tm-accent);
  font-family: var(--tm-sans);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.home-page .nav-label {
  margin-bottom: 12px;
}

.home-page .primary-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
  border-top: 1px solid var(--tm-line-dark);
}

.home-page .primary-btn {
  position: relative;
  min-height: 0;
  display: block;
  padding: 20px 42px 21px 0;
  border: 0;
  border-bottom: 1px solid var(--tm-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--tm-text);
  font-family: var(--tm-serif);
  text-align: left;
  transform: none;
}

.home-page .primary-btn::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: 4px;
  color: var(--tm-accent);
  font-family: var(--tm-sans);
  font-size: 20px;
  transform: translateY(-50%);
}

.home-page .primary-btn:hover {
  background: transparent;
  box-shadow: none;
  color: var(--tm-accent-dark);
  transform: none;
}

.material-type,
.material-description {
  display: block;
  font-family: var(--tm-sans);
}

.material-type {
  margin-bottom: 5px;
  color: var(--tm-accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.material-title {
  display: block;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.material-description {
  margin-top: 6px;
  color: var(--tm-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.home-page .latest-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--tm-line-dark);
}

.home-page .latest-heading {
  margin-bottom: 12px;
}

.home-page .latest-all {
  color: var(--tm-muted);
  font-size: 12px;
}

.home-page .latest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--tm-line);
  border-bottom: 1px solid var(--tm-line);
}

.home-page .latest-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 17px;
  border: 0;
  border-right: 1px solid var(--tm-line);
  border-radius: 0;
  background: transparent;
  transform: none;
}

.home-page .latest-card:last-child {
  border-right: 0;
}

.home-page .latest-card:hover {
  background: #fbfaf8;
  border-color: var(--tm-line);
  transform: none;
}

.home-page .latest-date,
.home-page .latest-section-name {
  font-size: 10.5px;
}

.home-page .latest-title {
  margin: 9px 0 14px;
  font-size: 17px;
  line-height: 1.38;
}

.home-page .secondary-wrap {
  margin-top: 32px;
}

.home-page .secondary-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
  border-top: 1px solid var(--tm-line);
}

.home-page .secondary-btn {
  min-height: 0;
  justify-content: space-between;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--tm-line);
  border-radius: 0;
  background: transparent;
  color: var(--tm-text);
  font-family: var(--tm-sans);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transform: none;
}

.home-page .secondary-btn::after {
  content: "↗";
  margin-left: 12px;
  color: var(--tm-accent);
}

.home-page .secondary-btn[href^="/"]::after {
  content: "→";
}

.home-page .secondary-btn:hover {
  background: transparent;
  border-color: var(--tm-line);
  color: var(--tm-accent-dark);
  transform: none;
}

.home-page .topic-nav {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--tm-line-dark);
}

.home-page .topic-links a {
  color: var(--tm-text);
  font-size: 13px;
}

.home-page .about-project {
  margin-top: 30px;
  border: 0;
  border-top: 1px solid var(--tm-line-dark);
  border-bottom: 1px solid var(--tm-line);
  border-radius: 0;
  background: transparent;
}

.home-page .about-project summary {
  padding: 15px 0;
  font-size: 13px;
}

.home-page .about-copy {
  max-width: 720px;
  padding: 0 0 18px;
  border: 0;
}

.home-page .about-copy p {
  color: var(--tm-muted);
  font-family: var(--tm-serif);
  font-size: 14px;
  line-height: 1.7;
}

.home-page .footer {
  display: none;
}

/* Article and topic pages */
.article-page main,
.topic-page main {
  max-width: 920px;
}

.article-page .page,
.topic-page .page {
  border-radius: 6px;
}

.article-page .article-header,
.topic-page .article-header {
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 74px 48px 40px;
  border-bottom: 1px solid var(--tm-line);
  background-position: center;
  color: #fff;
  text-align: left;
}

.article-page .article-header.has-cover,
.topic-page .article-header.has-cover {
  min-height: 290px;
  background-size: cover;
}

.article-page .article-header.no-cover,
.topic-page .article-header.no-cover {
  padding-top: 46px;
  background: #fff;
  color: var(--tm-text);
}

.article-page .article-header::after,
.topic-page .article-header::after {
  display: none;
}

.article-page .article-header h1,
.topic-page .article-header h1 {
  max-width: 780px;
  margin: 0 0 17px;
  font-size: clamp(31px, 5vw, 50px);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.article-page .article-header.no-cover h1,
.topic-page .article-header.no-cover h1 {
  text-shadow: none;
}

.article-kicker {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0 0 12px;
  color: #fff;
  font-family: var(--tm-sans);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.no-cover .article-kicker {
  color: var(--tm-accent);
  text-shadow: none;
}

.article-page .article-header .meta,
.topic-page .article-header .meta {
  justify-content: flex-start;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  line-height: 1.5;
}

.article-page .article-header.no-cover .meta,
.topic-page .article-header.no-cover .meta,
.article-page .article-header.no-cover .meta span,
.topic-page .article-header.no-cover .meta span {
  color: var(--tm-muted);
  text-shadow: none;
}

.article-page .content,
.topic-page .content {
  max-width: var(--tm-reading);
  margin: 0 auto;
  padding: 40px 0 44px;
  animation: none;
}

.article-page .content p,
.article-page .content ul li,
.article-page .content ol li,
.topic-page .content p,
.topic-page .content ul li,
.topic-page .content ol li {
  font-size: 18px;
  line-height: 1.76;
}

.article-page .content p,
.topic-page .content p {
  margin: 0 0 1.15em;
}

.article-page .content h2,
.topic-page .content h2 {
  margin: 2.1em 0 0.65em;
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.article-page .content h3,
.topic-page .content h3 {
  margin: 1.8em 0 0.55em;
  font-size: 21px;
  line-height: 1.3;
}

.article-page .content blockquote,
.topic-page .content blockquote {
  margin: 1.7em 0;
  padding: 0 0 0 20px;
  border-left: 3px solid var(--tm-accent);
  color: #444b50;
}

.article-page .content .summary,
.topic-page .content .summary {
  margin: 0 0 28px;
  padding: 18px 20px;
  border: 0;
  border-left: 3px solid var(--tm-accent);
  border-radius: 0;
  background: #faf8f6;
  font-size: 15px;
  line-height: 1.65;
}

.article-page .content .toc,
.topic-page .content .toc {
  margin: 28px 0 34px;
  padding: 17px 20px;
  border: 1px solid var(--tm-line);
  border-radius: 4px;
  background: #fff;
  font-family: var(--tm-sans);
}

.article-page .content .toc a,
.topic-page .content .toc a {
  display: block;
  padding: 5px 0;
  color: var(--tm-muted);
  border-bottom: 0;
  font-size: 13px;
}

.article-page .content a,
.topic-page .content a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-page .after,
.topic-page .after {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--tm-line-dark);
}

.article-page .react,
.topic-page .react {
  width: 100%;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--tm-line-dark);
  border-radius: 6px !important;
  background: #fbfbfa;
  box-shadow: none !important;
  text-align: left;
}

.article-page .react-title,
.topic-page .react-title {
  margin: 0 0 14px;
  color: var(--tm-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
}

.article-page .react .reaction-buttons,
.topic-page .react .reaction-buttons {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.article-page .react button,
.topic-page .react button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid var(--tm-line-dark);
  border-radius: 4px;
  background: #fff;
  color: var(--tm-text);
  box-shadow: none;
  font-size: 12.5px;
  line-height: 1.25;
}

.article-page .react button:hover,
.topic-page .react button:hover {
  border-color: var(--tm-accent);
  background: var(--tm-accent-soft);
  box-shadow: none;
}

.article-page .react .status,
.topic-page .react .status {
  grid-column: 1 / -1;
  margin-top: 5px;
  color: var(--tm-muted);
  font-size: 12px;
  text-align: left;
}

.article-page .react .reaction-buttons > button.comment-toggle,
.topic-page .react .reaction-buttons > button.comment-toggle {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  background: #fff;
}

.article-page .comments-panel,
.topic-page .comments-panel {
  width: 100%;
  margin: 10px 0 20px;
  padding: 20px;
  border: 1px solid var(--tm-line-dark);
  border-radius: 6px !important;
  background: #fff;
  box-shadow: none !important;
}

.article-page .actions,
.topic-page .actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.article-page .content a.action-link,
.topic-page .content a.action-link,
.article-page .content a.action-link.primary,
.topic-page .content a.action-link.primary {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--tm-line-dark);
  border-radius: 4px;
  background: #fff;
  color: var(--tm-text);
  box-shadow: none;
  font-family: var(--tm-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
}

.article-page .action-link.primary::before,
.topic-page .action-link.primary::before {
  content: "← ";
  color: var(--tm-accent);
}

.article-page .action-link:not(.primary)::after,
.topic-page .action-link:not(.primary)::after {
  content: " →";
  color: var(--tm-accent);
}

.article-page .content a.action-link:hover,
.topic-page .content a.action-link:hover,
.article-page .content a.action-link.primary:hover,
.topic-page .content a.action-link.primary:hover {
  border-color: var(--tm-accent);
  background: var(--tm-accent-soft);
  color: var(--tm-accent-dark);
  box-shadow: none;
}

.article-page .content .view-count,
.topic-page .content .view-count {
  margin-top: 18px;
  color: var(--tm-faint);
  font-size: 10px;
}

.article-page .related,
.article-page .related-reading,
.article-page .faq,
.topic-page .related,
.topic-page .related-reading,
.topic-page .faq {
  margin-top: 34px;
}

.article-page .content .related-reading,
.topic-page .content .related-reading {
  padding: 22px;
  border: 1px solid var(--tm-line-dark);
  border-radius: 6px !important;
  background: #fbfbfa;
  box-shadow: none !important;
}

.article-page .content .related-reading h2,
.topic-page .content .related-reading h2 {
  margin: 0 0 16px;
  color: var(--tm-text);
  font-family: var(--tm-serif);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.article-page .related-grid,
.topic-page .related-grid {
  gap: 9px;
  border: 0;
}

.article-page .related-grid a,
.topic-page .related-grid a {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 13px 38px 13px 14px;
  border: 1px solid var(--tm-line);
  border-radius: 4px !important;
  background: #fff;
  font-family: var(--tm-sans);
  font-size: 13px;
  line-height: 1.45;
}

.article-page .related-grid a::after,
.topic-page .related-grid a::after {
  content: "→";
  position: absolute;
  right: 14px;
  color: var(--tm-accent);
}

.article-page .related-grid a:hover,
.topic-page .related-grid a:hover {
  border-color: var(--tm-accent);
  background: var(--tm-accent-soft);
}

.article-page .guide-link,
.topic-page .guide-link {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--tm-line);
  text-align: right;
}

.article-page .site-footer,
.topic-page .site-footer {
  padding-right: max(28px, calc((100% - var(--tm-reading)) / 2));
  padding-left: max(28px, calc((100% - var(--tm-reading)) / 2));
}

/* Archive */
.archive-page main {
  max-width: var(--tm-page);
}

.archive-page .page {
  background: #fff;
}

.archive-intro {
  max-width: 780px;
  padding: 48px 28px 38px;
}

.archive-intro h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.archive-intro p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--tm-muted);
  font-family: var(--tm-serif);
  font-size: 16px;
  line-height: 1.7;
}

.archive-page .content {
  padding: 0 28px 36px;
}

.archive-page .top-actions,
.archive-page .bottom-actions,
.archive-page .chips-panel {
  display: none;
}

.archive-page .search-panel,
.archive-page .section-filter {
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-top: 1px solid var(--tm-line-dark);
  border-radius: 0;
  background: transparent;
}

.archive-page .section-filter {
  margin-bottom: 8px;
  border-bottom: 1px solid var(--tm-line);
}

.archive-page .search-label,
.archive-page .filter-label {
  color: var(--tm-accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.archive-page .search-input {
  height: 40px;
  border: 0;
  border-bottom: 1px solid var(--tm-line-dark);
  border-radius: 0;
  padding: 0 2px;
  font-family: var(--tm-serif);
  font-size: 15px;
}

.archive-page .search-input:focus {
  border-color: var(--tm-accent);
  box-shadow: none;
}

.archive-page .filter-buttons {
  gap: 5px 14px;
}

.archive-page .filter-btn {
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--tm-muted);
  font-size: 11px;
  font-weight: 600;
}

.archive-page .filter-btn:hover,
.archive-page .filter-btn[aria-pressed="true"] {
  border-color: var(--tm-accent);
  background: transparent;
  color: var(--tm-accent-dark);
}

.archive-page .featured {
  display: block;
  margin-top: 24px;
  padding: 28px 0 30px;
  border: 0;
  border-top: 1px solid var(--tm-line-dark);
  border-bottom: 1px solid var(--tm-line-dark);
  border-radius: 0;
  background: transparent;
}

.archive-page .featured .main {
  max-width: 760px;
}

.archive-page .featured h2 {
  margin: 0 0 12px;
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.archive-page .featured .excerpt {
  margin: 0 0 12px;
  color: var(--tm-muted);
  font-family: var(--tm-serif);
  font-size: 15px;
  line-height: 1.65;
}

.archive-page .featured .side {
  display: none;
}

.archive-page .section-title {
  margin: 32px 0 10px;
}

.archive-page .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  border-top: 1px solid var(--tm-line-dark);
}

.archive-page .card {
  min-width: 0;
  padding: 17px 0 18px;
  border: 0;
  border-bottom: 1px solid var(--tm-line);
  border-radius: 0;
  background: transparent;
}

.archive-page .card:hover {
  background: transparent;
  border-color: var(--tm-line);
}

.archive-page .card h3 {
  margin: 7px 0 7px;
  font-size: 17px;
  line-height: 1.38;
}

.archive-page .card .excerpt {
  color: var(--tm-muted);
  font-family: var(--tm-serif);
  font-size: 13px;
  line-height: 1.55;
  -webkit-line-clamp: 3;
}

.archive-page .meta {
  gap: 5px 10px;
  font-size: 10.5px;
}

.archive-page .no-results {
  border: 0;
  border-top: 1px solid var(--tm-line);
  border-radius: 0;
}

/* Guide */
.guide-page main {
  max-width: var(--tm-page);
  padding: 24px 18px 64px;
}

.guide-page .guide-shell {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--tm-line);
  border-radius: 6px;
  box-shadow: 0 12px 38px rgba(22, 28, 32, 0.055);
}

.guide-page .guide-intro {
  margin: 0;
  padding: 48px 28px 34px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.guide-page .guide-intro h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.guide-page .guide-intro p {
  max-width: 680px;
  color: var(--tm-muted);
  font-family: var(--tm-serif);
  font-size: 15px;
  line-height: 1.7;
}

.guide-page .guide-intro nav {
  display: none;
}

.guide-page .guide-content {
  padding: 0 28px 38px;
}

.guide-page .guide-section {
  margin: 30px 0 0;
}

.guide-page .guide-section > h2 {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  line-height: 1.4;
}

.guide-page .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  border-top: 1px solid var(--tm-line-dark);
}

.guide-page .card,
.guide-page .section-start .card,
.guide-page .section-compact .card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 0 16px;
  border: 0;
  border-bottom: 1px solid var(--tm-line);
  border-radius: 0;
  background: transparent;
}

.guide-page .card:hover {
  background: transparent;
  border-color: var(--tm-line);
}

.guide-page .card strong,
.guide-page .section-start .card strong,
.guide-page .section-compact .card strong {
  font-size: 15px;
  line-height: 1.4;
}

.guide-page .section-start .card small {
  color: var(--tm-muted);
  font-family: var(--tm-serif);
  font-size: 12px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
}

/* Book pages: preserve the book layout, only unify the publication frame */
.book-page main {
  max-width: 920px;
}

.book-page .page {
  border-radius: 6px;
}

.book-page .site-masthead {
  margin: 0;
}

.book-page footer:not(.site-footer) {
  display: none;
}

@media (max-width: 860px) {
  .site-masthead {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .masthead-nav {
    justify-content: flex-start;
    padding-top: 11px;
    border-top: 1px solid var(--tm-line);
  }

  .archive-page .grid,
  .guide-page .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body.editorial-page main,
  .guide-page main {
    padding: 10px 8px 40px;
  }

  body.editorial-page .page,
  body.editorial-page .shell,
  .guide-page .guide-shell {
    border-radius: 4px;
    box-shadow: 0 8px 25px rgba(22, 28, 32, 0.045);
  }

  .site-masthead {
    padding: 16px 16px 13px;
    border-top-width: 3px;
  }

  .masthead-logo {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    padding: 4px;
  }

  .masthead-title {
    font-size: 21px;
  }

  .masthead-description {
    font-size: 10.5px;
  }

  .masthead-nav {
    gap: 5px 15px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .masthead-nav::-webkit-scrollbar {
    display: none;
  }

  .masthead-nav a {
    flex: 0 0 auto;
    font-size: 11.5px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
    padding: 22px 16px 24px;
  }

  .footer-copy {
    text-align: left;
  }

  .home-page .content {
    padding: 0 16px 24px;
  }

  .home-intro {
    padding: 38px 0 32px;
  }

  .home-page .lede {
    font-size: clamp(25px, 8vw, 34px);
    line-height: 1.24;
  }

  .home-page .intro-summary {
    margin-top: 14px;
    font-size: 14px;
  }

  .home-page .primary-buttons,
  .home-page .secondary-buttons {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .home-page .primary-btn {
    padding: 17px 38px 18px 0;
  }

  .home-page .latest-grid {
    grid-template-columns: 1fr;
  }

  .home-page .latest-card {
    min-height: 0;
    padding: 15px 0;
    border-right: 0;
    border-bottom: 1px solid var(--tm-line);
  }

  .home-page .latest-card:last-child {
    border-bottom: 0;
  }

  .article-page .article-header,
  .topic-page .article-header {
    padding: 44px 20px 27px;
  }

  .article-page .article-header.has-cover,
  .topic-page .article-header.has-cover {
    min-height: 240px;
  }

  .article-page .article-header.no-cover,
  .topic-page .article-header.no-cover {
    padding-top: 32px;
  }

  .article-page .article-header h1,
  .topic-page .article-header h1 {
    font-size: clamp(26px, 8vw, 36px);
    letter-spacing: -0.035em;
  }

  .article-page .article-header .meta,
  .topic-page .article-header .meta {
    gap: 5px 8px;
    font-size: 10.5px;
  }

  .article-page .content,
  .topic-page .content {
    width: auto;
    max-width: none;
    padding: 28px 17px 34px;
  }

  .article-page .content p,
  .article-page .content ul li,
  .article-page .content ol li,
  .topic-page .content p,
  .topic-page .content ul li,
  .topic-page .content ol li {
    font-size: 16.5px;
    line-height: 1.72;
  }

  .article-page .content h2,
  .topic-page .content h2 {
    font-size: 23px;
  }

  .article-page .react .reaction-buttons,
  .topic-page .react .reaction-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-page .react,
  .topic-page .react,
  .article-page .comments-panel,
  .topic-page .comments-panel {
    padding: 16px;
  }

  .article-page .react button,
  .topic-page .react button {
    width: 100%;
  }

  .article-page .actions,
  .topic-page .actions {
    grid-template-columns: 1fr;
  }

  .article-page .content .related-reading,
  .topic-page .content .related-reading {
    padding: 16px;
  }

  .article-page .related-grid,
  .topic-page .related-grid {
    grid-template-columns: 1fr;
  }

  .article-page .site-footer,
  .topic-page .site-footer {
    padding: 22px 16px 24px;
  }

  .archive-intro,
  .guide-page .guide-intro {
    padding: 36px 16px 28px;
  }

  .archive-page .content,
  .guide-page .guide-content {
    padding: 0 16px 30px;
  }

  .archive-page .search-row {
    display: block;
  }

  .archive-page .search-label {
    display: block;
    margin-bottom: 5px;
  }

  .archive-page .filter-buttons {
    display: flex;
  }

  .archive-page .filter-btn {
    text-align: left;
  }
}

@media (max-width: 390px) {
  .masthead-description {
    max-width: 235px;
  }

  .home-page .content,
  .archive-page .content,
  .guide-page .guide-content {
    padding-left: 13px;
    padding-right: 13px;
  }

  .article-page .content,
  .topic-page .content {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Тематические посадочные страницы и контекстная перелинковка. */
.topic-hubs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--sans);
}

.topic-hub {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-decoration: none !important;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.topic-hub:hover {
  background: #fafbfc;
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.topic-hub strong {
  font-size: 14px;
  line-height: 1.35;
}

.topic-hub span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.seo-topic-links {
  margin: 26px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbfc;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
}

.content .seo-topic-links a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 720px) {
  .topic-hubs {
    grid-template-columns: 1fr;
  }

  .seo-topic-links {
    padding: 13px 14px;
  }
}
