/* Category discovery uses the same paper, type and accent language as Home and Library. */
.category-refresh { background: var(--site-surface); color: var(--site-text); }
.category-refresh .ww-container-v3 { width: min(100%, 1600px); max-width: 1600px; padding-inline: clamp(20px, 3.5vw, 56px); }
.category-hero { overflow: hidden; background: var(--site-page) url('/images/editorial/category-paper-calm.webp') center / cover no-repeat; }
.category-hero-inner { display: grid; grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr); min-height: 552px; align-items: stretch; gap: clamp(22px, 3vw, 48px); }
.category-hero-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding-block: 42px 30px; }
.category-kicker { color: var(--site-brand-strong); font: 700 12px/1.4 'Noto Serif SC', serif; letter-spacing: .18em; }
.category-hero h1 { margin-top: 14px; font-family: 'Noto Serif SC', serif; font-size: clamp(40px, 4vw, 62px); font-weight: 700; letter-spacing: -.06em; line-height: 1.24; white-space: nowrap; }
.category-lead { margin-top: 16px; color: var(--site-text-secondary); font-size: clamp(14px, 1.2vw, 17px); line-height: 1.8; }
.category-media-links { display: grid; max-width: 440px; margin-top: 24px; }
.category-media-links a { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 24px; min-height: 82px; align-content: center; border: 0; border-radius: 8px; padding: 10px 10px 10px 14px; transition: background-color .18s ease; }
.category-media-links a + a { margin-top: 4px; }
.category-media-links a:hover { background: var(--site-brand-soft); }
.category-media-links a:focus-visible { background: var(--site-brand-soft); outline: 2px solid var(--site-brand); outline-offset: 2px; }
.category-media-links strong { font-family: 'Noto Serif SC', serif; font-size: clamp(21px, 1.65vw, 27px); line-height: 1.35; }
.category-media-links small { grid-column: 1; margin-top: 2px; color: var(--site-text-secondary); font-size: 12px; line-height: 1.5; }
.category-media-links a > span { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--site-brand-strong); font-size: 22px; }
.category-hero-footnote { max-width: 440px; margin-top: 23px; padding-top: 12px; color: var(--site-text-secondary); font-family: 'Noto Serif SC', serif; font-size: 13px; letter-spacing: .22em; }
.category-hero-art { position: relative; min-width: 0; align-self: end; height: 482px; overflow: hidden; }
.category-media-gallery { display: flex; width: calc(100% - 26px); height: 100%; gap: 4px; overflow: hidden; isolation: isolate; }
.category-media-panel { position: relative; display: block; min-width: 0; flex: 1 1 0; overflow: hidden; appearance: none; border: 0; border-radius: 0; background: var(--site-surface) var(--category-media-art) center / cover no-repeat; padding: 0; text-align: left; cursor: pointer; transition: flex-grow .36s cubic-bezier(.2,.7,.2,1); }
.category-media-panel--text { --category-media-art: url('/images/editorial/category-text-v2-light.webp'); }
.category-media-panel--scan { --category-media-art: url('/images/editorial/category-photo-v2-light.webp'); }
.category-media-panel--image { --category-media-art: url('/images/editorial/category-image-v2-light.webp'); }
:root[data-site-theme="dark"] .category-media-panel--text { --category-media-art: url('/images/editorial/category-text-v2-dark.webp'); }
:root[data-site-theme="dark"] .category-media-panel--scan { --category-media-art: url('/images/editorial/category-photo-v2-dark.webp'); }
:root[data-site-theme="dark"] .category-media-panel--image { --category-media-art: url('/images/editorial/category-image-v2-dark.webp'); }
.category-media-panel.is-active { flex-grow: 2; }
.category-media-panel:focus-visible { outline: 3px solid var(--site-brand); outline-offset: -3px; }
.category-media-caption { position: absolute; right: 8px; bottom: 10px; left: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 38px; border: 1px solid var(--site-border); background: var(--site-page); padding: 7px 8px; color: var(--site-text); font: 600 12px/1.5 'Noto Serif SC', serif; }
.category-media-caption strong { min-width: 0; font: inherit; overflow-wrap: anywhere; }
.category-media-caption i { flex: none; color: var(--site-brand-strong); font: 400 16px/1 sans-serif; }
@media (prefers-reduced-motion: reduce) {
    .category-media-panel { transition: none !important; }
}
.category-hero-marginalia { position: absolute; top: 12px; right: 0; color: var(--site-text-secondary); font-family: 'Noto Serif SC', serif; font-size: 11px; letter-spacing: .2em; writing-mode: vertical-rl; }
.category-section { padding-block: clamp(34px, 4vw, 60px); }
.category-section + .category-section { border: 0; }
.category-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.category-section-head > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 24px; }
.category-section-head h2 { display: flex; align-items: center; gap: 12px; font-family: 'Noto Serif SC', serif; font-size: clamp(23px, 2vw, 31px); font-weight: 700; line-height: 1.3; white-space: nowrap; }
.category-section-head h2::before { width: 5px; height: 29px; border-radius: 3px; background: var(--site-brand); content: ''; }
.category-section-head p { color: var(--site-text-secondary); font-size: 12px; line-height: 1.6; }
.category-section-link { flex: none; color: var(--site-brand-strong); font-size: 12px; white-space: nowrap; }
.category-section-link:hover, .category-section-link:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.category-section-link span { margin-left: 5px; font-size: 17px; }
.category-topic-grid { display: grid; grid-template-columns: repeat(var(--topic-columns, 8), minmax(0, 1fr)); gap: 12px; }
.category-topic-item { display: flex; min-width: 0; min-height: 130px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 10px; text-align: center; transition: background-color .18s ease; }
.category-topic-item:last-child { border-right: 0; }
.category-topic-item:hover { background: var(--site-brand-soft); }
.category-topic-item:focus-visible { background: var(--site-brand-soft); outline: 2px solid var(--site-brand); outline-offset: 2px; }
.category-topic-icon { display: block; width: 58px; height: 58px; background: url('/images/editorial/category-topic-illustrations.webp') var(--topic-art-position) center / 800% auto no-repeat; }
.category-topic-item strong { font-family: 'Noto Serif SC', serif; font-size: 15px; font-weight: 600; white-space: nowrap; }
.category-topic-item small { display: -webkit-box; overflow: hidden; max-width: 100%; color: var(--site-text-muted); font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.category-more-topics { margin-top: 18px; padding-top: 7px; }
.category-more-topics summary { width: fit-content; min-height: 36px; padding: 8px 0; color: var(--site-brand-strong); font-size: 12px; cursor: pointer; list-style: none; }
.category-more-topics summary::-webkit-details-marker { display: none; }
.category-more-topics summary span { margin-left: 4px; }
.category-more-topic-links { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 10px 0; }
.category-more-topic-links a { font-size: 13px; }
.category-more-topic-links a:hover { color: var(--site-brand-strong); }
.category-more-topic-links small { margin-left: 4px; color: var(--site-text-muted); font-size: 11px; }
.category-classics { background: var(--site-page); }
.category-class-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.category-class-item { display: flex; min-width: 0; min-height: 64px; align-items: center; gap: 9px; border: 0; border-radius: 8px; padding: 7px 10px; transition: background-color .18s ease; }
.category-class-item:last-child { border-right: 0; }
.category-class-item:hover { background: var(--site-brand-soft); }
.category-class-item:focus-visible { background: var(--site-brand-soft); outline: 2px solid var(--site-brand); outline-offset: 2px; }
.category-class-icon { display: block; width: 42px; height: 42px; flex: none; background: url('/images/editorial/category-class-illustrations.webp') var(--class-art-position) center / 700% auto no-repeat; }
.category-class-item strong { overflow: hidden; font-family: 'Noto Serif SC', serif; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.category-class-item > span:last-child { margin-left: auto; color: var(--site-brand-strong); }
.category-all-classes { margin-top: 30px; scroll-margin-top: 84px; }
.category-all-classes h3 { margin-bottom: 10px; font-family: 'Noto Serif SC', serif; font-size: 17px; }
.category-all-class-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 16px; }
.category-all-class-grid a { display: flex; min-width: 0; justify-content: space-between; gap: 8px; border: 0; border-radius: 6px; padding: 10px 6px; font-size: 12px; }
.category-all-class-grid a:hover { color: var(--site-brand-strong); }
.category-all-class-grid a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-all-class-grid small { flex: none; color: var(--site-text-muted); font-size: 11px; }
.category-formats { background: var(--site-surface); }
.category-format-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.category-format-grid a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; min-height: 82px; border: 0; border-radius: 10px; background: var(--site-page); padding: 13px 16px; }
.category-format-grid a:hover { background: var(--site-brand-soft); }
.category-format-grid a:focus-visible { outline: 2px solid var(--site-brand); outline-offset: 2px; }
.category-format-grid strong { font-family: 'Noto Serif SC', serif; font-size: 15px; }
.category-format-grid small { grid-column: 1; color: var(--site-text-muted); font-size: 11px; }
.category-format-grid a > span { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--site-brand-strong); font-size: 12px; white-space: nowrap; }
.category-empty { padding-block: 22px; color: var(--site-text-secondary); font-size: 13px; }
:root[data-site-theme="dark"] .category-hero { background-image: none; }
@media (max-width: 1100px) {
    .category-hero-inner { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); min-height: 500px; }
    .category-hero h1 { font-size: clamp(36px, 4.4vw, 50px); }
    .category-hero-art { height: 410px; }
    .category-topic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .category-topic-item:nth-child(4n) { border-right: 0; }
    .category-class-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .category-class-item:nth-child(4n) { border-right: 0; }
    .category-all-class-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .category-hero-inner { display: flex; flex-direction: column; gap: 0; }
    .category-hero-copy { padding-block: 34px 10px; }
    .category-hero h1 { white-space: normal; font-size: clamp(35px, 8vw, 45px); }
    .category-lead { font-size: 13px; }
    .category-media-links { width: 100%; max-width: none; margin-top: 16px; }
    .category-media-links a { min-height: 72px; }
    .category-hero-footnote { margin-top: 18px; }
    .category-hero-art { width: 100%; height: clamp(230px, 53vw, 380px); margin-top: 20px; }
    .category-media-gallery { width: 100%; }
    .category-hero-marginalia { display: none; }
    .category-section { padding-block: 26px; }
    .category-section-head { align-items: start; }
    .category-section-head > div { display: block; }
    .category-section-head p { margin-top: 5px; }
    .category-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-topic-item:nth-child(2n) { border-right: 0; }
    .category-topic-item { min-height: 112px; }
    .category-class-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-class-item:nth-child(2n) { border-right: 0; }
    .category-all-class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-format-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .category-section-head { flex-wrap: wrap; gap: 8px; }
    .category-class-item { gap: 5px; padding-inline: 5px; }
    .category-class-icon { width: 34px; height: 34px; }
    .category-class-item strong { font-size: 12px; }
    .category-all-class-grid { gap: 0 8px; }
}
