/* --- 90s Minimal Theme --- */
body {
    background-color: #C0C0C0; /* Classic 90s Web Grey */
    font-family: 'Times New Roman', Times, serif;
    color: #000000;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 750px;
    margin: 0 auto;
    background-color: #C0C0C0;
    border: 2px solid #000;
    box-shadow: 5px 5px 0px #808080; /* Simple 3D effect */
}

header, main, footer {
    padding: 10px 25px;
}

header h1 a {
    color: #000000;
    text-decoration: none;
    border-bottom: 3px solid #FFFF00; /* Bright Yellow Accent */
}

/* Post list on homepage */
.post-list {
    list-style-type: none;
    padding: 0;
}

.post-list li {
    margin-bottom: 15px;
}

.post-list li a {
    font-size: 1.2em;
    text-decoration: underline;
    color: #00008B; /* Dark blue for links */
}

.post-list li a:hover {
    background-color: #FFFF00; /* Bright Yellow Accent on hover */
    color: #000;
}

.post-meta {
    display: block;
    font-size: 0.8em;
    color: #555;
    margin-top: 5px;
}

/* Single Post Styles */
.post-title {
    border-bottom: 3px solid #FFFF00; /* Bright Yellow Accent */
    padding-bottom: 10px;
}

.post-content {
    margin-top: 20px;
}

.post-content a {
    color: #0000FF; /* Classic hyperlink blue */
}

.post-content a:hover {
    background-color: #FFFF00;
}

.post-content blockquote {
    margin: 1.5em 10px;
    padding: 1em 10px;
    border-left: 5px solid #FFFF00; /* Bright Yellow Accent */
    background-color: #B0B0B0;
}

.post-content code {
    background: #FFF;
    padding: 2px 4px;
    border: 1px solid #000;
}

footer {
    text-align: center;
    font-size: 0.8em;
    margin-top: 40px;
    border-top: 2px solid #000;
}

/* --- Byline and Header Button Styles --- */

.byline-container {
    text-align: left;
    margin-top: -10px; /* Tucks it nicely under the main title */
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000;
}

.byline {
    margin-bottom: 15px;
    font-style: italic;
    font-size: 1.1em;
}

.button-container {
    display: flex; /* Allows buttons to sit nicely in the center */
    gap: 15px;
}

.header-button {
    text-decoration: none;
    color: #000000;
    border: 2px solid #000;
    padding: 5px 15px;
    background-color: #C0C0C0; /* Same as the page background */
    box-shadow: 3px 3px 0px #313131; /* 90s button raised effect */
    font-weight: bold;
    transition: all 0.1s ease-in-out; /* Smooths the effect slightly */
}

.header-button:hover {
    background-color: #FFFF00; /* The yellow accent on hover */
}

.header-button:active {
    /* This creates the "pushed in" effect when clicked */
    box-shadow: 1px 1px 0px #808080;
    transform: translate(2px, 2px);
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    display: block;
    animation: zoomIn 0.3s ease;
    /* Fix for rotated images */
    image-orientation: from-image;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1000;
}

.lightbox-close:hover {
    color: #FFFF00; /* Your yellow accent */
}

/* Make images in posts clickable */
.post-content img {
    cursor: zoom-in;
    transition: opacity 0.3s;
}

.post-content img:hover {
    opacity: 0.9;
}

/* Loading spinner */
.lightbox-spinner {
    display: none;
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #FFFF00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.lightbox.loading .lightbox-spinner {
    display: block;
}

.lightbox.loading .lightbox-content {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 100%;
        max-height: 100%;
    }
    
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 35px;
    }
}

/* Cloudflare Image Styles */
.cf-image-figure {
    margin: 2em 0;
    text-align: center;
}

.cf-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    cursor: zoom-in;
    /* Fix for rotated images */
    image-orientation: from-image;
}

.cf-image-figure figcaption {
    margin-top: 0.5em;
    font-style: italic;
    font-size: 0.9em;
    color: #666;
}

/* For side-by-side images - FIXED */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
    margin: 2em 0;
}

/* Three column grid - FIXED */
.image-grid.three-column {
    grid-template-columns: repeat(3, 1fr);
}

/* Ensure images in grid stay within bounds */
.image-grid .cf-image-figure {
    margin: 0;
    width: 100%;
}

.image-grid .cf-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Center single images */
.cf-image-figure.center {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Historical image styling */
.cf-image-figure.historical img {
    border: 3px solid #808080;
    box-shadow: 3px 3px 0px #000;
}

/* Full width images */
.cf-image-figure.full-width {
    margin-left: -25px;
    margin-right: -25px;
}

.cf-image-figure.full-width img {
    width: 100%;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .image-grid,
    .image-grid.three-column {
        grid-template-columns: 1fr;
    }
    
    .cf-image-figure.full-width {
        margin-left: -10px;
        margin-right: -10px;
    }
}

/* Ensure all images stay within container bounds */
.post-content img,
.post-content figure {
    max-width: 100%;
    height: auto;
}