/* ========================================
   游神 YÓUSHÉN — History Page Styles
   朱砂 × 纯黑  —  三千年仪式谱系
   ======================================== */

/* ==========================================
   HISTORY HERO
   ========================================== */
.history-hero {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
}

.history-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 30%;
    filter: brightness(0.30) saturate(1.3);
}

.history-hero-content {
    position: absolute;
    left: clamp(24px, 6vw, 80px);
    bottom: clamp(60px, 10vh, 120px);
    z-index: 2;
}

.history-kicker {
    font-size: 11px;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--vermilion);
    font-weight: 700;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
}

.history-hero-title {
    line-height: 1;
    margin-bottom: 1.2rem;
}

.history-title-main {
    display: block;
    font-weight: 700;
    font-size: clamp(60px, 12vw, 140px);
    line-height: 0.9;
    color: var(--text);
    opacity: 0;
    transform: translateY(40px);
}

.history-title-sub {
    display: block;
    font-weight: 700;
    font-size: clamp(40px, 8vw, 100px);
    line-height: 1;
    color: var(--vermilion);
    text-shadow:
        0 0 60px rgba(192, 57, 43, 0.6),
        0 0 120px rgba(192, 57, 43, 0.3);
    opacity: 0;
    transform: translateY(40px);
    margin-top: 0.1em;
}

.history-hero-desc {
    font-family: var(--serif-en);
    font-size: clamp(14px, 1.8vw, 20px);
    color: var(--text-muted);
    letter-spacing: 0.05em;
    line-height: 1.8;
    opacity: 0;
    transform: translateY(20px);
}

/* ==========================================
   INTRO STATEMENT
   ========================================== */
.history-intro {
    padding: clamp(60px, 10vh, 120px) clamp(24px, 6vw, 80px);
    text-align: center;
}

.history-intro-inner {
    max-width: 800px;
    margin: 0 auto;
}

.history-lead {
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 300;
    line-height: 1.8;
    color: var(--text);
}

.history-lead em {
    font-family: var(--serif-en);
    font-style: italic;
    color: var(--vermilion);
}

.history-lead-line {
    width: 40px;
    height: 1px;
    background: var(--vermilion);
    margin: 2.5rem auto 0;
}

/* ==========================================
   SECTION HEADERS
   ========================================== */
.history-section {
    padding: clamp(60px, 8vh, 100px) clamp(24px, 6vw, 80px);
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: clamp(20px, 3vw, 40px);
    margin-bottom: clamp(40px, 6vh, 80px);
}

.section-num {
    font-size: clamp(60px, 10vw, 120px);
    font-weight: 700;
    line-height: 0.85;
    color: var(--deep-red);
    opacity: 0.3;
    flex-shrink: 0;
}

.section-titles {
    padding-top: 0.5em;
}

.section-title-cn {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.3rem;
}

.section-title-en {
    font-family: var(--serif-en);
    font-style: italic;
    font-size: clamp(14px, 1.5vw, 20px);
    color: var(--vermilion);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: clamp(14px, 1.2vw, 18px);
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ==========================================
   CONTENT BLOCKS — Alternating Layout
   ========================================== */
.content-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(30px, 4vw, 60px);
    align-items: start;
    margin-bottom: clamp(50px, 6vh, 80px);
}

.content-block--reverse {
    direction: rtl;
}

.content-block--reverse>* {
    direction: ltr;
}

.content-block--full {
    grid-template-columns: 1fr;
}

.content-block--wide {
    grid-template-columns: 1fr;
}

.content-block--fangxiangshi {
    grid-template-columns: minmax(230px, 0.74fr) minmax(0, 1.26fr);
    align-items: center;
}

.content-block--fangxiangshi .content-text {
    max-width: 700px;
}

.content-block--fangxiangshi .media-figure {
    max-width: min(340px, 100%);
    margin-left: auto;
}

.content-block--fangxiangshi .media-figure img {
    height: clamp(360px, 52vh, 520px);
    object-fit: contain;
    background: rgba(139, 0, 0, 0.06);
    border: 1px solid var(--border);
}

.content-block--wangshenzhi {
    grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.18fr);
    align-items: center;
}

.content-block--wangshenzhi .media-figure {
    max-width: min(380px, 100%);
}

.content-block--wangshenzhi .media-figure img {
    aspect-ratio: 4 / 5;
    height: auto;
    object-fit: cover;
}

/* ---- Media ---- */
.content-media {
    position: relative;
}

.media-figure {
    position: relative;
    overflow: hidden;
}

.media-figure img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.85) saturate(1.1);
    transition: filter 0.5s ease, transform 0.6s ease;
}

.media-figure:hover img {
    filter: brightness(1) saturate(1.2);
    transform: scale(1.02);
}

.media-figure figcaption {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 0.05em;
    line-height: 1.5;
}

.media-grid {
    display: grid;
    gap: clamp(12px, 2vw, 20px);
}

.media-grid--2 {
    grid-template-columns: 1fr 1fr;
}

.media-grid--3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ---- Text ---- */
.content-text {
    padding-top: 0.5rem;
}

.content-text--wide {
    max-width: 900px;
    margin: 0 auto;
}

.content-text h3 {
    font-size: clamp(20px, 2.5vw, 30px);
    font-weight: 700;
    margin-bottom: 1rem;
}

.content-text p {
    font-size: clamp(14px, 1.2vw, 17px);
    line-height: 1.9;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.content-text p strong {
    color: var(--text);
    font-weight: 700;
}

.content-text p em {
    font-family: var(--serif-en);
    font-style: italic;
    color: var(--vermilion);
}

/* ---- Blockquotes ---- */
.content-text blockquote,
.conclusion-quote {
    padding: 1.2rem 1.5rem;
    margin: 1.5rem 0;
    background: rgba(139, 0, 0, 0.06);
    font-size: clamp(14px, 1.3vw, 18px);
    line-height: 1.8;
    color: var(--text);
    font-weight: 300;
    position: relative;
}

.content-text blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 48px;
    color: var(--deep-red);
    opacity: 0.3;
    font-family: var(--serif-en);
    line-height: 1;
}

.content-text blockquote cite {
    display: block;
    margin-top: 0.8rem;
    font-size: 14px;
    color: var(--text-muted);
    font-style: normal;
    letter-spacing: 0.05em;
}

.blockquote--large {
    font-size: clamp(15px, 1.4vw, 19px) !important;
    padding: 2rem 2rem !important;
}

/* ==========================================
   FIVE DEITIES SHOWCASE
   ========================================== */
.deities-showcase {
    margin: clamp(40px, 5vh, 80px) 0;
    padding: 0 clamp(24px, 6vw, 80px);
}

.deities-showcase-title {
    text-align: center;
    font-size: clamp(20px, 2.5vw, 32px);
    font-weight: 700;
    margin-bottom: clamp(24px, 3vh, 48px);
    color: var(--gold);
    letter-spacing: 0.15em;
}

.deities-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(12px, 1.5vw, 24px);
}

.deity-card {
    position: relative;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: border-color 0.4s, transform 0.4s;
}

.deity-card:hover {
    border-color: var(--vermilion);
    transform: translateY(-4px);
}

.deity-img-wrap {
    overflow: hidden;
    aspect-ratio: 3/4;
}

.deity-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8) saturate(1.1);
    transition: filter 0.5s, transform 0.5s;
}

.deity-card:hover .deity-img-wrap img {
    filter: brightness(1) saturate(1.2);
    transform: scale(1.05);
}

.deity-info {
    padding: clamp(10px, 1.5vw, 20px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.deity-role {
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--vermilion);
    text-transform: uppercase;
}

.deity-name {
    font-size: clamp(16px, 1.8vw, 22px);
    font-weight: 700;
}

.deity-desc {
    font-size: 12px;
    color: var(--text-faint);
    line-height: 1.5;
}

/* ==========================================
   STRATEGY / THEORY / FACTOR CARD GRIDS
   ========================================== */
.strategy-grid,
.factors-grid {
    display: grid;
    /* Two columns: four made each one too narrow, so text broke after a few characters. */
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 1.5vw, 20px) clamp(40px, 6vw, 96px);
    margin: 2rem 0;
}

.strategy-card,
.factor-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: clamp(20px, 2vw, 32px);
    transition: border-color 0.4s, transform 0.3s;
}

.strategy-card:hover,
.factor-card:hover {
    border-color: var(--vermilion);
    transform: translateY(-3px);
}

.strategy-card h4,
.factor-card h4 {
    font-size: clamp(15px, 1.3vw, 18px);
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.strategy-card p,
.factor-card p {
    font-size: clamp(14px, 1.1vw, 16px);
    color: var(--text-muted);
    line-height: 1.9;
    text-wrap: pretty;
}

.strategy-card h4,
.factor-card h4,
.theory-card h4 {
    text-wrap: balance;
}

.strategy-note {
    text-align: center;
    font-size: clamp(14px, 1.2vw, 17px);
    color: var(--text-muted);
    margin-top: 1.5rem;
}

/* Theory Grid */
.theory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(16px, 2vw, 24px);
    margin: 2rem 0;
}

.theory-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: clamp(24px, 2.5vw, 40px);
    transition: border-color 0.4s, transform 0.3s;
}

.theory-card:hover {
    border-color: var(--vermilion);
    transform: translateY(-3px);
}

.theory-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 0.8rem;
}

.theory-num {
    font-family: var(--serif-en);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    color: var(--deep-red);
    opacity: 0.5;
    line-height: 1;
}

.theory-card h4 {
    font-size: clamp(18px, 1.6vw, 24px);
    font-weight: 700;
    color: var(--text);
}

.theory-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ==========================================
   HIGHLIGHT STATS
   ========================================== */
.highlight-stat {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 1rem 0;
    padding: 0;
}

.stat-number {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    color: var(--vermilion);
    line-height: 1;
    text-shadow: 0 0 30px rgba(192, 57, 43, 0.4);
}

.stat-label {
    font-size: clamp(13px, 1.2vw, 16px);
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ==========================================
   CONCLUSION
   ========================================== */
.history-conclusion {
    padding: clamp(80px, 12vh, 160px) clamp(24px, 6vw, 80px);
    text-align: center;
    position: relative;
    background: linear-gradient(to bottom, var(--bg), rgba(139, 0, 0, 0.04), var(--bg));
}

.conclusion-inner {
    max-width: 760px;
    margin: 0 auto;
}

.conclusion-title {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.conclusion-line {
    width: 40px;
    height: 1px;
    background: var(--vermilion);
    margin: 0 auto 2rem;
}

.conclusion-text {
    font-size: clamp(15px, 1.4vw, 19px);
    line-height: 1.9;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.conclusion-text strong {
    color: var(--text);
    font-weight: 700;
}

.conclusion-text em {
    font-family: var(--serif-en);
    font-style: italic;
    color: var(--vermilion);
}

.conclusion-quote {
    font-size: clamp(20px, 3vw, 32px);
    text-align: center;
    border-left: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 2rem;
    margin: 2.5rem auto;
    max-width: 500px;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0.1em;
    background: none;
}

.conclusion-final {
    font-size: clamp(16px, 1.5vw, 20px) !important;
    color: var(--text) !important;
    font-weight: 300;
}

/* ==========================================
   NAV ACTIVE STATE
   ========================================== */
.nav-active {
    color: var(--vermilion) !important;
    opacity: 1 !important;
}

.nav-active::after {
    transform: scaleX(1) !important;
}

@media (min-width: 1600px) {
    .history-hero-content {
        left: clamp(80px, 7vw, 140px);
        max-width: 1040px;
        text-align: left;
    }

    .history-kicker {
        font-size: 13px;
    }

    .history-title-main {
        font-size: clamp(120px, 10vw, 230px);
    }

    .history-title-sub {
        font-size: clamp(84px, 7vw, 170px);
    }

    .history-hero-desc {
        font-size: 26px;
    }

    .history-intro,
    .history-section,
    .history-conclusion {
        padding-left: max(80px, calc((100vw - var(--layout-max)) / 2));
        padding-right: max(80px, calc((100vw - var(--layout-max)) / 2));
    }

    .history-lead {
        font-size: 32px;
    }

    .section-title-cn {
        font-size: 56px;
    }

    .section-title-en {
        font-size: 22px;
    }

    .section-subtitle {
        font-size: 20px;
    }

    .content-text h3 {
        font-size: 34px;
    }

    .content-text p {
        font-size: 18px;
    }

    .content-text blockquote,
    .conclusion-quote {
        font-size: 20px;
    }

    .media-figure figcaption {
        font-size: 14px;
    }

    .deities-showcase-title {
        font-size: 36px;
    }

    .deity-role,
    .deity-desc {
        font-size: 13px;
    }

    .deity-name {
        font-size: 24px;
    }

    .strategy-card h4,
    .factor-card h4 {
        font-size: 20px;
    }

    .strategy-card p,
    .factor-card p,
    .theory-card p {
        font-size: 16px;
    }

    .theory-card h4 {
        font-size: 26px;
    }

    .stat-label {
        font-size: 17px;
    }

    .conclusion-text {
        font-size: 20px;
    }

    .history-section .deities-showcase {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
    .content-block {
        grid-template-columns: 1fr;
    }

    .content-block--fangxiangshi {
        align-items: start;
    }

    .content-block--fangxiangshi .media-figure {
        max-width: min(420px, 100%);
        margin-left: 0;
    }

    .content-block--fangxiangshi .media-figure img {
        height: auto;
    }

    .content-block--wangshenzhi {
        align-items: start;
    }

    .content-block--wangshenzhi .media-figure {
        max-width: min(420px, 100%);
    }

    .content-block--reverse {
        direction: ltr;
    }

    .deities-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .strategy-grid,
    .factors-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .theory-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 10px;
    }

    .section-num {
        font-size: 60px;
    }

    .media-grid--3 {
        grid-template-columns: 1fr 1fr;
    }

    .history-hero {
        height: 50vh;
        min-height: 400px;
    }

    .history-title-main {
        font-size: clamp(40px, 14vw, 80px);
    }

    .history-title-sub {
        font-size: clamp(30px, 10vw, 60px);
    }
}

@media (max-width: 480px) {
    .deities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .strategy-grid,
    .factors-grid {
        grid-template-columns: 1fr;
    }

    .media-grid--2,
    .media-grid--3 {
        grid-template-columns: 1fr;
    }

    .history-hero {
        height: 45vh;
        min-height: 350px;
    }
}
