/*
Theme Name: Essential v24 (Bigger Tiles)
Author: You
Description: Taller category tiles and bolder subheadline.
Version: 24.1
*/

:root {
    --primary: #333;
    --accent: #b90f00; 
    --bg: #fff;       
    --border: #e6e6e6;
    --container: 1120px;
    --content-width: 1120px; 
}

* { box-sizing: border-box; }

/* FONT */
body, h1, h2, h3, h4, h5, h6, p, a, li, span, input, button {
    font-family: 'Lato', Helvetica, Arial, sans-serif !important;
}
.dashicons, .dashicons-before:before {
    font-family: 'dashicons' !important;
}

body { margin: 0; background: var(--bg); color: #333; line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* HEADER */
.site-header { 
    background: #fff; border-bottom: 1px solid var(--border); 
    height: 70px; display: flex; align-items: center; 
    position: relative; z-index: 1000;
}
.header-flex { display: flex; justify-content: space-between; align-items: center; width: 100%; }

/* LOGO FIX */
.logo h1 { font-size: 1.6rem; font-weight: 900; margin: 0; letter-spacing: -0.5px; }
.logo img, .custom-logo-link img {
    max-height: 50px; 
    width: auto;      
    display: block;
}

.main-nav ul { display: flex; gap: 25px; align-items: center; }
.main-nav a { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; color: #444; }

.header-actions { display: flex; align-items: center; gap: 20px; height: 100%; position: relative; }
.search-btn, .menu-toggle { 
    background: none; border: none; padding: 0; margin: 0; 
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #333; line-height: 1; 
}
.search-btn span, .menu-toggle span { font-size: 22px; }

/* SEARCH DROPDOWN */
.search-dropdown {
    display: none; 
    position: absolute; 
    top: 100%; right: 0; margin-top: 1px;
    width: 300px; 
    background: #fff; padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border); border-top: none; border-radius: 0 0 4px 4px; 
    z-index: 2000;
}
.search-dropdown.active { display: block; }
.search-field { 
    width: 100%; padding: 12px; border: 1px solid #ddd; background: #f9f9f9; border-radius: 3px; 
    transition: border-color 0.2s; 
}
.search-field:focus { border-color: var(--accent) !important; background: #fff; }

/* MOBILE MENU DRAWER */
.menu-toggle { display: none; } 
#mobile-menu { display: none; } 
.mobile-menu-overlay { 
    position: fixed; top: 70px; left: 0; right: 0; bottom: 0; 
    background: #fff; z-index: 990; 
    border-top: 2px solid var(--accent);
    overflow-y: auto; padding: 30px 40px; 
    -webkit-overflow-scrolling: touch; 
}
.mobile-menu-overlay ul { display: block; }
.mobile-menu-overlay li { border-bottom: 1px solid #eee; }
.mobile-menu-overlay a { 
    display: block; padding: 20px 0; 
    font-weight: 700; font-size: 1.2rem; color: #333;
}

/* OPTIMIZED HERO (FIXED) */
/* RESTORED: This constrains the hero width */
.hero-wrapper { 
    max-width: var(--container); 
    margin: 30px auto 0 auto; 
    padding: 0 20px; 
}

.hero-section {
    position: relative;
    overflow: hidden;
    background: #222; 
    
    /* RESTORED STYLES: This gives the hero its height and alignment */
    padding: 100px 20px; 
    text-align: center;
    color: #fff;
    border-radius: 4px;
    min-height: 400px; /* Optional: Enforce a minimum height */
    display: flex;     /* Flexbox helps center content vertically if needed */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4); 
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%; /* Ensure text can span the width */
}

.hero-content h2 {
    font-size: 2.8rem;
    font-weight: 900;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 20px auto 0 auto;
    color: #fff;
    max-width: 800px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    line-height: 1.4;
}

/* TILES (BIGGER) */
.category-tiles { display: flex; gap: 20px; margin: 30px 0 50px 0; width: 100%; }
.cat-tile {
    flex: 1; 
    height: 150px; /* Increased from 100px to 150px */
    background: #333; 
    border-radius: 3px;
    position: relative; display: flex; align-items: center; justify-content: center;
    overflow: hidden; text-align: center; padding: 0 10px; min-width: 0;
}
.cat-tile h3 { position: relative; z-index: 10; color: #fff; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; margin: 0; }

/* MAIN LAYOUT */
.main-layout { margin-bottom: 80px; padding-top: 80px; display: block !important; }
body.home:not(.paged) .main-layout { padding-top: 0 !important; }

/* POST GRID */
.content-area { width: 100% !important; max-width: var(--content-width); margin: 0 auto; }
.post-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 30px; 
    width: 100%;
    justify-content: center; 
}
.post-card { border: 1px solid #f0f0f0; border-radius: 4px; overflow: hidden; }
.card-image { height: 220px; background: #eee; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-content { padding: 25px; }
.card-content h3 { font-size: 1.3rem; font-weight: 700; margin: 0 0 10px; line-height: 1.3; }
.read-more { font-size: 0.8rem; font-weight: 700; color: var(--accent); text-transform: uppercase; }

/* PAGINATION */
.pagination { margin-top: 60px; text-align: center; display: block; }
.pagination .nav-links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pagination .page-numbers { display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; background: #f5f5f5; color: #555; font-weight: bold; border-radius: 4px; transition: 0.2s; padding: 0 10px; text-decoration: none; }
.pagination .page-numbers:hover { background: #e0e0e0; color: #000; }
.pagination .page-numbers.current { background: var(--accent); color: #fff; }
.pagination .page-numbers.dots { background: transparent; color: #999; }

/* SIDEBAR KILLER */
#secondary, .widget-area, .sidebar-area { display: none !important; }

/* FOOTER */
.site-footer { border-top: 1px solid #eee; padding: 40px 0; text-align: center; color: #888; font-size: 0.9rem; margin-top: auto; }
.footer-menu ul { display: flex; justify-content: center; gap: 25px; flex-wrap: wrap; }
.footer-menu a { font-weight: 700; font-size: 0.9rem; color: #444; text-transform: uppercase; }

/* UTILITY */
input:focus, textarea:focus, select:focus, button:focus { outline: none !important; }
html.no-scroll, body.no-scroll { overflow: hidden !important; height: 100% !important; position: fixed; width: 100%; touch-action: none; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .menu-toggle { display: flex; }
    .main-nav { display: none; }
    .category-tiles { flex-wrap: wrap; }
    .cat-tile { flex-basis: 45%; }
    #mobile-menu.open { display: block; } 
}

@media (max-width: 600px) {
    .cat-tile { flex-basis: 100%; }
    .search-dropdown {
        width: 300px !important; max-width: calc(100vw - 40px);
        right: 0 !important; left: auto !important; top: 100% !important;
        border-radius: 4px !important; margin-top: 5px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
        position: absolute !important; 
    }
    .hero-content h2 { font-size: 1.8rem; word-wrap: break-word; padding: 0 10px; }
    .hero-subtitle { font-size: 1.2rem; padding: 0 10px; }
}

/* SVG Icon Alignment */
.header-actions svg {
    display: block;
}
.search-btn, .menu-toggle {
    color: #333;
    transition: color 0.2s;
}
.search-btn:hover, .menu-toggle:hover {
    color: var(--accent);
}

/* OPTIMIZED TILES */
.cat-tile {
    position: relative;
    overflow: hidden;
    isolation: isolate; /* Create new stacking context */
}

.tile-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transition: transform 0.3s ease;
}

/* Optional: Zoom effect on hover */
.cat-tile:hover .tile-bg-img {
    transform: scale(1.05);
}

.tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4); /* Replaces the inline opacity style */
    z-index: -1;
}