/* Homepage structures that change by language. Desk palettes stay in theme-*.css. */

.home-facts {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 32px;
}
.home-facts strong {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 600;
  line-height: 1.1;
}
.home-facts span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: .08em;
  opacity: .68;
}

/* ——— English: paper cut, 2×2 film mosaic ——— */
body.lang-en.theme-portal .portal-hero { min-height: min(82vh, 800px); }
body.lang-en.theme-portal .photo-hero-copy { padding: 96px var(--gutter) 64px; }
body.lang-en.theme-portal h1 { max-width: 13em; letter-spacing: -0.02em; }
body.lang-en .home-facts {
  border-top: 1px solid rgba(138,106,47,.22);
  border-bottom: 1px solid rgba(138,106,47,.22);
  padding: 22px var(--gutter);
  gap: 12px 24px;
}
body.lang-en .home-facts span { text-transform: uppercase; font-family: var(--font-mono); letter-spacing: .16em; }
body.lang-en.theme-portal .desk-mosaic {
  gap: 6px;
  padding: 6px var(--gutter) 8px;
  min-height: 70vh;
}
body.lang-en.theme-portal .desk { min-height: 320px; padding: 28px 24px 22px; }
body.lang-en.theme-portal .kw-index { padding-top: 4.25rem; }
body.lang-en.theme-portal .people-row { gap: 28px 18px; }
body.lang-en.theme-crime .photo-hero { min-height: min(80vh, 780px); }
body.lang-en.theme-crime .crime-cols { gap: 64px 56px; }
body.lang-en.theme-dui .dui-hero { min-height: min(86vh, 840px); }
body.lang-en.theme-drug .protocol { gap: 14px; }
body.lang-en.theme-sex .quiet-hero { padding-top: 4.75rem; }

/* ——— Simplified Chinese: 卷宗 folio, inset mast, ledger cards ——— */
body.lang-zh-CN.theme-portal {
  --bg: #fbf8f4;
  --accent: #c45c4a;
  --folio: var(--max);
  --folio-side: clamp(28px, 7vw, 120px);
  background: #fbf8f4;
}
body.lang-zh-CN.theme-portal .portal-hero,
body.lang-zh-CN .home-facts,
body.lang-zh-CN.theme-portal .desk-mosaic {
  width: min(var(--folio), calc(100% - (var(--folio-side) * 2)));
  max-width: var(--folio);
  margin-left: auto;
  margin-right: auto;
}
body.lang-zh-CN.theme-portal .portal-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(280px, 1.08fr);
  min-height: 0;
  margin-top: 28px;
  align-items: stretch;
  color: inherit;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(196, 92, 74, 0.16);
  overflow: hidden;
}
body.lang-zh-CN.theme-portal .portal-hero > img {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-height: 420px;
  max-height: 500px;
  object-fit: cover;
  order: 2;
}
body.lang-zh-CN.theme-portal .portal-hero::after { display: none; }
body.lang-zh-CN.theme-portal .photo-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 44px 36px 44px 40px;
  background: #fff;
  border-left: 6px solid var(--cjk-accent);
  color: #1a1410;
}
body.lang-zh-CN.theme-portal h1 {
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.38;
  max-width: 12em;
  margin-bottom: 1rem;
}
body.lang-zh-CN.theme-portal .lead { font-size: 16px; max-width: 28em; line-height: 1.8; }
body.lang-zh-CN .home-facts {
  padding: 0;
  margin-top: -1px;
  border: 0;
  border-top: 1px solid rgba(196, 92, 74, 0.22);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(196, 92, 74, 0.16);
}
body.lang-zh-CN .home-facts > div {
  padding: 22px 28px 24px;
  border-right: 1px solid rgba(196, 92, 74, 0.18);
}
body.lang-zh-CN .home-facts > div:last-child { border-right: 0; }
body.lang-zh-CN .home-facts strong { color: #c45c4a; font-size: clamp(24px, 2.4vw, 32px); }
body.lang-zh-CN .home-facts span { letter-spacing: .16em; }
body.lang-zh-CN.theme-portal .desk-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  padding: 28px 0 12px;
  min-height: 0;
}
body.lang-zh-CN.theme-portal .desk {
  min-height: 0;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  padding: 0 0 22px;
  border: 1px solid rgba(196, 92, 74, 0.16);
  background: #fff;
  color: #1a1410;
  overflow: hidden;
}
body.lang-zh-CN.theme-portal .desk img {
  position: relative;
  inset: auto;
  width: 100%;
  flex: 0 0 auto;
  height: 210px;
  right: auto;
  transform: none;
}
body.lang-zh-CN.theme-portal .desk:hover img { transform: scale(1.04); }
body.lang-zh-CN.theme-portal .desk::after { display: none; }
body.lang-zh-CN.theme-portal .desk-no {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  margin: 16px 22px 0;
  font-size: 20px;
  letter-spacing: .18em;
  flex: 0 0 auto;
  color: #c45c4a;
  z-index: 3;
}
body.lang-zh-CN.theme-portal .desk h2 {
  font-size: clamp(24px, 2.1vw, 30px);
  margin: 4px 22px 8px;
  min-width: 0;
}
body.lang-zh-CN.theme-portal .desk p {
  margin: 0 22px 14px;
  max-width: 22em;
  flex: 0 0 auto;
  opacity: .86;
  line-height: 1.65;
}
body.lang-zh-CN.theme-portal .desk .go {
  margin: auto 22px 0;
  padding-top: 2px;
  letter-spacing: .14em;
}
body.lang-zh-CN.theme-portal .kw-index {
  padding: 3.25rem var(--gutter) 3rem;
  border-top: 3px solid var(--cjk-accent);
}
body.lang-zh-CN.theme-portal .kw-index-grid { gap: 20px 28px; }
body.lang-zh-CN.theme-portal .kw-index h3 { border-bottom: 1px solid rgba(196,92,74,.35); padding-bottom: 8px; }
body.lang-zh-CN.theme-portal .people-row { gap: 16px 14px; }
body.lang-zh-CN.theme-portal .strip { padding-top: 3rem; padding-bottom: 3.5rem; }

body.lang-zh-CN.theme-crime .photo-hero,
body.lang-zh-CN.theme-dui .photo-hero,
body.lang-zh-CN.theme-drug .photo-hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 0;
  align-items: stretch;
  color: inherit;
}
body.lang-zh-CN.theme-crime .photo-hero > img,
body.lang-zh-CN.theme-dui .photo-hero > img,
body.lang-zh-CN.theme-drug .photo-hero > img {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-height: 420px;
  order: 2;
}
body.lang-zh-CN.theme-crime .photo-hero::after,
body.lang-zh-CN.theme-dui .photo-hero::after,
body.lang-zh-CN.theme-drug .photo-hero::after { display: none; }
body.lang-zh-CN.theme-crime .photo-hero-copy,
body.lang-zh-CN.theme-dui .photo-hero-copy,
body.lang-zh-CN.theme-drug .photo-hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 48px 36px 48px clamp(20px, 5vw, 56px);
  background: var(--bg);
  color: var(--ink);
}
body.lang-zh-CN.theme-dui .dui-hero .photo-hero-copy {
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}
body.lang-zh-CN.theme-dui .dui-meter {
  text-align: left;
  border-left: 0;
  padding: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
body.lang-zh-CN.theme-dui .dui-meter .num { font-size: clamp(52px, 8vw, 84px); }
body.lang-zh-CN .crime-cols { grid-template-columns: 1fr; gap: 28px; }
body.lang-zh-CN .crime-sheet { padding-top: 2.75rem; }
body.lang-zh-CN .rule-list li {
  grid-template-columns: 2.2em 1fr;
  border: 1px solid rgba(196,165,116,.22);
  border-top: 1px solid rgba(196,165,116,.22);
  padding: 12px 14px;
  margin-bottom: 8px;
}
body.lang-zh-CN .graf { margin-bottom: 1.1rem; padding-bottom: 1.1rem; border-bottom: 1px dashed rgba(196,165,116,.25); }
body.lang-zh-CN .dui-split { grid-template-columns: 1fr; gap: 32px; padding-top: 2.75rem; }
body.lang-zh-CN .clock li { grid-template-columns: 4.25em 1fr; gap: 14px; margin-bottom: 16px; }
body.lang-zh-CN .dui-cards { gap: 10px; }
body.lang-zh-CN .protocol { grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 1.25rem; }
body.lang-zh-CN .protocol article { min-height: 0; padding: 16px 16px 18px; }
body.lang-zh-CN .lab-grid { gap: 28px 32px; padding-top: 1.25rem; }
body.lang-zh-CN.theme-sex .quiet-hero {
  padding-top: 2.75rem;
  padding-bottom: 1.75rem;
}
body.lang-zh-CN.theme-sex .quiet-stage,
body.lang-zh-CN.theme-sex .quiet-copy { min-height: 420px; }
body.lang-zh-CN.theme-sex .quiet-copy { padding: 28px 22px 24px; }
body.lang-zh-CN.theme-sex .quiet-body { gap: 32px 36px; padding-top: 1.25rem; }
body.lang-zh-CN.theme-sex .quiet-body li { margin-bottom: 18px; }
body.lang-zh-CN .band { padding-top: 3rem; padding-bottom: 3rem; }

/* ——— Traditional Chinese: 册页 folio, framed plate, four hanging desks ——— */
body.lang-zh-TW.theme-portal { --bg: #faf9f5; --accent: #9a7618; background: #faf9f5; }
body.lang-zh-TW.theme-portal .portal-hero {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  min-height: min(78vh, 740px);
  align-items: stretch;
  padding: 36px clamp(20px, 5vw, 64px) 12px;
  gap: 8px 0;
  background: #faf9f5;
  color: inherit;
}
body.lang-zh-TW.theme-portal .portal-hero > img {
  position: relative;
  inset: auto;
  width: calc(100% - 48px);
  height: calc(100% - 48px);
  min-height: 460px;
  margin: 24px;
  object-fit: cover;
  outline: 1px solid rgba(154,118,24,.4);
  outline-offset: 10px;
}
body.lang-zh-TW.theme-portal .portal-hero::after { display: none; }
body.lang-zh-TW.theme-portal .photo-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 48px 6% 48px 48px;
  color: #1a1814;
}
body.lang-zh-TW.theme-portal .photo-hero-copy .kicker {
  padding-top: 14px;
  border-top: 1px solid rgba(154,118,24,.55);
  margin-bottom: 1.4rem;
  letter-spacing: .22em;
}
body.lang-zh-TW.theme-portal h1 {
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.46;
  max-width: 14em;
  font-weight: 500;
  margin-bottom: 1.5rem;
  text-wrap: pretty;
}
body.lang-zh-TW.theme-portal .lead { font-size: 17px; line-height: 1.95; max-width: 28em; }
body.lang-zh-TW .home-facts {
  padding: 40px var(--gutter) 12px;
  gap: 24px 48px;
}
body.lang-zh-TW .home-facts strong { font-weight: 500; letter-spacing: .06em; }
body.lang-zh-TW .home-facts span { letter-spacing: .2em; margin-top: 10px; }
body.lang-zh-TW.theme-portal .desk-mosaic {
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 28px var(--gutter) 20px;
  min-height: 0;
}
body.lang-zh-TW.theme-portal .desk {
  min-height: min(62vh, 560px);
  padding: 32px 22px 28px;
}
body.lang-zh-TW.theme-portal .desk h2 { font-size: clamp(22px, 2vw, 30px); margin: 8px 0 14px; }
body.lang-zh-TW.theme-portal .desk p { line-height: 1.75; margin-bottom: 24px; }
body.lang-zh-TW.theme-portal .kw-index { padding: 5.5rem var(--gutter) 4.5rem; }
body.lang-zh-TW.theme-portal .kw-index-grid {
  grid-template-columns: 1fr 1fr;
  gap: 48px 80px;
}
body.lang-zh-TW.theme-portal .kw-index li { padding: 12px 0; }
body.lang-zh-TW.theme-portal .people-row { gap: 36px 28px; }
body.lang-zh-TW.theme-portal .strip { padding-top: 4.75rem; padding-bottom: 5.5rem; }
body.lang-zh-TW.theme-portal .person strong { font-size: 18px; margin-top: 16px; }

body.lang-zh-TW.theme-crime .photo-hero,
body.lang-zh-TW.theme-dui .photo-hero,
body.lang-zh-TW.theme-drug .photo-hero {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  min-height: 0;
  padding: 28px var(--gutter) 8px;
  align-items: stretch;
  gap: 12px 28px;
  color: inherit;
}
body.lang-zh-TW.theme-crime .photo-hero > img,
body.lang-zh-TW.theme-dui .photo-hero > img,
body.lang-zh-TW.theme-drug .photo-hero > img {
  position: relative;
  inset: auto;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  min-height: 400px;
  margin: 12px;
  outline: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 8px;
}
body.lang-zh-TW.theme-crime .photo-hero::after,
body.lang-zh-TW.theme-dui .photo-hero::after,
body.lang-zh-TW.theme-drug .photo-hero::after { display: none; }
body.lang-zh-TW.theme-crime .photo-hero-copy,
body.lang-zh-TW.theme-dui .photo-hero-copy,
body.lang-zh-TW.theme-drug .photo-hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 36px 8px 36px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
}
body.lang-zh-TW.theme-dui .dui-hero .photo-hero-copy {
  grid-template-columns: 1fr;
  gap: 28px;
}
body.lang-zh-TW.theme-dui .dui-meter {
  text-align: left;
  border-left: 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(232,163,23,.35);
}
body.lang-zh-TW .crime-cols { gap: 64px 80px; padding-top: .5rem; }
body.lang-zh-TW .crime-sheet { padding-top: 4.5rem; padding-bottom: 4.5rem; }
body.lang-zh-TW .rule-list li { padding: 22px 0; gap: 18px; }
body.lang-zh-TW .graf { margin-bottom: 2.1rem; }
body.lang-zh-TW .dui-split { gap: 64px 72px; padding-top: 4.5rem; }
body.lang-zh-TW .clock li { margin-bottom: 32px; gap: 22px; }
body.lang-zh-TW .protocol {
  grid-template-columns: 1fr;
  gap: 0;
  padding-bottom: 2rem;
}
body.lang-zh-TW .protocol article {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 28px 40px;
  min-height: 0;
  padding: 28px 8px;
  border: 0;
  border-bottom: 1px solid rgba(94,234,212,.22);
  background: none;
  align-items: start;
}
body.lang-zh-TW .protocol h2 { margin: 0 0 10px; font-size: 22px; }
body.lang-zh-TW .lab-grid { gap: 48px 64px; padding-top: 2rem; }
body.lang-zh-TW.theme-sex .quiet-hero {
  max-width: 880px;
  padding-top: 4.75rem;
  padding-bottom: 3rem;
}
body.lang-zh-TW.theme-sex .quiet-stage,
body.lang-zh-TW.theme-sex .quiet-copy { min-height: 520px; }
body.lang-zh-TW.theme-sex .quiet-copy { padding: 40px 32px 36px; }
body.lang-zh-TW.theme-sex .quiet-body {
  max-width: 880px;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-top: 1rem;
}
body.lang-zh-TW.theme-sex .quiet-body li { margin-bottom: 36px; }
body.lang-zh-TW .band { padding-top: 4.75rem; padding-bottom: 4.75rem; }
body.lang-zh-TW .faq details { padding: 20px 0; }

@media (max-width: 900px) {
  body.lang-zh-CN.theme-portal .portal-hero,
  body.lang-zh-TW.theme-portal .portal-hero,
  body.lang-zh-CN.theme-crime .photo-hero,
  body.lang-zh-CN.theme-dui .photo-hero,
  body.lang-zh-CN.theme-drug .photo-hero,
  body.lang-zh-TW.theme-crime .photo-hero,
  body.lang-zh-TW.theme-dui .photo-hero,
  body.lang-zh-TW.theme-drug .photo-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 0;
    gap: 0;
  }
  body.lang-zh-CN.theme-portal .portal-hero > img,
  body.lang-zh-TW.theme-portal .portal-hero > img,
  body.lang-zh-CN.theme-crime .photo-hero > img,
  body.lang-zh-CN.theme-dui .photo-hero > img,
  body.lang-zh-CN.theme-drug .photo-hero > img,
  body.lang-zh-TW.theme-crime .photo-hero > img,
  body.lang-zh-TW.theme-dui .photo-hero > img,
  body.lang-zh-TW.theme-drug .photo-hero > img {
    min-height: 38vh;
    width: 100%;
    height: 38vh;
    margin: 0;
    outline: none;
    order: -1;
  }
  body.lang-zh-CN.theme-portal .portal-hero,
  body.lang-zh-CN .home-facts,
  body.lang-zh-CN.theme-portal .desk-mosaic {
    width: calc(100% - 32px);
  }
  body.lang-zh-CN.theme-portal .portal-hero { margin-top: 16px; }
  body.lang-zh-CN.theme-portal .photo-hero-copy {
    padding: 28px var(--gutter) 32px;
    border-left: 0;
    border-top: 5px solid var(--cjk-accent);
  }
  body.lang-zh-CN.theme-portal .portal-hero > img { min-height: 0; max-height: none; }
  body.lang-zh-TW.theme-portal .photo-hero-copy,
  body.lang-zh-CN.theme-crime .photo-hero-copy,
  body.lang-zh-CN.theme-dui .photo-hero-copy,
  body.lang-zh-CN.theme-drug .photo-hero-copy,
  body.lang-zh-TW.theme-crime .photo-hero-copy,
  body.lang-zh-TW.theme-dui .photo-hero-copy,
  body.lang-zh-TW.theme-drug .photo-hero-copy {
    padding: 28px var(--gutter) 32px;
  }
  body.lang-zh-CN.theme-portal .desk-mosaic { grid-template-columns: 1fr; gap: 12px; padding-top: 18px; }
  body.lang-zh-CN.theme-portal .desk { padding-bottom: 16px; }
  body.lang-zh-CN.theme-portal .desk img { height: 160px; width: 100%; flex-basis: auto; }
  body.lang-zh-CN.theme-portal .desk-no { font-size: 14px; margin: 14px 18px 0; }
  body.lang-zh-CN.theme-portal .desk h2 { margin-left: 18px; margin-right: 18px; }
  body.lang-zh-CN.theme-portal .desk p { margin-left: 18px; margin-right: 18px; flex-basis: auto; }
  body.lang-zh-CN.theme-portal .desk .go { margin-left: 18px; padding-left: 0; }
  body.lang-zh-TW.theme-portal .desk-mosaic { grid-template-columns: 1fr 1fr; }
  body.lang-zh-TW.theme-portal .desk { min-height: 280px; }
  body.lang-zh-TW.theme-portal .kw-index-grid { grid-template-columns: 1fr; gap: 28px; }
  body.lang-zh-TW .protocol article { grid-template-columns: 1fr; gap: 8px; }
  .home-facts { grid-template-columns: 1fr; padding: 18px var(--gutter); }
  body.lang-zh-CN .home-facts > div { border-right: 0; border-bottom: 1px solid rgba(196,92,74,.22); }
}
@media (max-width: 640px) {
  body.lang-zh-TW.theme-portal .desk-mosaic { grid-template-columns: 1fr; }
  body.lang-en.theme-portal .desk-mosaic { padding-top: 12px; }
  .kw-plates { padding-left: var(--gutter); padding-right: var(--gutter); }
  body.lang-en.theme-portal .people-row,
  body.lang-zh-CN.theme-portal .people-row,
  body.lang-zh-TW.theme-portal .people-row {
    gap: 14px 10px;
  }
  body.lang-zh-TW.theme-portal .person strong {
    font-size: 13px;
    margin-top: 8px;
  }
}
