/*
Theme Name: CL1
Theme URI: https://crimelibrary.org
Author: Crime Library Team
Author URI: https://crimelibrary.org
Description: Fast, mobile-responsive theme for Crime Library with smart layout and AdSense integration
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cl1
*/

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Georgia, "Times New Roman", serif;
    background: #e3e3e3;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #000;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   WRAPPER & LAYOUT
   ======================================== */
.site-wrapper {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 0 0 0;
    width: 100%;
}

/* ========================================
   HEADER - BOX SUS cu LOGO
   ======================================== */
.site-header {
    background: #e8e7d0;
    padding: 20px;
    text-align: center;
    margin-bottom: 10px;
}

.site-logo img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.main-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    align-items: flex-start;
}

/* ========================================
   FIXED TOP UTILITY (Back + Hamburger)
   ======================================== */
:root {
    --top-utility-height: 52px;
}

.top-utility {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1200;
    display: none;
    gap: 10px;
    align-items: center;
}

/* Show the utility bar on single posts (desktop + mobile) */
body.single .top-utility {
    display: flex;
}

.utility-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--top-utility-height);
    padding: 0 14px;
    border: none;
    border-radius: 12px;
    background: #3d807e;
    color: #fff;
    font-family: Verdana, Arial, sans-serif;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* Make hamburger a square, easier target */
.utility-btn.hamburger-menu {
    width: var(--top-utility-height);
    padding: 0;
    font-size: 24px;
}

/* ========================================
   BOX STÂNGA - CONTENT
   ======================================== */
.content {
    width: 740px;
    padding: 30px 30px 30px 40px;
    background: #ffffff;
    font-family: Georgia, "Times New Roman", serif;
    box-shadow: 0 0 8px rgba(0,0,0,0.08);
}


/* ========================================
   POSTS
   ======================================== */
.post {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e8e8e8;
    overflow: hidden;
}

.post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.post-title {
    font-size: 28px;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.post-title a {
    color: #1a1a1a;
}

.post-title a:hover {
    color: #d32f2f;
}

.post-media {
    float: left;
    width: 200px;
    margin-right: 20px;
}

.post-thumbnail {
    margin-bottom: 10px;
}

.post-thumbnail img {
    width: 200px;
    height: auto;
    display: block;
}

.post-share {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 11px;
    font-family: Verdana, Arial, sans-serif;
    font-weight: bold;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
}

.share-btn:hover {
    opacity: 0.8;
}

.share-fb {
    background: #3b5998;
}

.share-reddit {
    background: #ff4500;
}

.share-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.post-content {
    overflow: hidden;
}

.post-excerpt {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 10px;
}

.read-more {
    color: #d32f2f;
    font-weight: bold;
    font-size: 13px;
}

.read-more:hover {
    text-decoration: underline;
}

.adsense-content {
    margin: 30px 0;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
}

/* ========================================
   BOX DREAPTA - SIDEBAR
   ======================================== */
.sidebar {
    width: 360px;
    padding: 30px 25px;
    background: #e8e7d0;
    font-family: Verdana, Arial, sans-serif;
    box-shadow: 0 0 8px rgba(0,0,0,0.08);
}


.search-box {
    margin-bottom: 25px;
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 13px;
    background: #fff;
}

.widget {
    margin-bottom: 25px;
}

.widget-title {
    background: #3d807e;
    color: #fff;
    padding: 14px 15px;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1.5px;
    font-family: Verdana, Arial, sans-serif;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -1px 0 rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.widget-content {
    background: #fff;
    border: 1px solid #d5d5d5;
    border-top: none;
}

.cat-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 14px;
    font-weight: bold;
}

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

.cat-item a {
    color: #333;
    display: block;
}

.cat-item a:hover {
    color: #d32f2f;
}

.cat-item.current > a {
    color: #d32f2f;
}

.cat-parent {
    cursor: pointer;
}

/* No arrows on category parents */
.cat-parent::after {
    content: "";
}

.cat-children {
    display: none;
    padding-left: 15px;
    margin-top: 10px;
}

.cat-children.open {
    display: block;
}

.cat-child {
    padding: 8px 0;
    font-size: 12px;
    font-weight: normal;
}

.cat-child a {
    color: #666;
}

.cat-child a:hover {
    color: #d32f2f;
}

.sidebar-list {
    padding: 0;
}

.sidebar-list li {
    padding: 12px 15px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 12px;
    line-height: 1.5;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-list a {
    color: #333;
}

.sidebar-list a:hover {
    color: #d32f2f;
}

.sidebar-list .bullet {
    color: #d32f2f;
    margin-right: 6px;
}

.adsense-sidebar {
    margin: 25px 0;
    text-align: center;
}

/* ========================================
   MOBILE OVERLAY (drawer)
   ======================================== */

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: #e8e7d0;
    z-index: 1100; /* below .top-utility (1200) so buttons remain clickable */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);

    /* Closed state must be non-interactive (prevents invisible click blockers) */
    transform: translateX(105%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;

    /* Keep overlay content below the top utility bar */
    padding: calc(var(--top-utility-height) + 28px) 25px 30px;
}

.sidebar-overlay.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Collapse to one column at <=1024px and use the overlay sidebar */
@media (max-width: 1024px) {
    .site-wrapper { padding: 10px; }

    .site-header { padding: 15px 10px; margin-bottom: 8px; }

    .main-wrapper { flex-direction: column; gap: 12px; }

    .content {
        width: 100%;
        max-width: 820px;
        margin: 0 auto;
        padding: 20px 15px;
    }

    .sidebar { display: none; }

    /* On mobile/tablet, show the utility bar (hamburger; back appears on single only) */
    .top-utility { display: flex; }

    .sidebar-overlay { display: block; }

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

    .post-title { font-size: 22px; margin-bottom: 12px; }

    .post-media { float: none; width: 100%; margin-right: 0; margin-bottom: 15px; }

    .post-thumbnail img { width: 100%; }

    .post-excerpt { font-size: 15px; }
}

@media (max-width: 480px) {
    .post-title { font-size: 20px; }
    .share-btn { font-size: 10px; padding: 5px 10px; }
}
        font-size: 20px;
    }

    .share-btn {
        font-size: 10px;
        padding: 5px 10px;
    }
}
/* ========================================
   SINGLE POST
   ======================================== */

body.single .sidebar {
    display: none !important;
}

body.single .main-wrapper {
    display: block;
}

body.single .content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 34px 28px 60px;
}

.single-post-content {
    font-size: 16px;
    line-height: 1.8;
}

.single-post-content h1,
.single-post-content h2 {
    color: #1a1a1a;
    margin: 1.5em 0 0.8em;
    font-weight: bold;
}

.single-post-content h1 {
    font-size: 32px;
    border-bottom: 3px solid #d32f2f;
    padding-bottom: 10px;
}

.single-post-content h2 {
    font-size: 24px;
}

.single-post-content p {
    margin: 1.1em 0;
}

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

@media (max-width: 768px) {
    body.single .content {
        padding: 18px 16px 90px;
    }

    .single-post-content h1 {
        font-size: 26px;
    }

    .single-post-content h2 {
        font-size: 20px;
    }

    /* Slightly smaller buttons on small screens */
    :root { --top-utility-height: 48px; }
}

/* ========================================
   UTILITIES
   ======================================== */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}


/* ========================================
   MOBILE OVERLAY CLOSE + SCROLL LOCK
   ======================================== */

body.menu-open {
    overflow: hidden;
}

.overlay-close {
    position: sticky;
    top: 12px;
    float: right;
    margin: 8px 8px 12px 0;
    z-index: 1150;
    background: #3d807e;
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* ========================================
   MOBILE: SIDEBAR OVERLAY SAFETY
   - when closed: not clickable
   - when open: slides in, does not fight top utility
   ======================================== */
.sidebar-overlay {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    right: 0;
    transform: translateX(100%);
    transition: transform 0.25s ease, opacity 0.2s ease, visibility 0s linear 0.25s;
    z-index: 1100;
    padding-top: calc(var(--top-utility-height) + 18px);
}

.sidebar-overlay.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    transition: transform 0.25s ease, opacity 0.2s ease;
}


