/* style.css - Johnston Electrical & Contracting */

/* --- GLOBAL VARIABLES --- */
:root {
    --primary-color: #FBC02D; /* Electrical Yellow */
    --secondary-color: #333333; /* Dark Grey */
    --text-color: #444;
    --light-bg: #f9f9f9;
    --white: #ffffff;
}

:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px; 
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 60px; /* Space for mobile sticky bar */
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    color: var(--secondary-color);
}

.h1-subline {
  display: block;
  font-size: 0.55em;
  font-weight: 200;
  margin-top: 10px;
  color: #eaeaea;
  letter-spacing: 0.5px;
}

a { text-decoration: none; transition: 0.3s; }
ul { list-style: none; }

/* --- UTILITIES --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}
.btn-primary:hover { background-color: #e6a900; }

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}
.btn-secondary:hover { background-color: var(--white); color: var(--secondary-color); }

.section-padding { padding: 60px 0; }
.text-center { text-align: center; }

/* --- HEADER & NAVIGATION --- */
header {
    background: var(--secondary-color);
    color: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.logo img {
    max-height: 55px; 
    width: auto;
    flex-shrink: 0;
}

.logo-text-group {
    display: flex;
    flex-direction: column; 
    justify-content: center;
    line-height: 1.1; 
}

.logo-name {
    font-family: 'Montserrat', sans-serif; 
    font-weight: 800; 
    font-size: 1.4rem;
    color: var(--primary-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.logo-tagline {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
}

.canadian-flag {
    color: #FF0000;
    font-size: 1.1rem;
    margin-left: 4px;
    vertical-align: middle; 
    transition: transform 0.3s ease;
}

.canadian-flag:hover {
    transform: scale(1.2); /* Cute effect: grows slightly when hovered */
}


.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--white); font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary-color); }

.mobile-menu-btn { 
    display: none; 
    background: none; 
    border: none;
    font-size: 1.5rem; 
    color: var(--white); 
    cursor: pointer; 
}

/* --- HERO --- */
.hero {
    background-color: #333; 
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('./pai/hero.webp');
    background-size: cover;
    background-position: top center;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 0 20px;
}

.hero-content h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 20px; color: var(--white); }
.hero-content p { font-size: 1.2rem; margin-bottom: 30px; max-width: 700px; margin: 0 auto 30px auto; }

/* --- BAEUMLER BADGE --- */
.baeumler-badge-container {
    position: relative;
    display: inline-block;
    margin-bottom: 25px;
    cursor: pointer;
}

.baeumler-badge {
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    border: 2px solid transparent; 
}

.baeumler-badge:hover, .baeumler-badge:focus { transform: scale(1.05); }

.tooltip-text {
    display: none; 
    width: 280px;
    background-color: #222;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 15px;
    position: absolute;
    z-index: 10;
    bottom: 135%; 
    left: 50%;
    transform: translateX(-50%); 
    font-size: 0.85rem;
    font-weight: normal;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    line-height: 1.4;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #222 transparent transparent transparent;
}

.tooltip-close {
    position: absolute;
    top: 5px;
    right: 10px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 5px;
}

.tooltip-visible {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

/* --- SERVICES --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
    text-align: left;
    border-bottom: 4px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    border-bottom: 4px solid var(--primary-color);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.service-card h3 { text-align: center; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }

.service-card ul { list-style: none; padding: 0; }
.service-card ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #555;
}
.service-card ul li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary-color);
    position: absolute;
    left: 0;
    top: 0;
}

/* --- CAROUSEL --- */
.carousel-section { background-color: var(--secondary-color); color: var(--white); }
.carousel-section h2 { color: var(--white); }

.carousel-wrapper {
    position: relative;
    max-width: 900px;
    margin: 40px auto 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    background: #000;
}

.carousel-track { display: flex; transition: transform 0.5s ease-in-out; }
.carousel-slide { min-width: 100%; height: 400px; position: relative; }

.carousel-slide img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    cursor: pointer; 
    transition: opacity 0.3s;
}
.carousel-slide img:hover { opacity: 0.9; }

.carousel-caption {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: rgba(0,0,0,0.7); color: white; padding: 15px; text-align: center;
    pointer-events: none;
}

.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.5); color: white; border: none;
    padding: 15px; cursor: pointer; z-index: 10; font-size: 1.5rem;
}
.carousel-btn:hover { background: var(--primary-color); color: var(--secondary-color); }
.prev-btn { left: 0; }
.next-btn { right: 0; }

/* --- TRUST & ABOUT --- */
.trust-section { background-color: var(--light-bg); }
.trust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.trust-img img { width: 100%; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

/* --- REVIEWS --- */
.mobile-swipe-text {
    display: none; /* Hidden on Desktop */
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: #666;
}

/* --- COMMUNITY SECTION --- */
.community-highlight {
    transition: transform 0.3s ease;
}
.community-highlight:hover {
    transform: translateY(-5px);
}

/* --- FAQ SECTION  --- */
.faq-container {
    max-width: 1000px;
    margin: 0 auto;
    
    /* NEW: Uses Columns instead of Grid for better stacking */
    column-count: 2; 
    column-gap: 20px;
    display: block; 
}

.faq-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    
    /* CRITICAL FIXES FOR COLUMNS: */
    display: inline-block; /* Behave like a block of text */
    width: 100%; /* Fill the column width */
    margin-bottom: 20px; /* Space between items verticaly */
    break-inside: avoid; /* Prevents a box from being chopped in half */
}

/* ... (Keep the rest of the styling below exactly the same) ... */
.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.faq-item details { padding: 0; }

.faq-item summary {
    padding: 20px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--secondary-color);
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.faq-item summary::after {
    content: '+';
    font-weight: 900;
    color: var(--primary-color);
    font-size: 1.5rem;
    line-height: 1;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.faq-item details[open] summary::after {
    content: '-';
    transform: rotate(180deg);
    color: #333;
}

.faq-answer {
    padding: 0 20px 20px 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    animation: fadeIn 0.3s ease-in-out;
}


/* --- FOOTER --- */
footer { background: #1a1a1a; color: #ccc; padding: 40px 0; font-size: 0.9rem; }
footer h4 { color: var(--white); margin-bottom: 15px; }
footer ul li { margin-bottom: 10px; }
footer a { color: #ccc; }
footer a:hover { color: var(--primary-color); }

.footer-logos {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-logo-img { height: 65px; width: auto; }
.logo-white-bg { background: #fff; padding: 5px; border-radius: 4px; }

/* --- MODALS & COMPONENTS --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    display: none; 
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 500px;
    padding: 30px;
    border-radius: 8px;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
    background: none;
    border: none;
    z-index: 10010;
}
.close-modal:hover { color: #fff; }

.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px;
    border: 1px solid #ddd; border-radius: 4px;
    font-family: inherit; font-size: 1rem;
}
.form-group textarea { resize: vertical; height: 100px; }

/* Sticky CTA (Hidden on Desktop) */
.mobile-sticky-cta { display: none; }

/* Lightbox */
#lightboxImage {
    margin: auto;
    display: block;
    width: auto;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform:scale(0.8); opacity: 0;} 
    to {transform:scale(1); opacity: 1;}
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   MOBILE RESPONSIVE OVERRIDES
   (Must be at the bottom to override global styles)
   ========================================= */
@media (max-width: 768px) {
    /* Logo & Nav */
    .logo { font-size: 0.9rem; max-width: 80%; }
    .logo img { max-height: 45px; }
    .logo-name { font-size: 1.1rem; }
    .logo-tagline { font-size: 0.65rem; letter-spacing: 1px; }
    .logo i { font-size: 1.2rem; } 

    .nav-links {
        display: none; flex-direction: column; position: absolute;
        top: 100%; left: 0; width: 100%; background: var(--secondary-color);
        padding: 20px; text-align: center;
    }
    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: block; }
    
    /* Layout Adjustments */
    .trust-grid { grid-template-columns: 1fr; }
    .carousel-slide { height: 250px; }
    .tooltip-text { width: 260px; }

    /* FAQ (Force 1 Column) */
   .faq-container { 
        column-count: 1 !important; /* Changed from grid-template-columns */
        display: block !important;
    }

    /* Sticky Bar (Visible) */
    .mobile-sticky-cta {
        display: flex;
        position: fixed; bottom: 0; left: 0; width: 100%; z-index: 9999;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    .mobile-sticky-cta a {
        flex: 1; padding: 15px; text-align: center; font-weight: bold;
        font-size: 1rem; display: flex; justify-content: center; align-items: center; gap: 8px;
    }

    /* Reviews Swipe Logic */
    .mobile-swipe-text { display: block; }

    .reviews-wrapper {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        width: 100%; 
    }
    .reviews-wrapper::-webkit-scrollbar { display: none; }
    .reviews-wrapper .service-card {
        width: 85%; 
        min-width: 85%; 
        max-width: 85%; 
        flex-shrink: 0; 
        scroll-snap-align: center;
        white-space: normal !important; 
        word-wrap: break-word; 
    }
