/*
Theme Name: SSI Construction Theme
Theme URI: https://getmeautomated.com
Author: Get Me Automated
Author URI: https://getmeautomated.com
Description: A professional construction company WordPress theme designed for use with Elementor. Features a dark blue top bar, full-width hero areas, project showcase sections, and a multi-column footer. Built around the SSI brand palette. Fully compatible with Elementor page builder.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ssi-theme
Tags: construction, business, elementor, full-width, custom-header, custom-menu, featured-images
*/

/* ============================================
   CSS CUSTOM PROPERTIES — SSI BRAND PALETTE
   ============================================ */
:root {
    --ssi-blue:        #164185;
    --ssi-blue-dark:   #0e3060;
    --ssi-blue-darker: #091e3f;
    --ssi-blue-accent: #3a6bb5;
    --ssi-blue-light:  #a7b6d3;
    --ssi-blue-pale:   #d4dff0;
    --ssi-gray:        #7a7a7a;
    --ssi-gray-dark:   #4a4a4a;
    --ssi-gray-light:  #9a9a9a;
    --ssi-gray-border: #d0d4da;
    --ssi-white:       #ffffff;
    --ssi-off-white:   #f2f4f7;
    --ssi-text:        #3a3f47;
    --ssi-text-light:  #6b7280;
    --ssi-font-primary:   'Montserrat', sans-serif;
    --ssi-font-secondary: 'Open Sans', sans-serif;
    --ssi-transition:     all 0.3s ease;
    --ssi-shadow:         0 2px 15px rgba(14, 48, 96, 0.08);
    --ssi-shadow-hover:   0 5px 25px rgba(14, 48, 96, 0.16);
    --ssi-radius:         4px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--ssi-font-secondary);
    font-size: 16px;
    line-height: 1.7;
    color: var(--ssi-text);
    background: var(--ssi-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--ssi-font-primary);
    font-weight: 700;
    line-height: 1.3;
    color: var(--ssi-blue-dark);
}
h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 0.95rem; }

a { color: var(--ssi-blue-accent); text-decoration: none; transition: var(--ssi-transition); }
a:hover { color: var(--ssi-blue); }
img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ============================================
   PRELOADER
   ============================================ */
.kp-preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--ssi-blue-dark); z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.kp-preloader.loaded { opacity: 0; visibility: hidden; }
.kp-preloader .spinner {
    width: 50px; height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--ssi-blue-light);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   TOP BAR
   ============================================ */
.kp-top-bar {
    background: var(--ssi-blue-darker);
    padding: 8px 0; font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.kp-top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.kp-top-bar a { color: rgba(255, 255, 255, 0.65); }
.kp-top-bar a:hover { color: var(--ssi-blue-light); }
.kp-top-bar-left, .kp-top-bar-right { display: flex; align-items: center; gap: 20px; }
.kp-top-bar .kp-icon { margin-right: 6px; font-size: 0.9rem; color: var(--ssi-blue-light); }

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.kp-header {
    background: var(--ssi-blue-dark);
    padding: 0; position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.kp-header .container { display: flex; justify-content: space-between; align-items: center; min-height: 80px; }

.kp-logo img, .kp-logo .custom-logo { max-height: 60px; width: auto; }
.kp-logo a { display: inline-flex; align-items: center; gap: 12px; }
.kp-logo-text {
    color: var(--ssi-white); font-family: var(--ssi-font-primary);
    font-weight: 800; font-size: 1.6rem; letter-spacing: 2px; text-transform: uppercase;
}

.kp-nav { display: flex; align-items: center; }
.kp-nav ul { list-style: none; display: flex; align-items: center; gap: 0; }
.kp-nav ul li { position: relative; }
.kp-nav ul li a {
    display: block; padding: 28px 18px; color: var(--ssi-white);
    font-family: var(--ssi-font-primary); font-size: 0.9rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    transition: var(--ssi-transition); position: relative;
}
.kp-nav ul li a::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%); width: 0; height: 3px;
    background: var(--ssi-blue-light); transition: var(--ssi-transition);
}
.kp-nav ul li a:hover::after,
.kp-nav ul li.current-menu-item a::after,
.kp-nav ul li.current_page_item a::after { width: 100%; }
.kp-nav ul li a:hover { color: var(--ssi-blue-light); }

/* Dropdown */
.kp-nav ul li ul.sub-menu {
    position: absolute; top: 100%; left: 0; min-width: 220px;
    background: var(--ssi-blue); display: none; flex-direction: column;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3); z-index: 100;
}
.kp-nav ul li:hover > ul.sub-menu { display: flex; }
.kp-nav ul li ul.sub-menu li a {
    padding: 12px 20px; font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.kp-nav ul li ul.sub-menu li a::after { display: none; }
.kp-nav ul li ul.sub-menu li a:hover { background: rgba(255, 255, 255, 0.08); padding-left: 25px; }

/* Mobile Toggle */
.kp-mobile-toggle {
    display: none; background: none; border: none; cursor: pointer; padding: 10px;
}
.kp-mobile-toggle span {
    display: block; width: 28px; height: 3px; background: var(--ssi-white);
    margin: 5px 0; transition: var(--ssi-transition); border-radius: 2px;
}
.kp-mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.kp-mobile-toggle.active span:nth-child(2) { opacity: 0; }
.kp-mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* ============================================
   PAGE HEADER / HERO (non-Elementor)
   ============================================ */
.kp-page-header {
    background: linear-gradient(135deg, var(--ssi-blue-dark) 0%, var(--ssi-blue) 100%);
    padding: 80px 0 60px; text-align: center;
    position: relative; overflow: hidden;
}
.kp-page-header::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}
.kp-page-header h1 { color: var(--ssi-white); font-size: 2.5rem; position: relative; z-index: 1; }
.kp-page-header .kp-breadcrumbs { color: var(--ssi-blue-light); margin-top: 10px; position: relative; z-index: 1; }
.kp-page-header .kp-breadcrumbs a { color: var(--ssi-blue-pale); }
.kp-page-header .kp-breadcrumbs a:hover { color: var(--ssi-white); }

/* ============================================
   CONTENT AREA
   ============================================ */
.kp-content { padding: 60px 0; }
.kp-content.elementor-default { padding: 0; }

.kp-post-thumb { margin-bottom: 20px; border-radius: var(--ssi-radius); overflow: hidden; }
.kp-post-thumb img { width: 100%; display: block; transition: var(--ssi-transition); }
.kp-post-thumb:hover img { transform: scale(1.03); }

.kp-post-meta { color: var(--ssi-text-light); font-size: 0.85rem; margin-bottom: 12px; }
.kp-post-meta i { color: var(--ssi-blue-accent); margin-right: 4px; }

article.post, article.page {
    margin-bottom: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--ssi-gray-border);
}
article.post:last-child { border-bottom: none; }

/* ============================================
   BUTTONS
   ============================================ */
.ssi-btn, .wp-block-button__link {
    display: inline-block; padding: 14px 32px; background: var(--ssi-blue);
    color: var(--ssi-white); font-family: var(--ssi-font-primary);
    font-weight: 600; font-size: 0.85rem; text-transform: uppercase;
    letter-spacing: 1px; border: 2px solid var(--ssi-blue);
    border-radius: var(--ssi-radius); cursor: pointer; transition: var(--ssi-transition);
}
.ssi-btn:hover, .wp-block-button__link:hover {
    background: var(--ssi-blue-dark); border-color: var(--ssi-blue-dark);
    color: var(--ssi-white); box-shadow: var(--ssi-shadow-hover);
}
.ssi-btn-outline { background: transparent; color: var(--ssi-blue); }
.ssi-btn-outline:hover { background: var(--ssi-blue); color: var(--ssi-white); }

/* ============================================
   FOOTER
   ============================================ */
.kp-footer { background: var(--ssi-blue-dark); color: rgba(255, 255, 255, 0.65); padding: 60px 0 0; }
.kp-footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.kp-footer h4 {
    color: var(--ssi-white); font-size: 1.1rem; text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 2px solid var(--ssi-blue-accent); display: inline-block;
}
.kp-footer p { font-size: 0.9rem; line-height: 1.8; }
.kp-footer a { color: rgba(255, 255, 255, 0.65); }
.kp-footer a:hover { color: var(--ssi-blue-light); }

.kp-footer-logo { margin-bottom: 15px; }
.kp-footer-logo img { max-height: 55px; width: auto; opacity: 0.9; }

.kp-footer-links { list-style: none; }
.kp-footer-links li { margin-bottom: 8px; }
.kp-footer-links li a { font-size: 0.9rem; display: inline-block; transition: var(--ssi-transition); }
.kp-footer-links li a:hover { padding-left: 5px; color: var(--ssi-blue-light); }
.kp-footer-links li a::before { content: '\203a'; margin-right: 8px; color: var(--ssi-blue-accent); font-weight: bold; }

.kp-footer-hours dl { font-size: 0.9rem; }
.kp-footer-hours dt { font-weight: 600; color: var(--ssi-white); margin-top: 8px; }
.kp-footer-hours dd { margin-left: 0; }

.kp-footer-contact li {
    list-style: none; margin-bottom: 12px; font-size: 0.9rem;
    display: flex; align-items: flex-start; gap: 10px;
}
.kp-footer-contact .kp-icon { color: var(--ssi-blue-accent); margin-top: 3px; flex-shrink: 0; }

.kp-footer-bottom {
    margin-top: 40px; padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center; font-size: 0.85rem; color: rgba(255, 255, 255, 0.45);
}

/* ============================================
   ELEMENTOR OVERRIDES & HELPERS
   ============================================ */
.elementor-section.elementor-section-full_width { max-width: 100%; }
.elementor-button {
    font-family: var(--ssi-font-primary) !important;
    font-weight: 600 !important; text-transform: uppercase !important; letter-spacing: 1px !important;
}
.kp-default-content { max-width: 800px; margin: 0 auto; }
.kp-layout-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 40px; }
.kp-sidebar .widget {
    margin-bottom: 30px; padding: 25px; background: var(--ssi-off-white);
    border-radius: var(--ssi-radius); border: 1px solid var(--ssi-gray-border);
}
.kp-sidebar .widget h3 {
    font-size: 1.1rem; margin-bottom: 15px; padding-bottom: 10px;
    border-bottom: 2px solid var(--ssi-blue-accent);
}

/* ============================================
   BACK TO TOP
   ============================================ */
.kp-back-to-top {
    position: fixed; bottom: 30px; right: 30px; width: 45px; height: 45px;
    background: var(--ssi-blue); color: var(--ssi-white); border: none;
    border-radius: var(--ssi-radius); cursor: pointer; font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: var(--ssi-transition); z-index: 999;
    box-shadow: var(--ssi-shadow);
}
.kp-back-to-top.visible { opacity: 1; visibility: visible; }
.kp-back-to-top:hover {
    background: var(--ssi-blue-dark); transform: translateY(-3px);
    box-shadow: var(--ssi-shadow-hover);
}

/* ============================================
   PAGINATION
   ============================================ */
.nav-links { display: flex; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.nav-links .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px;
    background: var(--ssi-off-white); color: var(--ssi-text);
    border: 1px solid var(--ssi-gray-border); border-radius: var(--ssi-radius);
    font-size: 0.9rem; transition: var(--ssi-transition);
}
.nav-links .page-numbers.current,
.nav-links .page-numbers:hover {
    background: var(--ssi-blue); color: var(--ssi-white); border-color: var(--ssi-blue);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .kp-footer-grid { grid-template-columns: repeat(2, 1fr); }
    .kp-layout-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .kp-top-bar { display: none; }
    .kp-mobile-toggle { display: block; }
    .kp-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--ssi-blue-dark); display: none;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    }
    .kp-nav.active { display: block; }
    .kp-nav ul { flex-direction: column; }
    .kp-nav ul li a { padding: 15px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
    .kp-nav ul li a::after { display: none; }
    .kp-nav ul li ul.sub-menu { position: static; box-shadow: none; background: rgba(0, 0, 0, 0.15); }
    .kp-nav ul li ul.sub-menu li a { padding-left: 35px; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    .kp-page-header { padding: 50px 0 40px; }
    .kp-footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .container { padding: 0 15px; }
    h1 { font-size: 1.7rem; }
    .kp-nav ul li a { font-size: 0.85rem; }
}
