/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    overflow-x: hidden;
    background: #000;
    color: #fff;
    height: 100%;
    position: relative;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

/* Section */
.section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Card Preview (Left Side) */
.card-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    z-index: 80;
    overflow: hidden;
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-preview.active {
    transform: translateX(0);
}

.preview-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.4) contrast(1.1);
    transition: filter 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.card-preview.active .preview-image {
    filter: brightness(0.3) contrast(1.2) saturate(1.1);
    opacity: 1;
}

/* Preview Overlay */
.preview-overlay {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 81;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
    pointer-events: none;
}

.card-preview.active .preview-overlay {
    opacity: 0.8;
    transform: translateY(0);
}

.preview-number {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ff6b00;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
}

.preview-source {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Preview Label */
.preview-label {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
    pointer-events: none;
}

.card-preview.active .preview-label {
    opacity: 1;
    transform: translateY(0);
}

.preview-label svg {
    width: 16px;
    height: 16px;
}

/* Article Sidebar (Right Side) */
.article-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: #000;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.article-sidebar.active {
    transform: translateX(0);
}

/* Close Button */
.article-close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 101;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.article-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(90deg);
}

.article-close-btn svg {
    width: 20px;
    height: 20px;
}

/* Article Content */
.article-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6rem 3rem 3rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ff6b00 rgba(255, 255, 255, 0.1);
}

/* Webkit Scrollbar Styles */
.article-content::-webkit-scrollbar {
    width: 6px;
}

.article-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.article-content::-webkit-scrollbar-thumb {
    background: #ff6b00;
    border-radius: 3px;
}

.article-content::-webkit-scrollbar-thumb:hover {
    background: #ff8533;
}

/* Cards Container */
.cards-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Hide cards when article is open */
.article-sidebar.active ~ .cards-container {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

/* Individual Card */
.card {
    position: relative;
    flex: 1;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: flex, transform, filter;
    min-width: 0;
}

.card:hover {
    flex: 1.5;
    z-index: 10;
}

/* Image Wrapper */
.image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.image-container {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

.card:hover .image-container {
    transform: scale(1.1);
}

/* Card Inner Content */
.card-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    pointer-events: none;
}

/* Main Heading in Card */
.main-heading {
    font-family: 'Anton', sans-serif;
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.card:hover .main-heading {
    opacity: 1;
    transform: translateY(0);
}

/* Card Overlay (Number and Source) */
.card-overlay {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 3;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card:hover .card-overlay {
    opacity: 1;
}

.card-number {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #ff6b00;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
}

.card-source {
    font-family: 'Oswald', sans-serif;
    font-size: 0.875rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Scrolling Text Wrapper */
.scroll-type-wrapper {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
    pointer-events: none;
}

.card:hover .scroll-type-wrapper {
    opacity: 1;
    transform: translateY(0);
}

.scroll-type {
    display: flex;
    animation: scrollText 20s linear infinite;
    white-space: nowrap;
    padding: 0.5rem 0;
}

.row-scroll {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-right: 2rem;
}

.divider-scroll {
    width: 4px;
    height: 4px;
    background: #ff6b00;
    border-radius: 50%;
}

.small-text {
    font-family: 'Oswald', sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.small-text.tag {
    color: #ff6b00;
    font-weight: 600;
}

/* Scroll Text Animation */
@keyframes scrollText {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Article Styles */
.article {
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.article.loaded {
    opacity: 1;
    transform: translateY(0);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.article-number {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #ff6b00;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.article-source {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.article-credit {
    font-family: 'Oswald', sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: right;
}

.article-title {
    font-family: 'Anton', sans-serif;
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    color: white;
}

.article-origin {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
}

.article-link {
    color: #ff6b00;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-link:hover {
    color: #ff8533;
    text-decoration: underline;
}

.article-divider {
    height: 2px;
    background: #ff6b00;
    margin: 3rem 0;
    width: 60px;
}

.article-divider.orange {
    background: #ff6b00;
}

.article-body {
    font-size: 1.125rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}

.article-paragraph {
    margin-bottom: 2rem;
}

.drop-cap {
    font-size: 4em;
    line-height: 0;
    color: #ff6b00;
    float: left;
    margin-right: 0.2em;
    margin-top: 0.1em;
    font-weight: bold;
}

.drop-cap.orange {
    color: #ff6b00;
}

/* Article Gallery */
.article-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-image {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-caption {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.gallery-caption a {
    color: #ff6b00;
    text-decoration: none;
}

.gallery-caption a:hover {
    text-decoration: underline;
}

/* Article Footer */
.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.read-full-link {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: #ff6b00;
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
    transition: gap 0.3s ease;
}

.read-full-link:hover {
    gap: 1.5rem;
}

.read-full-link svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.read-full-link:hover svg {
    transform: translateX(5px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.close-link {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 2001;
}

.close-icon {
    width: 24px;
    height: 24px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-icon:hover {
    opacity: 1;
}

.button {
    display: inline-block;
    padding: 1rem 2rem;
    background: #ff6b00;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.1em;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    font-family: 'Oswald', sans-serif;
}

.button:hover {
    background: #ff8533;
    transform: translateY(-2px);
}

.modal-button {
    margin-bottom: 3rem;
    font-size: 1.25rem;
    padding: 1.5rem 3rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    max-width: 600px;
    width: 100%;
}

.modal-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.modal-link:hover {
    color: #ff6b00;
}

.fix-button {
    background: transparent;
    border: 2px solid #ff6b00;
    color: #ff6b00;
}

.fix-button:hover {
    background: #ff6b00;
    color: #000;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
    animation: bounce 2s infinite;
    z-index: 102;
    pointer-events: none;
}

.scroll-text {
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    animation: scrollArrow 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

@keyframes scrollArrow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 0, 0.3);
}

.error-message h2 {
    font-family: 'Anton', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ff6b00;
}

.error-message p {
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.retry-btn {
    padding: 0.75rem 1.5rem;
    background: #ff6b00;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.retry-btn:hover {
    background: #ff8533;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .card-preview,
    .article-sidebar {
        width: 60%;
    }
    
    .article-content {
        padding: 5rem 2.5rem 2.5rem;
    }
}

@media (max-width: 992px) {
    .card-preview,
    .article-sidebar {
        width: 70%;
    }
    
    .article-content {
        padding: 5rem 2rem 2rem;
    }
    
    .card-overlay,
    .preview-overlay {
        top: 1.5rem;
        left: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Mobile: article takes full screen, preview hidden */
    .card-preview {
        display: none;
    }
    
    .article-sidebar {
        width: 100%;
    }
    
    /* Cards container becomes vertical on mobile */
    .cards-container {
        flex-direction: column;
    }
    
    .card {
        flex: 1;
        height: 20vh;
        min-width: 100%;
    }
    
    .card:hover {
        flex: 1.2;
    }
    
    .article-close-btn {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
    
    .article-content {
        padding: 4rem 1.5rem 1.5rem;
    }
    
    .article-header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .article-credit {
        text-align: left;
    }
    
    .article-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .article-gallery {
        grid-template-columns: 1fr;
    }
    
    .gallery-image {
        height: 250px;
    }
    
    .modal-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .card {
        height: 25vh;
    }
    
    .article-content {
        padding: 4rem 1rem 1rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .preview-number,
    .card-number {
        font-size: 0.875rem;
    }
    
    .preview-source,
    .card-source {
        font-size: 0.75rem;
    }
    
    .main-heading {
        font-size: 1.25rem;
    }
}

/* Border between preview and article on desktop */
@media (min-width: 769px) {
    .card-preview.active::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 1px;
        height: 100%;
        background: linear-gradient(to bottom, 
            transparent, 
            rgba(255, 107, 0, 0.3), 
            transparent);
        z-index: 82;
    }
}

/* Smooth transitions for all interactive elements */
a, button, .card, .article-close-btn {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Loading screen styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 107, 0, 0.3);
    border-radius: 50%;
    border-top-color: #ff6b00;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}