/* ==========================================================================
   Survival Category Page – survival.css
   Design: editorial dark-earth palette, mixed-size grid, sticky sidebar
   ========================================================================== */

/* ── TOKENS ─────────────────────────────────────────────────────────────── */
.survival-page {
    --sv-bg:          #0d0f0c;
    --sv-surface:     #141713;
    --sv-surface-2:   #1c201a;
    --sv-border:      #2a2e27;
    --sv-accent:      #c8a96e;       /* warm gold */
    --sv-accent-2:    #7ea86b;       /* sage green */
    --sv-text-high:   #f0ede6;
    --sv-text-mid:    #a8a49b;
    --sv-text-low:    #6b6861;
    --sv-tag-bg:      rgba(200, 169, 110, 0.12);
    --sv-radius:      6px;
    --sv-radius-lg:   12px;
    --sv-font-head:   'Georgia', 'Times New Roman', serif;
    --sv-font-body:   system-ui, -apple-system, sans-serif;
    --sv-max-w:       1320px;
    --sv-gap:         28px;
    --sv-transition:  0.22s ease;

    background: var(--sv-bg);
    color: var(--sv-text-high);
    font-family: var(--sv-font-body);
    /* Override Blocksy container defaults */
    --theme-background-color: #0d0f0c;
}

/* Reset Blocksy wrappers on this page */
.survival-page *,
.survival-page *::before,
.survival-page *::after {
    box-sizing: border-box;
}

/* Ensure Blocksy's outer containers don't clip us */
body:has(.survival-page) {
    background: var(--sv-bg, #0d0f0c);
}

/* ── HERO BAND ───────────────────────────────────────────────────────────── */
.sv-hero-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 72px clamp(20px, 5vw, 80px) 56px;
    max-width: var(--sv-max-w);
    margin: 0 auto;
    border-bottom: 1px solid var(--sv-border);
}

.sv-hero-band__inner {
    flex: 1;
}

.sv-hero-band__eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--sv-accent);
    margin-bottom: 18px;
    padding: 4px 12px;
    border: 1px solid var(--sv-accent);
    border-radius: 2px;
}

.sv-hero-band__title {
    font-family: var(--sv-font-head);
    font-size: clamp(52px, 8vw, 100px);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.03em;
    color: var(--sv-text-high);
    margin: 0 0 24px;
    /* Subtle texture effect */
    background: linear-gradient(135deg, #f0ede6 0%, #c8a96e 60%, #f0ede6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sv-hero-band__sub {
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.65;
    color: var(--sv-text-mid);
    max-width: 560px;
    margin: 0;
}

.sv-hero-band__stats {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-left: 60px;
    border-left: 1px solid var(--sv-border);
    flex-shrink: 0;
}

.sv-hero-band__stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sv-hero-band__stat strong {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--sv-font-head);
    color: var(--sv-accent);
    line-height: 1;
}

.sv-hero-band__stat span {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sv-text-low);
}

@media (max-width: 768px) {
    .sv-hero-band {
        flex-direction: column;
        align-items: flex-start;
        padding: 48px 20px 36px;
    }
    .sv-hero-band__stats {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid var(--sv-border);
        padding-left: 0;
        padding-top: 28px;
        width: 100%;
    }
    .sv-hero-band__stat {
        flex: 1;
    }
}

/* ── HERO POST ───────────────────────────────────────────────────────────── */
.sv-hero-post {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: var(--sv-max-w);
    margin: 0 auto;
    border-bottom: 1px solid var(--sv-border);
}

.sv-hero-post__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    text-decoration: none;
}

.sv-hero-post__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.sv-hero-post__media:hover .sv-hero-post__img {
    transform: scale(1.04);
}

.sv-hero-post__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 60%, rgba(13, 15, 12, 0.5) 100%);
    pointer-events: none;
}

.sv-hero-post__img--placeholder {
    background: var(--sv-surface-2);
    min-height: 400px;
}

.sv-hero-post__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 5vw, 64px);
    background: var(--sv-surface);
    border-left: 1px solid var(--sv-border);
}

.sv-hero-post__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sv-hero-post__date {
    font-size: 13px;
    color: var(--sv-text-low);
}

.sv-hero-post__title {
    font-family: var(--sv-font-head);
    font-size: clamp(26px, 3.5vw, 44px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 20px;
}

.sv-hero-post__title a {
    color: var(--sv-text-high);
    text-decoration: none;
    transition: color var(--sv-transition);
}

.sv-hero-post__title a:hover {
    color: var(--sv-accent);
}

.sv-hero-post__excerpt {
    font-size: 16px;
    line-height: 1.7;
    color: var(--sv-text-mid);
    margin: 0 0 32px;
}

.sv-hero-post__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.sv-hero-post__author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--sv-text-mid);
}

.sv-hero-post__avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .sv-hero-post {
        grid-template-columns: 1fr;
    }
    .sv-hero-post__body {
        border-left: none;
        border-top: 1px solid var(--sv-border);
    }
    .sv-hero-post__overlay {
        background: linear-gradient(to bottom, transparent 50%, rgba(13, 15, 12, 0.4) 100%);
    }
}

/* ── LAYOUT WRAPPER ──────────────────────────────────────────────────────── */
.sv-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--sv-gap);
    max-width: var(--sv-max-w);
    margin: 0 auto;
    padding: 52px clamp(16px, 4vw, 60px);
    align-items: start;
}

@media (max-width: 1060px) {
    .sv-layout {
        grid-template-columns: 1fr;
    }
}

/* ── SECTION HEADER ──────────────────────────────────────────────────────── */
.sv-section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 36px;
}

.sv-section-header__title {
    font-family: var(--sv-font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--sv-text-low);
    white-space: nowrap;
    margin: 0;
}

.sv-section-header__line {
    flex: 1;
    height: 1px;
    background: var(--sv-border);
    display: block;
}

/* ── FEED GRID ───────────────────────────────────────────────────────────── */
/* Auto-placed CSS Grid: 3 cols; every 6th item spans full row */
.sv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sv-gap);
}

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

@media (max-width: 560px) {
    .sv-grid {
        grid-template-columns: 1fr;
    }
}

/* ── ARTICLE CARD ────────────────────────────────────────────────────────── */
.sv-card {
    display: flex;
    flex-direction: column;
    background: var(--sv-surface);
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius-lg);
    overflow: hidden;
    transition: transform var(--sv-transition), box-shadow var(--sv-transition);
}

.sv-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Wide card – spans full 3 columns */
.sv-card--wide {
    grid-column: 1 / -1;
    flex-direction: row;
}

.sv-card--wide .sv-card__media {
    width: 52%;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
}

.sv-card--wide .sv-card__body {
    padding: clamp(24px, 3vw, 44px);
    justify-content: center;
}

@media (max-width: 860px) {
    .sv-card--wide {
        flex-direction: column;
    }
    .sv-card--wide .sv-card__media {
        width: 100%;
    }
}

/* Card media */
.sv-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    text-decoration: none;
    flex-shrink: 0;
}

.sv-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.sv-card:hover .sv-card__img {
    transform: scale(1.05);
}

.sv-card__img-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 15, 12, 0.15);
    pointer-events: none;
    transition: background var(--sv-transition);
}

.sv-card:hover .sv-card__img-overlay {
    background: rgba(13, 15, 12, 0.05);
}

/* Card body */
.sv-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    flex: 1;
}

.sv-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sv-card__read-time {
    font-size: 11px;
    color: var(--sv-text-low);
    margin-left: auto;
}

.sv-card__title {
    font-family: var(--sv-font-head);
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.sv-card__title--lg {
    font-size: clamp(22px, 2.5vw, 30px);
    letter-spacing: -0.01em;
}

.sv-card__title a {
    color: var(--sv-text-high);
    text-decoration: none;
    transition: color var(--sv-transition);
}

.sv-card__title a:hover {
    color: var(--sv-accent);
}

.sv-card__excerpt {
    font-size: 15px;
    line-height: 1.7;
    color: var(--sv-text-mid);
    margin: 0;
}

.sv-card__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--sv-border);
}

.sv-card__avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sv-card__author {
    font-size: 12px;
    color: var(--sv-text-mid);
}

.sv-card__dot {
    color: var(--sv-text-low);
    font-size: 12px;
}

.sv-card__date {
    font-size: 12px;
    color: var(--sv-text-low);
    margin-left: auto;
}

/* ── TAGS ────────────────────────────────────────────────────────────────── */
.sv-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--sv-tag-bg);
    color: var(--sv-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 3px;
    border: 1px solid rgba(200, 169, 110, 0.25);
    transition: background var(--sv-transition), color var(--sv-transition);
}

.sv-tag:hover {
    background: var(--sv-accent);
    color: var(--sv-bg);
}

.sv-tag--sm {
    font-size: 10px;
    padding: 3px 8px;
}

/* ── BUTTON ──────────────────────────────────────────────────────────────── */
.sv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    background: var(--sv-accent);
    color: var(--sv-bg);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-radius: var(--sv-radius);
    transition: background var(--sv-transition), transform var(--sv-transition);
    white-space: nowrap;
}

.sv-btn:hover {
    background: #d9bc83;
    transform: translateY(-1px);
}

/* ── PAGINATION ──────────────────────────────────────────────────────────── */
.sv-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 52px;
    flex-wrap: wrap;
}

.sv-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius);
    color: var(--sv-text-mid);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--sv-transition);
    background: var(--sv-surface);
}

.sv-pagination .page-numbers:hover,
.sv-pagination .page-numbers.current {
    background: var(--sv-accent);
    color: var(--sv-bg);
    border-color: var(--sv-accent);
}

.sv-pagination .page-numbers.prev,
.sv-pagination .page-numbers.next {
    width: auto;
    padding: 0 16px;
}

/* ── NO POSTS ────────────────────────────────────────────────────────────── */
.sv-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: var(--sv-text-low);
    font-size: 18px;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sv-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 90px;         /* clear sticky header */
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--sv-border) transparent;
}

.sv-sidebar::-webkit-scrollbar {
    width: 4px;
}

.sv-sidebar::-webkit-scrollbar-track { background: transparent; }
.sv-sidebar::-webkit-scrollbar-thumb { background: var(--sv-border); border-radius: 2px; }

/* ── WIDGET ──────────────────────────────────────────────────────────────── */
.sv-widget {
    background: var(--sv-surface);
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius-lg);
    padding: 24px;
}

.sv-widget__title {
    font-family: var(--sv-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sv-text-low);
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--sv-border);
}

/* ── CATEGORY LIST ───────────────────────────────────────────────────────── */
.sv-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sv-cat-list__item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--sv-radius);
    color: var(--sv-text-mid);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--sv-transition);
    gap: 10px;
}

.sv-cat-list__item a:hover,
.sv-cat-list__item.is-active a {
    background: var(--sv-surface-2);
    color: var(--sv-text-high);
}

.sv-cat-list__item.is-active a {
    border-left: 2px solid var(--sv-accent);
    padding-left: 10px;
    color: var(--sv-accent);
}

.sv-cat-list__name {
    flex: 1;
}

.sv-cat-list__count {
    background: var(--sv-surface-2);
    color: var(--sv-text-low);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 26px;
    text-align: center;
}

.sv-cat-list__item.is-active .sv-cat-list__count {
    background: var(--sv-tag-bg);
    color: var(--sv-accent);
}

/* ── MINI CARDS (Must Read) ──────────────────────────────────────────────── */
.sv-mini-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--sv-border);
}

.sv-mini-card:first-child { padding-top: 0; }
.sv-mini-card:last-child  { border-bottom: none; padding-bottom: 0; }

.sv-mini-card__img-wrap {
    flex-shrink: 0;
    display: block;
    overflow: hidden;
    border-radius: var(--sv-radius);
    width: 68px;
    height: 68px;
}

.sv-mini-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.sv-mini-card__img-wrap:hover .sv-mini-card__img {
    transform: scale(1.08);
}

.sv-mini-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sv-mini-card__title {
    font-family: var(--sv-font-head);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    margin: 0;
}

.sv-mini-card__title a {
    color: var(--sv-text-high);
    text-decoration: none;
    transition: color var(--sv-transition);
}

.sv-mini-card__title a:hover {
    color: var(--sv-accent);
}

.sv-mini-card__date {
    font-size: 11px;
    color: var(--sv-text-low);
}

/* ── ABOUT WIDGET ────────────────────────────────────────────────────────── */
.sv-widget--about {
    text-align: center;
}

.sv-widget__about-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--sv-accent-2);
}

.sv-widget__about-icon svg {
    width: 100%;
    height: 100%;
}

.sv-widget__about-text {
    font-size: 13px;
    line-height: 1.7;
    color: var(--sv-text-mid);
    margin: 0 0 18px;
}

.sv-widget__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

/* ── SCROLLBAR FOR SIDEBAR ON MOBILE ─────────────────────────────────────── */
@media (max-width: 1060px) {
    .sv-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

/* ── PRINT / A11Y ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .sv-card,
    .sv-card__img,
    .sv-hero-post__img,
    .sv-btn {
        transition: none;
    }
}

@media print {
    .sv-sidebar,
    .sv-hero-band__stats { display: none; }
    .sv-layout { grid-template-columns: 1fr; }
    .survival-page { color: #000; background: #fff; }
}
