/**
 * The Sappic Review - Main Stylesheet
 * @version 2.6.0 (FINAL, STABLE - Rebuilt slide-out menu, fixed all layouts)
 */

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
1.0 Core Setup & Variables
2.0 General Typography & Links
3.0 Layout & Helpers (Mobile-First)
4.0 Forms & Buttons
5.0 Header & Navigation (Mobile-First)
6.0 Hero Search Section
7.0 Homepage, Archive & Card Layouts (Mobile-First)
8.0 Single Post & Page Content
8.5 Custom Content Blocks & Single Post Enhancements
9.0 Sidebar & Widgets
10.0 Footer & Footer Widgets
11.0 Media Queries (Tablet & Desktop Overrides)
12.0 Live Search Results
--------------------------------------------------------------*/

/*--------------------------------------------------------------
1.0 Core Setup & Variables
--------------------------------------------------------------*/
:root {
    --tsr-primary-color: #D946EF;
    --tsr-secondary-color: #f472b6;
    --tsr-dark-text: #1f2937;
    --tsr-light-text: #6b7280;
    --tsr-border-color: #e5e7eb;
    --tsr-background-light: #f9fafb;
    --tsr-white: #ffffff;
    --tsr-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --tsr-border-radius: 12px;
    --tsr-content-width: 1280px;
}
body {
    font-family: var(--tsr-font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--tsr-dark-text);
    background-color: var(--tsr-white);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.menu-active { overflow: hidden; }
*, *::before, *::after { box-sizing: border-box; }

/*--------------------------------------------------------------
2.0 General Typography & Links
--------------------------------------------------------------*/
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; margin: 1.5em 0 0.5em 0; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
a { color: var(--tsr-primary-color); text-decoration: none; }
a:hover { color: var(--tsr-dark-text); }

/*--------------------------------------------------------------
3.0 Layout & Helpers (Mobile-First)
--------------------------------------------------------------*/
.site-content { max-width: var(--tsr-content-width); margin: 0 auto; padding: 20px; }
.container-with-sidebar { display: grid; grid-template-columns: 1fr; gap: 30px; }
.site-main { min-width: 0; }
.screen-reader-text { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/*--------------------------------------------------------------
4.0 Forms & Buttons
--------------------------------------------------------------*/
button, input[type="submit"], .cta-button {
    background-color: var(--tsr-primary-color); color: var(--tsr-white); padding: 12px 24px; border-radius: 8px; font-weight: 600; text-decoration: none; display: inline-block; border: none; cursor: pointer; transition: background-color 0.2s ease;
}
button:hover, input[type="submit"]:hover, .cta-button:hover { background-color: #c026d3; color: var(--tsr-white); text-decoration: none; }

/*--------------------------------------------------------------
5.0 Header & Navigation (Mobile-First) - REBUILT WITH SLIDE-OUT ANIMATION
--------------------------------------------------------------*/
.site-header { padding: 15px 24px; border-bottom: 1px solid var(--tsr-border-color); display: flex; align-items: center; justify-content: space-between; gap: 15px; position: relative; z-index: 1001; }
.site-branding { flex-shrink: 0; }
.site-branding .custom-logo { max-height: 40px; width: auto; }
.header-right { flex-shrink: 0; }

/* Menu Display Logic */
.desktop-navigation { display: none; } /* Hide desktop menu on mobile */
.mobile-navigation { flex-grow: 1; }

/* Mobile Menu Panel Styles */
.mobile-navigation ul {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh; /* Full viewport height */
    background: var(--tsr-white);
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 80px 0; /* Top padding, no side padding */
    margin: 0;
    list-style: none;
    /* --- Animation logic --- */
    transform: translateX(-100%);
    transition: transform 0.35s ease-in-out, visibility 0.35s;
    visibility: hidden;
}

/* Toggled state: slide the menu in */
.mobile-navigation.toggled > ul {
    transform: translateX(0);
    visibility: visible;
}

/* Style for individual menu items */
.mobile-navigation ul li a {
    display: block;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--tsr-dark-text);
    border-bottom: 1px solid var(--tsr-border-color);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.mobile-navigation ul li:first-child a {
    border-top: 1px solid var(--tsr-border-color);
}
.mobile-navigation ul li a:hover,
.mobile-navigation ul .current-menu-item > a {
    background-color: var(--tsr-background-light);
    color: var(--tsr-primary-color);
}

.main-navigation a { text-decoration: none !important; }

/* Hamburger Icon Styles */
.menu-toggle { display: block; background: none; border: none; padding: 8px; cursor: pointer; position: relative; width: 30px; height: 22px; }
.icon-bars { display: block; position: absolute; top: 50%; right: 0; width: 100%; height: 2px; background-color: var(--tsr-dark-text); transform: translateY(-50%); transition: background-color 0.3s ease-in-out; }
.icon-bars::before, .icon-bars::after { content: ''; display: block; position: absolute; right: 0; width: 100%; height: 2px; background-color: var(--tsr-dark-text); transition: transform 0.3s ease-in-out; }
.icon-bars::before { transform: translateY(-8px); }
.icon-bars::after { transform: translateY(8px); }

/* Hamburger to "X" (Close) transition */
.mobile-navigation.toggled ~ .header-right .menu-toggle .icon-bars { background-color: transparent; }
.mobile-navigation.toggled ~ .header-right .menu-toggle .icon-bars::before { transform: translateY(0) rotate(45deg); }
.mobile-navigation.toggled ~ .header-right .menu-toggle .icon-bars::after { transform: translateY(0) rotate(-45deg); }

/* Menu Overlay for closing */
body.menu-active::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}


/*--------------------------------------------------------------
6.0 - 10.0 (No changes needed)
--------------------------------------------------------------*/
.hero-search-wrapper { background-color: #111827; width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; }
.hero-search-container { padding: 0; background-image: linear-gradient(45deg, rgba(79, 70, 229, 0.9), rgba(162, 28, 175, 0.9)); color: var(--tsr-white); text-align: center; }
.hero-search-inner { max-width: var(--tsr-content-width); margin: 0 auto; padding: 40px 20px; }
.hero-search-title { color: var(--tsr-white); font-size: 2rem; margin: 0 0 10px 0; }
.hero-search-subtitle { font-size: 1.1rem; opacity: 0.8; margin-bottom: 30px; }
.hero-search-form { position: relative; max-width: 600px; margin: 0 auto; }
.hero-search-field { width: 100%; height: 50px; padding: 0 120px 0 20px; border-radius: 99px; border: 1px solid transparent; font-size: 1rem; color: var(--tsr-dark-text); }
.hero-search-submit { position: absolute; top: 4px; right: 4px; bottom: 4px; width: 100px; background-color: var(--tsr-primary-color); border: none; border-radius: 99px; color: var(--tsr-white); cursor: pointer; font-weight: 600; }
.category-tabs-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; list-style: none; padding: 0; margin-top: 30px; }
.category-tab-trigger { padding: 8px 18px; border: 1px solid rgba(255,255,255,0.3); border-radius: 99px; font-weight: 500; color: rgba(255,255,255,0.8); }
.category-tab-trigger.active, .category-tab-trigger:hover { background-color: var(--tsr-white); color: var(--tsr-dark-text); border-color: var(--tsr-white); }
.homepage-section { margin-bottom: 50px; }
.section-title { font-size: 1.2rem; text-transform: uppercase; }
.posts-container-grid-4-col, .archive-posts-grid, .tab-posts-container { display: grid; grid-template-columns: 1fr; gap: 20px; }
.card-item { background: var(--tsr-white); border: 1px solid var(--tsr-border-color); border-radius: var(--tsr-border-radius); overflow: hidden; }
.card-thumbnail img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.card-content { padding: 15px; }
.card-title { font-size: 1.1rem; margin: 0; line-height: 1.4; }
.card-title a { color: var(--tsr-dark-text); }
.entry-content img, .entry-content video, .entry-content iframe  { max-width: 100%; height: auto; border-radius: var(--tsr-border-radius); }
.responsive-video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin-bottom: 1.5em; border-radius: var(--tsr-border-radius); }
.responsive-video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.product-item { background: var(--tsr-background-light); padding: 20px; margin-bottom: 20px; border-left: 4px solid var(--tsr-primary-color); border-radius: var(--tsr-border-radius); }
.product-item .product-name { font-size: 1.5em; font-weight: 700; }
.product-review { margin-top: 10px; color: var(--tsr-light-text); }
.product-price { margin-top: 10px; font-weight: 700; font-size: 1.2em; color: var(--tsr-secondary-color); }
.howto-container { margin: 30px 0; border: 1px solid var(--tsr-border-color); border-radius: var(--tsr-border-radius); overflow: hidden; }
.howto-step { padding: 20px; border-bottom: 1px solid var(--tsr-border-color); }
.howto-step:last-child { border-bottom: none; }
.faq-container { margin: 30px 0; }
.faq-item { margin-bottom: 10px; border: 1px solid var(--tsr-border-color); border-radius: var(--tsr-border-radius); overflow: hidden; }
.faq-question { font-weight: 700; background: var(--tsr-background-light); padding: 15px 20px; cursor: pointer; }
.faq-answer { padding: 15px 20px; }
.comparison-table-container { overflow-x: auto; margin: 30px 0; }
.comparison-table { width: 100%; border-collapse: collapse; text-align: center; }
.comparison-table th, .comparison-table td { padding: 15px; border: 1px solid var(--tsr-border-color); vertical-align: middle; }
.comparison-table thead { background-color: var(--tsr-primary-color); color: var(--tsr-white); }
.comparison-table .feature-column { background: var(--tsr-background-light); text-align: left; font-weight: 600; }
.entry-header { margin-bottom: 30px; }
.post-thumbnail img { border-radius: var(--tsr-border-radius); }
.entry-title { font-size: 2.5em; margin-bottom: 15px; }
.entry-meta { color: var(--tsr-light-text); display: flex; align-items: center; flex-wrap: wrap; gap: 15px; font-size: 0.9em; }
.trust-score { background-color: var(--tsr-background-light); padding: 5px 10px; border-radius: 5px; font-weight: 700; }
.zen-mode-trigger { background: none; border: 1px solid var(--tsr-border-color); padding: 5px 10px; border-radius: 5px; cursor: pointer; }
.zen-mode-active { overflow: hidden; }
.zen-mode-active .site-header, .zen-mode-active .site-footer, .zen-mode-active #secondary.widget-area { display: none; }
.zen-mode-active .site-content { max-width: var(--tsr-content-width); margin: 0 auto; padding-top: 40px; }
.author-box { display: flex; flex-direction: column; text-align: center; align-items: center; background-color: var(--tsr-background-light); padding: 30px; margin-top: 40px; border-radius: var(--tsr-border-radius); gap: 20px; }
.author-avatar img { border-radius: 50%; max-width: 100px; }
#secondary.widget-area { background-color: var(--tsr-background-light); padding: 20px; border-radius: var(--tsr-border-radius); }
.widget { margin-bottom: 40px; }
.widget-title { font-size: 1.2rem; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget_tsr_recent_posts_widget li { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 15px; }
.widget_tsr_recent_posts_widget .post-thumbnail { flex-shrink: 0; }
.widget_tsr_recent_posts_widget .post-thumbnail img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }
.widget_tsr_recent_posts_widget .post-title { font-weight: 600; line-height: 1.4; font-size: 0.95rem; }
.site-footer { background-color: var(--tsr-dark-text); color: #a0aec0; padding-top: 1px; margin-top: 40px; }
#footer-widget-area.widget-area { display: grid; grid-template-columns: 1fr; gap: 40px; padding: 60px 20px; max-width: var(--tsr-content-width); margin: 0 auto; }
#footer-widget-area .widget-title { color: var(--tsr-white); }
#footer-widget-area a:hover { color: var(--tsr-white); }
.site-info { padding: 30px 20px; text-align: center; background-color: #111827; }

/*--------------------------------------------------------------
11.0 Media Queries (Tablet & Desktop Overrides)
--------------------------------------------------------------*/
/* --- Tablet (768px and up) --- */
@media (min-width: 768px) {
    body { font-size: 18px; }
    .container-with-sidebar { grid-template-columns: 1fr 300px; }
    .site-main { order: 0; }
    #secondary.widget-area { order: 1; }
    .archive-posts-grid { grid-template-columns: repeat(2, 1fr); }
    .posts-container-grid-4-col { grid-template-columns: repeat(3, 1fr); }
    .hero-search-title { font-size: 2.8rem; }
    .card-title { font-size: 1.25rem; }
    .author-box { flex-direction: row; text-align: left; align-items: flex-start; }
}

/* --- Desktop (1024px and up) --- */
@media (min-width: 1024px) {
    .site-header {
        max-width: var(--tsr-content-width);
        margin-left: auto;
        margin-right: auto;
        padding-left: 20px;
        padding-right: 20px;
    }

    .menu-toggle, .mobile-navigation { display: none; }
    .desktop-navigation { display: flex; flex-grow: 1; justify-content: center; }
    
    .desktop-navigation ul {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 30px;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .desktop-navigation a {
        font-weight: 600;
        padding: 5px 0;
        position: relative;
    }
    
    .desktop-navigation a::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 0;
        height: 2px;
        background-color: var(--tsr-primary-color);
        transition: width 0.3s ease;
    }
    
    .desktop-navigation a:hover::after,
    .desktop-navigation .current-menu-item > a::after {
        width: 100%;
    }
    
    .archive-posts-grid { grid-template-columns: repeat(3, 1fr); }
    .posts-container-grid-4-col { grid-template-columns: repeat(4, 1fr); }
    #footer-widget-area.widget-area { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
}

/* --- Mobile Specific Fixes --- */
@media (max-width: 767px) {
    .entry-title {
        font-size: 1.8rem;
    }

    .single .site-main > article > .post-thumbnail {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        max-width: calc(100% + 40px);
        border-radius: 0;
    }
}

/*--------------------------------------------------------------
12.0 Live Search Results
--------------------------------------------------------------*/
#live-search-results-container {
    position: relative;
    max-width: 600px;
    margin: 10px auto 0;
    z-index: 100;
}
.live-search-results {
    position: absolute;
    width: 100%;
    background: var(--tsr-white);
    border: 1px solid var(--tsr-border-color);
    border-radius: var(--tsr-border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    text-align: left;
    overflow: hidden;
}
.live-search-results li a {
    display: block;
    padding: 10px 20px;
    color: var(--tsr-dark-text);
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.live-search-results li a:hover {
    background-color: var(--tsr-background-light);
    color: var(--tsr-primary-color);
}
.live-search-results .no-results,
.live-search-results .loading-results {
    padding: 20px;
    text-align: center;
    color: var(--tsr-light-text);
}