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

body {
    background-color: #e0dfc2;
    font-family: 'VT323', monospace;
    font-size: 22px; /* Adjusted to match your image */
    color: #1a1a1a;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layer 1: Fluid Warping Background Effect */
.fluid-bg {
    position: fixed;
    top: -10%; left: -10%;
    width: 100%; height: 120%;
    background-image: url('../assets/green_bg.webp'); 
    background-size: cover;
    background-position: center;
    z-index: -3; /* Deepest layer */
    animation: warpEffect 10s ease-in-out infinite alternate;
}

@keyframes warpEffect {
    0% { transform: scale(1) translate(0, 0) skew(0deg); }
    50% { transform: scale(1.05) translate(20px, 15px) skew(1deg); }
    100% { transform: scale(1.1) translate(-10px, -20px) skew(-1deg); }
}

h1 {
    font-weight: normal;
}

h2 {
    font-weight: normal;
}

h3 {
    font-weight: normal;
}

h4 {
    font-weight: normal;
}

a {
    color: #00974a;
}

/* Layer 2: Beige Background Frame Wrapper */
.bg-frame-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    display: flex;
    z-index: -2;
    pointer-events: none;
}

.bg-img-center {
    height: 100vh;
    width: auto;
    display: block;
}

.side-fill {
    flex: 1;
    background-color: #e0dfc2;
}

/* Layer 3: Main Page Wrapper */
.page-wrapper {
    width: 100%;
    max-width: 1000px; /* Narrowed slightly since 3D column is gone */
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1; 
}

/* Shared UI Panel Styling (Inner bevel + Outer drop shadow) */
.panel {
    background-color: #e0dfc2;
    box-shadow: 
        inset 1px 1px 0px #ffffff, 
        inset -1px -1px 0px #b5b3a3,
        5px 5px 15px rgba(0, 0, 0, 0.15); /* Drop shadow from screenshot */
}

/* Top Clock Banner */
.top-banner {
    text-align: center;
    padding: 12px;
    font-size: 26px;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Layout constraints */
.layout-container {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

/* Left Sidebar */
.sidebar-left {
    display: flex;
    flex-direction: column;
    width: 220px;
    gap: 20px;
    position: sticky;
    top: 60px;
}

.profile-pic {
    padding: 12px;
}

.profile-pic img {
    width: 100%;
    display: block;
    border-radius: 8px; /* Added slight rounding to profile pic */
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
}

/* Rounded Navigation Buttons */
.nav-btn {
    text-decoration: none;
    color: #1a1a1a;
    background-color: #e0dfc2;
    padding: 6px 10px;
    text-align: center;
    font-size: 24px;
    border-radius: 8px; /* Rounded pill shape */
    border: 1px solid #b5b3a3;
    box-shadow: inset 1px 1px 0px #ffffff;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.nav-btn:hover {
    background-color: #d1cfbc;
}

.system-status {
    padding: 15px;
    font-size: 16px;
    line-height: 1.2;
}

/* Middle Content Stackable Sections */
.middle-content {
    flex: 1; 
    padding: 30px;
    position: relative; /* Crucial for absolute positioning the watermark */
    overflow: hidden; /* Keeps the watermark inside the borders */
    min-height: 520px; /* Ensures enough height for the watermark */
}

/* Ensures text sits ABOVE the watermark */
.middle-content > * {
    position: relative;
    z-index: 1;
}

.middle-content h1 {
    font-size: 32px;
    font-weight: normal;
}

.middle-content p, .middle-content ul {
    line-height: 1.2;
}

.middle-content ul {
    list-style-type: "- ";
    padding-left: 20px;
}


hr {
    border: none;
    height: 2px;
    background-color: #000;
    margin: 20px 0;
}

.verse-container-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.vertical-line {
    height: 100px;
    width: 2px;
    background-color: #000;
    margin-right: 15px;
}

#verse-container {
    flex: 1;
}

/* Watermark Image Effect */
.watermark-chibi {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 380px;
    opacity: 0.15; /* Fades the image drastically */
    filter: grayscale(100%); /* Removes color to make it look like a sketch */
    z-index: 0;
    pointer-events: none; /* Allows user to select text over the image */
    user-select: none;
}

.chibi-bg {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 380px;
    opacity: 0.8; /* Fades the image drastically */
    filter: grayscale(100%); /* Removes color to make it look like a sketch */
    z-index: 0;
    pointer-events: none; /* Allows user to select text over the image */
    user-select: none;
}

/* Base Hamburger Button Styles (Hidden by default) */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-family: 'VT323', monospace;
    font-size: 30px;
    color: #1a1a1a;
    cursor: pointer;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
}


/* Activate Mobile Layout for screens 768px and smaller */
@media (max-width: 768px) {
    /* Show the hamburger icon */
    .hamburger {
        display: block; 
    }

    /* Change padding to fit mobile screens better */
    .page-wrapper {
        padding: 15px; 
    }

    /* Stack layout vertically instead of side-by-side */
    .layout-container {
        flex-direction: column; 
    }

    /* Hide the left sidebar by default and make it full width */
    .sidebar-left {
        display: none;
        width: 100%;
        position: sticky;
        top: 60px;
        z-index: 9;
    }

    /* Class added by Javascript when hamburger is clicked */
    .sidebar-left.active {
        display: flex; 
    }

    /* Shrink the watermark slightly so it doesn't break mobile boundaries */
    .chibi-bg {
        width: 280px;
        right: -10px;
        bottom: -10px;
    }

    .article-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .article-thumb {
        width: 100%;
        max-width: 250px;
        height: auto;
        aspect-ratio: 16/9; /* Makes it a nice widescreen thumbnail on mobile */
    }

    .article-write-up img {
        width: 100%;
        max-width: 250px;
        height: auto;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Safety constraint: Force display if window is resized back to desktop */
@media (min-width: 769px) {
    .sidebar-left {
        display: flex !important;
    }
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1; /* Ensures cards float ABOVE the chibi watermark */
    margin-bottom: 20px; /* Gives padding so the last card doesn't hit the bottom edge */
}

.article-card {
    display: flex;
    gap: 20px;
    padding: 15px;
    text-decoration: none; /* Removes link underline */
    color: #1a1a1a;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

/* Hover effect matching your navigation buttons */
.article-card:hover {
    background-color: #d1cfbc; 
}

/* RSS Subscribe Link styling – matches navigation button look */
.rss-subscribe {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    text-align: center;
}
.rss-subscribe a {
    text-decoration: none;
    color: #1a1a1a;
    background-color: #e0dfc2;
    padding: 6px 10px;
    border: 1px solid #b5b3a3;
    border-radius: 8px;
    box-shadow: inset 1px 1px 0px #ffffff;
    cursor: pointer;
    transition: background-color 0.1s ease;
    display: inline-block;
    font-size: 16px;
}
.rss-subscribe a:hover {
    background-color: #d1cfbc;
}


/* The thumbnail image */
.article-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #b5b3a3;
    background-color: #e0dfc2;
    flex-shrink: 0; /* Prevents the image from squishing if text is long */
}

/* Container for Title and Description */
.article-info {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically centers text next to the image */
    flex: 1;
}

.article-info .timestamp {
    font-weight: normal;
    color: #777569;
    text-align: right;
}

.article-info h2 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: normal;
}

.article-info p {
    font-size: 20px;
    line-height: 1.2;
}

.article-write-up p {
    padding-top: 10px;
    padding-bottom: 10px;
}

.article-write-up img {
    max-width: 635px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #b5b3a3;
    background-color: #e0dfc2;
    flex-shrink: 0;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Art Grid Layout */
.art-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    align-items: start;
}

/* Base style for headers to make them span all columns */
.grid-header {
    grid-column: 1 / -1; /* This makes it span the full width */
    margin: 20px 0 10px 0;
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(0,0,0,0.1);
    width: 100%;
}

.year-header {
    font-size: 2.5rem;
    color: #000;
    margin-top: 40px;
}

.month-header {
    font-size: 1.5rem;
    color: #000;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}

/* Ensure the art items don't look weird next to headers */
.art-item {
    display: flex;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid #b5b3a3;
    align-items: center;
}

.art-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the square without stretching */
    display: block;
}

/* Hover Effect */
.art-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10;
}

/* Status / Footer text */
.art-status {
    text-align: center;
    padding: 40px 0;
    font-size: 24px;
}

/* Lightbox Modal Styles */
.art-modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: #e0dfc2;
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.modal-close {
    position: absolute;
    top: 20px; right: 35px;
    color: #fff;
    font-size: 60px;
    cursor: pointer;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .art-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 wide on small phones */
    }
}
