/*
Theme Name: Elementor Block Theme
Theme URI: https://example.com/elementor-block-theme
Author: Antigravity
Author URI: https://example.com
Description: A modern WordPress block theme optimized for Elementor page builder with Full Site Editing support.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: elementor-block-theme
*/

/* Basic CSS Reset/Variables if needed - Gutenberg handles most of this via theme.json */
:root {
	/* CUSTOMIZABLE SETTINGS FOR EASY MANUAL ADJUSTMENTS */
	--dh-header-bg: #0f2e1e;
	--dh-header-nav-font-size: 0.8rem;
	--dh-header-nav-font-size-mobile: 0.85rem;
	--dh-header-nav-gap: 0.9rem;
	--dh-header-nav-gap-mobile: 1.2rem;
	--dh-header-text-color: #cbd5e1;
	--dh-header-text-hover-color: #ffffff;
	--dh-header-active-underline-color: #f97316;
}

body {
	font-family: var(--wp--preset--font-family--system-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);
	line-height: 1.6;
	margin: 0;
}

/* Card Grid Layout */
.wp-block-post-template {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (max-width: 1024px) {
    .wp-block-post-template {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .wp-block-post-template {
        grid-template-columns: 1fr !important;
    }
}

/* Card Styling */
.blog-card {
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03), 0 0 0 1px rgba(0,0,0,0.05) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.blog-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0,0,0,0.05) !important;
}

/* Image Aspect Ratio */
.blog-card .wp-block-post-featured-image {
    margin: 0 !important;
    overflow: hidden !important;
    aspect-ratio: 16/10 !important;
}

.blog-card .wp-block-post-featured-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.blog-card:hover .wp-block-post-featured-image img {
    transform: scale(1.03) !important;
}

/* Category Link Styling */
.blog-card-category {
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #ef4444 !important; /* Orange-Red color matching the image */
    margin-top: 1rem !important;
    display: block !important;
}

.blog-card-category a {
    color: #ef4444 !important;
    text-decoration: none !important;
}

/* Title Link Styling */
.blog-card-title {
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    color: #0f172a !important;
}

.blog-card-title a {
    color: #0f172a !important;
    text-decoration: none !important;
    transition: color 0.15s ease !important;
}

.blog-card-title a:hover {
    color: #8b5cf6 !important;
}

/* Excerpt Styling */
.blog-card-excerpt {
    font-size: 0.875rem !important;
    color: #64748b !important;
    line-height: 1.5 !important;
    margin-bottom: 1.5rem !important;
    flex-grow: 1 !important;
}

/* Meta Row Styling */
.blog-card-meta {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 1rem !important;
    font-size: 0.875rem !important;
    color: #94a3b8 !important;
}

.blog-card-meta .wp-block-post-date {
    margin: 0 !important;
    color: #94a3b8 !important;
}

.blog-card-read-time {
    font-size: 0.875rem !important;
    color: #94a3b8 !important;
}

/* --- CUSTOM HEADER STYLES --- */
.custom-header {
    background-color: var(--dh-header-bg) !important; /* Deep forest green */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 1rem 0 !important;
}

.header-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1.5rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 1.5rem !important;
}

/* Custom Logo */
.site-logo-custom {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    letter-spacing: -0.5px !important;
}

.site-logo-custom .logo-dark {
    color: #ffffff !important; /* White logo text for high contrast */
}

.site-logo-custom .logo-accent {
    color: #f97316 !important; /* Red-Orange accent matching the brand */
}

/* Header Navigation Links */
.header-nav {
    display: flex !important;
    align-items: center !important;
    gap: var(--dh-header-nav-gap) !important;
}

.header-nav .nav-item {
    font-size: var(--dh-header-nav-font-size) !important;
    font-weight: 500 !important;
    color: var(--dh-header-text-color) !important; /* Light slate gray */
    text-decoration: none !important;
    padding: 0.5rem 0 !important;
    position: relative !important;
}

.header-nav .nav-item:hover {
    color: var(--dh-header-text-hover-color) !important; /* White hover */
}

.header-nav .nav-item.active {
    color: var(--dh-header-text-hover-color) !important;
}

.header-nav .nav-item.active::after {
    content: "" !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 0 !important;
    width: 100% !important;
    height: 2px !important;
    background-color: var(--dh-header-active-underline-color) !important; /* Underline red-orange */
}

/* Header Actions: Search & Sun */
.header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 1.5rem !important;
}

.search-box-custom form {
    position: relative !important;
}

.search-box-custom input[type="search"] {
    background-color: rgba(255, 255, 255, 0.15) !important; /* Semi-transparent white */
    border: none !important;
    border-radius: 20px !important;
    padding: 0.5rem 2.5rem 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    color: #ffffff !important; /* White text for contrast */
    width: 180px !important;
    outline: none !important;
    transition: width 0.2s ease !important;
}

.search-box-custom input[type="search"]::placeholder {
    color: #cbd5e1 !important;
}

.search-box-custom input[type="search"]:focus {
    width: 220px !important;
    background-color: rgba(255, 255, 255, 0.25) !important;
}

.search-box-custom button {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    color: #cbd5e1 !important; /* Light slate gray */
    cursor: pointer !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.theme-toggle-icon {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
}

/* --- CUSTOM FOOTER STYLES --- */
.custom-footer {
    background-color: #0f2e1e !important; /* Deep forest green */
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 4rem 0 2rem 0 !important;
    font-family: inherit !important;
}

.footer-grid {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1.5rem !important;
    display: grid !important;
    grid-template-columns: 2fr 1.2fr 1.2fr 2fr !important;
    gap: 3rem !important;
}

@media (max-width: 960px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
    }
}

.footer-col h4 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #ffffff !important; /* White headers */
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
}

.brand-col .brand-desc {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    color: #cbd5e1 !important; /* Light slate text */
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
}

.brand-contact {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    margin-bottom: 1.5rem !important;
}

.contact-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    font-size: 0.875rem !important;
    color: #cbd5e1 !important; /* Light slate */
    line-height: 1.4 !important;
}

.contact-item icon {
    font-size: 1rem !important;
}

.contact-item a {
    color: #cbd5e1 !important;
    text-decoration: none !important;
}

.contact-item a:hover {
    color: #f97316 !important; /* Orange-Red accent hover */
}

.social-links-footer {
    display: flex !important;
    gap: 1.5rem !important;
}

.social-link-item {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #cbd5e1 !important; /* Light slate */
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
}

.social-link-item:hover {
    color: #f97316 !important;
}

/* Links Columns (Middle) */
.links-col ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
}

.links-col ul li a {
    font-size: 0.9rem !important;
    color: #cbd5e1 !important; /* Light slate */
    text-decoration: none !important;
    transition: color 0.15s ease !important;
}

.links-col ul li a:hover {
    color: #f97316 !important;
}

/* Newsletter Column (Right) */
.newsletter-col p {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    color: #cbd5e1 !important;
    margin-bottom: 1.5rem !important;
}

.newsletter-form {
    display: flex !important;
    gap: 0.75rem !important;
}

.newsletter-form input[type="email"] {
    background-color: rgba(255, 255, 255, 0.15) !important; /* Transparent white */
    border: none !important;
    border-radius: 24px !important;
    padding: 0.75rem 1.25rem !important;
    font-size: 0.875rem !important;
    outline: none !important;
    flex-grow: 1 !important;
    color: #ffffff !important;
}

.newsletter-form input[type="email"]::placeholder {
    color: #cbd5e1 !important;
}

.newsletter-form button {
    background-color: #f97316 !important; /* Red-Orange */
    color: #ffffff !important;
    border: none !important;
    border-radius: 24px !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease !important;
}

.newsletter-form button:hover {
    background-color: #ea580c !important;
}

/* Footer Bottom Row */
.footer-bottom {
    max-width: 1200px !important;
    margin: 3rem auto 0 auto !important;
    padding: 1.5rem 1.5rem 0 1.5rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important; /* Subtler border */
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    font-size: 0.875rem !important;
    color: #cbd5e1 !important;
}

.footer-bottom p {
    margin: 0 !important;
}

/* ==========================================================================
   RESPONSIVE MOBILE STYLES & OVERFLOW PREVENTION
   ========================================================================== */

/* 1. Header Navigation for Mobile view (max-width: 768px) */
.mobile-nav-toggle {
    display: none !important; /* Hidden on desktop */
}

.mobile-menu-search {
    display: none !important; /* Hidden on desktop */
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        position: relative !important;
    }
    
    .mobile-nav-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent !important;
        border: 1px solid rgba(255, 255, 255, 0.25) !important;
        border-radius: 6px !important;
        padding: 6px 8px !important;
        color: #ffffff !important;
        cursor: pointer !important;
        outline: none !important;
        transition: border-color 0.2s ease, background-color 0.2s ease !important;
    }
    
    .mobile-nav-toggle:hover,
    .mobile-nav-toggle:focus,
    .mobile-nav-toggle.is-active {
        border-color: rgba(255, 255, 255, 0.6) !important;
        background-color: rgba(255, 255, 255, 0.08) !important;
    }
    
    /* Toggle SVG Animations */
    .mobile-nav-toggle line {
        transition: transform 0.25s ease, opacity 0.25s ease !important;
        transform-origin: center !important;
    }
    
    .mobile-nav-toggle.is-active .line-mid {
        opacity: 0 !important;
    }
    
    .mobile-nav-toggle.is-active .line-top {
        transform: translateY(6px) rotate(45deg) !important;
    }
    
    .mobile-nav-toggle.is-active .line-bot {
        transform: translateY(-6px) rotate(-45deg) !important;
    }
    
    /* Collapsible vertical menu */
    .header-nav {
        display: none !important;
        flex-direction: column !important;
        width: 100% !important;
        background-color: var(--dh-header-bg) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin-top: 1rem !important;
        padding: 0.25rem 0 0 0 !important;
        gap: 0 !important;
        box-sizing: border-box !important;
    }
    
    .header-nav.is-open {
        display: flex !important;
    }
    
    /* Nav links matching mockup */
    .header-nav .nav-item {
        width: 100% !important;
        padding: 0.85rem 1.5rem !important;
        font-size: 0.95rem !important;
        color: #ffffff !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        text-align: left !important;
        display: block !important;
        box-sizing: border-box !important;
    }
    
    .header-nav .nav-item:hover,
    .header-nav .nav-item:focus {
        background-color: rgba(255, 255, 255, 0.05) !important;
        color: var(--dh-header-active-underline-color) !important;
    }
    
    .header-nav .nav-item.active {
        background-color: rgba(255, 255, 255, 0.08) !important;
        color: var(--dh-header-active-underline-color) !important;
    }
    
    .header-nav .nav-item.active::after {
        display: none !important; /* Hide desktop underline */
    }
    
    /* Hide desktop actions row */
    .header-actions {
        display: none !important;
    }
    
    /* Mobile Search at the bottom of the dropdown list */
    .mobile-menu-search {
        display: block !important;
        padding: 1rem 1.5rem !important;
        background-color: rgba(0, 0, 0, 0.1) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }
    
    .mobile-menu-search form {
        position: relative !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .mobile-menu-search input[type="search"] {
        width: 100% !important;
        background-color: rgba(255, 255, 255, 0.12) !important;
        border: none !important;
        border-radius: 20px !important;
        padding: 0.6rem 2.5rem 0.6rem 1.2rem !important;
        font-size: 0.875rem !important;
        color: #ffffff !important;
        outline: none !important;
        box-sizing: border-box !important;
    }
    
    .mobile-menu-search button {
        position: absolute !important;
        right: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        background: none !important;
        border: none !important;
        color: #cbd5e1 !important;
        cursor: pointer !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* 2. Responsive 2-Column layouts (FSE single post layout) */
@media (max-width: 960px) {
    .wp-block-columns {
        flex-direction: column !important;
    }
    .wp-block-column {
        flex-basis: 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .sidebar-column {
        margin-top: 3rem !important;
    }
}

/* 3. Global Content Overflow Prevention on Mobile */
.wp-block-post-content, 
.entry-content,
main,
body {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Make wpp tables and standard tables scrollable on small screens */
.wp-block-post-content table,
.wp-block-table table,
table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
}

/* Ensure images and videos scale down correctly */
.wp-block-post-content img,
.wp-block-post-content iframe,
.wp-block-post-content video,
img,
iframe,
video {
    max-width: 100% !important;
    height: auto !important;
}

/* 4. Responsive Author Bio Box */
@media (max-width: 600px) {
    .author-bio-box {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1.2rem !important;
    }
}

/* 5. Mobile Gutter Margins */
@media (max-width: 768px) {
    main {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}


