/* Shared spacing and typography for the existing public theme. */
:root {
  --layout-surface: #fff;
  --layout-muted: #556158;
  --layout-border: #d9dfd9;
  --layout-focus: #24634e;
}

.header.system-header { background: var(--layout-surface); }
.header .brand {
  display: flex;
  align-items: center;
  width: clamp(164px, 15vw, 216px);
}
.header .brand img, .system-footer .footer-brand img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  object-fit: contain;
}
.system-footer .footer-brand > a { display: block; width: min(208px, 100%); }
.header .nav-tools .button { align-items: center; min-height: 44px; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--layout-focus);
  outline-offset: 3px;
}

.breadcrumbs { font-size: .82rem; gap: .45rem .65rem; padding-top: clamp(16px, 2.35vw, 32px); }
.breadcrumbs + .page-heading { padding-top: clamp(24px, 4vw, 52px); padding-bottom: clamp(20px, 3vw, 42px); }
.page-heading h1 { max-width: 23ch; margin-bottom: .38em; font-size: clamp(2.15rem, 4.6vw, 4rem); line-height: 1.13; letter-spacing: -.045em; text-wrap: balance; }
:lang(zh) .page-heading h1 { max-width: 25em; letter-spacing: -.02em; }
.page-heading .lead { max-width: 65ch; line-height: 1.65; color: var(--layout-muted); }
.section { min-width: 0; }
.detail-actions, .download-actions { flex-wrap: wrap; gap: .75rem; }
:where(.catalog-toolbar, .module-search, .form-grid) > * { min-width: 0; }

.journal-grid { gap: clamp(18px, 2.5vw, 34px); align-items: stretch; }
.journal-grid > article {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--layout-border);
  border-radius: 6px;
  overflow: clip;
  background: var(--layout-surface);
}
.journal-grid .journal-image { display: block; height: auto; aspect-ratio: 16 / 10; }
.journal-grid .journal-card-body { padding: clamp(14px, 2vw, 24px); flex: 1; }
.journal-grid h2 { font-size: clamp(1.15rem, 1.9vw, 1.45rem); line-height: 1.32; text-wrap: pretty; }
.journal-grid .journal-card-body p { line-height: 1.55; }

.editorial-story { width: min(100% - 48px, 1160px); margin-inline: auto; }
.story-heading, .story-prose, .story-links { width: min(100%, 760px); margin-inline: auto; }
.story-heading { padding-block: clamp(24px, 4.5vw, 60px) clamp(20px, 3vw, 36px); }
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .9rem; margin: 0 0 18px; font-size: .86rem; color: var(--layout-muted); }
.story-meta a { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.story-meta time { border-inline-start: 1px solid var(--layout-border); padding-inline-start: .9rem; }
.story-heading h1 { font-size: clamp(2.15rem,4.5vw,3.7rem); letter-spacing: -.042em; line-height: 1.12; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
:lang(zh) .story-heading h1 { letter-spacing: -.02em; line-height: 1.23; }
.story-deck { font-size: clamp(1.08rem, 1.8vw, 1.25rem); line-height: 1.6; color: var(--layout-muted); margin: 1rem 0 0; }
.story-cover { width: min(100%, 920px); margin: 0 auto clamp(26px, 5vw, 54px); }
.story-cover img { display: block; width: 100%; max-height: 520px; height: auto; object-fit: contain; background: var(--sand); border-radius: 6px; }
.story-prose { display: flow-root; margin-block: 0; font-size: clamp(1rem, 1.35vw, 1.12rem); line-height: 1.76; overflow-wrap: anywhere; }
.story-prose > :first-child { margin-block-start: 0; }
.story-prose p { margin: 0 0 1.15em; }
.story-prose h2 { margin: 1.6em 0 .55em; font-size: clamp(1.48rem, 2.8vw, 2rem); line-height: 1.25; letter-spacing: -.026em; }
.story-prose h3 { margin: 1.45em 0 .45em; font-size: clamp(1.19rem, 2.1vw, 1.44rem); line-height: 1.35; }
.story-prose :is(ul,ol) { padding-inline-start: 1.35em; margin: 0 0 1.2em; }
.story-prose li + li { margin-block-start: .38em; }
.story-prose blockquote { margin: 1.5em 0; padding: .8em 1.15em; border-inline-start: 3px solid #7b9a89; background: #eef2ed; }
.story-prose blockquote > :last-child { margin-bottom: 0; }
.story-prose figure { max-width: 100%; margin: 1.45em auto; }
.story-prose img { display: block; width: auto; max-width: 100%; height: auto !important; margin: .7em auto; border-radius: 4px; }
.story-prose figure img { margin-block: 0; }
.story-prose figcaption { margin-top: .5em; font-size: .86rem; line-height: 1.5; color: var(--layout-muted); }
.story-prose a { text-underline-offset: .2em; }
.story-prose .wp-block-table { overflow-x: auto; }
.story-prose table { border-collapse: collapse; width: 100%; max-width: 100%; font-size: .93em; line-height: 1.5; }
.story-prose :is(th,td) { padding: .6em .72em; border: 1px solid var(--layout-border); text-align: start; }
.story-prose th { background: #eef2ed; }
.story-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 1.5rem; margin-block: 2rem clamp(42px, 6vw, 88px); padding-block-start: 1rem; border-top: 1px solid var(--layout-border); }

.rfq-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.rfq-layout > * { min-width: 0; }
.rfq-layout .rfq-aside { background: #eef2ed; border-radius: 6px; padding: clamp(16px, 2.3vw, 28px); }
@media (max-width: 950px) {
  .rfq-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .header .brand { width: min(188px, 53vw); }
  .header .menu-toggle { min-height: 44px; }
  .editorial-story { width: calc(100% - 36px); }
  .story-meta { margin-bottom: 12px; }
  .story-prose > table { display: block; overflow-x: auto; }
  .journal-grid { grid-template-columns: minmax(0, 1fr); }
  .journal-grid .journal-card-body { padding: 18px; }
}

.hero h1 { line-height: 1.06; }
.hero-actions { flex-wrap: wrap; }
.trade-tools > a { transition: background-color .18s ease; }
.trade-tools > a:hover { background: #f0f2eb; }
.trade-tools h2 { margin-top: 0; }
.collection-card h3 { text-wrap: balance; }
.material-grid > *, .resources-grid > *, .application-grid > * { min-width: 0; }

@media (max-width: 600px) {
  .hero h1 { font-size: clamp(2.1rem, 10vw, 3rem); line-height: 1.12; }
  .hero-actions { align-items: flex-start; gap: 12px 18px; }
  .hero-content { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .trade-tools > a { transition: none; }
}

:is(.single-post, .single-dbl_archive) main > .breadcrumbs {
  width: min(100% - 48px, 760px);
}
.story-heading { padding-block-start: clamp(23px, 3vw, 42px); }
@media (max-width: 600px) {
  :is(.single-post, .single-dbl_archive) main > .breadcrumbs {
    width: calc(100% - 36px);
  }
  :is(.single-post, .single-dbl_archive) .breadcrumbs :is([aria-current="page"], [aria-hidden]:has(+ [aria-current="page"])) {
    display: none;
  }
}

.story-prose figure.wp-block-image:not(.alignleft):not(.alignright) {
  width: min(100%, 620px);
}
.story-prose figure.wp-block-image:not(.alignleft):not(.alignright) img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
}
.story-prose figure.wp-block-image figcaption { text-align: center; }
