/* 2026 editorial redesign: calm, content-first, accessible. */
:root {
    --primary: #3157d5;
    --primary-hover: #2345b4;
    --primary-light: #e9edff;
    --background: #f4f1ea;
    --card-bg: #fffdf8;
    --text: #171717;
    --text-light: #55534e;
    --text-muted: #77736b;
    --border: #dcd7cd;
    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 28px;
}

[data-theme="dark"] {
    --primary: #8ea5ff;
    --primary-hover: #b3c0ff;
    --primary-light: #242c4c;
    --background: #201d19;
    --card-bg: #2a2621;
    --text: #f5f2ea;
    --text-light: #d3ccc1;
    --text-muted: #aaa095;
    --border: #4a4239;
}

html { scroll-behavior: smooth; }

body {
    background: var(--background) !important;
    color: var(--text);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

body::before,
body::after { display: none !important; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container { max-width: 1240px !important; padding-inline: 24px; }

/* Navigation */
.navbar,
[data-theme="dark"] .navbar,
[data-theme="dark"] .navbar.scrolled {
    position: sticky;
    top: 0;
    min-height: 78px;
    background: color-mix(in srgb, var(--background) 92%, transparent) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none !important;
    backdrop-filter: blur(18px) !important;
    z-index: 100;
}

.navbar::after { display: none !important; }
.navbar .container { min-height: 78px; gap: 28px; }

.nav-brand a { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.logo-icon { width: 42px !important; height: 42px !important; border-radius: 12px !important; object-fit: cover; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { font-size: 16px; letter-spacing: .08em; }
.brand-copy small { margin-top: 6px; font-size: 9px; letter-spacing: .17em; color: var(--text-muted); text-transform: uppercase; }

.nav-menu { gap: 4px !important; }
.nav-menu a { padding: 10px 12px !important; border-radius: 10px; color: var(--text-light) !important; font-size: 14px !important; }
.nav-menu a::after { display: none !important; }
.nav-menu a:hover { color: var(--text) !important; background: var(--card-bg); }

.nav-search form { width: min(260px, 22vw); height: 44px; display: flex; border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg); overflow: hidden; }
.nav-search input { min-width: 0; flex: 1; border: 0 !important; background: transparent !important; padding: 0 4px 0 14px !important; color: var(--text); }
.nav-search button { width: 42px; display: grid; place-items: center; border: 0; background: transparent !important; color: var(--text); cursor: pointer; }
.nav-search button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.theme-toggle { width: 44px !important; height: 44px !important; border: 1px solid var(--border) !important; border-radius: 12px !important; background: var(--card-bg) !important; color: var(--text) !important; box-shadow: none !important; }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-login, .btn-member { min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px !important; border-radius: 12px !important; background: var(--text) !important; color: var(--background) !important; box-shadow: none !important; }

/* Mobile navigation drawer */
.hamburger-menu {
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 10px !important;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    appearance: none;
}
.hamburger-menu:hover { background: var(--card-bg); border-color: var(--border); }
.hamburger-menu span { width: 21px !important; height: 1.5px !important; flex: 0 0 auto; }
.hamburger-menu.active span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px) !important; }
.hamburger-menu.active span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px) !important; }

.mobile-drawer {
    top: 0 !important;
    z-index: 1000 !important;
    background: rgba(15, 15, 14, .46) !important;
    backdrop-filter: blur(3px);
    transition: opacity .22s ease, visibility .22s ease !important;
}
.drawer-content {
    left: 0 !important;
    width: min(88vw, 360px) !important;
    height: 100dvh !important;
    padding: 0 18px 24px;
    color: var(--text);
    background: var(--background) !important;
    border: 0 !important;
    border-right: 1px solid var(--border) !important;
    box-shadow: 28px 0 80px rgba(0,0,0,.16) !important;
    backdrop-filter: none !important;
    transform: translateX(-102%);
    transition: transform .28s cubic-bezier(.22,1,.36,1) !important;
    scrollbar-width: thin;
}
.mobile-drawer.show .drawer-content { left: 0 !important; transform: translateX(0); }
.drawer-close-overlay { left: min(88vw, 360px) !important; }

.drawer-brand-row {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 78px;
    background: color-mix(in srgb, var(--background) 94%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}
.drawer-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.drawer-brand img { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; }
.drawer-brand span { display: flex; flex-direction: column; }
.drawer-brand strong { font-size: 15px; letter-spacing: .08em; }
.drawer-brand small { margin-top: 4px; color: var(--text-muted); font-size: 8px; letter-spacing: .15em; }
.drawer-close-btn { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg); color: var(--text); cursor: pointer; }
.drawer-close-btn svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.drawer-user { display: grid !important; grid-template-columns: 46px 1fr; gap: 12px; margin: 18px 0 4px; padding: 18px !important; border-radius: 16px; background: #171717 !important; color: #fff; }
.drawer-user-avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #3157d5; font-family: Georgia, serif; font-size: 20px; }
.drawer-user-name { display: flex; flex-direction: column; justify-content: center; margin: 0 !important; }
.drawer-user-name small { margin-bottom: 3px; color: rgba(255,255,255,.58); font-size: 10px; letter-spacing: .08em; }
.drawer-user-name strong { font-size: 15px; }
.drawer-user-links { grid-column: 1 / -1; display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; }
.drawer-user-links a { min-height: 40px; display: grid; place-items: center; padding: 0 8px !important; border: 1px solid rgba(255,255,255,.13); border-radius: 10px !important; background: rgba(255,255,255,.07) !important; color: #fff !important; font-size: 12px !important; }

.drawer-search { padding: 18px 0 4px !important; }
.drawer-search form { display: flex; align-items: center; height: 50px; border: 1px solid var(--border); border-radius: 13px; background: var(--card-bg); }
.drawer-search svg { flex: 0 0 auto; width: 18px; margin-left: 15px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; }
.drawer-search input { height: 100%; padding: 0 14px !important; border: 0 !important; background: transparent !important; color: var(--text); font-size: 14px !important; }
.drawer-search form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }

.drawer-section { padding: 24px 0 !important; border-bottom: 1px solid var(--border) !important; }
.drawer-section-title { padding: 0 4px 10px !important; color: var(--text-muted) !important; font-size: 10px !important; font-weight: 800 !important; letter-spacing: .17em; }
.drawer-nav-list { display: grid; gap: 5px; margin: 0; padding: 0; }
.drawer-nav-list li a { display: grid !important; grid-template-columns: 38px 1fr 18px; align-items: center; min-height: 58px; padding: 8px 10px !important; border: 0 !important; border-radius: 13px; color: var(--text) !important; transition: background .2s ease !important; }
.drawer-nav-list li a:hover, .drawer-nav-list li a.active { border: 0 !important; background: var(--card-bg) !important; color: var(--text) !important; }
.drawer-nav-list li a > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; font-size: 14px; font-weight: 650; }
.drawer-nav-list li a small { margin-top: 3px; color: var(--text-muted); font-size: 10px; font-weight: 400; }
.drawer-link-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary-light); color: var(--primary); }
.drawer-link-icon svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drawer-index { color: var(--primary); font-family: Georgia, serif; font-size: 12px; font-weight: 700; }
.drawer-chevron { width: 16px; fill: none; stroke: var(--text-muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.drawer-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.drawer-quick-grid a { min-height: 78px; display: flex; flex-direction: column; justify-content: space-between; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--card-bg); color: var(--text); font-size: 12px; font-weight: 650; }
.drawer-quick-grid svg { width: 19px; fill: none; stroke: var(--primary); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.drawer-account-actions { display: grid; gap: 9px; }
.drawer-account-actions a { min-height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 13px; font-weight: 700; }
.drawer-primary-action { background: var(--text); color: var(--background); }
.drawer-secondary-action { justify-content: space-between !important; padding: 0 15px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); }
.drawer-secondary-action span { color: var(--primary); font-size: 18px; }
.drawer-note { display: flex; align-items: center; gap: 8px; padding: 20px 4px 8px; color: var(--text-muted); font-size: 10px; }
.drawer-note span { width: 6px; height: 6px; border-radius: 50%; background: #f06449; box-shadow: 0 0 0 4px color-mix(in srgb, #f06449 14%, transparent); }

/* Homepage hero */
.main-content { padding: 28px 0 64px !important; }
.home-hero {
    position: relative;
    min-height: 500px;
    margin-bottom: 72px;
    border: 1px solid var(--border);
    border-radius: 30px;
    overflow: hidden;
    background: #e8e2d6;
    isolation: isolate;
}

.home-hero-content { position: relative; z-index: 2; width: 55%; padding: 62px 0 54px 58px; }
.hero-eyebrow { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border: 1px solid rgba(23,23,23,.22); border-radius: 999px; color: #30302d; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.home-hero h1 { margin: 22px 0 18px; color: #161616; font-family: "Songti SC", STSong, Georgia, serif; font-size: clamp(44px, 5vw, 72px); line-height: 1.06; letter-spacing: -.055em; }
.home-hero h1 em { color: #3157d5; font-style: normal; }
.home-hero-content > p { max-width: 530px; margin: 0 0 30px; color: #4c4a44; font-size: 16px; line-height: 1.8; }
.home-hero-art { position: absolute; inset: 0; z-index: 0; background: url('/images/knowledge-hero.webp') center right / cover no-repeat; }
.home-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(232,226,214,.98) 0%, rgba(232,226,214,.92) 42%, rgba(232,226,214,.18) 66%, transparent 82%); }

.hero-search { display: flex; align-items: center; width: min(590px, 100%); height: 60px; padding: 6px; border: 1px solid rgba(23,23,23,.16); border-radius: 16px; background: rgba(255,253,248,.94); box-shadow: 0 16px 40px rgba(32,29,24,.10); }
.hero-search svg { flex: 0 0 auto; width: 20px; margin-left: 13px; fill: none; stroke: #55534e; stroke-width: 2; stroke-linecap: round; }
.hero-search input { min-width: 0; flex: 1; height: 100%; padding: 0 12px; border: 0; outline: 0; background: transparent; color: #171717; font-size: 15px; }
.hero-search button { flex: 0 0 auto; height: 46px; padding: 0 20px; border: 0; border-radius: 11px; background: #171717; color: #fff; font-weight: 700; cursor: pointer; transition: background .2s ease; }
.hero-search button:hover { background: #3157d5; }
.hero-meta { display: flex; gap: 20px; margin-top: 18px; color: #666259; font-size: 12px; }
.hero-meta span + span::before { content: "\00b7"; margin-right: 20px; }
.hero-meta strong { color: #171717; }

/* Editorial headings and cards */
.editorial-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 14px; margin-bottom: 22px; }
.editorial-heading > span { grid-column: 1 / -1; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.editorial-heading .featured-title { margin: 0 !important; font-family: "Songti SC", STSong, Georgia, serif; font-size: 30px !important; letter-spacing: -.03em; }
.editorial-heading p { margin: 0 0 4px; color: var(--text-muted); font-size: 13px; }
.featured-section { margin-bottom: 74px !important; }
.featured-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 18px !important; }

.featured-card,
.content-card,
[data-theme="dark"] .content-card,
[data-theme="dark"] .featured-card {
    opacity: 1 !important;
    animation: none !important;
    overflow: hidden;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    background: var(--card-bg) !important;
    box-shadow: none !important;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease !important;
}

.featured-card:hover,
.content-card:hover,
[data-theme="dark"] .content-card:hover,
[data-theme="dark"] .featured-card:hover { transform: translateY(-3px) !important; border-color: color-mix(in srgb, var(--primary) 55%, var(--border)) !important; box-shadow: 0 14px 30px rgba(20,20,20,.08) !important; }
.featured-card::before, .featured-card::after, .content-card::before, .content-card::after { display: none !important; }
.featured-card-image { height: 178px !important; background: #ebe7de !important; }
.card-image { height: 164px !important; background: #ebe7de !important; }
.featured-card-image img, .card-image img { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; object-fit: cover !important; }
.featured-card:hover img, .content-card:hover img { transform: scale(1.025) !important; }
.featured-card-content, .card-content { padding: 16px !important; }
.featured-card-content h3, .card-content h3 { color: var(--text) !important; line-height: 1.55 !important; }
.card-tag { border-radius: 6px !important; background: var(--primary-light) !important; color: var(--primary) !important; }

.category-section { opacity: 1 !important; animation: none !important; margin-bottom: 66px !important; }
.section-header-clickable { padding: 0 0 14px !important; border-bottom: 1px solid var(--border) !important; }
.section-title { font-family: "Songti SC", STSong, Georgia, serif; font-size: 28px !important; letter-spacing: -.03em; }
.section-icon { display: none; }
.section-arrow { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 50%; }
.content-grid { grid-template-columns: repeat(5, 1fr) !important; gap: 18px !important; }
.btn-more { padding: 11px 20px !important; border: 1px solid var(--border) !important; border-radius: 10px !important; background: transparent !important; color: var(--text) !important; box-shadow: none !important; animation: none !important; letter-spacing: 0 !important; }
.btn-more::before { display: none !important; }
.btn-more:hover { transform: none !important; border-color: var(--text) !important; box-shadow: none !important; }

/* Membership callout and footer */
.vip-section { background: #171717 !important; color: #f7f3ea; }
.vip-section::before, .vip-section::after { display: none !important; }
.vip-card { background: #22221f !important; border: 1px solid #3b3a35 !important; box-shadow: none !important; }
.vip-card:hover { transform: translateY(-3px) !important; border-color: #8ea5ff !important; }
.footer { background: #0f0f0e !important; }

@media (max-width: 1100px) {
    .nav-menu { display: none !important; }
    .nav-search form { width: min(300px, 32vw); }
    .home-hero-content { width: 62%; padding-left: 44px; }
    .content-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

@media (max-width: 768px) {
    .container { padding-inline: 16px !important; }
    .navbar, .navbar .container { min-height: 68px; }
    .brand-copy small, .nav-search { display: none !important; }
    .brand-copy strong { font-size: 15px; }
    .mobile-drawer { display: block; pointer-events: none; }
    .mobile-drawer.show { pointer-events: auto; }
    .home-hero { min-height: 570px; margin-bottom: 52px; border-radius: 22px; }
    .home-hero-content { width: 100%; padding: 34px 24px 250px; }
    .home-hero h1 { font-size: clamp(38px, 11vw, 54px); }
    .home-hero-content > p { font-size: 14px; }
    .home-hero-art { background-position: 66% center; }
    .home-hero::after { background: linear-gradient(180deg, rgba(232,226,214,.99) 0%, rgba(232,226,214,.92) 55%, rgba(232,226,214,.18) 78%, transparent 100%); }
    .hero-search { height: 56px; }
    .hero-search button { padding: 0 14px; }
    .hero-meta { gap: 10px; flex-wrap: wrap; }
    .hero-meta span + span::before { margin-right: 10px; }
    .featured-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .content-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .featured-card-image, .card-image { height: 128px !important; }
    .editorial-heading { display: block; }
    .editorial-heading > span { display: block; margin-bottom: 8px; }
    .editorial-heading p { margin-top: 6px; }
    .section-title { font-size: 23px !important; }
}

@media (max-width: 390px) {
    .brand-copy { display: none; }
    .home-hero-content { padding-inline: 18px; }
    .hero-search input { font-size: 13px; }
    .hero-search button { font-size: 12px; }
}

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