/* ============================================================
   TERTON PUBLIC PAGE
   Hero + Featured + Small Row + Regular Cards + CTAs
   ============================================================ */

:root {
    --aff-deepgreen: #4B993F;
    --aff-green: #7DBD73;
    --aff-neutral: #9D9D9D;
    --aff-blue: #73AABD;
    --aff-deepblue: #738ABD;
}

/* ============================================================
   HERO (55vh)
   ============================================================ */
.iri-hero {
    position: relative;
    width: 100%;
    height: 55vh;
    min-height: 320px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: calc(-1 * var(--nav-height));
}

.iri-hero__canvas { position: absolute; inset: 0; z-index: 0; }
.iri-hero__canvas canvas { width: 100% !important; height: 100% !important; display: block; }

.iri-hero__overlay {
    position: absolute; inset: 0; z-index: 1;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
}

.iri-hero__content {
    position: relative; z-index: 2; text-align: center;
    max-width: 640px; padding: 0 1.5rem;
}

.iri-hero__title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700; line-height: 1.15; color: #fff;
    margin: 0 0 1rem;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.iri-hero__title em { font-style: italic; color: #d8b4fe; }

.iri-hero__subtitle {
    font-family: var(--font-body);
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    color: rgba(255,255,255,0.85); line-height: 1.75; margin: 0;
    text-shadow: 0 1px 10px rgba(0,0,0,0.3);
}

.iri-hero__fade {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
    pointer-events: none; height: 180px;
    background: linear-gradient(to bottom, transparent, var(--bg-primary));
}

[data-theme="light"] .iri-hero__fade {
    height: 120px;
    background: linear-gradient(to bottom,
        transparent 0%, rgba(236,232,244,0.15) 20%, rgba(236,232,244,0.35) 40%,
        rgba(236,232,244,0.6) 60%, rgba(236,232,244,0.82) 78%, #ece8f4 100%);
}

[data-theme="light"] .iri-hero__overlay {
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.35) 100%);
}

/* ============================================================
   FEED CONTAINER
   ============================================================ */
.feed-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

/* ============================================================
   SHARED CARD ELEMENTS
   ============================================================ */
.story-card__date {
    display: inline-block; font-size: 0.7rem; color: var(--text-muted);
    font-family: var(--font-display); font-weight: 500;
    letter-spacing: 0.04em; margin-bottom: 0.35rem;
}

.story-card__link {
    color: inherit; text-decoration: none; transition: color 0.2s ease;
}

.story-card__link::after {
    content: ''; position: absolute; inset: 0; z-index: 1;
}

.story-card__link:hover { color: var(--accent); }

/* Affiliation bar */
.story-card__bar-wrap {
    padding: 0 1rem 0.75rem;
}

.story-card__bar-wrap--full {
    padding: 0 0.75rem 0.75rem;
}

.story-card__bar {
    display: flex; height: 6px; border-radius: 3px; overflow: hidden;
}

.story-card__bar-seg { min-width: 0; }
.story-card__bar-seg[data-aff="Deep Green"] { background: #4B993F; }
.story-card__bar-seg[data-aff="Green"] { background: #7DBD73; }
.story-card__bar-seg[data-aff="Neutral"] { background: #9D9D9D; }
.story-card__bar-seg[data-aff="Blue"] { background: #73AABD; }
.story-card__bar-seg[data-aff="Deep Blue"] { background: #738ABD; }

.story-card__bar-meta {
    font-size: 0.6rem; color: var(--text-muted); margin-top: 4px;
    font-family: var(--font-display);
}

/* Placeholder */
.story-card__placeholder {
    width: 100%; height: 100%; display: flex;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(30,25,50,0.5));
    border: 1px dashed rgba(139,92,246,0.2);
}

[data-theme="light"] .story-card__placeholder {
    background: linear-gradient(135deg, rgba(124,58,237,0.04), rgba(245,245,247,0.9));
    border-color: rgba(139,92,246,0.12);
}

/* ============================================================
   FEATURED CARD
   ============================================================ */
.story-featured {
    position: relative;
    border-radius: 16px; overflow: hidden;
    background: linear-gradient(165deg, rgba(124,58,237,0.15), rgba(18,14,30,0.98) 50%);
    border: 1px solid rgba(139,92,246,0.22);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3), 0 0 60px rgba(124,58,237,0.06);
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.story-featured:hover {
    border-color: rgba(139,92,246,0.4);
    box-shadow: 0 0 40px rgba(124,58,237,0.15);
}

.story-featured__image {
    padding: 0.75rem 0.75rem 0;
}

.story-featured__image img {
    width: 100%; height: 340px; object-fit: cover;
    border-radius: 10px; display: block;
}

.story-featured__image .story-card__placeholder {
    height: 340px; border-radius: 10px;
}

.story-featured__content {
    position: relative; z-index: 2;
    padding: 1rem 1.5rem 0.5rem;
}

.story-featured__title {
    font-family: var(--font-display);
    font-size: 1.5rem; font-weight: 700;
    color: #ede9fe; line-height: 1.3;
    margin: 0 0 0.6rem;
}

.story-featured__commentary {
    font-size: 0.9rem; color: #9890b0;
    line-height: 1.65; margin: 0 0 0.75rem;
}

.story-featured .story-card__bar-wrap {
    padding: 0 1.5rem 1.25rem;
}

/* Featured full bar (with percentages and labels) */
.story-featured__bar-full {
    padding: 0 1.5rem 1.25rem;
}

.story-featured__bar {
    display: flex; height: 28px; border-radius: 6px; overflow: hidden; margin-bottom: 4px;
}

.story-featured__bar-seg {
    display: flex; align-items: center; justify-content: center; min-width: 0;
}

.story-featured__bar-seg[data-aff="Deep Green"] { background: #4B993F; }
.story-featured__bar-seg[data-aff="Green"] { background: #7DBD73; }
.story-featured__bar-seg[data-aff="Neutral"] { background: #9D9D9D; }
.story-featured__bar-seg[data-aff="Blue"] { background: #73AABD; }
.story-featured__bar-seg[data-aff="Deep Blue"] { background: #738ABD; }

.story-featured__bar-pct {
    font-size: 0.65rem; font-weight: 700; color: #fff;
    font-family: var(--font-display);
}

.story-featured__bar-labels {
    display: flex; margin-bottom: 0.35rem;
}

.story-featured__bar-label {
    min-width: 0; text-align: center;
    font-size: 0.55rem; font-family: var(--font-display);
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px;
}

.story-featured__bar-label[data-aff="Deep Green"] { color: #4B993F; }
.story-featured__bar-label[data-aff="Green"] { color: #7DBD73; }
.story-featured__bar-label[data-aff="Neutral"] { color: #9D9D9D; }
.story-featured__bar-label[data-aff="Blue"] { color: #73AABD; }
.story-featured__bar-label[data-aff="Deep Blue"] { color: #738ABD; }

/* ============================================================
   SMALL ROW (3 cards)
   ============================================================ */
.story-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.story-small {
    position: relative;
    border-radius: 14px; overflow: hidden;
    background: linear-gradient(165deg, rgba(124,58,237,0.12), rgba(18,14,30,0.95) 50%);
    border: 1px solid rgba(139,92,246,0.18);
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.story-small:hover {
    border-color: rgba(139,92,246,0.35);
    box-shadow: 0 0 30px rgba(124,58,237,0.1);
}

.story-small__image {
    padding: 0.5rem 0.5rem 0;
}

.story-small__image img {
    width: 100%; height: 140px; object-fit: cover;
    border-radius: 8px; display: block;
}

.story-small__image .story-card__placeholder,
.story-card__placeholder--sm {
    height: 140px; border-radius: 8px;
}

.story-small__content {
    position: relative; z-index: 2;
    padding: 0.75rem 1rem 0.5rem;
}

.story-small__title {
    font-family: var(--font-display);
    font-size: 0.95rem; font-weight: 700;
    color: #ede9fe; line-height: 1.35; margin: 0;
}

.story-small .story-card__bar-wrap {
    padding: 0 0.75rem 0.75rem;
}

/* ============================================================
   REGULAR CARD (horizontal)
   ============================================================ */
.story-regular-batch {
    display: flex; flex-direction: column; gap: 1rem;
    margin-bottom: 1.5rem;
}

.story-regular {
    position: relative;
    border-radius: 14px; overflow: hidden;
    background: linear-gradient(165deg, rgba(124,58,237,0.12), rgba(18,14,30,0.95) 50%);
    border: 1px solid rgba(139,92,246,0.18);
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    display: grid;
    grid-template-columns: 28% 1fr;
    grid-template-rows: auto auto;
}

.story-regular:hover {
    border-color: rgba(139,92,246,0.35);
    box-shadow: 0 0 30px rgba(124,58,237,0.1);
}

.story-regular__thumb {
    padding: 0.75rem 0 0.75rem 0.75rem;
    grid-row: 1;
}

.story-regular__thumb img {
    width: 100%; height: 110px; object-fit: cover;
    border-radius: 8px; display: block;
}

.story-card__placeholder--thumb {
    width: 100%; height: 110px; border-radius: 8px;
}

.story-regular__body {
    padding: 0.75rem 1rem;
    grid-row: 1;
    min-width: 0;
}

.story-regular__title {
    font-family: var(--font-display);
    font-size: 0.95rem; font-weight: 700;
    color: #ede9fe; line-height: 1.35;
    margin: 0 0 0.35rem;
}

.story-regular__commentary {
    font-size: 0.78rem; color: #9890b0;
    line-height: 1.55; margin: 0;
    overflow: hidden; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.story-regular .story-card__bar-wrap--full {
    grid-column: 1 / -1;
    grid-row: 2;
}

/* ============================================================
   INLINE CTA
   ============================================================ */
.feed-cta {
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(18,14,30,0.6));
    border: 1px solid rgba(139,92,246,0.2);
}

.feed-cta__title {
    font-family: var(--font-display);
    font-size: 1.1rem; font-weight: 700;
    color: #d8b4fe;
    margin: 0 0 0.5rem;
}

.feed-cta__text {
    font-size: 0.85rem; color: #9890b0;
    line-height: 1.6; margin: 0 0 1.25rem;
    max-width: 480px; margin-left: auto; margin-right: auto;
}

.feed-cta__btn {
    display: inline-block;
    padding: 10px 28px; border-radius: 9999px; border: none;
    background: var(--accent); color: #fff;
    font-family: var(--font-display);
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(147,102,255,0.3);
}

.feed-cta__btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px rgba(147,102,255,0.4);
}

/* ============================================================
   END OF FEED
   ============================================================ */
.feed-end {
    text-align: center; padding: 2rem 0;
    font-size: 0.8rem; color: var(--text-muted);
    font-family: var(--font-display);
}

/* ============================================================
   LIGHT THEME
   ============================================================ */
[data-theme="light"] .story-featured {
    background: linear-gradient(165deg, rgba(124,58,237,0.06), rgba(255,255,255,0.98) 50%);
    border-color: rgba(139,92,246,0.18);
    box-shadow: 0 4px 30px rgba(0,0,0,0.06), 0 0 60px rgba(124,58,237,0.04);
}

[data-theme="light"] .story-featured:hover {
    border-color: rgba(139,92,246,0.35);
    box-shadow: 0 4px 30px rgba(124,58,237,0.1);
}

[data-theme="light"] .story-featured__title { color: #1a1a2e; }
[data-theme="light"] .story-featured__commentary { color: #4a4a5a; }

[data-theme="light"] .story-small,
[data-theme="light"] .story-regular {
    background: linear-gradient(165deg, rgba(124,58,237,0.04), rgba(255,255,255,0.98) 50%);
    border-color: rgba(139,92,246,0.14);
}

[data-theme="light"] .story-small:hover,
[data-theme="light"] .story-regular:hover {
    border-color: rgba(139,92,246,0.3);
    box-shadow: 0 4px 20px rgba(124,58,237,0.06);
}

[data-theme="light"] .story-small__title,
[data-theme="light"] .story-regular__title { color: #1a1a2e; }
[data-theme="light"] .story-regular__commentary { color: #4a4a5a; }

[data-theme="light"] .feed-cta {
    background: linear-gradient(135deg, rgba(124,58,237,0.04), rgba(255,255,255,0.8));
    border-color: rgba(139,92,246,0.12);
}

[data-theme="light"] .feed-cta__title { color: #7c3aed; }
[data-theme="light"] .feed-cta__text { color: #4a4a5a; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .iri-hero { height: 45vh; min-height: 280px; }

    .feed-container { padding: 1.5rem 0.5rem 3rem; }

    .story-featured__image img,
    .story-featured__image .story-card__placeholder { height: 220px; }

    .story-featured__title { font-size: 1.2rem; }
    .story-featured__commentary { font-size: 0.82rem; }

    .story-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .story-small__image img,
    .story-small__image .story-card__placeholder,
    .story-card__placeholder--sm { height: 160px; }

    .story-regular {
        grid-template-columns: 30% 1fr;
    }

    .story-regular__thumb {
        padding: 0.75rem 0 0.75rem 0.75rem;
    }

    .story-regular__thumb img,
    .story-card__placeholder--thumb {
        width: 100%; height: 100px;
    }

    .story-regular .story-card__bar-wrap--full {
        grid-column: 1 / -1;
    }

    .story-featured__bar { height: 22px; }
    .story-featured__bar-pct { font-size: 0.55rem; }
    .story-featured__bar-label { font-size: 0.5rem; }

    .story-regular__body { padding: 0.75rem; }

    .feed-cta { padding: 2rem 1.25rem; }
    .feed-cta__title { font-size: 1rem; }
}

@media (max-width: 480px) {
    .story-featured__content { padding: 0.75rem 1rem 0.5rem; }
    .story-featured .story-card__bar-wrap { padding: 0 1rem 1rem; }
    .story-featured__title { font-size: 1.1rem; }
}
