/* Reset and Base – Dark Mode */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: #121212;
    display: flex;
    flex-direction: column;
    font-size: clamp(1rem, 2.2vw + 0.4rem, 1.125rem);
}

/* Main content grows to fill available space, pushing footer down */
.main-content {
    flex: 1 0 auto;
}

/* =============================================
   HEADER & NAVBAR with Dropdown Mobile Menu
   ============================================= */
header {
    background: #1f1f1f;
    color: white;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

.logo a {
    display: block;
}

.header-logo {
    height: clamp(40px, 6vw, 55px);
    width: auto;
    display: block;
}

/* Desktop navigation (horizontal) */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: clamp(1.2rem, 3vw, 2.4rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.desktop-nav a {
    color: white;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s ease;
}

.desktop-nav a:hover {
    color: #c41e3a;
}

.nav-phone {
    background: #c41e3a;
    color: white !important;
    padding: 0.65rem 1.3rem;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-phone:hover {
    background: #a0162e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.35);
}

/* Hamburger - only visible on mobile */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1101;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.35s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* MOBILE DROPDOWN MENU */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1f1f1f;
    box-shadow: 0 8px 16px rgba(0,0,0,0.6);
    padding: 1.5rem 0;
    z-index: 999;
}

.mobile-menu.active {
    display: block;
}

.mobile-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
}

.mobile-nav a {
    color: white;
    font-weight: bold;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.mobile-nav a:hover {
    color: #c41e3a;
}

/* === FIXED PHONE BUTTON - Using flex centering === */
.mobile-nav .nav-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 360px;
    margin: 0 auto;
    padding: 1rem 2rem;
    background: #c41e3a;
    color: white !important;
    font-size: 1.3rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.mobile-nav .nav-phone:hover {
    background: #a0162e;
}

/* Mobile visibility rules */
@media (max-width: 900px) {
    .hamburger {
        display: flex;
    }

    .desktop-nav {
        display: none;
    }

    .navbar {
        padding: 1rem 1.5rem;
    }
}

/* Extra safety for very small screens */
@media (max-width: 380px) {
    .mobile-nav .nav-phone {
        width: 94%;
        padding: 1rem 1.6rem;
        font-size: 1.25rem;
    }
}

/* =============================================
   REST OF THE SITE STYLES
   ============================================= */

/* Hero */
.hero {
    background: linear-gradient(rgba(28, 28, 28, 0.7), rgba(28, 28, 28, 0.7)),
                url('images/courthouseroofs.jpg') center/cover no-repeat;
    color: white;
    text-align: center;
    padding: clamp(8rem, 15vw, 12rem) 2rem 6rem;
    margin-top: 80px; /* Accounts for fixed header height */
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw + 0.5rem, 4.2rem);
    margin-bottom: 1rem;
    color: white;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: white;
}

/* Special black background for hero CTAs */
.hero-cta-black {
    background: #000000 !important;
    color: white;
}
.hero-cta-black:hover {
    background: #333333 !important;
}

.cta-button {
    background: #c41e3a;
    color: white;
    padding: 1rem 2rem;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    display: inline-block;
    text-decoration: none;
}
.cta-button:hover {
    background: #a0162e;
}

/* Page Content & Sections */
section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 4rem 2rem;
    text-align: center;
}

section h2 {
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    margin-bottom: 2rem;
    color: white;
}

/* Home Services & Other Sections */
.home-services,
.difference,
.about,
.page-content {
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

/* Experience the Escalera Difference */
.difference ul {
    list-style: none;
    font-size: 1.2rem;
    max-width: 800px;
    margin: 2rem auto;
}

.difference li {
    margin: 1rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.difference li:before {
    content: "✓";
    color: #c41e3a;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* City Search Feature */
.search-container {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

#citySearch {
    width: 100%;
    max-width: 400px;
    padding: 0.8rem 1rem;
    font-size: 1.1rem;
    border: 2px solid #444;
    background: #2d2d2d;
    color: white;
    border-radius: 6px;
    margin-bottom: 0.8rem;
}

#citySearch:focus {
    outline: none;
    border-color: #c41e3a;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.3);
}

.search-result {
    font-size: 1.2rem;
    font-weight: bold;
    min-height: 1.5em;
    margin: 0.5rem 0;
}

/* Clickable service cards */
.link-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.link-card:hover {
    opacity: 0.9;
}

/* CTA in sections */
.section-cta {
    margin-top: 100px;
    display: inline-block;
}

/* Grid for cards */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    justify-content: center;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    justify-content: center;
}

/* Service cards – Dark style */
.service-card {
    background: #2d2d2d;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(196, 30, 58, 0.2);
}

.service-icon {
    width: 180px;
    height: auto;
    margin-bottom: 1.5rem;
    object-fit: contain;
}

.service-card h3 {
    color: #c41e3a;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.service-card p {
    font-size: 1rem;
    color: #cccccc;
}

/* Search page sections */
.search-section {
    max-width: 800px;
    margin: 0 auto 4rem;
    text-align: center;
}

.search-section h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: white;
}

/* Lists */
.service-list,
.difference ul {
    list-style: none;
    font-size: 1.2rem;
    max-width: 800px;
    margin: 2rem auto;
    color: #e0e0e0;
}

.service-list li,
.difference li {
    margin: 1rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.service-list li:before,
.difference li:before {
    content: "•";
    color: #c41e3a;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Footer – stays at bottom thanks to flex */
footer {
    flex-shrink: 0;
    background: #1f1f1f;
    color: #aaa;
    text-align: center;
    padding: 1.2rem 1rem;           /* further reduced */
}

/* === SOCIAL LINKS & PHONE LINK STYLING (UPDATED LAYOUT) === */
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;           /* further tightened */
}

.footer-social-left,
.footer-social-right {
    flex: 0 0 auto;
}

.footer-text {
    margin: 0;
    text-align: center;
    color: #aaa;
    font-size: 0.95rem;
    flex: 1;
}

/* Make phone link match regular text color & style */
.footer-text a[href^="tel:"] {
    color: #aaa;
    text-decoration: none;
    transition: color 0.25s ease;
}

.footer-text a[href^="tel:"]:hover {
    color: #c41e3a;
}

.footer-bottom-row {
    text-align: center;
}

.blog-link {
    color: #aaa;
    text-decoration: none;
    font-size: 0.95rem;              /* slightly smaller */
    font-weight: 600;
    transition: color 0.25s ease, transform 0.2s ease;
}

.blog-link:hover {
    color: #c41e3a;
    transform: translateY(-2px);
}

.social-icon {
    width: 32px;                     /* further reduced */
    height: 32px;
    object-fit: contain;
    transition: transform 0.25s ease, opacity 0.25s ease;
    filter: brightness(0.9);
}

.social-icon:hover {
    transform: scale(1.18);
    opacity: 1;
    filter: brightness(1.1);
}

/* Instagram size adjustment if needed */
.footer-social-right .social-icon {
    transform: scale(1.1);
}

/* Mobile stacking */
@media (max-width: 768px) {
    .footer-top-row {
        flex-direction: column;
        gap: 0.9rem;
        margin-bottom: 0.7rem;
    }

    .footer-social-left,
    .footer-social-right {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .social-icon {
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 600px) {
    .social-icon {
        width: 30px;
        height: 30px;
    }
}

/* Spacer */
.spacer {
    height: 1.8rem;                    /* slightly reduced */
}

/* Contact Form Styling */
.contact-form {
    max-width: 700px;
    margin: 3rem auto 0;
    background: #2d2d2d;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.4);
}

.form-group {
    margin-bottom: 1.8rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: bold;
    color: #cccccc;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.9rem;
    border: 1px solid #444;
    background: #1e1e1e;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #c41e3a;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.3);
}

.form-group.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.form-group.checkbox input {
    margin-top: 0.4rem;
    width: 18px;
    height: 18px;
}

.form-group.checkbox label {
    color: #cccccc;
    font-size: 0.95rem;
    line-height: 1.4;
}

.contact-form button {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .grid-5 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1100px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .service-icon { width: 160px; }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .hero h1 { font-size: clamp(2rem, 6vw, 3rem); }
    .grid { grid-template-columns: 1fr; }
    .service-icon { width: 200px; }
    .spacer { height: 1.6rem; }
    .contact-form {
        padding: 1.8rem;
        margin: 2rem auto 0;
    }
}

@media (max-width: 550px) {
    .grid-5 { grid-template-columns: 1fr; }
}