/* Post details side-by-side layout */
.post-details-wrap {
    display: flex;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 24px;
}
.post-featured-image-side {
    flex: 0 0 280px; /* preview width similar to index */
    display: flex;
    align-items: stretch;
}
.post-featured-image-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
/* Ensure figure element doesn't add extra margin */
figure.post-featured-image-side {
    margin: 0;
}
.project-details {
    flex: 1 1 auto;
}

/* ==========================================================================
   Craft Journal Styles
   ========================================================================== */

/* Accessibility - Visually Hidden */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Reduce side whitespace on large screens */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px; /* widen content area */
        padding: 0 10px;   /* slightly reduce inner padding */
    }
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Header */
.site-header {
    background-color: #fff;
    border-bottom: 3px solid #007bff;
    padding: 30px 0;
    margin-bottom: 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.site-logo {
    display: block;
    flex-shrink: 0;
}

.site-logo img {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

.site-logo:hover img {
    transform: scale(1.05);
}

.site-title {
    font-size: 2.5em;
    margin: 0;
}

.site-title a {
    color: #333;
    text-decoration: none;
}

.site-title a:hover {
    color: #007bff;
}

.site-description {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.site-nav {
    margin-top: 15px;
}

.site-nav a {
    margin-right: 20px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Main Content */
.page-content {
    min-height: calc(100vh - 300px);
    padding: 20px 0;
}

/* Home Page - Post List */
.home {
    margin-top: 20px;
}

.home h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.post-list {
    margin-bottom: 40px;
}

.post-preview {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    gap: 25px;
    align-items: stretch;
}

.post-preview.image-left {
    flex-direction: row;
}

.post-preview.image-right {
    flex-direction: row-reverse;
}

.post-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.post-featured-image {
    flex-shrink: 0;
    width: 250px;
    border-radius: 5px;
    overflow: hidden;
    align-self: stretch;
}

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

.post-featured-image a {
    display: block;
    height: 100%;
}

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

.post-preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-preview h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.post-preview h3 a {
    color: #333;
}

.post-preview h3 a:hover {
    color: #007bff;
}

.post-meta {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.post-author {
    margin-left: 10px;
}

.post-categories {
    margin: 15px 0;
}

.categories-label {
    font-weight: 600;
    color: #666;
    margin-right: 10px;
}

.category-tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    margin: 0 5px 5px 0;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.category-tag:hover {
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
}

.post-excerpt {
    margin: 15px 0;
    color: #555;
    line-height: 1.7;
}

.read-more {
    color: #007bff;
    font-weight: 600;
    display: inline-block;
    margin-top: 10px;
}

.read-more:hover {
    text-decoration: none;
    color: #0056b3;
}

.view-all {
    text-align: center;
    margin-top: 40px;
}

.btn {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #0056b3;
    text-decoration: none;
}

/* Individual Post */
.post {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-featured-image-full {
    margin: -40px -40px 30px -40px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.post-featured-image-full img {
    max-width: 800px;
    width: 100%;
    height: auto;
    display: block;
}

/* Lightbox overlay for post image */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.lightbox-overlay.visible { display: flex; }
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-radius: 8px;
}

.post-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.post-title {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #333;
}

/* Project Details Table */
.project-details {
    margin-bottom: 30px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.details-table thead th {
    background-color: #007bff;
    color: #fff;
    padding: 15px;
    text-align: left;
    font-size: 1.1em;
    font-weight: 600;
}

.details-table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.details-table tbody tr:last-child {
    border-bottom: none;
}

.details-table td {
    padding: 12px 15px;
}

.detail-label {
    font-weight: 600;
    color: #495057;
    width: 35%;
    vertical-align: top;
}

.detail-list {
    margin: 0;
    padding-left: 20px;
}

.detail-list li {
    margin-bottom: 5px;
}

.post-content {
    line-height: 1.8;
    color: #444;
    font-size: 1.05em;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 5px;
}

.post-content figure {
    margin: 20px 0;
}

.post-content figure img {
    margin: 0 auto;
}

.post-content figcaption {
    text-align: center;
    font-style: italic;
    color: #666;
    font-size: 0.9em;
    margin-top: 8px;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-content table caption {
    caption-side: top;
    padding: 10px;
    font-weight: 600;
    text-align: left;
    background-color: #f8f9fa;
}

.post-content table thead {
    background-color: #007bff;
    color: #fff;
}

.post-content table th,
.post-content table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.post-content table tbody tr:last-child td {
    border-bottom: none;
}

.post-content h2 {
    font-size: 1.8em;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #333;
}

.post-content h3 {
    font-size: 1.4em;
    margin-top: 25px;
    margin-bottom: 12px;
    color: #333;
}

.post-content ul, .post-content ol {
    margin: 15px 0 15px 30px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content p {
    margin-bottom: 15px;
}

.post-content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
}

.post-content code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9em;
}

.post-content pre {
    background-color: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

.post-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.post-tags {
    margin-bottom: 20px;
}

.tags-label {
    font-weight: 600;
    color: #666;
    margin-right: 10px;
}

.tag {
    display: inline-block;
    background-color: #f8f9fa;
    color: #495057;
    padding: 4px 10px;
    margin: 0 5px 5px 0;
    border-radius: 3px;
    font-size: 0.85em;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.prev-post, .next-post {
    flex: 0 0 48%;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.prev-post:hover, .next-post:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.next-post {
    text-align: right;
}

/* Categories Page */
.categories-page h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.category-search {
    margin: 30px 0;
}

.category-search input {
    width: 100%;
    padding: 12px 20px;
    font-size: 1em;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.category-search input:focus {
    outline: none;
    border-color: #007bff;
}

.category-nav {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-nav h3 {
    margin-bottom: 15px;
    color: #333;
}

.category-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-list li {
    background-color: #f8f9fa;
    padding: 8px 15px;
    border-radius: 5px;
}

.category-list li a {
    font-weight: 500;
}

.category-count {
    color: #666;
    font-size: 0.9em;
}

.category-section {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-heading {
    font-size: 1.8em;
    color: #007bff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.category-section .post-list {
    list-style: none;
}

.post-item {
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.post-info time {
    display: inline-block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.post-info h4 {
    font-size: 1.3em;
    margin-bottom: 10px;
}

.post-info h4 a {
    color: #333;
}

.post-info h4 a:hover {
    color: #007bff;
}

.post-info .excerpt {
    color: #555;
    margin-bottom: 10px;
}

.post-categories-mini {
    margin-top: 10px;
}

.mini-tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 3px 10px;
    margin-right: 5px;
    border-radius: 3px;
    font-size: 0.8em;
}

/* Footer */
.site-footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

.site-footer a {
    color: #007bff;
}

.site-footer a:hover {
    color: #0056b3;
}

.site-footer p {
    margin: 5px 0;
}

/* About Page */
.about-page {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.about-page h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.about-page h3 {
    font-size: 1.5em;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #007bff;
}

.about-page p {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #555;
}

.about-page ul {
    margin: 15px 0 15px 30px;
}

.about-page li {
    margin-bottom: 8px;
    color: #555;
}

/* Archive Page */
.archive h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.archive-year {
    margin: 30px 0 15px;
    font-size: 1.5em;
    color: #007bff;
}

.archive-post {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.archive-post time {
    display: inline-block;
    width: 80px;
    color: #666;
    font-size: 0.9em;
}

.archive-post a {
    color: #333;
    font-weight: 500;
}

.archive-post a:hover {
    color: #007bff;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header and Navigation */
    .site-header {
        padding: 20px 0;
    }
    
    .site-branding {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .site-logo img {
        height: 50px;
    }
    
    .site-title {
        font-size: 2em;
    }
    
    /* Show mobile menu toggle */
    .menu-toggle {
        display: flex;
        position: absolute;
        top: 30px;
        right: 20px;
    }
    
    /* Mobile Navigation Menu */
    .site-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 20px;
        padding: 20px 0;
        background-color: #f8f9fa;
        border-radius: 8px;
    }
    
    .site-nav.active {
        display: flex;
    }
    
    .site-nav a {
        margin: 0;
        padding: 12px 20px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .site-nav a:last-child {
        border-bottom: none;
    }
    
    /* Index Page - Post Previews */
    .post-preview,
    .post-preview.image-left,
    .post-preview.image-right {
        flex-direction: column !important;
    }
    
    .post-featured-image {
        width: 100%;
        height: 200px;
    }
    
    .post-preview, .post {
        padding: 20px;
    }
    
    /* Article Page - Post Details */
    .post-details-wrap {
        flex-direction: column;
    }
    
    .post-featured-image-side {
        flex: 1 1 auto;
        width: 100%;
        max-height: 300px;
    }
    
    .project-details {
        width: 100%;
    }
    
    /* Project Details Table - Mobile Optimization */
    .details-table {
        font-size: 0.9em;
    }
    
    .details-table thead th {
        padding: 12px;
        font-size: 1em;
    }
    
    .details-table td {
        padding: 10px 12px;
        display: block;
        width: 100%;
    }
    
    .detail-label {
        width: 100%;
        font-weight: 700;
        padding-bottom: 5px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .details-table tbody tr {
        display: block;
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 2px solid #e9ecef;
    }
    
    .details-table tbody tr:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .detail-list {
        padding-left: 20px;
        margin-top: 8px;
    }
    
    /* Post Title */
    .post-title {
        font-size: 2em;
    }
    
    /* Post Navigation */
    .post-navigation {
        flex-direction: column;
    }
    
    .prev-post, .next-post {
        flex: 1 1 100%;
        margin-bottom: 10px;
    }
    
    /* Category List */
    .category-list {
        flex-direction: column;
    }
}