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

body {
    font-family: 'Times New Roman', Times, serif;
    background-color: #2c2c2c;
    /* Dark background */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Stack Layout (Index Page) - Preserved */
.stack-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 60px 100px;
    padding-left: 200px;
    overflow-x: auto;
    width: 100%;
    min-height: 100vh;
    scrollbar-width: none;
}

.newspaper-item {
    position: relative;
    flex: 0 0 auto;
    width: 300px;
    height: 420px;
    background-color: #f4f1ea;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, margin 0.3s ease;
    cursor: pointer;
    border: 1px solid #444;
    margin-left: -150px;
}

.newspaper-item:first-child {
    margin-left: 0;
}

.newspaper-item:hover {
    transform: translateY(-40px) rotate(2deg);
    z-index: 100 !important;
    margin-right: 50px;
    margin-left: -100px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.newspaper-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ------------------------------------------------ */
/* Focus Slider Viewer Layout                       */
/* ------------------------------------------------ */

body.viewer-mode {
    background-color: #1a1a1a;
    overflow: hidden;
}

.viewer-stage {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    /* We will translate this container to slide */
    overflow: visible;
}

.slider-track {
    display: flex;
    align-items: center;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    /* We will calculate position in JS */
}

.slide-page {
    /* Height dictates the size */
    height: 95vh;
    width: auto;
    /* Let image decide width */
    flex-shrink: 0;
    margin: 0;
    /* No gap */
    position: relative;
    opacity: 0.3;
    filter: grayscale(100%);
    transition: all 0.5s ease;
    cursor: pointer;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    /* Subtle seam */
}

.slide-page:last-child {
    border-right: none;
}

.slide-page img {
    height: 100%;
    width: auto;
    /* Maintain aspect ratio */
    display: block;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    /* Unified shadow */
}

/* Active State */
.slide-page.active {
    opacity: 1;
    filter: grayscale(0%);
    z-index: 10;
}

/* Minimalist Back Button */
.back-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    z-index: 2000;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.back-btn svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.back-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Navigation Arrow */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-arrow.next {
    right: 30px;
}

.nav-arrow.prev {
    left: 100px;
    /* Offset from back button */
}

.nav-arrow svg {
    stroke: white;
    width: 30px;
    height: 30px;
}