/* ============================================================
   ANALYSIS HUB  /assets/css/pages/analysis.css
   Written from scratch. Prefix: an-
   ============================================================ */

/* ── Variables ── */
:root {
    --an-gold:      #c8a96e;
    --an-gold-line: rgba(200, 169, 110, 0.32);
    --an-gold-bg:   rgba(200, 169, 110, 0.08);
    --an-bg:        #0d0d0f;
    --an-border:    rgba(255, 255, 255, 0.07);
    --an-text:      #f0ece4;
    --an-text-sub:  rgba(240, 236, 228, 0.55);
    --an-text-dim:  rgba(240, 236, 228, 0.28);
    --an-pad:       clamp(80px, 14vw, 240px);
}

/* ============================================================
   HERO
   bg image: /assets/img/pages/analysis/hero-bg.jpg
   ============================================================ */
.an-hero {
    position: relative;
    width: 100%;
    height: 45vh;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #050508;
}
.an-hero__bg {
    position: absolute;
    inset: 0;
    background-image: url('/assets/img/pages/analysis/hero-bg.jpg');
    background-size: cover;
    background-position: 60% center;
    background-color: #1a1410;
    opacity: .45;
    filter: blur(1px);
    z-index: 1;
}
.an-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(200, 169, 110, .18) 0%,
        rgba(0, 0, 0, .50) 50%,
        rgba(20, 10, 40, .32) 100%);
    z-index: 2;
}
.an-hero__text {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 20px;
}
.an-hero__eyebrow {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .5em;
    color: var(--an-gold);
    text-transform: uppercase;
    margin-bottom: 12px;
}
.an-hero__title {
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    font-weight: 900;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: .12em;
    color: #fff;
    line-height: 1;
    text-transform: uppercase;
    margin: 0 0 14px;
}
.an-hero__sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, .7);
    letter-spacing: .08em;
    margin: 0;
}
.an-scroll {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
}

/* ============================================================
   DIVIDER — full-width horizontal rule
   ============================================================ */
.an-divider {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 52px;
    padding: 0 40px;
    background: var(--an-bg);
    border-top:    1px solid var(--an-border);
    border-bottom: 1px solid var(--an-border);
    width: 100vw;
    margin-left:  calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    box-sizing: border-box;
}
.an-divider__line {
    flex: 1;
    height: 1px;
    background: var(--an-gold-line);
    opacity: .4;
}
.an-divider__label {
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .5em;
    color: var(--an-gold);
    text-transform: uppercase;
    white-space: nowrap;
}

/* ============================================================
   SECTION 1 — PRIMARY: RANKING | COLUMN
   Full-width, two equal columns.
   Left/right padding + outer borders (same style as updates hub).
   ============================================================ */
.an-primary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100vw;
    margin-left:  calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    background: var(--an-bg);
    border-bottom: 1px solid var(--an-border);
    padding-left:  var(--an-pad);
    padding-right: var(--an-pad);
    box-sizing: border-box;
    align-items: stretch;
}

/* Card */
.an-card {
    position: relative;
    display: block;
    padding: 36px 40px;
    text-decoration: none;
    overflow: hidden;
    box-sizing: border-box;
}
.an-card--ranking {
    border-left:  1px solid var(--an-border);
    border-right: 1px solid var(--an-border);
}
.an-card--column {
    border-right: 1px solid var(--an-border);
}

/* Background image layer */
.an-card__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #1c1810;
    opacity: .16;
    transition: opacity .5s, transform .6s;
    z-index: 0;
}
.an-card--ranking .an-card__bg { background-image: url('/assets/img/pages/analysis/ranking-bg.jpg'); }
.an-card--column  .an-card__bg { background-image: url('/assets/img/pages/analysis/column-bg.jpg'); background-color: #101418; }
.an-card--ranking:hover .an-card__bg { opacity: .30; transform: scale(1.03); }

/* Gradient overlay */
.an-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10,10,14,.5) 0%, rgba(10,10,14,.9) 100%);
    z-index: 1;
}

/* Body */
.an-card__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}
.an-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.an-card__num {
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .4em;
    color: var(--an-gold);
}
.an-card__tag {
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .35em;
    color: var(--an-gold);
    border: 1px solid var(--an-gold-line);
    background: var(--an-gold-bg);
    padding: 3px 10px;
    text-transform: uppercase;
}
.an-card__title {
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    font-weight: 900;
    color: var(--an-text);
    margin: 0 0 10px;
    line-height: 1.2;
    position: relative;
    padding-bottom: 12px;
}
.an-card__title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 28px; height: 2px;
    background: var(--an-gold);
    transition: width .4s cubic-bezier(.165,.84,.44,1);
}
.an-card--ranking:hover .an-card__title::after { width: 60px; }
.an-card__desc {
    font-size: .85rem;
    color: var(--an-text-sub);
    line-height: 1.75;
    margin: 0 0 20px;
}
.an-card__cta {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--an-gold);
    text-transform: uppercase;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--an-gold-line);
    transition: color .2s, border-color .2s;
}
.an-card--ranking:hover .an-card__cta { color: #fff; border-color: rgba(255,255,255,.3); }
.an-card__viewall {
    display: inline-block;
    margin-top: 14px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .25em;
    color: var(--an-gold);
    text-decoration: none;
    text-transform: uppercase;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--an-gold-line);
    transition: color .25s, border-color .25s;
}
.an-card__viewall:hover { color: #fff; border-color: rgba(255,255,255,.3); }

/* Inline column list (inside COLUMN card) */
.an-collist {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--an-border);
    border: 1px solid var(--an-border);
    margin-top: 12px;
}
.an-col {
    display: grid;
    grid-template-columns: 68px 1fr;
    text-decoration: none;
    background: rgba(10,10,14,.82);
    position: relative;
    overflow: hidden;
    transition: background .25s;
}
.an-col::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 2px; height: 0;
    background: var(--an-gold);
    transition: height .3s;
    z-index: 1;
}
.an-col:hover::before { height: 100%; }
.an-col:hover { background: rgba(200,169,110,.06); }
.an-col__thumb {
    width: 68px;
    aspect-ratio: 1/1;
    background: #1a1a20;
    overflow: hidden;
    flex-shrink: 0;
}
.an-col__thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: .85;
    display: block;
    transition: transform .4s, opacity .3s;
}
.an-col:hover .an-col__thumb img { transform: scale(1.08); opacity: 1; }
.an-col--ph .an-col__thumb {
    background: rgba(255,255,255,.06);
    animation: an-pulse 1.6s ease-in-out infinite;
}
.an-col--ph { pointer-events: none; opacity: .4; }
.an-col__info {
    padding: 9px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}
.an-col__date   { font-size: .6rem;  font-weight: 600; color: var(--an-gold); letter-spacing: .05em; }
.an-col__title  { font-size: .82rem; font-weight: 600; color: var(--an-text); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-col__author { font-size: .58rem; font-weight: 600; color: var(--an-text-dim); letter-spacing: .08em; text-transform: uppercase; }
.an-col__empty  { color: rgba(255,255,255,.3); font-size: .8rem; padding: 14px 12px; margin: 0; }

@keyframes an-pulse {
    0%, 100% { opacity: .3; }
    50%      { opacity: .6; }
}

/* ============================================================
   SECTION 2 — SECONDARY: THEORY | SYSTEM
   Full-width, two equal columns, same padding as PRIMARY.
   Each card is a flex row: [icon 36px] [body flex:1]
   Sub-links live inside body → zero overflow risk.
   ============================================================ */
.an-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100vw;
    margin-left:  calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    background: var(--an-bg);
    border-bottom: 1px solid var(--an-border);
    padding-left:  var(--an-pad);
    padding-right: var(--an-pad);
    box-sizing: border-box;
}

.an-sub {
    /* IMPORTANT: flex row, icon then body. Nothing else at this level. */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    padding: 32px 36px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: background .3s;
    box-sizing: border-box;
    /* Prevent grid blowout */
    min-width: 0;
    max-width: 100%;
}
/* Left outer border + divider between the two cards */
.an-sub:first-child {
    border-left:  1px solid var(--an-border);
    border-right: 1px solid var(--an-border);
    border-bottom: 1px solid var(--an-border);
}
.an-sub:last-child {
    border-right:  1px solid var(--an-border);
    border-bottom: 1px solid var(--an-border);
}

.an-sub:hover { background: rgba(200, 169, 110, .03); }

/* Gold accent line on the left edge */
.an-sub::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 0;
    background: var(--an-gold);
    transition: height .4s;
    z-index: 1;
}
.an-sub:hover::before { height: 100%; }

/* Icon — fixed 36px, never shrinks */
.an-sub__icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--an-gold);
    opacity: .6;
    transition: opacity .3s;
}
.an-sub:hover .an-sub__icon { opacity: 1; }

/* Body — takes all remaining width */
.an-sub__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.an-sub__en {
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .4em;
    color: var(--an-gold);
    margin-bottom: 5px;
}
.an-sub__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--an-text);
    margin: 0 0 5px;
    line-height: 1.3;
}
.an-sub__desc {
    font-size: .78rem;
    color: var(--an-text-sub);
    line-height: 1.6;
    margin: 0 0 14px;
}
/* Sub-links: horizontal wrap row inside body, cannot overflow */
.an-sub__links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
}
.an-sub__link {
    display: inline-block;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .22em;
    color: var(--an-text-dim);
    text-decoration: none;
    text-transform: uppercase;
    padding: 5px 12px;
    border: 1px solid var(--an-border);
    white-space: nowrap;
    transition: color .25s, border-color .25s, background .25s;
}
.an-sub__link:hover {
    color: var(--an-gold);
    border-color: var(--an-gold-line);
    background: var(--an-gold-bg);
}

/* ============================================================
   SECTION 3 — COLUMNS GRID
   Same padding as the sections above.
   VIEW ALL button matches top.css .btn-more / .top-news-footer.
   ============================================================ */
.an-columns {
    background: var(--an-bg);
    border-bottom: 1px solid var(--an-border);
    padding: 48px 0 60px;
    width: 100vw;
    margin-left:  calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    box-sizing: border-box;
}
.an-columns__inner {
    padding-left:  var(--an-pad);
    padding-right: var(--an-pad);
    box-sizing: border-box;
}

/* Footer: centered VIEW ALL button — matches top.css */
.an-columns__footer {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}
/* Scoped .btn-more — same values as top.css */
.an-columns__footer .btn-more {
    color: #aaa;
    font-size: .85rem;
    font-weight: 800;
    line-height: 1;
    border-bottom: 2px solid rgba(255, 255, 255, .1);
    text-decoration: none;
}
.an-columns__footer .btn-more:hover {
    color: #fff;
    border-color: #8e2de2;
    text-shadow: 0 0 10px #8e2de2;
}

/* Placeholder cards */
.column-card--ph    { pointer-events: none; opacity: .35; }
.card-eyecatch--ph  { background: rgba(255,255,255,.06); animation: an-pulse 1.6s ease-in-out infinite; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .an-primary,
    .an-secondary {
        grid-template-columns: 1fr;
        padding-left:  24px;
        padding-right: 24px;
    }
    .an-card {
        border: 1px solid var(--an-border);
        border-top: none;
        padding: 28px 20px;
    }
    .an-card--ranking { border-top: 1px solid var(--an-border); }
    .an-sub {
        border: 1px solid var(--an-border) !important;
        border-top: none !important;
        padding: 24px 20px;
        gap: 14px;
    }
    .an-sub:first-child { border-top: 1px solid var(--an-border) !important; }
    .an-columns__inner { padding-left: 24px; padding-right: 24px; }
    .an-divider { padding: 0 20px; }
}

@media (max-width: 768px) {
    .an-hero { height: 38vh; min-height: 260px; }
    .an-col__title { white-space: normal; }
}