/* ==========================================
   THE HORIZON TIMES - PREMIUM EDITORIAL STYLESHEET
   ========================================== */

/* ==========================================
   1. Base Variables & Setup 
   ========================================== */
:root {
    --gold: #d4af37;
    --gold-hover: #b5952f;
    --bg-dark: #050505;      
    --bg-darker: #020202;
    --bg-panel: #0a0a0c;     
    --text-main: #d1d1d1;    
    --text-muted: #888888;   
    --border-color: #222222; 
    --font-head: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

body.article-page-body {
    background-color: var(--bg-dark); 
    color: var(--text-main);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    line-height: 1.8; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. Reading Progress & Loader */
.reading-progress-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: transparent;
    z-index: 10000;
    display: none; 
    pointer-events: none;
}

.reading-progress-bar {
    height: 100%;
    background: var(--gold);
    width: 0%;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

#premium-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-dark);
    display: flex; flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.8s ease;
}

.loader-brand {
    font-family: var(--font-head);
    font-size: 3rem;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.loader-line {
    width: 100px;
    height: 2px;
    background: var(--gold);
    margin: 0 auto;
    animation: loader-grow 2s infinite ease-in-out;
}

@keyframes loader-grow {
    0%, 100% { width: 0; }
    50% { width: 150px; }
}

/* 3. Main Article Layout & Hero */
#article-main {
    display: block; /* FIXED: Was 'none' */
    opacity: 1;     /* FIXED: Was '0' */
    transition: opacity 0.8s ease; 
}

.article-hero-wrapper {
    width: 100%;
    height: 65vh; 
    min-height: 400px; 
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    /* FIXED: Removed clip-path: inset(100% 0 0 0) which was masking the hero image completely */
}

.article-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.65) contrast(1.1) grayscale(15%);
    transform: scale(1);
    will-change: transform;
    transition: transform 1.5s ease-out; /* Added smooth transition back in */
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 50%, rgba(5,5,5,0.8) 100%),
                linear-gradient(to top, rgba(5,5,5,1) 0%, transparent 40%);
    pointer-events: none;
}

.hero-caption {
    position: absolute;
    bottom: 20px; right: 40px;
    font-size: 0.65rem;
    color: var(--gold);
    letter-spacing: 3px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); 
}

.article-content-wrapper {
    max-width: 1200px; 
    margin: 0 auto; 
    position: relative;
    display: flex;
    gap: 60px; 
    padding: 60px 40px;
    z-index: 10;
}

/* 4. Sticky Sidebar */
.article-sidebar {
    width: 60px;
    flex-shrink: 0;
    position: sticky;
    top: 100px; 
    height: max-content;
}

.sticky-share-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.share-label {
    font-size: 0.55rem;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    writing-mode: vertical-rl; 
    transform: rotate(180deg);
}

.sidebar-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    margin: 10px 0;
}

.share-btn {
    background: rgba(255,255,255,0.02); 
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.9rem;
    width: 44px; 
    height: 44px;
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.share-btn:hover { 
    color: var(--bg-dark); 
    background: var(--gold);
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

/* 5. Core Article Styling */
.article-core {
    flex-grow: 1;
    max-width: 800px;
    margin: 0 auto; 
}

.meta-top {
    display: flex;
    flex-wrap: wrap; 
    align-items: center;
    gap: 15px 20px;
    margin-bottom: 25px;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.royal-tag { color: var(--gold); font-weight: 700; }
.read-time { color: var(--text-muted); font-weight: 600; }

.article-headline {
    font-family: var(--font-head);
    font-size: clamp(2rem, 4vw, 4rem); 
    line-height: 1.15;
    margin: 0 0 30px 0;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.article-byline-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 50px; 
}

.author-name { font-weight: 600; font-size: 1.1rem; color: #fff; margin-top: 5px; display: block; }
.date-info { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ==========================================
   6. UPGRADED MASTHEAD (PROPER SPACING & NORMAL FLOW)
   ========================================== */

.masthead {
    position: relative; 
    width: 100%;
    z-index: 2000; 
    background-color: var(--bg-dark);
    padding: 35px 0 35px 0; 
    border-bottom: 1px solid var(--border-color);
    will-change: transform, opacity;
}

.masthead-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.brand-logo {
    font-family: var(--font-head);
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #ffffff;
    margin: 0;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hamburger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 40px;
}
.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--gold);
    transition: all 0.3s ease;
}
.hamburger-btn:hover span {
    background-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ==========================================
   7. Dynamic Body Content 
   ========================================== */
.article-body-content {
    line-height: 1.8;
    font-size: 1.15rem; 
    transition: font-size 0.3s ease;
}

.article-body-content p { 
    margin-bottom: 2.2rem; 
    color: #cccccc;
    font-weight: 300;
}

.article-body-content h2 { 
    color: #fff; 
    font-family: var(--font-head); 
    font-size: 2.2rem;
    margin: 3.5rem 0 1.5rem;
    line-height: 1.3;
}

.article-body-content img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 4px; 
    margin: 2.5rem 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4); 
}

.article-body-content figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    font-style: italic;
}

.article-body-content blockquote {
    border-left: 3px solid var(--gold); 
    padding: 20px 0 20px 30px;
    margin: 3.5rem 0;
    background: linear-gradient(to right, rgba(212, 175, 55, 0.05), transparent);
    font-family: var(--font-head);
    font-style: italic;
    font-size: 1.6rem;
    line-height: 1.5;
    color: var(--gold);
}

/* 8. Newsletter Box */
.newsletter-block {
    background: var(--bg-panel);
    padding: 60px 40px;
    text-align: center;
    border: 1px solid var(--border-color);
    margin-top: 80px;
    border-radius: 8px; 
}

.newsletter-block h3 {
    font-family: var(--font-head);
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: #fff;
}

.newsletter-form { display: flex; justify-content: center; gap: 0; max-width: 550px; margin: 0 auto; }
.newsletter-form input {
    flex-grow: 1; padding: 18px 25px; border: 1px solid var(--border-color); background: var(--bg-dark);
    color: #fff; outline: none; transition: border-color 0.3s;
    border-radius: 4px 0 0 4px;
}
.newsletter-form input:focus { border-color: var(--gold); }
.newsletter-form button {
    background: var(--text-main); color: #000; border: none; padding: 0 35px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: 0.3s;
    border-radius: 0 4px 4px 0;
}
.newsletter-form button:hover { background: var(--gold); }

/* ==========================================
   9. MOBILE RESPONSIVE OPTIMIZATIONS
   ========================================== */

@media (max-width: 1024px) {
    .article-content-wrapper { gap: 40px; padding: 50px 30px;}
    .article-headline { font-size: 2.8rem; }
}

@media (max-width: 768px) {
    .article-content-wrapper { 
        flex-direction: column; 
        gap: 30px; 
        padding: 30px 20px; 
    }
    
    .article-hero-wrapper { height: 45vh; min-height: 300px; }
    .hero-caption { right: 20px; bottom: 15px; font-size: 0.55rem; }
    
    .article-sidebar {
        position: static; 
        width: 100%; 
        border-bottom: 1px solid var(--border-color); 
        padding-bottom: 25px;
        margin-bottom: -10px; 
    }
    .sticky-share-box { 
        flex-direction: row; 
        justify-content: flex-start; 
        flex-wrap: wrap;
    }
    .share-label { 
        writing-mode: horizontal-tb; 
        transform: none; 
        margin: 0 15px 0 0; 
        font-size: 0.65rem;
    }
    .sidebar-divider { width: 30px; height: 1px; margin: 0 10px; }
    
    .article-headline { font-size: 2.2rem; margin-bottom: 20px; line-height: 1.2; }
    .article-body-content { font-size: 1.05rem; }
    .article-body-content h2 { font-size: 1.8rem; margin: 2.5rem 0 1.2rem; }
    .article-body-content blockquote { font-size: 1.3rem; padding: 15px 0 15px 20px; }
    
    .article-byline-box { flex-direction: column; align-items: flex-start; gap: 15px; }
    .newsletter-block { padding: 40px 20px; margin-top: 60px; }
    .newsletter-block h3 { font-size: 1.8rem; }
    .newsletter-form { flex-direction: column; gap: 10px; }
    .newsletter-form input { border-radius: 4px; padding: 15px; text-align: center; }
    .newsletter-form button { border-radius: 4px; padding: 15px; width: 100%; }
}