/* Blog-specific styles */
* {
    box-sizing: border-box;  /* Ensure consistent box model for all elements */
}
.search-row-container{
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: auto;
    width: min(1000px, 95%);
}
.row-container{
    grid-column: 1 / -1;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;           
    width: 100%;
}

.home{
    text-align: right;
    margin-left: auto;
    display: flex;                 
    align-items: center;            
}

.tags{
    text-align: left;
    display: flex;
    gap: 15px;
    align-items: center;         
}

.tags a,
.home a {
    white-space: nowrap;
    line-height: 1;                
    display: inline-block;
}


.blog-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1%;
    margin: auto;
    width: min(1000px, 95%);
    border-radius: 10px;
    margin-bottom: 30px;
    margin-top: 1px;
}

/* FIXED: Search container uses same grid structure as parent for perfect alignment */
.search-container {
    grid-column: 1 / -1;  /* Span all columns */
    grid-template-columns: 1fr 1fr;  /* Match parent grid exactly */
    gap: 1%;  /* Match parent gap */
}

.search-container form {
    grid-column: 2;  /* Place form in second column */
}

.search-box {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    font-family: 'Roboto Mono', sans-serif;
    font-size: 14px;
    width: 100%; 
    margin-left: auto; 
    transition: all 0.3s ease;
}

.search-box::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    width: 100%;  /* Full column width when focused */
    margin-left: 0;  /* Reset margin to fill entire column */
}

.post-item {
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    margin-bottom: 0px;
    padding: 6%;
    transition: all 0.3s ease;
}


.post-title {
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.post-title:hover {
    color: rgba(255, 255, 255, 0.8);
}

.post-meta {
    font-family: 'Roboto Mono', sans-serif;
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.post-tags {
    font-family: 'Roboto Mono', sans-serif;
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.no-posts {
    grid-column: 1 / -1;  /* Span all columns when no posts */
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Roboto Mono', sans-serif;
}

/* Search results spans full width */
.search-results {
    grid-column: 1 / -1;  /* Span all columns */
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Roboto Mono', sans-serif;
    font-size: 0.5rem;
}

.clear-search {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-left: 10px;
    font-size: 0.4rem;
}

.clear-search:hover {
    color: white;
}

.clear-search:hover {
    color: white;
}

/* Individual blog post styles */
.post-container {
    width: min(75%, 100%);
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.0);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    margin-top: 20px;
    margin-bottom: 40px;
}

.post-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.post-content {
    font-family: 'Roboto Mono', monospace !important;
    font-weight: 360 !important;
    font-size: 0.85rem;
    line-height: 1.6;
    color: white;
    margin-bottom: 30px;
    text-align: justify;
}

.post-content p {
    margin-bottom: 15px;
    font-family: 'Roboto Mono', monospace !important;
    font-weight: 350 !important;
}

.post-content p,
.post-content div {
    font-size: 0.6rem;
}

.post-content h1, .post-content h2, .post-content h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
}

.post-content ul, .post-content ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.post-content a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}


.case-toggle-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 100;
}

.case-toggle {
    background: rgba(0, 0, 0);
    border: 1px solid rgba(255, 255, 255);
    color: white;
    padding: 8px 16px;
    font-family: 'Roboto Mono', sans-serif;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-transform: none;
}

.case-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.case-toggle.active {
    background: rgba(0, 0, 0);
    border-color: rgba(255, 255, 255);
}

.navigation {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.navigation a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-family: 'Roboto Mono', sans-serif;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.navigation a:hover {
    color: white;
}

/* Case toggle states */
.proper-case {
    text-transform: none;
}

.proper-case .post-content p:first-letter,
.proper-case .post-content h1:first-letter,
.proper-case .post-content h2:first-letter,
.proper-case .post-content h3:first-letter,
.proper-case .post-content li:first-letter {
    text-transform: uppercase;
}

/* content warning modal — matches individual-description-box aesthetic from home.html */

/* always in layout; hidden via visibility+opacity so transitions actually work.
   position:fixed with explicit top/left/width/height avoids the inset+overflow-x:hidden quirk
   that can downgrade fixed to absolute on some browsers. */
.cw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cw-modal-overlay.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.cw-modal-box {
    width: min(50%, 80%);
    max-width: 85vw;
    padding: 20px;
    background-color: rgba(70, 70, 70, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.cw-modal-title {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.5rem;
    font-weight: 600;
    color: white;
    line-height: 1.6;
    margin: 0 0 8px 0;
}

.cw-modal-body {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.5rem;
    font-weight: 300;
    color: white;
    line-height: 1.6;
    text-align: left;
    margin: 0 0 15px 0;
}

.cw-modal-buttons {
    display: flex;
    gap: 10px;
}

.cw-btn {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.45rem;
    color: white;
    padding: 6px 19px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cw-btn:hover,
.cw-btn:focus {
    background-color: rgba(255, 255, 255, 0.2);
    outline: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-container {
        padding: 15px 0;
        /* Mobile: Keep grid structure for alignment */
        grid-template-columns: 1fr;
        gap: 3%;  /* Match mobile gap */
    }

    .search-box {
        /* Mobile: Larger default width for easier tapping */
        width: 100%;
        margin-left: auto;  /* Keep right alignment */
    }
    
    .search-box:focus {
        /* Mobile: Full column width */
        width: 100%;
        margin-left: 0;
    }

    .blog-container {
        grid-template-columns: 1fr;
        gap: 1%;
        padding: 5px;
    }

    .post-item {
        padding: 4%;
        margin-bottom: 15px;
    }
    
    .case-toggle-container {
        position: static;
        text-align: center;
        margin-bottom: 20px;
    }

    .post-container {
        width: min(450px, 100%);
        padding: 2px;
    }

    .post-title {
        font-size: 0.95rem;
    }

    .post-content {
        font-size: 0.75rem;
    }

    .post-content p,
    .post-content div {
        font-size: 0.85rem;
    }

    .post-meta, .post-tags {
        font-size: 0.65rem;
    }

    .navigation a {
        display: block;
        margin: 10px 0;
    }
        .search-container form {
        grid-column: 1;  /* Mobile: Use first column instead of second */
    }

    /* content warning modal — mobile */
    .cw-modal-box {
        padding: 15px;
        width: min(89%, 100%);   
    }

    .cw-modal-title,
    .cw-modal-body {
        font-size: 0.65rem;
    }

    .cw-btn {
        font-size: 0.6rem;
        padding: 15px 16%;
    }
}