/* ================================
   ENHANCED MAGAZINE ARTICLE READER
   TheRoamist.com - Premium Edition
   With StyleType System
   ================================ */

:root {
    --rust-orange: #ff6b35;
    --deep-rust: #b43a24;
    --warm-sand: #e8dcc4;
    --earth-brown: #5c4a42;
    --text-dark: #2a2a2a;
    --text-light: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
}

/* ================================
   GLASSMORPHISM READER OVERLAY
   ================================ */

.article-reader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.article-reader-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Blurred Backdrop */
.reader-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
}

/* Enhanced Glassmorphism Plate */
.reader-plate {
    position: relative;
    width: 95%;
    max-width: 1100px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    padding: 0;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.article-reader-overlay.active .reader-plate {
    transform: scale(1) translateY(0);
}

/* Close/Back Button */
.reader-close {
    position: absolute;
    top: 25px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 25px;
    padding: 12px 20px;
    color: var(--text-light);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.reader-close:hover {
    background: rgba(255, 107, 53, 0.4);
    border-color: var(--rust-orange);
    transform: translateX(-3px);
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.3);
}

.reader-close svg {
    width: 20px;
    height: 20px;
}

/* Scrollable Content Area */
.reader-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 80px 60px 60px 60px;
    position: relative;
}

/* Custom Enhanced Scrollbar */
.reader-content::-webkit-scrollbar {
    width: 10px;
}

.reader-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin: 10px 0;
}

.reader-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--rust-orange), var(--deep-rust));
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.05);
}

.reader-content::-webkit-scrollbar-thumb:hover {
    background: var(--rust-orange);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

/* ================================
   MAGAZINE HEADER
   ================================ */

.article-header {
    margin-bottom: 50px;
    text-align: center;
    position: relative;
}

.article-header .community-tag {
    display: inline-block;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--rust-orange), var(--deep-rust));
    color: white;
    border-radius: 25px;
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 20px;
    text-transform: uppercase;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.article-header h1 {
    font-size: 3.5em;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--rust-orange), var(--warm-sand));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -1px;
}

.article-meta {
    display: flex;
    gap: 20px;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1em;
    margin-bottom: 40px;
}

/* ================================
   HERO IMAGE WITH GLOW
   ================================ */

.article-hero-image {
    width: 100%;
    margin: 0 0 60px 0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 107, 53, 0.2);
}

.article-hero-image::before {
    content: '';
    position: absolute;
    inset: -10px;
    background: linear-gradient(135deg, 
        rgba(255, 107, 53, 0.3), 
        rgba(180, 58, 36, 0.3));
    filter: blur(20px);
    z-index: -1;
    opacity: 0.6;
}

.article-hero-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

/* ================================
   SECTION IMAGES (Dynamic)
   ================================ */

.section-image {
    width: 100%;
    margin: 50px 0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 107, 53, 0.15);
}

.section-image.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-image::before {
    content: '';
    position: absolute;
    inset: -10px;
    background: linear-gradient(135deg, 
        rgba(255, 107, 53, 0.25), 
        rgba(180, 58, 36, 0.25));
    filter: blur(20px);
    z-index: -1;
    opacity: 0.5;
}

.section-image img {
    width: 100%;
    height: auto;
    display: block;
}

.section-image figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    font-size: 0.9em;
    font-style: italic;
}

/* ================================
   MAGAZINE TEXT LAYOUT
   ================================ */

.article-body {
    font-size: 1.15em;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.92);
    max-width: 900px;
    margin: 0 auto;
}

/* Drop Cap - First Letter */
.article-body p:first-of-type::first-letter {
    font-size: 4.5em;
    line-height: 0.85;
    float: left;
    margin: 8px 12px 0 0;
    font-weight: 700;
    background: linear-gradient(135deg, var(--rust-orange), var(--deep-rust));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-body p {
    margin-bottom: 30px;
    text-align: justify;
}

/* Section Headers */
.article-body h2 {
    font-size: 2.2em;
    margin: 60px 0 30px 0;
    color: var(--rust-orange);
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    padding-bottom: 15px;
}

.article-body h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--rust-orange), transparent);
}

.article-body h3 {
    font-size: 1.6em;
    margin: 40px 0 20px 0;
    color: rgba(255, 255, 255, 0.95);
}

.article-body strong {
    color: var(--rust-orange);
    font-weight: 600;
}

.article-body em {
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
}

/* ================================
   PARALLAX PULL QUOTES
   ================================ */

.pull-quote {
    position: relative;
    margin: 60px 0;
    padding: 40px 50px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border-left: 5px solid var(--rust-orange);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.pull-quote::before {
    content: '"';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 6em;
    color: var(--rust-orange);
    opacity: 0.2;
    font-family: Georgia, serif;
    line-height: 0.8;
}

.pull-quote p {
    font-size: 1.4em;
    line-height: 1.6;
    font-style: italic;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Parallax effect on scroll */
.pull-quote.parallax {
    transform: translateZ(20px) scale(0.98);
}

/* ================================
   CINEMATIC MODE - CRAZY ANIMATIONS
   ================================ */

/* Cinematic Images - Slide in from sides */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%) rotate(5deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

.cinematic-mode .section-image:nth-child(odd).visible {
    animation: slideInLeft 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cinematic-mode .section-image:nth-child(even).visible {
    animation: slideInRight 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Cinematic Pull Quotes - Letter Scramble Effect */
@keyframes letterScramble {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: scale(0.8) rotateX(90deg);
    }
    50% {
        opacity: 0.5;
        filter: blur(5px);
        transform: scale(1.1) rotateX(45deg);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1) rotateX(0deg);
    }
}

.cinematic-mode .pull-quote.visible {
    animation: letterScramble 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cinematic-mode .pull-quote p {
    animation: letterScramble 1.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Enhanced glow for cinematic mode */
.cinematic-mode .section-image::before {
    opacity: 0.8;
    filter: blur(30px);
}

/* ================================
   MINIMAL MODE - SIMPLE EFFECTS
   ================================ */

.minimal-mode .section-image.visible {
    animation: fadeIn 0.6s ease;
}

.minimal-mode .pull-quote.visible {
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subtle glow for minimal mode */
.minimal-mode .section-image::before {
    opacity: 0.3;
}

/* ================================
   FADE IN ANIMATIONS (DEFAULT)
   ================================ */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 768px) {
    .reader-plate {
        width: 98%;
        height: 95vh;
        border-radius: 20px;
    }

    .reader-content {
        padding: 70px 30px 40px 30px;
    }

    .reader-close {
        top: 15px;
        left: 15px;
        padding: 10px 15px;
        font-size: 0.85em;
    }

    .article-header h1 {
        font-size: 2.2em;
    }

    .article-body {
        font-size: 1em;
    }

    .article-body p:first-of-type::first-letter {
        font-size: 3.5em;
    }

    .article-body h2 {
        font-size: 1.8em;
    }

    .pull-quote {
        padding: 30px 25px;
        margin: 40px 0;
    }

    .pull-quote p {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .reader-close span {
        display: none;
    }

    .article-header h1 {
        font-size: 1.8em;
    }

    .article-body p:first-of-type::first-letter {
        font-size: 3em;
    }
}