/*
Theme Name: Infer02
Theme URI: https://infernew.com
Author: Trae AI
Author URI: https://infernew.com
Description: A modern WordPress theme with full block editor support.
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: infer02
Tags: block-styles, wide-blocks, full-width-template, block-patterns
*/

/* ========================================
   CSS Variables & Base Styles
   ======================================== */
:root {
    --content-width: min(95vw, 1000px);
    --wide-width: min(98vw, 1000px);
    --spacing-base: clamp(0.75rem, 2vw, 1rem);
    --spacing-large: clamp(1.5rem, 3vw, 2rem);
    --brand: #6366f1;
    --brand-2: #22d3ee;
    --border: rgba(148, 163, 184, 0.18);
}

body {
    margin: 0;
    padding-top: 2.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: clamp(16px, 1vw + 14px, 18px);
    line-height: 1.6;
    overflow-x: hidden;
    color: #1f2937;
    background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
    width: 100%;
    max-width: 100%;
}

a {
    color: #eeaa00;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 1.1em;
}

a:hover {
    color: #ffcc00;
    cursor: pointer;
}

/* ========================================
   Admin Bar Toggle
   ======================================== */
.admin-bar-toggle {
    position: fixed;
    top: 32px;
    right: 10px;
    z-index: 100000;
    background: rgba(35, 40, 45, 0.9);
    color: #fff;
    border: none;
    border-radius: 0 0 4px 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: all 0.2s ease;
}

.admin-bar-toggle:hover {
    background: rgba(0, 133, 186, 0.9);
}

.admin-bar-toggle .toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

body.hide-admin-bar .admin-bar-toggle .toggle-icon {
    transform: rotate(180deg);
}

body.hide-admin-bar #wpadminbar {
    display: none !important;
}

body.hide-admin-bar {
    padding-top: 4.5rem !important;
}

body.hide-admin-bar .admin-bar-toggle {
    top: 0;
}

html.hide-admin-bar {
    margin-top: 0 !important;
}

/* ========================================
   Header Styles
   ======================================== */
.site-header {
    padding: 0.1rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(160%) blur(8px);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.12);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0.3rem 0.8rem;
    position: relative;
    box-sizing: border-box;
}

.site-branding {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.1rem 0;
    flex: 0 0 auto;
}

.site-title {
    margin: 0;
    font-size: clamp(1.2rem, 1.5vw + 0.8rem, 1.6rem);
    padding: 0 0.5rem;
}

.site-title a {
    text-decoration: none;
    color: #0f172a;
    letter-spacing: -0.02em;
}

/* Resource Navigation */
.resource-menu-toggle {
    display: none;
}

.resource-links-container {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0;
    flex: 1 1 auto;
}

.resource-link {
    text-decoration: none;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-block;
    box-sizing: border-box;
}

.resource-link:hover {
    color: var(--brand);
    border-color: rgba(99,102,241,0.25);
    background: rgba(99,102,241,0.08);
}

/* ========================================
   Content Layout
   ======================================== */
.site-content {
    max-width: var(--content-width);
    margin: 0.5rem auto 3rem;
    padding: var(--spacing-base);
    display: grid !important;
    grid-template-columns: 220px 1fr !important;
    grid-template-areas: "sidebar main" !important;
    gap: 1rem;
    align-items: start !important;
}

.no-sidebar .site-content {
    grid-template-columns: 1fr !important;
    grid-template-areas: "main" !important;
    max-width: 1200px !important;
}

.sidebar-left {
    grid-area: sidebar !important;
    order: 1;
    width: 100% !important;
    min-width: 220px !important;
    max-width: 220px !important;
    background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    border-radius: 16px !important;
    padding: 1rem !important;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.12) !important;
    margin: 0 !important;
}

.site-main {
    grid-area: main !important;
    order: 2;
    min-width: 0 !important;
    width: 100% !important;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 0.5px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 0 var(--spacing-base) 1rem !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    margin: 0 !important;
}

.posts-container {
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto !important;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.posts-container article {
    background: #f8fafc;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    padding: 0 var(--spacing-base) 1rem !important;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.12);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.posts-container article:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.35);
    border-color: rgba(148, 163, 184, 0.32);
}

/* ========================================
   Entry Title Styles
   ======================================== */
.entry-title {
    font-size: clamp(2.2rem, 4vw + 1.2rem, 2.8rem) !important;
    line-height: 1.0 !important;
    max-width: 100% !important;
    margin: 0 auto;
    padding: 1rem var(--spacing-base) 0 !important;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.entry-header {
    padding: 0 !important;
    margin: 0 !important;
}

.entry-header .entry-title,
.entry-header h1.entry-title,
.entry-header h2.entry-title {
    padding: 1rem var(--spacing-base) 0 !important;
    line-height: 1.0 !important;
    margin: 0 !important;
    display: block;
}

.entry-header h1.entry-title *,
.entry-header h2.entry-title *,
.entry-header h2.entry-title a {
    line-height: 1.0 !important;
    display: inline !important;
}

.entry-title a {
    color: #0f172a !important;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
    transition: color 0.2s ease, text-shadow 0.2s ease;
    line-height: 1.0 !important;
}

.entry-title a:hover {
    color: var(--brand-2) !important;
    text-shadow: 0 1px 10px rgba(34,211,238,0.35);
    text-decoration: none;
    cursor: pointer;
}

/* ========================================
   Entry Content Styles
   ======================================== */
.entry-content {
    max-width: 100% !important;
    margin: 0 auto;
    padding: 0.5rem var(--spacing-base) !important;
    width: 100%;
    box-sizing: border-box;
    font-size: clamp(18px, 1.2vw + 16px, 20px);
    line-height: 1.4;
    margin-top: 0;
    color: #374151;
}

.entry-header + .entry-content {
    margin-top: 0 !important;
    padding-top: 0.05rem !important;
}

.entry-content > * {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

.entry-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.entry-content > [class*="wp-block"] {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ========================================
   Sidebar Widget Styles
   ======================================== */
.sidebar-left .widget {
    background: #f8fafc;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sidebar-left .widget:last-child {
    margin-bottom: 0;
}

.sidebar-left .widget:hover {
    background: #eef2f7;
    border-color: rgba(0,0,0,0.12);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.12);
}

.sidebar-left .widget-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
    border-bottom: 2px solid rgba(99,102,241,0.4);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.sidebar-left .widget ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.sidebar-left .widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    margin: 0 !important;
}

.sidebar-left .widget ul li:last-child {
    border-bottom: none;
}

.sidebar-left .widget ul li:hover {
    background: rgba(99, 102, 241, 0.06);
    margin: 0 -0.75rem !important;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: 8px;
}

.sidebar-left .widget a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
    font-size: 1.15rem;
    line-height: 1.4;
}

.sidebar-left .widget a:hover {
    color: #6366f1;
}

/* ========================================
   WordPress Block Styles
   ======================================== */
.wp-block-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-block-cover {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.wp-block-gallery {
    display: grid;
    grid-gap: 1rem;
    margin: 0;
    padding: 0;
}

.alignfull {
    margin-left: calc(-100vw / 2 + 100% / 2);
    margin-right: calc(-100vw / 2 + 100% / 2);
    max-width: 100%;
    width: 100%;
}

.alignwide {
    margin-left: -2rem;
    margin-right: -2rem;
    max-width: calc(100% + 4rem);
    width: calc(100% + 4rem);
}

.aligncenter,
div.aligncenter,
.wp-block-image .aligncenter,
.wp-caption.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.alignleft,
.wp-block-image .alignleft,
.wp-caption.alignleft {
    float: left;
    margin-right: 1.5em;
}

.alignright,
.wp-block-image .alignright,
.wp-caption.alignright {
    float: right;
    margin-left: 1.5em;
}

.wp-block-image {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

figure:not([class*="align"]) {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   Post Categories
   ======================================== */
.post-categories {
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9rem;
    line-height: 1.6;
}

.post-categories .categories-label {
    color: #64748b;
    font-weight: 600;
    margin-right: 0.5rem;
}

.post-categories .category-link {
    display: inline-block;
    background: #f8fafc;
    color: #475569;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.post-categories .category-link:hover {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

/* ========================================
   Footer Styles
   ======================================== */
.site-footer {
    padding: var(--spacing-base);
    background: #0f172a;
    border-top: 1px solid var(--border);
}

.footer-widgets {
    max-width: var(--content-width);
    margin: 0 auto var(--spacing-base);
    padding: var(--spacing-base);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-base);
}

.widget {
    margin-bottom: var(--spacing-base);
}

.widget-title {
    color: #1A1A1A;
    font-size: 1.2rem;
}

.site-info {
    font-size: 0.875rem;
    color: #666666;
}

.site-info a {
    color: #eeaa00;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-info a:hover {
    color: #ffcc00;
}

/* ========================================
   Utility Classes
   ======================================== */
.post-separator {
    margin: 0rem 0;
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(148,163,184,0), rgba(148,163,184,0.6), rgba(148,163,184,0));
}

.post-thumbnail {
    margin-bottom: 1.5rem;
    overflow: hidden;
    border-radius: 8px;
    text-align: center;
}

.post-thumbnail img {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.more-link {
    display: inline-block;
    margin-top: 1rem;
    color: #1e88e5;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.more-link:hover {
    color: #0d47a1;
}

/* ========================================
   Desktop Styles (min-width: 769px)
   ======================================== */
@media (min-width: 769px) {
    .site-content {
        grid-template-columns: 220px 1fr !important;
        grid-template-areas: "sidebar main" !important;
        max-width: 1400px !important;
    }
    
    .no-sidebar .site-content {
        grid-template-columns: 1fr !important;
        grid-template-areas: "main" !important;
        max-width: 1200px !important;
    }
    
    .site-main {
        padding-top: 2rem !important;
    }
    
    /* Title spacing and sizing for desktop */
    .entry-title {
        font-size: clamp(1.8rem, 3vw + 0.8rem, 2.2rem) !important;
        padding: 1.5rem var(--spacing-base) 0 !important;
        margin-top: 2.5rem !important;
    }
    
    /* Content spacing for desktop */
    .entry-header + .entry-content {
        padding: 1rem var(--spacing-base) 0.5rem !important;
        margin-top: 0 !important;
    }
    
    article .entry-content {
        padding: 1rem var(--spacing-base) 0.5rem !important;
    }
    
    /* Larger navigation for desktop */
    .resource-link {
        font-size: 1.3rem !important;
        padding: 0.5rem 1rem !important;
        font-weight: 600 !important;
    }
    
    .youtube-preview iframe {
        width: 560px;
        height: 315px;
        max-width: 100%;
    }
}

/* ========================================
   Mobile Styles (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    body {
        padding-top: 4rem;
    }

    .site-header-inner {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.3rem 0.5rem;
    }

    .site-branding {
        flex: 1;
        padding-bottom: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }

    .resource-links-container {
        margin-top: 0;
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    
    .resource-link {
        font-size: 0.8rem;
        padding: 0.25rem;
    }

    .site-content {
        grid-template-columns: 1fr !important;
        grid-template-areas: "main" "sidebar" !important;
        padding: 0.5rem !important;
    }
    
    .sidebar-left {
        order: 2;
        max-width: 100% !important;
        min-width: auto !important;
    }
    
    .site-main {
        order: 1;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
        padding: var(--spacing-base) 0;
    }

    .widget {
        margin-bottom: calc(var(--spacing-base) * 1.5);
    }

    .site-info {
        text-align: center;
        padding: var(--spacing-base) 0;
    }

    .youtube-preview iframe {
        width: 100%;
        height: 200px;
    }
}

/* ========================================
   Mobile Menu Toggle (max-width: 900px)
   ======================================== */
@media (max-width: 900px) {
    .resource-menu-toggle {
        display: block !important;
        background: transparent;
        border: none;
        font-size: 2.8rem;
        cursor: pointer;
        padding: 0.3rem 0.5rem;
        margin: 0;
        color: #1A1A1A;
        z-index: 1001;
        flex-shrink: 0;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        line-height: 1;
        width: auto;
        height: auto;
    }
    
    .site-title, .site-title a, .site-title h1, .site-title p {
        order: 1;
        margin: 0;
    }
    
    .resource-links-container {
        display: none !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        z-index: 1000;
        padding: 0.5rem 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    
    .resource-links-container.active {
        display: flex !important;
        max-height: 500px;
        overflow: visible;
    }
    
    .resource-link {
        padding: 1rem;
        border-bottom: 1px solid #eee;
        font-size: 1.1rem;
        white-space: normal;
        text-align: center;
    }
    
    .resource-link:last-child {
        border-bottom: none;
    }
}
