/**
 * HEIMWEER VERHAAL STYLESHEET v5.0
 * Alle styling voor verhaalpagina's.
 * GEEN inline CSS nodig behalve --tier-color en region-hero background.
 *
 * SECTIES:
 * 1. HW Logo Theme Swap
 * 2. Region Hero
 * 3. Language Switcher
 * 4. Story Intro
 * 5. HW Crest Divider
 * 6. Chapters
 * 7. Original Button (active + disabled)
 * 8. Story Source
 * 9. HW Branding
 * 10. Ad Space
 * 11. Sidebar
 * 12. Responsive
 */

/* ============================================================
   1. HW LOGO THEME SWAP
   ============================================================ */
.hw-logo-white { display: inline-block; }
.hw-logo-black { display: none; }
[data-theme="light"] .hw-logo-white { display: none; }
[data-theme="light"] .hw-logo-black { display: inline-block; }

/* ============================================================
   1b. STORY NAV (Terug / Verhalen / Home)
   ============================================================ */
.story-nav {
    padding: 12px 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

[data-theme="light"] .story-nav {
    background: rgba(255,255,255,0.8);
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.btn-story-nav {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 16px;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-story-nav:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.btn-story-nav i {
    margin-right: 5px;
}

[data-theme="light"] .btn-story-nav {
    color: rgba(0,0,0,0.6);
}

[data-theme="light"] .btn-story-nav:hover {
    color: #000;
    background: rgba(0,0,0,0.06);
}

/* ============================================================
   2. REGION HERO
   ============================================================ */
.region-hero {
    background-size: cover;
    background-position: center;
    padding: 100px 0;
    border-bottom: 5px solid var(--tier-color);
    margin-bottom: 0;
}

.shield-img, .flag-img {
    max-width: 100px;
    height: auto;
    filter:
        drop-shadow(0 0 8px rgba(0,0,0,1))
        drop-shadow(0 0 15px rgba(0,0,0,0.8))
        drop-shadow(0 4px 20px rgba(111,66,193,0.6));
}

.region-badge {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #ffc107;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000,
        -2px 2px 0 #000, 2px 2px 0 #000,
        0 0 10px rgba(0,0,0,0.9),
        0 0 20px rgba(0,0,0,0.7);
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(32px, 5vw, 56px);
    color: #fff;
    margin-bottom: 25px;
    font-weight: 700;
    text-shadow:
        -3px -3px 0 #000, 3px -3px 0 #000,
        -3px 3px 0 #000, 3px 3px 0 #000,
        -3px 0 0 #000, 3px 0 0 #000,
        0 -3px 0 #000, 0 3px 0 #000,
        0 0 15px rgba(0,0,0,0.9),
        0 0 30px rgba(0,0,0,0.8),
        0 4px 40px rgba(111,66,193,0.5);
    -webkit-text-stroke: 2px black;
    paint-order: stroke fill;
}

.hero-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-meta span {
    background: rgba(0,0,0,0.85);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 15px;
    border: 3px solid rgba(0,0,0,0.9);
    box-shadow: 0 0 10px rgba(0,0,0,0.8), 0 4px 20px rgba(0,0,0,0.6);
}

.tier-badge {
    background: var(--tier-color) !important;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.3) !important;
}

/* ============================================================
   3. LANGUAGE SWITCHER
   ============================================================ */
.language-switcher {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 12px 24px;
    border: 2px solid var(--tier-color);
    border-radius: 8px;
    background: rgba(111,66,193,0.1);
    color: var(--tier-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lang-btn:hover, .lang-btn.active {
    background: var(--tier-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111,66,193,0.4);
}

.lang-btn .fi {
    font-size: 18px;
    border-radius: 2px;
}

/* ============================================================
   4. STORY INTRO
   ============================================================ */
.story-intro {
    background: linear-gradient(135deg, rgba(111,66,193,0.15) 0%, rgba(111,66,193,0.05) 100%);
    padding: 35px;
    border-left: 5px solid var(--tier-color);
    border-radius: 12px;
    margin-bottom: 50px;
    font-size: 19px;
    line-height: 1.9;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.story-intro p { margin-bottom: 20px; }

/* INITIAAL — Eerste letter als middeleeuwse miniatuur */
.story-intro p:first-of-type::first-letter {
    font-family: 'Cinzel', serif;
    font-size: 5.5em;
    float: left;
    line-height: 0.75;
    margin: 8px 12px 0 0;
    padding: 4px 8px;
    color: var(--tier-color);
    font-weight: 700;
    text-shadow:
        0 0 10px rgba(111,66,193,0.3),
        0 0 30px rgba(111,66,193,0.15);
    background: linear-gradient(135deg, rgba(111,66,193,0.12) 0%, transparent 100%);
    border-left: 3px solid var(--tier-color);
    border-bottom: 3px solid var(--tier-color);
}

[data-theme="light"] .story-intro p:first-of-type::first-letter {
    text-shadow:
        0 0 10px rgba(111,66,193,0.15),
        0 0 30px rgba(111,66,193,0.08);
}

/* ============================================================
   5. HW CREST DIVIDER
   ============================================================ */
.hw-divider {
    text-align: center;
    margin: 40px 0;
    position: relative;
}

.hw-divider::before, .hw-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 50px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tier-color), transparent);
}

.hw-divider::before { left: 0; }
.hw-divider::after { right: 0; }

.hw-divider img {
    height: 65px;
    width: auto;
    opacity: 0.85;
    transition: opacity 0.3s;
}

.hw-divider:hover img { opacity: 1; }

/* ============================================================
   6. CHAPTERS
   ============================================================ */
.chapter {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 2px dotted #333;
}

.chapter:last-of-type { border-bottom: none; }

.chapter-title {
    font-family: 'Cinzel', serif;
    font-size: 36px;
    color: var(--tier-color);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.chapter-number {
    background: linear-gradient(135deg, var(--tier-color), #8b5cf6);
    color: #fff;
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-family: Arial, sans-serif;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(111,66,193,0.4);
}

.chapter-content {
    font-size: 18px;
    line-height: 1.9;
    color: #d1d5db;
}

.chapter-content p { margin-bottom: 25px; }

[data-theme="light"] .chapter-content { color: #374151; }

/* ============================================================
   7. ORIGINAL BUTTON (ALTIJD AANWEZIG)
   ============================================================ */
.btn-original {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border: 2px solid var(--tier-color);
    border-radius: 10px;
    background: rgba(111,66,193,0.1);
    color: var(--tier-color);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s;
    margin: 30px 0;
}

.btn-original:hover {
    background: var(--tier-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(111,66,193,0.4);
}

.btn-original i { font-size: 18px; }

/* Greyed out wanneer geen origineel beschikbaar */
.btn-original.disabled {
    border-color: #444;
    color: #555;
    background: rgba(50,50,50,0.3);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.5;
}

[data-theme="light"] .btn-original.disabled {
    border-color: #ccc;
    color: #999;
    background: rgba(200,200,200,0.2);
}

/* ============================================================
   8. STORY SOURCE
   ============================================================ */
.story-source {
    background: rgba(111,66,193,0.1);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(111,66,193,0.3);
    margin-top: 30px;
    font-style: italic;
}

/* ============================================================
   8b. TRIVIA ("Wist je dat?")
   ============================================================ */
.hw-trivia {
    margin: 30px 0;
    padding: 18px 22px;
    border-left: 4px solid var(--tier-color, #4A90E2);
    background: rgba(74, 144, 226, 0.06);
    border-radius: 0 10px 10px 0;
    font-size: 0.93rem;
    line-height: 1.7;
    color: #ccc;
    max-width: 100%;
    box-sizing: border-box;
}

.hw-trivia i {
    color: var(--tier-color, #4A90E2);
    margin-right: 6px;
    font-size: 1rem;
    vertical-align: baseline;
}

.hw-trivia strong {
    color: var(--tier-color, #4A90E2);
    margin-right: 4px;
    white-space: nowrap;
}

[data-theme="light"] .hw-trivia {
    background: rgba(74, 144, 226, 0.07);
    color: #444;
}

@media (max-width: 768px) {
    .hw-trivia {
        padding: 14px 16px;
        font-size: 0.88rem;
        margin: 20px 0;
    }
}

/* ============================================================
   9. HW BRANDING
   ============================================================ */
.hw-branding {
    text-align: center;
    margin: 50px 0 30px;
    padding: 30px;
    border-top: 1px solid #333;
    opacity: 1;
    transition: opacity 0.3s;
}

.hw-branding:hover { opacity: 1; }

.hw-branding img {
    height: 50px;
    width: auto;
    margin-bottom: 10px;
}

.hw-branding p {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: #9ca3af;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}

[data-theme="light"] .hw-branding { border-top-color: #ddd; }
[data-theme="light"] .hw-branding p { color: #6b7280; }

/* ============================================================
   10. AD SPACE
   ============================================================ */
.ad-space {
    text-align: center;
    margin: 30px 0;
}

.ad-leaderboard {
    padding: 4px 0;
}

.ad-content {
    margin: 40px 0;
}

.ad-sidebar {
    margin-bottom: 25px;
}

/* Placeholder (verwijderen zodra echte ads) */
.ad-placeholder {
    background: rgba(50,50,50,0.3);
    border: 1px dashed #444;
    border-radius: 8px;
    padding: 30px;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

[data-theme="light"] .ad-placeholder {
    background: rgba(0,0,0,0.03);
    border-color: #ddd;
    color: #bbb;
}

/* ============================================================
   11. SIDEBAR
   ============================================================ */
.sidebar-card {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

[data-theme="light"] .sidebar-card {
    background: #fff;
    border-color: #e5e7eb;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.sidebar-card h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--tier-color);
    border-bottom: 2px solid var(--tier-color);
    padding-bottom: 12px;
    font-weight: 600;
}

.sidebar-card h3 i { margin-right: 8px; }

.btn-outline-tier {
    border-color: var(--tier-color);
    color: var(--tier-color);
    background: transparent;
    border-width: 2px;
}

.btn-outline-tier:hover {
    background: var(--tier-color);
    border-color: var(--tier-color);
    color: #fff;
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-list li { margin-bottom: 15px; }

.link-list a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-list a:hover { color: var(--tier-color); }

[data-theme="light"] .link-list a { color: #6b7280; }

/* ============================================================
   12. RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .region-hero { padding: 60px 0; }
    .shield-img, .flag-img { max-width: 60px; }
    .chapter-title { font-size: 28px; }
    .ad-leaderboard { min-height: 60px; }
}

@media (max-width: 768px) {
    .hero-meta { gap: 10px; }
    .hero-meta span { padding: 8px 14px; font-size: 13px; }
    .language-switcher { gap: 8px; }
    .lang-btn { padding: 10px 16px; font-size: 14px; }
    .hw-divider img { height: 45px; }
    .btn-original { padding: 12px 20px; font-size: 14px; }
    .ad-sidebar { min-height: 100px; }
}
