/* =========================================
   DARK REVIEWS - CUSTOM BRAND THEME
========================================= */

/* --- Base Styles & Typography --- */
html {
    scroll-behavior: smooth;
}

body {
    /* Clean, highly readable sans-serif font */
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #293132;
    /* Charcoal background */
    color: #e0e0e0;
    /* Off-white text for easy reading */
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.site-header { 
    display: grid; 
    grid-template-columns: 1fr auto 1fr; /* 3 columns: flexible sides, perfectly sized center */
    align-items: center; 
    margin-bottom: 40px; 
    border-bottom: 2px solid #8959FA; 
    padding-bottom: 20px; 
}

h1.site-title { 
    grid-column: 2; /* Locks the title to the exact center column */
    color: #05F5AE; 
    margin: 0; 
    letter-spacing: 1.5px; 
    text-shadow: 0 0 12px rgba(5, 245, 174, 0.3);
    text-align: center;
}

/* --- Sidebar & TOC Styles --- */

.archive-select {
    width: 100%;
    padding: 12px 15px;
    box-sizing: border-box;
    background: #1e2425; 
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95em;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.archive-select:focus {
    border-color: #05F5AE;
    box-shadow: 0 0 8px rgba(5, 245, 174, 0.3);
}

.archive-select option {
    background: #293132;
    color: #e0e0e0;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    z-index: 10;
}

.toc {
    background: #333d3e;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.toc h3 {
    margin-top: 0;
    font-size: 1.1em;
    color: #8959FA;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 14px;
    line-height: 1.4;
}

.toc a {
    text-decoration: none;
    color: #e0e0e0;
    font-size: 0.95em;
    display: block;
    transition: all 0.3s ease;
}

.toc a:hover {
    color: #05F5AE;
    text-shadow: 0 0 8px rgba(5, 245, 174, 0.4);
    transform: translateX(5px);
}

/* --- Post Styles --- */
.post {
    background: #333d3e;
    padding: 35px;
    margin-bottom: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.post:hover {
    transform: translateY(-2px);
}

.post-title {
    margin-top: 0; 
    margin-bottom: 10px;
    font-size: 2.4em;       /* Now visibly larger than the 2.2em body headings */
    color: #C4A1FF;         /* A softer, highly luminous lavender variant of your purple */
    font-weight: 800;       /* Makes the title look punchy and authoritative */
    letter-spacing: -0.3px; /* Tightens the large letters slightly for a premium feel */
}

.post-date {
    color: #a0aab2;
    font-size: 0.9em;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}


/* --- Split Review Layout Architecture --- */
.review-header {
    display: block;      /* Turns OFF Flexbox to allow wrapping */
   /* margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);*/
    overflow: hidden;    /* Acts as a 'clearfix' so the dotted line stays below the image */
}

.featured-thumb-wrap {
    float: left;         /* Pins the image left so text flows naturally around it */
    margin-right: 20px;  /* Adds breathing room between the image and text */
    margin-bottom: 10px; /* UPDATED: Now matches margin-right for perfect uniform wrapping */
    width: 250px;
    height: 247px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    overflow: hidden;
}

.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* Fallback (PHP overrides this inline now) */
    margin: 0;
    display: block;
}

.review-overview {
    display: block;
    line-height: 1.6;
    font-size: 1.05em;
    overflow-wrap: break-word; /* Keeps your long-string anti-break fix active */
}

/* Forces the top text to sit perfectly flush with the top edge of the image */
.review-overview > *:first-child {
    margin-top: -5px;
    line-height: 1.1; 
}

/* Forces the final paragraph in the overview to sit perfectly flush at the bottom */
.review-overview > *:last-child {
    margin-bottom: 0; 
}

.review-overview h1 {
    margin-top: 0;
    color: #FFD166;      
    font-size: 2.2em;
    margin-bottom: 15px;
}

.review-body {
    line-height: 1.8;
    color: #d5dadd;
    font-size: 1.05em;
    clear: both; /* Ensures body text clears the floated image if overview is short */
}

.review-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-top: 15px;
}

/* Tames the massive default browser gap above your subheadings */
.review-body h1 {
    margin-top: 0;
    color: #FFD166;      
    font-size: 2.2em;
    margin-bottom: 15px;
}


/* --- Buttons & UI (Admin Controls) --- */
.admin-bar {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

/* Create Button (Neon Green) */
.btn-primary {
    background-color: #05F5AE;
    color: #121212;
    box-shadow: 0 4px 15px rgba(5, 245, 174, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(5, 245, 174, 0.6);
    transform: translateY(-2px);
}

/* Edit Button (Purple) */
.btn-success {
    background-color: #8959FA;
    color: white;
    box-shadow: 0 4px 15px rgba(137, 89, 250, 0.2);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(137, 89, 250, 0.6);
    transform: translateY(-2px);
}

/* Delete Button (Punchy Red) */
.btn-danger {
    background-color: #EF476F;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 71, 111, 0.2);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 71, 111, 0.6);
    transform: translateY(-2px);
}

/* Warning/Draft Button (Yellow) */
.btn-warning {
    background-color: #FFD166;
    color: #121212;
    box-shadow: 0 4px 15px rgba(255, 209, 102, 0.2);
}

.btn-warning:hover {
    box-shadow: 0 6px 20px rgba(255, 209, 102, 0.6);
    transform: translateY(-2px);
}

.logout-btn { 
    grid-column: 1; 
    justify-self: start; 
    position: static; 
}

.create-btn { 
    grid-column: 3; 
    justify-self: end; 
    position: static;
}

/* --- Top Right Lock Icon --- */
.login-icon { 
    grid-column: 3; 
    justify-self: end; 
    cursor: pointer; 
    opacity: 0.1; 
    font-size: 24px; 
    transition: all 0.3s; 
    color: #e0e0e0;
}

.login-icon:hover { 
    opacity: 1; 
    color: #05F5AE; 
    text-shadow: 0 0 15px rgba(5, 245, 174, 0.4); 
}

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #293132;
    color: #e0e0e0;
    margin: 5vh auto;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid #8959FA;
    max-height: 85vh; 
    overflow-y: auto; 
}

.login-modal {
    max-width: 350px;
    margin: 15% auto;
    text-align: center;
}

.close {
    color: #a0aab2;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #EF476F;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #05F5AE;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #555;
    background: #1e2425;
    color: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #05F5AE;
    box-shadow: 0 0 8px rgba(5, 245, 174, 0.3);
}

/* --- Pagination Styles --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 50px 0;
}

.page-link {
    padding: 10px 18px;
    background: #333d3e;
    border: none;
    text-decoration: none;
    color: #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.page-link:hover {
    background: #8959FA;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(137, 89, 250, 0.4);
}

.page-link.active {
    background: #05F5AE;
    color: #121212;
    box-shadow: 0 0 15px rgba(5, 245, 174, 0.4);
}

.page-link.disabled {
    color: #555;
    cursor: not-allowed;
    background: #1e2425;
    box-shadow: none;
}

.page-link.disabled:hover {
    transform: none;
    background: #1e2425;
}

/* --- Layout Structure --- */
.layout-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-content {
    flex-grow: 1;
    min-width: 0;
}


/* =========================================
   MOBILE RESPONSIVENESS (Screens under 768px)
========================================= */
@media (max-width: 768px) {
    
    /* 1. Stack the Main Layout */
    .layout-wrapper {
        flex-direction: column; 
    }

    /* 2. Tame the Sidebar */
    .sidebar {
        width: 100%; 
        position: relative; 
        top: 0;
        margin-bottom: 20px;
    }

    /* 3. Reorganize the Header */
    .site-header {
        display: flex; 
        flex-direction: column; 
        gap: 15px;
        text-align: center;
    }
    
    .login-icon {
        display: none; 
    }

    /* 4. Fix the Flexbox Split Layout for Mobile */
    .review-header {
        display: flex; /* Turns Flexbox ON just for mobile stacking */
        flex-direction: column; 
        gap: 15px;
    }

    .featured-thumb-wrap {
        float: none; /* Stops the float on tiny screens */
        width: 100%; 
        height: 200px; 
        margin: 0 0 10px 0; 
    }

    /* 5. General Mobile Polish */
    body {
        padding: 15px; 
    }
    
    .post {
        padding: 20px; 
    }
    
    .admin-bar {
        flex-direction: column;
    }
    
    .admin-bar .btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    /* 6. Rating Title Polish */
    .review-overview h1 {
        margin-top: 15px;   /* Adds the breathing room below the image */
        text-align: center; /* Centers ONLY this specific heading */
    }
}