/* Modern Blog-Style CSS with Windows 95 Frame Aesthetic */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
    /* background: linear-gradient(135deg, #008080 0%, #20b2aa 25%, #4682b4 50%, #6495ed 75%, #87ceeb 100%); */
    background-image: url('https://i.redd.it/02dw11nuqf681.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Window frame container */
.window-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    min-height: calc(100vh - 80px);
}

/* Windows 95 style window frame */
.blog-window {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    border-radius: 0;
    position: relative;
    min-height: 600px;
}

/* Title bar */
.blog-title-bar {
    background: linear-gradient(90deg, #0a246a 0%, #a6caf0 100%);
    color: white;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: bold;
    border-bottom: 1px solid #808080;
    user-select: none;
}

.blog-title-text {
    font-weight: bold;
}

.blog-title-controls {
    display: flex;
    gap: 2px;
}

.blog-title-controls button {
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    width: 16px;
    height: 14px;
    font-size: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-title-controls button:hover {
    background: #d4d0c8;
}

.blog-title-controls button:active {
    border: 1px inset #c0c0c0;
}

/* Modern content area */
.blog-content {
    background: white;
    padding: 0;
    min-height: 500px;
    overflow: hidden;
    position: relative;
}

/* Blog layout with consistent margins - left aligned */
.blog-layout {
    max-width: 65rem;
    margin: 0 auto;
    padding: 2.5rem 18.75rem 3rem 1.5rem;
    line-height: 1.7;
    color: #2c3e50;
    text-align: left;
}

/* Table of Contents */
.blog-toc {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 15px;
    font-size: 13px;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    z-index: 10;
}

.blog-toc h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
}

.blog-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-toc li {
    margin: 4px 0;
}

.blog-toc a {
    color: #4a5568;
    text-decoration: none;
    display: block;
    padding: 2px 0;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.blog-toc a:hover {
    color: #3182ce;
    background: #edf2f7;
    padding-left: 8px;
}

.blog-toc .toc-h2 {
    font-weight: 500;
}

.blog-toc .toc-h3 {
    padding-left: 12px;
    font-size: 12px;
}

.blog-toc .toc-h4 {
    padding-left: 24px;
    font-size: 11px;
}

/* Typography */
.blog-layout h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

.blog-layout h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
    margin: 2.5rem 0 1rem 0;
    line-height: 1.3;
}

.blog-layout h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4a5568;
    margin: 2rem 0 0.75rem 0;
    line-height: 1.4;
}

.blog-layout h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4a5568;
    margin: 1.5rem 0 0.5rem 0;
}

.blog-layout p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #2d3748;
    line-height: 1.7;
}

.blog-layout ul, .blog-layout ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.blog-layout li {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Code styling */
.blog-layout code {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e53e3e;
}

.blog-layout pre {
    background: #2d3748;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.blog-layout pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Media styling - consistent sizing and heights */
.blog-layout img {
    max-width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    margin: 2rem 0 0.5rem 0;
    display: block;
}

/* Image captions */
.image-caption {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
    text-align: center;
    margin: 0 0 2rem 0;
    line-height: 1.4;
}

.image-with-caption {
    margin: 2rem 0;
}

.image-with-caption img {
    margin: 0 0 0.5rem 0;
}

/* Standard image sizes - consistent heights */
.blog-layout img[data-size="small"] {
    max-width: 300px;
    height: 200px;
    margin: 1.5rem 0;
}

.blog-layout img[data-size="medium"] {
    max-width: 500px;
    height: 300px;
    margin: 2rem 0;
}

.blog-layout img[data-size="large"] {
    max-width: 700px;
    height: 400px;
    margin: 2.5rem 0;
}

.blog-layout img[data-size="full"] {
    max-width: 100%;
    height: 500px;
    margin: 2rem 0;
}

/* Video styling */
.blog-layout video {
    max-width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    margin: 2rem 0;
    display: block;
}

.blog-layout video[data-size="small"] {
    max-width: 400px;
    height: 250px;
    margin: 1.5rem 0;
}

.blog-layout video[data-size="medium"] {
    max-width: 600px;
    height: 300px;
    margin: 2rem 0;
}

.blog-layout video[data-size="large"] {
    max-width: 800px;
    height: 400px;
    margin: 2.5rem 0;
}

/* Image galleries - can extend beyond right margin */
.image-gallery {
    display: flex;
    gap: 1rem;
    margin: 2rem -300px 2rem -10px;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: calc(100% + 310px);
}

.image-gallery img {
    max-width: 200px;
    height: 150px;
    margin: 0;
    flex: 1;
    min-width: 150px;
}

/* Links */
.blog-layout a {
    color: #3182ce;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.blog-layout a:hover {
    color: #2c5aa0;
    border-bottom-color: #2c5aa0;
}

/* Blockquotes */
.blog-layout blockquote {
    border-left: 4px solid #3182ce;
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background: #f7fafc;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4a5568;
}

/* Tables */
.blog-layout table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blog-layout th, .blog-layout td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.blog-layout th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

/* Navigation */
.blog-nav {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    margin-bottom: 20px;
    padding: 10px 20px;
    display: flex;
    justify-content: flex-start;
}

.blog-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0;
    padding: 0;
    max-width: 85vw;
    /* Force wrapping to 2 rows by limiting width to fit approximately 6-7 items per row */
}

.blog-nav li {
    white-space: nowrap;
}

.blog-nav a {
    color: #000;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-block;
}

.blog-nav a:hover {
    background: #d4d0c8;
    border: 1px outset #c0c0c0;
}

.blog-nav a.active {
    background: #a6caf0;
    border: 1px inset #c0c0c0;
}

/* Responsive design */
@media (max-width: 768px) {
    .window-container {
        margin: 20px auto;
        padding: 0 10px;
    }
    
    .blog-layout {
        padding: 30px 20px;
    }
    
    .image-gallery {
        margin: 2rem 0;
    }
    
    .blog-layout h1 {
        font-size: 2rem;
    }
    
    .blog-layout h2 {
        font-size: 1.5rem;
    }
    
    .blog-layout h3 {
        font-size: 1.25rem;
    }
    
    /* Make images responsive on mobile */
    .blog-layout img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .blog-layout img[data-size="small"],
    .blog-layout img[data-size="medium"],
    .blog-layout img[data-size="large"],
    .blog-layout img[data-size="full"] {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    /* Make videos responsive on mobile */
    .blog-layout video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .blog-layout video[data-size="small"],
    .blog-layout video[data-size="medium"],
    .blog-layout video[data-size="large"] {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .image-gallery {
        flex-direction: column;
        align-items: center;
        margin: 2rem 0;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .image-gallery img {
        max-width: 100% !important;
        width: 100% !important;
        min-width: auto;
        height: auto !important;
    }
    
    .blog-nav ul {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* Hide TOC on mobile */
    .blog-toc {
        display: none;
    }
}

@media (max-width: 480px) {
    .blog-layout {
        padding: 20px 15px;
    }
    
    .image-gallery {
        margin: 2rem 0;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .blog-layout h1 {
        font-size: 1.75rem;
    }
    
    .blog-layout p, .blog-layout li {
        font-size: 1rem;
    }
    
    /* Ensure images are fully responsive on small screens */
    .blog-layout img,
    .blog-layout img[data-size="small"],
    .blog-layout img[data-size="medium"],
    .blog-layout img[data-size="large"],
    .blog-layout img[data-size="full"] {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .blog-layout video,
    .blog-layout video[data-size="small"],
    .blog-layout video[data-size="medium"],
    .blog-layout video[data-size="large"] {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .image-gallery img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
}

/* Fullscreen image viewer */
.image-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-fullscreen.active {
    opacity: 1;
    visibility: visible;
}

.image-fullscreen img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    cursor: default;
}

.image-fullscreen .image-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.875rem;
    max-width: 80%;
    text-align: center;
}

.image-fullscreen .close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.2s ease;
}

.image-fullscreen .close-button:hover {
    background: white;
    transform: scale(1.1);
}

/* Custom Audio Player - Retro Windows Style */
.audio-player {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    border: 2px outset #c0c0c0;
    padding: 12px;
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: 'MS Sans Serif', sans-serif;
    box-shadow: 3px 3px 6px rgba(0,0,0,0.4);
    position: relative;
    min-width: 400px;
}

.audio-player::before {
    content: "♪";
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 16px;
    color: #666;
    opacity: 0.7;
}

.audio-player .audio-info {
    display: flex;
    flex-direction: column;
    background: #f0f0f0;
    border: 1px inset #c0c0c0;
    padding: 6px 8px;
    margin-bottom: 4px;
}

.audio-player .audio-title {
    font-weight: bold;
    color: #000000;
    font-size: 12px;
    margin-bottom: 2px;
    font-family: 'MS Sans Serif', sans-serif;
    text-shadow: 1px 1px 0px #fff;
}

.audio-player .audio-description {
    font-size: 10px;
    color: #333;
    font-style: normal;
    font-family: 'MS Sans Serif', sans-serif;
}

.audio-player .controls-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #c0c0c0;
    border: 1px inset #c0c0c0;
    padding: 6px;
}

.audio-player .play-button {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    width: 32px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 10px;
    color: #000;
    user-select: none;
}

.audio-player .play-button:hover {
    background: #d4d0c8;
}

.audio-player .play-button:active {
    border: 2px inset #c0c0c0;
}

.audio-player .progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.audio-player .progress-bar {
    flex: 1;
    height: 16px;
    background: #f0f0f0;
    border: 1px inset #c0c0c0;
    position: relative;
    cursor: pointer;
}

.audio-player .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2 0%, #357abd 100%);
    width: 0%;
    transition: width 0.1s ease;
}

.audio-player .time-display {
    font-size: 10px;
    color: #000;
    font-family: 'MS Sans Serif', sans-serif;
    min-width: 60px;
    text-align: center;
    background: #f0f0f0;
    border: 1px inset #c0c0c0;
    padding: 2px 4px;
}

.audio-player .volume-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.audio-player .volume-icon {
    font-size: 12px;
    color: #000;
    width: 16px;
    text-align: center;
}

.audio-player .volume-slider {
    width: 60px;
    height: 16px;
    background: #f0f0f0;
    border: 1px inset #c0c0c0;
    position: relative;
    cursor: pointer;
}

.audio-player .volume-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #e53e3e 100%);
    width: 70%;
    transition: width 0.1s ease;
}

.audio-player .skip-buttons {
    display: flex;
    gap: 2px;
}

.audio-player .skip-button {
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 8px;
    color: #000;
    user-select: none;
}

.audio-player .skip-button:hover {
    background: #d4d0c8;
}

.audio-player .skip-button:active {
    border: 1px inset #c0c0c0;
}

/* Hidden audio element */
.audio-player audio {
    display: none;
}

/* YouTube video container */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin: 2rem 0;
    border: 2px outset #c0c0c0;
    background: #c0c0c0;
    box-shadow: 3px 3px 6px rgba(0,0,0,0.4);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Download Component - Windows 95/98 Style */
.download-component {
    background: #c4c4c4;
    border: 2px outset #c0c0c0;
    padding: 12px;
    margin: 1.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-family: 'MS Sans Serif', sans-serif;
}

.download-component-icon {
    width: 2rem;
    height: 2rem;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.download-component-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.download-component-text {
    flex: 1;
    min-width: 0;
}

.download-component-filename {
    font-weight: bold;
    font-size: 12px;
    color: #000;
    margin-bottom: 4px;
    word-break: break-word;
}

.download-component-description {
    font-size: 11px;
    color: #333;
    line-height: 1.3;
}

.download-component-button {
    background: #c0c0c0;
    border: 2px outset #b7b7b7;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    font-family: 'MS Sans Serif', sans-serif;
    text-decoration: none;
    display: inline-block;
    user-select: none;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0;
}

.download-component-button:hover {
    background: #d4d0c8;
}

.download-component-button:active {
    border: 2px inset #c0c0c0;
    background: #a0a0a0;
}

.download-component-button:visited {
    color: #000;
}

/* Print styles */
@media print {
    .window-container {
        margin: 0;
        padding: 0;
    }
    
    .blog-window {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .blog-title-bar {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .blog-layout {
        padding: 20px;
    }
    
    .blog-layout img, .blog-layout video {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .audio-player {
        display: none;
    }
}
