/* res_contactus.css - Responsive styles for contact page */

/* Mobile First Approach */

/* Mobile Devices (up to 767px) */
@media screen and (max-width: 767px) {
    
    /* Contact Banner Section */
    .contact-banner {
        height: 150px;
        padding: 15px 10px;
        width: auto;
        margin-top: 50px;
    }
    
    .contact-banner .content {
        padding: 10px 0;
    }
    
    .contact-banner h1 {
        font-size: 1.8rem;
        margin-bottom: 0.3rem;
    }
    
    .contact-banner p {
        font-size: 0.9rem;
        padding: 0 10px;
    }
    
    /* Contact Container - FIX OVERLAPPING */
    .contact-container {
        flex-direction: column;
        height: auto;
        gap: 20px;
        padding: 10px;
        align-items: center;
    }
    
    .contact-card {
        max-width: 100%;
        width: 100%;
        padding: 20px;
        margin-bottom: 0;
        box-sizing: border-box;
    }
    
    /* Ensure proper spacing between cards */
    .contact-card:first-child {
        margin-bottom: 20px;
    }
    
    .contact-card h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    /* Form Elements */
    .contact-card form .form-group {
        margin-bottom: 15px;
    }
    
    .contact-card form .form-group input,
    .contact-card form .form-group textarea {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        width: 100%;
        box-sizing: border-box;
    }
    
    .contact-card form button {
        padding: 14px;
        font-size: 1rem;
        width: 100%;
    }
    
    /* Contact Details */
    .contact-details {
        margin-top: 0;
    }
    
    .contact-item {
        margin-bottom: 15px;
        padding: 8px 0;
    }
    
    .contact-icon {
        width: 22px;
        height: 22px;
        margin-right: 10px;
    }
    
    .office-hours {
        margin-top: 20px;
    }
    
    .office-hours p:first-child {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .office-hours p:last-child {
        font-size: 0.9rem;
    }
    
    /* Map Section */
    .map-section {
        flex-direction: column;
        gap: 20px;
        padding: 0;
        margin-top: 20px;
    }
    
    .map-content {
        flex-direction: column;
        padding: 0;
        gap: 25px;
    }
    
    .map-text {
        flex: 1 1 100%;
        max-width: 100%;
        text-align: center;
    }
    
    .map-text h2 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .map-text p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .map-container {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
    }
    
    iframe {
        height: 300px;
        width: 100%;
    }
    
    .map-long-description {
        font-size: 0.9rem;
        line-height: 1.6;
        text-align: center;
        padding: 0 5px;
    }
}

/* Fix for very small mobile devices where overlapping might still occur */
@media screen and (max-width: 480px) {
    .contact-container {
        gap: 25px;
        padding: 15px 5px;
    }
    
    .contact-card {
        padding: 15px;
        margin-bottom: 0;
    }
    
    .contact-card:first-child {
        margin-bottom: 25px;
    }
    
    /* Ensure no overlap by adding clear separation */
    .contact-card + .contact-card {
        margin-top: 0;
    }
}

/* Tablet Devices (768px to 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    
    /* Contact Banner Section */
    .contact-banner {
        height: 170px;
        padding: 20px 15px;
    }
    
    .contact-banner h1 {
        font-size: 2.2rem;
    }
    
    .contact-banner p {
        font-size: 1.1rem;
        padding: 0 20px;
    }
    
    /* Contact Container */
    .contact-container {
        flex-direction: row;
        flex-wrap: wrap;
        height: auto;
        gap: 25px;
        padding: 20px;
        justify-content: center;
    }
    
    .contact-card {
        flex: 1 1 calc(50% - 25px);
        max-width: calc(50% - 25px);
        min-width: 300px;
        padding: 25px;
    }
    
    /* Map Section */
    .map-section {
        flex-direction: column;
        gap: 25px;
        padding: 25px 15px;
    }
    
    .map-content {
        flex-direction: column;
        padding: 30px 25px;
        gap: 30px;
    }
    
    .map-text {
        flex: 1 1 100%;
        max-width: 90%;
        text-align: center;
    }
    
    .map-text h2 {
        font-size: 1.8rem;
    }
    
    .map-container {
        flex: 1 1 100%;
        max-width: 90%;
    }
    
    iframe {
        height: 350px;
    }
    
    .map-long-description {
        font-size: 0.95rem;
        line-height: 1.7;
        text-align: center;
    }
}

/* Laptop Devices (1024px to 1439px) */
@media screen and (min-width: 1024px) and (max-width: 1439px) {
    
    /* Contact Banner Section */
    .contact-banner {
        height: 180px;
    }
    
    .contact-banner h1 {
        font-size: 2.3rem;
    }
    
    .contact-banner p {
        font-size: 1.15rem;
    }
    
    /* Contact Container */
    .contact-container {
        gap: 30px;
        padding: 25px;
    }
    
    .contact-card {
        max-width: 480px;
        padding: 30px;
    }
    
    /* Map Section */
    .map-content {
        gap: 40px;
        padding: 40px 30px;
    }
    
    .map-text {
        max-width: 500px;
    }
    
    .map-container {
        max-width: 700px;
    }
    
    iframe {
        height: 400px;
    }
}

/* Desktop Devices (1440px and above) */
@media screen and (min-width: 1440px) {
    
    /* Contact Banner Section */
    .contact-banner {
        height: 200px;
    }
    
    .contact-banner h1 {
        font-size: 2.8rem;
    }
    
    .contact-banner p {
        font-size: 1.3rem;
    }
    
    /* Contact Container */
    .contact-container {
        gap: 40px;
        padding: 30px;
    }
    
    .contact-card {
        max-width: 550px;
        padding: 35px;
    }
    
    /* Map Section */
    .map-content {
        gap: 50px;
        padding: 50px 40px;
    }
    
    .map-text {
        max-width: 600px;
    }
    
    .map-text h2 {
        font-size: 2.2rem;
    }
    
    .map-text p {
        font-size: 1.1rem;
    }
    
    .map-container {
        max-width: 800px;
    }
    
    iframe {
        height: 450px;
    }
    
    .map-long-description {
        font-size: 1.05rem;
        line-height: 1.8;
    }
}

/* Additional Responsive Enhancements */

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .contact-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .contact-card form button {
        padding: 16px;
    }
    
    /* Larger touch targets for mobile */
    .contact-item {
        padding: 10px 0;
    }
    
    .email-link,
    .facebook-link {
        padding: 8px 0;
    }
    
    .contact-card form .form-group input,
    .contact-card form .form-group textarea {
        min-height: 44px; /* Minimum touch target size */
    }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .contact-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape orientation for mobile */
@media screen and (max-width: 767px) and (orientation: landscape) {
    .contact-banner {
        height: 120px;
        padding: 10px;
    }
    
    .contact-banner h1 {
        font-size: 1.5rem;
    }
    
    .contact-banner p {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }
    
    .contact-container {
        flex-direction: row;
        height: auto;
        gap: 15px;
    }
    
    .contact-card {
        flex: 1 1 calc(50% - 15px);
        max-width: calc(50% - 15px);
        padding: 15px;
    }
    
    /* Ensure no overlap in landscape */
    .contact-card:first-child {
        margin-bottom: 0;
    }
}

/* Print styles */
@media print {
    .contact-banner {
        background: none !important;
        color: black !important;
        height: auto;
    }
    
    .contact-card {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .contact-container {
        flex-direction: column !important;
    }
    
    .map-container iframe {
        display: none;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .contact-card {
        transition: none;
    }
    
    .fade-in-section {
        transition: opacity 0.3s ease-out;
    }
}

/* Very small mobile devices */
@media screen and (max-width: 360px) {
    .contact-banner h1 {
        font-size: 1.6rem;
    }
    
    .contact-banner p {
        font-size: 0.85rem;
    }
    
    .contact-container {
        padding: 10px 5px;
        gap: 20px;
    }
    
    .contact-card {
        padding: 15px 12px;
    }
    
    .contact-card h3 {
        font-size: 1.2rem;
    }
    
    .map-text h2 {
        font-size: 1.3rem;
    }
    
    .map-long-description {
        font-size: 0.85rem;
    }
}

/* Emergency overlap fix - Add this if overlapping persists */
.contact-section {
    overflow: hidden;
    padding: 0;
}

.contact-container {
    position: relative;
}

.contact-card {
    position: relative;
    z-index: 1;
}