/*
 * =================================================================================
 * ROOT VARIABLES & GLOBAL STYLES (LIGHT THEME)
 * =================================================================================
 */
:root {
    --header-height: 4rem;
    /* A more robust height */

    /* Light Theme Variables (Default) */
    --primary-bg: #E0FFFF;
    --secondary-bg: #B0E0E6;
    --text-color: #36454F;
    --heading-color: #000000;
    --link-color: #005a9c;
    --subtle-text-color: #555;
    --header-link-hover: #007acc;
    --border-color: #ADD8E6;
    --article-bg: #fffef9;
    --accent-color-orange: #FFDAB9;
    --accent-color-green: #90EE90;
}

html {
    scroll-padding-top: var(--header-height);
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', system-ui, -apple-system, Segoe UI, sans-serif;
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--primary-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(#074d61, #09090980), url("/assets/jback.png") center / cover no-repeat fixed;
}

/*
 * =================================================================================
 * HEADER & NAVIGATION
 * =================================================================================
 */
header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--secondary-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.1em;
    transition: color 0.3s ease, transform 0.3s ease;
}

header a:hover {
    color: var(--header-link-hover);
    transform: translateY(-2px);
}

/* --- NEW: STYLES FOR HEADER FLAG ICONS --- */

/* This targets the <a> tag wrapping the flag */
header .header-flag-link {
    /* This helps with vertical alignment and transforms */
    display: inline-block;
    line-height: 1;
    /* Prevents extra space below the image */

    /* Apply the same hover effect as the other text links */
    transition: transform 0.3s ease;
}

header .header-flag-link:hover {
    transform: translateY(-2px);
}

/* This targets the <img> tag itself */
header .header-flag-link img {
    /* Set a height relative to the font size for perfect alignment */
    height: 1.2em;
    width: auto;
    /* Maintain the flag's aspect ratio */

    /* This is the key to aligning the image with the text */
    vertical-align: middle;
}

/* --- NEW: STYLES FOR TELEPROMPTER CONTROLS --- */

.teleprompter-control {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.8em;
    /* Make the + and - signs bigger */
    line-height: 1;
    /* Helps with vertical centering */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.teleprompter-control:hover {
    background-color: var(--text-color);
    color: var(--secondary-bg);
}

/*
 * =================================================================================
 * HERO SECTION
 * =================================================================================
 */
.hero-section {
    background-image: url("/assets/jback.png");
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 5rem 1rem;
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    background-color: rgba(0, 0, 0, 0.4);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 3em;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.5em;
    margin-bottom: 2rem;
    font-weight: 500;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-button {
    background-color: var(--accent-color-orange);
    color: var(--text-color);
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--text-color);
}

.hero-button:nth-child(2) {
    background-color: var(--accent-color-green);
}

.hero-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
    background-color: #ffc8a1;
}

/*
 * =================================================================================
 * MAIN CONTENT & ARTICLE
 * =================================================================================
 */
main {
    max-width: 960px;
    margin: 0 auto;
    padding: var(--header-height) 1.5rem 2rem;
    flex-grow: 1;
}

article {
    background: var(--article-bg);
    padding: 1rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

article p {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.15rem;
    line-height: 1.8;
    max-width: 680px;
    text-align: justify;
    hyphens: auto;
    color: var(--text-color);
    margin: 1.5rem auto;
    margin-bottom: .2rem;
}

article p+p {
    text-indent: 2em;
    margin-top: 0;
}

h2 {
    font-family: 'Merriweather', cursive;
    font-size: 1.1em;
    line-height: 1.6;
    color: var(--heading-color);
    text-align: center;
    margin: 5px 0;
    text-transform: uppercase;
}

article h3 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--heading-color);
    text-align: center;
    margin: 2.5rem auto 1rem auto;
    /* Corrected for better centering */
}

article .post-meta {
    font-size: 0.9em;
    font-style: italic;
    color: var(--subtle-text-color);
    text-align: center;
    max-width: 500px;
    text-indent: 0;
    margin: 1rem auto;
    /* Adjusted margin */
}

/* assets/style.css */
#comments-section {
    margin-top: 2rem;
    padding-top: 1rem;
    padding-left: 1rem;
    ;
    border-top: 1px solid #ccc;
    background: antiquewhite;
}

.comment {
    border-bottom: 1px solid #eee;
    padding: 1rem;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-rating {
    color: #ffc107;
    /* gold */
}

#comment-form .form-group {
    margin-bottom: 1rem;
    padding: 1rem;
    padding-right: 2rem;
    padding-left: 1rem;
}



#comment-form label {
    display: block;
    margin-bottom: 0.25rem;
}

#comment-form input,
#comment-form select,
#comment-form textarea {
    width: 100%;
    padding: .5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* /assets/style.css */

.show-more-btn {
    background-color: transparent;
    border: 1px solid #888;
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    font-size: 0.8em;
    padding: 4px 8px;
    margin-top: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.show-more-btn:hover {
    background-color: #f0f0f0;
    color: #111;
}

/* For Dark Mode, if you have one */
body.dark-mode .show-more-btn {
    color: #ccc;
    border-color: #555;
}

body.dark-mode .show-more-btn:hover {
    background-color: #333;
    color: #fff;
}

/*
 * =================================================================================
 * COMPONENTS
 * =================================================================================
 */

/* Thumbnail Styles */
.thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.thumb {
    inline-size: clamp(120px, 30vw, 220px);
    border-radius: 4px;
    display: block;
    margin: 1px auto;
}

.thumb.square {
    width: 180px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.thumb.square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Table of Contents */
.table-of-contents {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-left: 5px solid #007acc;
    padding: 1.5rem;
    margin: 1rem auto 2rem;
    max-width: 80%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.table-of-contents::before {
    content: "Table of Contents";
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    font-size: 1.1em;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.table-of-contents li:last-child {
    margin-bottom: 0;
}

.table-of-contents a {
    text-decoration: none;
    color: var(--link-color);
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.table-of-contents a:hover {
    color: var(--header-link-hover);
    text-decoration: underline;
    padding-left: 5px;
}


/* "Back to Top" Link */

/*
 * =================================================================================
/*
 * =================================================================================
 * STACKED & CENTERED IMAGE + TEXT LAYOUT (Legacy/Contact)
 * =================================================================================
 */
.image-text-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem auto;
    max-width: 960px;
}

.image-text-layout .image-container {
    width: 100%;
}

.image-text-layout .image-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-text-layout .text-container {
    text-align: center;
}

/*
 * =================================================================================
 * ABOUT SECTION (JOIN MY PACK)
 * =================================================================================
 */
.about {
    display: flex;
    flex-direction: column;
    margin: 2rem auto;
    max-width: 1000px;
    background-color: #2c242a;
    /* Dark background */
    border-radius: 12px;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .about {
        flex-direction: row;
        align-items: stretch;
    }
}

.about-image {
    flex: 1 1 40%;

    position: relative;
    /* Ensure no flex gaps interact roughly */
    margin: 0;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    box-shadow: none;
    /* Remove previous shadow */
    border-radius: 0;
    /* Remove previous radius */
}

.book-image {
    flex: 1 1 50%;
    min-height: 400px;
    position: relative;
    /* Ensure no flex gaps interact roughly */
    margin: 0;
    padding: 1rem;
}

.book-image img {

    object-fit: cover;
    display: block;
    box-shadow: none;
    /* Remove previous shadow */
    border-radius: 0;
    /* Remove previous radius */
}


.about-content {
    flex: 1 1 50%;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #2c242a;
    text-align: left;
}

.about-content h2 {
    font-family: 'Merriweather', serif;
    font-size: 1.2rem;
    color: #fff;
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: left;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 0.5rem;
}

/* Decoration line under title */
.about-content h2::after {
    content: "";
    display: block;
    width: 200px;
    height: 3px;
    background-color: #c45b5d;
    margin-top: 0.5rem;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    color: #e0d0d5;
    background: transparent;
    max-width: 100%;
    text-align: left;
    text-indent: 0;
    /* Override article p+p indent if inherited */
}

/* Ensure no conflicts with global styling */
.about-content p+p {
    text-indent: 0;
}

.book-image p {
    font-size: 0.9em;
    font-style: italic;
    color: #f9f6f6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.about-button {
    display: inline-block;
    background-color: #c45b5d;
    /* Salmon/Red accent */
    color: #fff;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.3s, transform 0.2s;
    align-self: flex-start;
    border: none;
}

.about-button:hover {
    background-color: #d17274;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196, 91, 93, 0.4);
    color: #fff;
}

.back-to-top {
    text-align: right;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
}

.back-to-top a {
    font-size: 0.9em;
    font-style: italic;
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-to-top a:hover {
    color: #000;
    text-decoration: underline;
}

#toc-container+.back-to-top {
    display: none;
}

/* Post Image Container */
.post-image-container {
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.post-image-container img {
    max-width: 40%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: block;
}

.post-image-container figcaption {
    font-size: 0.9rem;
    font-style: italic;
    color: #6c757d;
    text-align: center;
    margin-top: 0.75rem;
}

/*
 * =================================================================================
 * CUSTOM AUDIO PLAYER
 * =================================================================================
 */
.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--secondary-bg);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-width: 500px;
    /* Adjust as needed */
    margin: 1rem auto;
    /* Center the player */
}

.play-pause-btn {
    background-color: var(--text-color);
    color: var(--secondary-bg);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.play-pause-btn:hover {
    transform: scale(1.1);
}

.play-pause-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--secondary-bg);
}

.pause-icon {
    display: none;
    /* Initially hidden */
}

.player-controls {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.25rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    /* Important for the inner bar */
}

.progress {
    height: 100%;
    width: 0%;
    /* Initially no progress */
    background-color: var(--text-color);
    border-radius: 4px;
}

.time-container {
    font-size: 0.8em;
    font-family: monospace;
    color: var(--subtle-text-color);
}

/* --- DARK MODE FOR AUDIO PLAYER --- */
body.dark-mode .custom-audio-player {
    background-color: var(--secondary-bg);
    border-color: var(--border-color);
}

body.dark-mode .play-pause-btn {
    background-color: var(--text-color);
    color: var(--secondary-bg);
}

body.dark-mode .play-pause-btn svg {
    fill: var(--secondary-bg);
}

body.dark-mode .progress-bar {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .progress {
    background-color: var(--text-color);
}

body.dark-mode .time-container {
    color: var(--subtle-text-color);
}

/*
 * =================================================================================
 * POST LIST & FOOTER
 * =================================================================================
 */
/*
 * =================================================================================
 * STYLES FOR THE POST PREVIEW LIST (MODIFIED FOR CENTERED LAYOUT)
 * =================================================================================
 */

.post-preview {
    display: flex;
    /* --- CHANGE #1: Stack items vertically --- */
    flex-direction: column;
    /* --- CHANGE #2: Center items horizontally --- */
    align-items: center;
    gap: 1rem;
    /* Adjust gap for vertical stacking */

    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.post-preview:last-child {
    border-bottom: none;
}

/* The .thumb will now use its global centering style (margin: auto) */
.post-preview .thumb {
    flex-shrink: 0;
    /* --- CHANGE #3: Remove margin override so it can self-center --- */
    margin: 0 auto 1rem auto;
    /* Ensure it's centered and has space below */
}

.post-preview .post-preview-content {
    /* --- CHANGE #4: Center the text content block --- */
    text-align: center;
}

.post-preview h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.3em;
    font-family: 'Merriweather', Georgia, serif;
    /* --- CHANGE #5: Ensure title is centered --- */
    text-align: center;
}

.post-preview h3 a {
    text-decoration: none;
    color: var(--heading-color);
}

.post-preview h3 a:hover {
    text-decoration: underline;
}

.post-preview .post-meta {
    margin: 0;
    /* --- CHANGE #6: Ensure date is centered --- */
    text-align: center;
}

/* --- Dark Mode Overrides (Unchanged but still needed) --- */
body.dark-mode .post-preview {
    border-bottom-color: var(--border-color);
}

body.dark-mode .post-preview h3 a {
    color: var(--heading-color);
}

/* 
    The old responsive block for this is no longer needed
    because the default is now the stacked layout you want.
  */

ul.posts {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

ul.posts li {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

ul.posts li:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

ul.posts li h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.5em;
    color: var(--text-color);
}

ul.posts li p {
    font-size: 0.95em;
    color: var(--subtle-text-color);
    flex-grow: 1;
}

ul.posts li a {
    color: var(--header-link-hover);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-top: 1rem;
    transition: color 0.3s ease;
}

ul.posts li a:hover {
    text-decoration: underline;
}

footer {
    background: var(--secondary-bg);
    color: var(--text-color);
    text-align: center;
    padding: 2rem 1rem;
    border-top: 2px solid var(--border-color);
    margin-top: 3rem;
}

/*
 * =================================================================================
 * THEME TOGGLE BUTTON
 * =================================================================================
 */
.theme-toggle {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--text-color);
    color: var(--secondary-bg);
}

/*
 * =================================================================================
 * DARK MODE THEME
 * =================================================================================
 */
/*
 * =================================================================================
 * DARK MODE FOR COMMENTS SECTION
 * =================================================================================
 */

/* Main container and borders */
body.dark-mode #comments-section {
    background: var(--secondary-bg);
    /* Use the dark secondary background */
    border-top-color: var(--border-color);
    /* Use the dark border color */
}

body.dark-mode .comment {
    border-bottom-color: var(--border-color);
    /* Use the dark border color for separators */
}

/* Text inside comments */
body.dark-mode .comment-meta strong {
    color: var(--heading-color);
    /* Make the name stand out */
}

body.dark-mode .comment-text {
    color: var(--text-color);
    /* Use the main dark theme text color */
}

/* Comment submission form */
body.dark-mode #comment-form label {
    color: var(--heading-color);
    /* Make labels clearer */
}

body.dark-mode #comment-form input,
body.dark-mode #comment-form select,
body.dark-mode #comment-form textarea {
    background-color: #2c2c2c;
    /* A slightly lighter dark for inputs */
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Style for when the user is typing in an input */
body.dark-mode #comment-form input:focus,
body.dark-mode #comment-form select:focus,
body.dark-mode #comment-form textarea:focus {
    border-color: var(--link-color);
    /* Use a highlight color on focus */
    outline: none;
    /* Remove the default browser outline */
}

/* The submit button */
body.dark-mode #comment-form button[type="submit"] {
    background-color: var(--accent-color-green);
    /* Use a nice accent color */
    color: #000000;
    /* Dark text for contrast on the green button */
    border: 1px solid var(--accent-color-green);
    font-weight: bold;
    cursor: pointer;
    padding: 0.75rem;
    width: 100%;
    border-radius: 4px;
    transition: background-color 0.2s;
}

body.dark-mode #comment-form button[type="submit"]:hover {
    background-color: #78c878;
    /* A slightly lighter green on hover */
}

/* Show More Button (already in your code, but here for completeness) */
body.dark-mode .show-more-btn {
    color: #ccc;
    border-color: #555;
}

body.dark-mode .show-more-btn:hover {
    background-color: #333;
    color: #fff;
}

body.dark-mode {
    --primary-bg: #000000;
    --secondary-bg: #1a1a1a;
    --text-color: #90EE90;
    --heading-color: #90EE90;
    --link-color: #a1e8a1;
    --subtle-text-color: #a3b1a3;
    --header-link-hover: #ffffff;
    --border-color: #444444;
    --article-bg: #111111;
}

/* --- Specific Dark Mode Overrides --- */
body.dark-mode article p {
    color: var(--subtle-text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode article h3 {
    color: var(--heading-color);
}

body.dark-mode article .post-meta {
    color: var(--subtle-text-color);
}

body.dark-mode .table-of-contents {
    background-color: var(--secondary-bg);
    border-color: var(--border-color);
    border-left-color: var(--text-color);
}

body.dark-mode ul.posts li {
    background: var(--secondary-bg);
    border-color: var(--border-color);
}

body.dark-mode ul.posts li h3 {
    color: var(--text-color);
}

body.dark-mode ul.posts li p {
    color: var(--subtle-text-color);
}

body.dark-mode .thumb {
    border: 1px solid var(--border-color);
}

/* --- NEW: DARK MODE FOR POST PREVIEW LIST --- */
body.dark-mode .post-preview {
    border-bottom-color: var(--border-color);
}

body.dark-mode .post-preview h3 a {
    color: var(--heading-color);
}

/* Details Summary Styling */
details summary {
    cursor: pointer;
    font-weight: bold;
    padding: 10px;
    background-color: #f4f4f4;
    /* Light mode background */
    border-radius: 5px;
    margin-bottom: 15px;
}

/* Dark Mode Spoilers */
body.dark-mode details summary {
    background-color: var(--secondary-bg);
    color: var(--heading-color);
    border: 1px solid var(--border-color);
}

/* Dark Mode Hero Button */
body.dark-mode .hero-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--link-color);
    color: #005ba5;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    transition: background-color 0.3s;
    align-self: flex-start;
    border: none;
}

/*
 * =================================================================================
 * RESPONSIVE ADJUSTMENTS
 * =================================================================================
 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2em;
    }

    .hero-subtitle {
        font-size: 1.2em;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    main {
        margin: 1rem auto;
    }

    article {
        padding: 0.5rem;
    }

    .image-text-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .image-text-layout .image-container {
        flex-basis: 80%;
        margin-bottom: 1.5rem;
    }

    .image-text-layout .text-container {
        margin-left: auto;
        text-align: left;
    }
}

/* --- NEW: RESPONSIVE FOR POST PR
/* 
 * =================================================================================
 * NEW HOME PAGE LAYOUT (HERO + GRID)
 * =================================================================================
 */

/* Hero Section */
.hero-featured {
    display: grid;
    margin-top: 1rem;
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 3rem;
    background: var(--article-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .hero-featured {
        grid-template-columns: 60% 40%;
        align-items: center;
    }
}

.hero-image {
    width: 100%;
    /* aspect-ratio: 16 / 9; */
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.hero-featured:hover .hero-image img {
    transform: scale(1.03);
}

.hero-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content h2 {
    /* "Featured" label */
    text-align: left;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--accent-color-orange);
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 900;
}

.hero-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1.25;
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    text-align: left;
}

.hero-title a {
    text-decoration: none;
    color: var(--heading-color);
    transition: color 0.3s;
}

.hero-title a:hover {
    color: var(--link-color);
}

.hero-content .post-meta {
    text-align: left;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

.hero-excerpt {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.hero-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--link-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    transition: background-color 0.3s;
    align-self: flex-start;
    border: none;
}

.hero-button:hover {
    background-color: var(--header-link-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: white;
}

/* Post Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.post-card {
    background: var(--article-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    /* Override generic article padding */
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.card-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    text-align: left;
    font-family: 'Merriweather', Georgia, serif;
}

.card-title a {
    text-decoration: none;
    color: var(--heading-color);
}

.card-title a:hover {
    color: var(--link-color);
    text-decoration: none;
}

.card-content .post-meta {
    text-align: left;
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
    color: #888;
}

.card-excerpt {
    font-size: 0.95rem;
    color: var(--subtle-text-color);
    flex-grow: 1;
    /* Pushes the Read More link to bottom */
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-align: left;
}

.read-more-link {
    text-decoration: none;
    font-weight: 700;
    color: var(--link-color);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more-link:after {
    content: "→";
    transition: transform 0.3s;
}

.read-more-link:hover:after {
    transform: translateX(4px);
}

/*
 * =================================================================================
 * EPUB DOWNLOAD BUTTON
 * =================================================================================
    background-color: var(--accent-color-green); */
.download-button {
    display: inline-block;

    color: var(--text-color);
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--text-color);
    margin: 5px auto;
    text-align: center;
}

.download-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
    background-color: #b2f5b2;
    color: blue;
}

.epub-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 5px;
    gap: 1rem;
    flex-wrap: wrap;
}