/*
Theme Name: Astra Child
Theme URI: http://example.com/astra-child/
Description: Astra Child Theme for Anderson Materials Evaluation
Author: Antigravity
Author URI: http://example.com
Template: astra
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-child
*/

/* Custom CSS Enhancements */

/* =Header & Branding
--------------------------------------------- */
.ast-main-header-wrap {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ast-main-header-wrap:hover {
    background: rgba(255, 255, 255, 1);
}

/* Constrain logo size to look clean and modern */
.site-branding .custom-logo-link img.custom-logo {
    max-width: 80px !important;
    height: auto !important;
    display: block;
    transition: transform 0.3s ease;
}

.site-branding .custom-logo-link img.custom-logo:hover {
    transform: scale(1.05);
}

/* Flex branding layout for vertical centering */
.site-branding {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

/* Site Title styling */
.site-title a {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 700 !important;
    color: #1e293b !important;
    letter-spacing: -0.5px;
    line-height: 1.2 !important;
    transition: color 0.2s ease;
}

.site-title a:hover {
    color: #0284c7 !important;
}

/* Align navigation links vertically and add top/bottom bar padding */
.ast-primary-header-bar {
    padding: 10px 0 !important;
}

/* =Primary Navigation
--------------------------------------------- */
/* Global / Common Typography & Base styles */
.main-header-menu > .menu-item > a {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 500;
    color: #334155 !important;
    transition: color 0.3s ease;
}

.main-header-menu > .menu-item:hover > a {
    color: #0284c7 !important;
}

.main-header-menu .sub-menu .menu-item a {
    font-family: 'Inter', sans-serif;
    color: #475569 !important;
    transition: all 0.2s ease !important;
}

/* Mobile menu toggle */
.ast-menu-toggle {
    border-radius: 6px;
    transition: all 0.2s ease;
}

.ast-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Mobile-specific adjustments (max-width: 921px) */
@media screen and (max-width: 921px) {
    /* Reduce site title size on mobile to prevent horizontal overflow */
    .site-title a {
        font-size: 1.1rem !important;
    }
    
    /* Make branding and menu toggle layout clean on mobile */
    .site-branding {
        gap: 8px !important;
    }
    
    .site-branding .custom-logo-link img.custom-logo {
        max-width: 60px !important;
    }

    /* Sub-menu styling for mobile (Astra accordion dropdown) */
    .main-header-menu .sub-menu {
        background: #f8fafc !important;
        border-left: 2px solid #0284c7 !important;
        padding-left: 10px !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        border-top: none !important;
        border-right: none !important;
        border-bottom: none !important;
    }
    
    .main-header-menu .sub-menu .menu-item a {
        font-size: 0.85rem;
        padding: 10px 15px !important;
    }

    /* Scope mobile sidenav display and scroll options */
    #sidenav {
        top: 110px !important; /* Move higher up on mobile to avoid overlapping content */
        max-height: calc(100vh - 130px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    /* Override absolute positions for mobile sub-menus so they stack vertically */
    .sidebar-items > li > ul, .sidebar-items > ul > li > ul {
        position: static !important;
        width: 100% !important;
        margin-left: 0 !important;
        box-shadow: none !important;
        border: none !important;
        border-left: 2px solid #0284c7 !important;
        padding-left: 10px !important;
        background: #f8fafc !important;
        max-height: none !important; /* Let it grow naturally inside the scrolling sidebar */
        overflow: visible !important;
    }
    
    .sidebar-items li ul li ul {
        position: static !important;
        width: 100% !important;
        margin-left: 0 !important;
        border-left: 1px solid #cbd5e1 !important;
        padding-left: 10px !important;
        background: #ffffff !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* Desktop-specific layout & animations (min-width: 922px) */
@media screen and (min-width: 922px) {
    .site-title a {
        font-size: 1.35rem !important;
    }

    .main-header-menu > .menu-item > a {
        font-size: 0.95rem;
        position: relative;
        padding: 0 12px;
    }

    /* Nav Link Hover Underline Animation */
    .main-header-menu > .menu-item > a::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: -4px;
        left: 12px;
        background-color: #0284c7;
        transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .main-header-menu > .menu-item:hover > a::after {
        width: calc(100% - 24px);
    }

    /* Sub-menus dropdown style */
    .main-header-menu .sub-menu {
        border-radius: 8px !important;
        box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        padding: 8px 0 !important;
        background: #ffffff !important;
        transform: translateY(10px);
        transition: opacity 0.3s ease, transform 0.3s ease !important;
    }

    .main-header-menu .menu-item:hover > .sub-menu {
        transform: translateY(0);
    }

    .main-header-menu .sub-menu .menu-item a {
        font-size: 0.9rem;
        padding: 8px 20px !important;
    }

    .main-header-menu .sub-menu .menu-item:hover > a {
        background-color: #f1f5f9 !important;
        color: #0284c7 !important;
        padding-left: 24px !important;
    }
}

/* =Footer Enhancement
--------------------------------------------- */
#footer.site-footer {
    background-color: #0f172a !important; /* Elegant slate-900 background */
    color: #94a3b8 !important; /* Soft gray text */
    border-top: 4px solid #0284c7 !important; /* Vibrant brand highlight top border */
    padding: 40px 20px !important;
    font-family: 'Inter', sans-serif;
    text-align: center;
}

#footer-in {
    max-width: 980px;
    margin: 0 auto;
}

#copyright {
    font-size: 0.9rem;
    line-height: 1.6;
}

#copyright a {
    color: #e2e8f0 !important;
    text-decoration: none !important;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

#copyright a:hover {
    color: #38bdf8 !important; /* Sky blue hover */
    border-bottom-color: #38bdf8;
}

/* Footer card image container */
.footer-accept-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-accept-section strong {
    color: #f8fafc;
    font-weight: 600;
}

.cards-img {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
}

.footer-contact-section {
    color: #64748b;
}

.footer-contact-section a.special {
    color: #38bdf8 !important;
    font-weight: 500;
}

.footer-contact-section a.special:hover {
    color: #7dd3fc !important;
}

.footer-timestamp-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 25px !important;
    padding-top: 20px;
    color: #475569 !important;
}

/* =Homepage Slider Styling
--------------------------------------------- */
#slider {
    margin-top: 0px !important;
    margin-bottom: 35px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Hide featured images on pages to avoid huge duplicated images at the top of content */
.page .ast-single-post-featured-section {
    display: none !important;
}

/* =Vertical Sidebar Navigation
--------------------------------------------- */
#sidenav {
    position: fixed;
    left: 0;
    top: 150px;
    z-index: 99999;
    width: 24px; /* Slightly wider collapsed state for the vertical tab text */
    height: auto;
    background-color: #ffffff;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    border-radius: 0 12px 12px 0;
    overflow: visible !important; /* Allow absolute submenus to float outside the container */
    border: 1px solid rgba(2, 132, 199, 0.1);
    border-left: none;
}

/* Vertical tab label when collapsed */
#sidenav::after {
    content: "❯  N A V I G A T I O N";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(270deg);
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #0284c7;
    white-space: nowrap;
    letter-spacing: 2px;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
}

/* Hide label on hover or active state */
#sidenav:hover::after, #sidenav.active::after {
    opacity: 0;
    visibility: hidden;
}

/* Expand drawer on hover or active state */
#sidenav:hover, #sidenav.active {
    width: 260px;
}

/* Main sidebar container styling (handles both assigned menu and fallback container) */
#sidenav > .sidebar, #sidenav > .sidebar-items {
    z-index: 9999;
    position: relative;
    width: 240px; /* Force internal width so items don't reflow/wrap weirdly during transition */
    padding: 10px 10px 10px 5px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease 0.1s, visibility 0.2s ease 0.1s;
}

/* Reveal menu links on hover or active state */
#sidenav:hover > .sidebar, #sidenav:hover > .sidebar-items,
#sidenav.active > .sidebar, #sidenav.active > .sidebar-items {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Reset main menu list defaults and paddings to prevent horizontal shifting */
.sidebar-items, .sidebar-items ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

/* Style for the top-level menu items */
.sidebar-items > li, .sidebar-items > ul > li {
    list-style: none;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 0 20px 20px 0;
    background: #f8fafc;
    border-left: 3px solid #0284c7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: left;
    position: relative;
    transition: all 0.2s ease;
}

.sidebar-items > li:hover, .sidebar-items > ul > li:hover {
    background: #f0f9ff;
    transform: translateX(3px);
}

.sidebar ul li a {
    color: #334155;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none !important;
    display: block;
}

/* Style for the sub-menus dropdown */
.sidebar-items ul {
    font-size: 11.5px;
    margin-left: 0;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 5px 0;
    max-height: calc(100vh - 180px); /* Limit vertical height to screen viewport height */
    overflow-y: auto; /* Scrollable menu items if they overflow */
}

/* Custom scrollbar for sub-menus */
.sidebar-items ul::-webkit-scrollbar {
    width: 4px;
}
.sidebar-items ul::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Style for the second-level menu items */
.sidebar-items ul li {
    padding: 6px 16px;
    position: relative;
    transition: background-color 0.2s ease;
}

.sidebar-items ul li:hover {
    background-color: #f1f5f9;
}

.sidebar-items ul li:hover > a {
    color: #0284c7 !important;
}

/* Hide sublists by default */
.sidebar-items li ul {
    display: none;
}

/* Hover position dropdown menus to the right */
.sidebar-items > li > ul, .sidebar-items > ul > li > ul {
    display: none;
    list-style: none;
    position: absolute;
    top: 0;
    left: 100%;
    width: 220px;
    z-index: 10000;
    margin-left: 5px;
}

.sidebar-items li ul li ul {
    position: absolute;
    left: 100%;
    top: 0;
    width: 220px;
    margin-left: 5px;
}

.sidebar-items li ul li ul li {
    display: none;
}

/* Hover triggers to display sub-menus */
.sidebar-items > li:hover > ul, .sidebar-items > ul > li:hover > ul {
    display: block !important;
}

.sidebar-items ul li:hover > ul {
    display: block !important;
}

.sidebar-items ul li:hover > ul li {
    display: block !important;
}

/* Hide third-level sub-menus by default */
.sidebar-items ul ul {
    display: none;
}

/* Third-level menu items styling */
.sidebar-items ul li ul li {
    font-size: 11px;
    padding: 6px 16px;
    background: #ffffff;
    transition: background-color 0.2s ease;
}

.sidebar-items ul li ul li:hover {
    background-color: #f1f5f9;
}

.sidebar-items ul li ul li:hover > a {
    color: #0284c7 !important;
}

/* =Body Content Enhancements
--------------------------------------------- */
.entry-content, .site-main {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #334155;
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Gutenberg block group card styling (only top-level groups in content) */
.entry-content > .wp-block-group {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(241, 245, 249, 0.8);
    padding: 35px 35px 35px 35px !important;
    margin: 40px 0 !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.entry-content > .wp-block-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

/* =Premium Typography & Heading Highlights
--------------------------------------------- */
/* Main page title styling */
.entry-title {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 800 !important;
    font-size: 2.5rem !important;
    color: #0f172a !important;
    letter-spacing: -1px !important;
    line-height: 1.2 !important;
    margin-top: 10px !important;
    margin-bottom: 25px !important;
    border-left: 5px solid #0284c7;
    padding-left: 18px;
}

/* First paragraph (lead intro / subtitle text) */
.entry-content > p:first-of-type, .entry-content > .wp-block-paragraph:first-of-type {
    font-size: 1.2rem !important;
    line-height: 1.8 !important;
    color: #475569 !important;
    font-weight: 400;
    margin-bottom: 35px !important;
}

/* Section Headings (h2) */
.entry-content h2, .entry-content h2.wp-block-heading {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700 !important;
    color: #1e293b !important;
    font-size: 1.75rem !important;
    letter-spacing: -0.5px !important;
    margin-top: 2em !important;
    margin-bottom: 0.8em !important;
    line-height: 1.3 !important;
    padding-left: 14px;
    border-left: 3px solid #0284c7;
}

/* Subsection Headings (h3) */
.entry-content h3, .entry-content h3.wp-block-heading {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 600 !important;
    color: #334155 !important;
    font-size: 1.35rem !important;
    margin-top: 1.8em !important;
    margin-bottom: 0.6em !important;
    line-height: 1.4 !important;
}

/* Minor Headings (h4) */
.entry-content h4, .entry-content h4.wp-block-heading {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 600 !important;
    color: #475569 !important;
    font-size: 1.15rem !important;
    margin-top: 1.5em !important;
    margin-bottom: 0.5em !important;
    line-height: 1.4 !important;
}

/* Modern Bullet Lists style inside content */
.entry-content ul.wp-block-list {
    padding-left: 20px;
    margin-bottom: 1.5em;
}

.entry-content ul.wp-block-list li {
    position: relative;
    list-style: none;
    padding-left: 25px;
    margin-bottom: 8px;
}

.entry-content ul.wp-block-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #0284c7;
    font-weight: bold;
    font-size: 1rem;
}

/* Link transitions inside content */
.entry-content a {
    color: #0284c7;
    text-decoration: none;
    border-bottom: 1px solid rgba(2, 132, 199, 0.2);
    transition: all 0.2s ease;
}

.entry-content a:hover {
    color: #0369a1;
    border-bottom-color: #0369a1;
}

/* Separator styling */
hr.wp-block-separator {
    border: none;
    height: 1px;
    background-color: #e2e8f0;
    margin: 40px auto;
    width: 60%;
}
