/* Basic Setup & Dark Theme Variables */
:root {
    --bg-color: #000000;
    --surface-color: #121212;
    --text-color: #ffffff;
    --accent-color: #cc00ff;
    --border-color: #696969;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* ================================================= */
/*  NEW BANNER HEADER STYLES (and updated footer)    */
/* ================================================= */

/* The main header with the banner image */
header {
    position: relative; /* Needed for the overlay effect */
    text-align: center;
    padding: 20px 20px; /* Increased padding to make the banner taller */
    color: #ffffff; /* Sets the text color to white for readability */
    border-radius: 8px; /* Adds nice rounded corners */
    margin-bottom: 30px; /* Space between the banner and the content below */
    overflow: hidden; /* Ensures the background image respects the rounded corners */

    /* This is the key part: */
    /* It creates a semi-transparent black layer on top of your banner image. */
    /* This makes the white text on top much easier to read. */
    background: 
        url('./images/new_blog-banner-v2.jpg') no-repeat center center;
    background-size: cover; /* This makes the image cover the entire header area */
}

/* Styling for the main site title */
header h1 {
    margin: 0;
    font-size: 3em; /* Makes the title bigger and more impactful */
    font-weight: bold;
    /* Adds a subtle shadow to the text to lift it off the background */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

/* Styling for the site subtitle */
header p {
    font-size: 1.2em;
    opacity: 1; /* Makes it slightly less prominent than the title */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

/* Updated footer to be consistent */
footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border-color); /* We removed the border from the header */
    margin-top: 40px;
    font-size: 0.9em;
}

/* Main Layout (Sidebar + Content) */
.main-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.sidebar h2 {
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 5px;
    font-size: 1.2em;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar a {
    text-decoration: none;
    color: var(--text-color);
    display: block;
    padding: 8px 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar a:hover {
    background-color: var(--surface-color);
    color: var(--accent-color);
}

#archives .year {
    margin-top: 15px;
}
#archives .month {
    margin-left: 15px;
}

main {
    flex-grow: 1;
    background-color: var(--surface-color);
    padding: 20px 30px;
    border-radius: 8px;
    min-height: 500px;
}

/* Post Content Styling */
#content h1, #content h2, #content h3 {
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-top: 1.5em;
}
#content p {
    margin-bottom: 1em;
}
#content a {
    color: var(--accent-color);
}
#content code {
    background-color: var(--bg-color);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: "Courier New", Courier, monospace;
}
#content pre {
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}
#content blockquote {
    border-left: 4px solid var(--accent-color);
    margin-left: 0;
    padding-left: 15px;
    color: #b0b0b0;
    font-style: italic;
}

/* Styling for responsive images and locally hosted videos */
#content img, #content video {
    max-width: 100%;
    height: auto; /* This is correct for these elements to maintain aspect ratio */
    border-radius: 5px;
    display: block;
    margin: 15px 0;
}

/* FIX: Specific styling for responsive iframes (e.g., YouTube embeds) */
#content iframe {
    display: block;
    width: 100%; /* Make iframe take full width of its container */
    max-width: 100%;
    
    /* This is the key fix. It forces the iframe to maintain a 16:9 aspect ratio, 
       which is standard for videos. This prevents it from collapsing vertically. */
    aspect-ratio: 16 / 9;
    height: auto; /* Height will be calculated automatically based on aspect-ratio */

    margin: 15px 0;
    border-radius: 5px;
    border: none; /* Remove default iframe border */
}


/* Responsive Design for smaller screens */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
}