/* Bath Surveyors UK - Main Stylesheet */
/* Professional surveying practice design with Bath heritage feel */

:root {
    --bath-stone: #F5E6D3;
    --heritage-gold: #C9A961;
    --professional-navy: #1e3a5f;
    --trust-blue: #2E5C8A;
    --accent-green: #3D7C47;
    --text-dark: #2C2C2C;
    --text-light: #666666;
    --white: #FFFFFF;
    --light-grey: #F8F8F8;
    --border-grey: #E0E0E0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    /* Prevent horizontal scrolling */
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent horizontal scrolling */
    width: 100%;
    max-width: 100vw;
    /* Improve mobile performance */
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

/* Ensure all images are visible and responsive */
img {
    max-width: 100%;
    height: auto;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

video {
    max-width: 100%;
    height: auto;
    display: block !important;
    visibility: visible !important;
}

/* Ensure all image containers are visible */
.article-image,
.blog-image,
.team-photo,
.service-image,
[class*="image"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: hidden;
}

.article-image img,
.blog-image img,
.team-photo img,
[class*="image"] img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
    font-size: 16px;
    background: var(--white);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--professional-navy);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
    line-height: 1.8;
}

a {
    color: var(--trust-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--heritage-gold);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header & Navigation */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--professional-navy);
}

.logo span {
    color: var(--heritage-gold);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

nav a:hover,
nav a.active {
    color: var(--trust-blue);
    border-bottom-color: var(--heritage-gold);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--professional-navy);
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    height: 95vh;
    min-height: 600px;
    max-height: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--professional-navy);
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0.4;
    object-fit: cover;
    display: block;
    visibility: visible;
    /* Ensure video plays on iOS */
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.85) 0%, rgba(46, 92, 138, 0.75) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.hero-text {
    color: var(--white);
}

.hero-text h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-text .highlight {
    color: var(--heritage-gold);
}

.hero-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-badges {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    color: var(--white);
}

.hero-form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.hero-form h3 {
    color: var(--professional-navy);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Sections */
.section {
    padding: 3rem 2rem;
}

.section-grey {
    background: var(--light-grey);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid var(--heritage-gold);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--trust-blue);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-card p {
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--trust-blue);
    color: var(--white);
    border-radius: 6px;
    font-weight: 600;
    border: 2px solid var(--trust-blue);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: var(--professional-navy);
    border-color: var(--professional-navy);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-outline {
    background: transparent;
    color: var(--trust-blue);
    border: 2px solid var(--trust-blue);
}

.btn-outline:hover {
    background: var(--trust-blue);
    color: var(--white);
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--heritage-gold);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Reviews Section */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.review-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.stars {
    color: var(--heritage-gold);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.review-text {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.reviewer-name {
    font-weight: 600;
    color: var(--professional-navy);
}

.reviewer-location {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
}

.team-member {
    text-align: center;
}

.team-photo {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: block;
}

.team-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.team-member h3 {
    margin-bottom: 0.5rem;
}

.team-role {
    color: var(--heritage-gold);
    font-weight: 600;
    margin-bottom: 1rem;
}

.team-bio {
    text-align: left;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.blog-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.blog-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    display: block;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-content {
    padding: 2rem;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.blog-content h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.blog-excerpt {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* FAQ Section */
.faq-container {
    max-width: 900px;
    margin: 2rem auto 0;
}

.faq-item {
    background: var(--white);
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--professional-navy);
    background: var(--white);
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: var(--light-grey);
}

.faq-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 1.5rem 1.5rem;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 3rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--professional-navy);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-grey);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--trust-blue);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Areas List */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.area-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-left: 4px solid var(--heritage-gold);
}

.area-card h3 {
    margin-bottom: 1rem;
}

.area-card ul {
    list-style: none;
}

.area-card li {
    padding: 0.5rem 0;
    color: var(--text-light);
    padding-left: 1.5rem;
    position: relative;
}

.area-card li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: 700;
}

/* Article Content */
.article-header {
    max-width: 900px;
    margin: 0 auto 2rem;
    text-align: center;
}

.article-meta {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1.5rem;
    color: var(--text-light);
}

.article-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h2 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-content img {
    width: 100%;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.article-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
    margin: 1rem 0;
    display: block;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Call to Action */
.cta-section {
    background: linear-gradient(135deg, var(--professional-navy) 0%, var(--trust-blue) 100%);
    color: var(--white);
    padding: 5rem 2rem;
    text-align: center;
}

.cta-section h2 {
    color: var(--white);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.cta-section .btn {
    background: var(--heritage-gold);
    border-color: var(--heritage-gold);
    color: var(--professional-navy);
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
}

.cta-section .btn:hover {
    background: var(--white);
    border-color: var(--white);
    color: var(--professional-navy);
}

/* Footer */
footer {
    background: var(--professional-navy);
    color: var(--white);
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--heritage-gold);
    margin-bottom: 1.5rem;
}

.footer-section p,
.footer-section a {
    color: #ffffff !important;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.75rem;
}

.footer-section a:hover {
    color: var(--heritage-gold) !important;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    color: #ffffff !important;
}

.footer-bottom p {
    color: #ffffff !important;
}

/* Responsive Design */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1rem;
    }
    
    .hero {
        height: auto;
        min-height: 500px;
        padding: 2rem 0;
        position: relative;
        overflow: hidden;
    }
    
    .hero-video {
        display: block !important;
        visibility: visible !important;
        opacity: 0.3;
        object-fit: cover;
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        min-width: 100%;
        min-height: 100%;
    }
    
    .hero-text {
        order: 1;
        margin-bottom: 1.5rem;
    }
    
    .hero-form {
        order: 2;
        padding: 1.5rem;
        max-height: none;
        overflow-y: visible;
        margin-bottom: 2rem;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-badges {
        flex-wrap: wrap;
        margin-bottom: 1rem;
    }
    
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    
    nav ul.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .services-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    /* Ensure images are visible on mobile */
    img,
    .article-image img,
    .blog-image img,
    .team-photo img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100%;
        height: auto;
    }
    
    .article-image {
        height: 300px;
        display: block;
        overflow: hidden;
    }
    
    .blog-image {
        height: 220px;
        display: block;
        overflow: hidden;
    }
    
    /* Mobile HubSpot Form Optimizations - Force full visibility */
    .hero-form,
    .contact-form,
    #hero-form-container,
    #bottom-form-container,
    #contact-form-container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }
    
    .hs-form {
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .hs-form-field,
    .hs-form > .hs-form-field,
    .hs-form fieldset,
    .hs-form fieldset > .hs-form-field {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        margin-bottom: 1rem !important;
    }
    
    .hs-input,
    .hs-form input[type="text"],
    .hs-form input[type="email"],
    .hs-form input[type="tel"],
    .hs-form select,
    .hs-form textarea {
        font-size: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .hs-button {
        font-size: 16px !important;
        padding: 1rem !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
    }
    
    .hs-form-field > label {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero {
        min-height: 500px;
        height: auto;
        padding: 2rem 0;
        position: relative;
        overflow: hidden;
    }
    
    .hero-video {
        display: block !important;
        visibility: visible !important;
        opacity: 0.25;
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        min-width: 100%;
        min-height: 100%;
        object-fit: cover;
    }
    
    .hero-content {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-text p {
        font-size: 0.95rem;
    }
    
    .hero-form {
        padding: 1.25rem;
        max-height: none;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    .hero-form h3 {
        font-size: 1.25rem;
        text-align: center;
    }
    
    .hero-badges {
        justify-content: center;
    }
    
    .section {
        padding: 2rem 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Ensure all images are visible and properly sized on mobile */
    img {
        display: block !important;
        max-width: 100% !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .article-image {
        height: 250px;
        width: 100%;
        display: block;
        overflow: hidden;
        margin: 1rem 0;
    }
    
    .article-image img {
        display: block !important;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .blog-image {
        height: 200px;
        width: 100%;
        display: block;
        overflow: hidden;
    }
    
    .blog-image img {
        display: block !important;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .team-photo {
        width: 100%;
        display: block;
    }
    
    .team-photo img {
        display: block !important;
        width: 100%;
        height: auto;
    }
    
    /* Mobile-specific form styling - Force full visibility */
    .contact-form,
    .hero-form,
    #hero-form-container,
    #bottom-form-container,
    #contact-form-container {
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: visible !important;
    }
    
    .hs-form,
    .hs-form-field,
    .hs-input,
    .hs-button {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .hs-form fieldset,
    .hs-form > .hs-form-field,
    .hs-form fieldset > .hs-form-field {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
    }
    
    /* Prevent zoom on input focus (iOS Safari) */
    .hs-input,
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Make buttons touch-friendly */
    .btn,
    .hs-button {
        min-height: 44px !important;
        font-size: 16px !important;
    }
    
    /* Improve readability on small screens */
    .article-content {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    /* Stack footer sections vertically */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Improve table/grid readability */
    .blog-grid,
    .services-grid,
    .areas-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* reCAPTCHA mobile styling */
    .recaptcha-container {
        transform: scale(0.9);
        transform-origin: 0 0;
    }
}

/* Large Desktop Screens - Ensure form fits properly */
@media (min-width: 1400px) {
    .hero-content {
        max-width: 1400px;
        gap: 4rem;
    }
    
    .hero-form {
        max-height: 85vh;
    }
}

/* Medium screens - tablet portrait and smaller laptops */
@media (max-width: 1200px) and (min-width: 969px) {
    .hero-form {
        max-height: 88vh;
        padding: 2rem;
    }
}

/* HubSpot Form Styling for Hero */
.hero-form .hs-form {
    max-width: 100%;
}

.hero-form .hs-form-field {
    margin-bottom: 1rem;
}

.hero-form .hs-input {
    width: 100% !important;
    max-width: 100% !important;
}

.hero-form .hs-button {
    width: 100%;
    padding: 1rem !important;
    margin-top: 1rem;
}

/* Global HubSpot Form Styling - Force full visibility at all screen sizes */
.hero-form,
.contact-form,
#hero-form-container,
#bottom-form-container,
#contact-form-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 50px !important;
}

.hs-form {
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hs-form-field {
    margin-bottom: 1rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
}

.hs-form-field > label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 0.5rem !important;
    font-weight: 600 !important;
}

.hs-input {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.75rem !important;
    font-size: 16px !important;
    border: 2px solid #ddd !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hs-input:focus {
    border-color: #2E5C8A !important;
    outline: none !important;
}

.hs-button {
    width: 100% !important;
    padding: 1rem !important;
    background: #2E5C8A !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-top: 1rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hs-button:hover {
    background: #1E3A5F !important;
}

.hs-error-msgs {
    list-style: none !important;
    padding: 0 !important;
    margin-top: 0.5rem !important;
}

.hs-error-msg {
    color: #d32f2f !important;
    font-size: 0.875rem !important;
}

/* Ensure HubSpot forms and containers are fully visible on all devices */
.hs-form-iframe {
    width: 100% !important;
    min-height: 400px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#hubspotForm,
#hubspotForm-hero,
#hubspotForm-bottom,
#hubspotForm-contact,
#hero-form-container,
#bottom-form-container,
#contact-form-container,
.hero-form > div,
.contact-form > div {
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 50px !important;
}

/* HubSpot form fieldset styling */
.hs-form fieldset {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hs-form .hs-fieldtype-text,
.hs-form .hs-fieldtype-select,
.hs-form .hs-fieldtype-textarea,
.hs-form .hs-fieldtype-phonenumber {
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Mobile form wrapper - Force all form fields visible */
.hs-form > .hs-form-field,
.hs-form > fieldset > .hs-form-field {
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* reCAPTCHA Styling */
.recaptcha-container {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.recaptcha-error {
    color: #d32f2f;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

.recaptcha-error.show {
    display: block;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.hidden {
    display: none;
}

/* Extra Small Devices - Phones in portrait (320px and up) */
@media (max-width: 480px) {
    .hero {
        padding: 1.5rem 0;
        min-height: 500px;
        position: relative;
        overflow: hidden;
    }
    
    .hero-video {
        display: block !important;
        visibility: visible !important;
        opacity: 0.2;
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        min-width: 100%;
        min-height: 100%;
        object-fit: cover;
    }
    
    .hero-content {
        padding: 0.5rem;
        gap: 1rem;
    }
    
    .hero-text h1 {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .hero-text p {
        font-size: 0.9rem;
    }
    
    .section-header h1 {
        font-size: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.35rem;
    }
    
    .hero-form,
    #hero-form-container,
    #bottom-form-container,
    #contact-form-container {
        padding: 1rem;
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: visible !important;
    }
    
    .hero-form h3 {
        font-size: 1rem;
    }
    
    /* Force all HubSpot form elements visible on extra small screens */
    .hs-form,
    .hs-form-field,
    .hs-form fieldset,
    .hs-form > .hs-form-field,
    .hs-form fieldset > .hs-form-field {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
    }
    
    .hs-input,
    .hs-form input,
    .hs-form select,
    .hs-form textarea {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        font-size: 16px !important;
    }
    
    .hs-button {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
    }
    
    .hs-form-field > label {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure all images are visible on extra small screens */
    img {
        display: block !important;
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .article-image {
        height: 200px;
        width: 100%;
        display: block !important;
    }
    
    .article-image img {
        display: block !important;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .blog-image {
        height: 180px;
        width: 100%;
        display: block !important;
    }
    
    .blog-image img {
        display: block !important;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Ensure form inputs are visible and usable */
    .hs-input,
    input,
    textarea,
    select {
        min-height: 44px !important;
        padding: 0.6rem !important;
    }
    
    /* Stack badges vertically on very small screens */
    .hero-badges {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .badge {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Adjust card padding for small screens */
    .service-card,
    .area-card,
    .review-card {
        padding: 1.25rem;
    }
    
    /* Optimize blog cards for small screens */
    .blog-card {
        margin-bottom: 1.5rem;
    }
    
    /* Footer optimization */
    .footer-content {
        text-align: center;
    }
    
    .footer-section ul {
        padding-left: 0;
    }
    
    /* Section padding optimization */
    .section {
        padding: 2rem 0.75rem;
    }
}

/* Landscape orientation fixes for mobile */
@media (max-width: 968px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        height: auto;
    }
    
    .hero-form {
        max-height: none;
    }
}

/* CRITICAL: Force ALL images and videos to be visible on mobile - Final Override */
@media (max-width: 968px) {
    /* Ensure every image element is visible regardless of container */
    img,
    video,
    .article-image,
    .article-image img,
    .blog-image,
    .blog-image img,
    .team-photo,
    .team-photo img,
    .service-image,
    .service-image img,
    [class*="image"],
    [class*="image"] img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure containers don't hide content */
    .article-image,
    .blog-image,
    .team-photo,
    .service-image,
    [class*="image"] {
        overflow: visible !important;
        max-width: 100% !important;
    }
    
    /* Ensure proper image rendering */
    img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Exception: Keep specific image containers with height constraints */
    .article-image,
    .blog-image {
        overflow: hidden !important;
    }
    
    .article-image img,
    .blog-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}

/* Print styles */
@media print {
    .hero-form,
    .recaptcha-container,
    header nav,
    footer {
        display: none !important;
    }
}
