/*--------------------------------------------------------------
# Global Responsive Overrides
# This file ensures all pages work on every device & zoom level
# Loaded LAST so it overrides all page-specific styles
--------------------------------------------------------------*/

/* ============================================================
   BASE: Fluid defaults for all elements
   ============================================================ */
img {
    max-width: 100%;
    height: auto;
}

.container,
.container-fluid {
    overflow-x: hidden;
}

/* ============================================================
   HEADER: Prevent overflow at any zoom level
   ============================================================ */
.header .container-fluid.container-xl {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* ============================================================
   HERO BANNERS (.fi_temple1-con / .s_temple1-con)
   ============================================================ */
.fi_temple1-con,
.s_temple1-con {
    height: auto;
    min-height: 250px;
    max-height: 450px;
    padding: 40px 15px;
    background-size: cover;
    background-position: center;
}

@media (max-width: 576px) {
    .fi_temple1-con,
    .s_temple1-con {
        min-height: 180px;
        max-height: 280px;
        padding: 30px 10px;
        margin-top: 60px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .fi_temple1-con,
    .s_temple1-con {
        min-height: 220px;
        max-height: 350px;
        margin-top: 70px;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .fi_temple1-con,
    .s_temple1-con {
        min-height: 260px;
        max-height: 400px;
    }
}

/* ============================================================
   SEARCH BAR - Responsive sizing
   ============================================================ */
.search-box {
    max-width: 100%;
}

.search-box input.form-control {
    font-size: clamp(13px, 2vw, 16px);
    padding: 10px 15px 10px 40px;
}

.search-box .filter-btn {
    width: clamp(36px, 5vw, 45px);
    height: clamp(36px, 5vw, 45px);
}

@media (max-width: 576px) {
    .search-box {
        margin: 0 5px;
    }
    .search-box input.form-control {
        padding: 8px 12px 8px 35px;
        font-size: 13px;
    }
    .search-box .search-icon {
        font-size: 14px;
        left: 12px;
    }
}

/* ============================================================
   HOME PAGE - Swiper / Hero Slider
   ============================================================ */
@media (max-width: 576px) {
    .swiper {
        height: 280px !important;
    }
    .hero-search-overlay h2 {
        font-size: 1.1rem !important;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .swiper {
        height: 380px !important;
    }
    .hero-search-overlay h2 {
        font-size: 1.4rem !important;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .swiper {
        height: 440px !important;
    }
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-title h2 {
    font-size: clamp(1.4rem, 4vw, 2.5rem);
}

.section-title p {
    font-size: clamp(0.8rem, 2vw, 1rem);
}

@media (max-width: 576px) {
    .section-title {
        margin-bottom: 15px !important;
    }
    .section-title h2.display-5 {
        font-size: 1.5rem !important;
    }
}

/* ============================================================
   GOD CARDS / TEMPLE CARDS - Consistent grid
   ============================================================ */
@media (max-width: 576px) {
    .god-card .card-body {
        padding: 12px !important;
    }
    .god-card .card-body h5 {
        font-size: 0.9rem;
    }
    .god-card .card-body img {
        max-height: 80px;
    }
}

/* ============================================================
   TEMPLE CARDS (home page grid)
   ============================================================ */
.custom-card img.card-img {
    width: 100%;
    height: auto;
    min-height: 180px;
    max-height: 300px;
    object-fit: cover;
}

@media (max-width: 576px) {
    .custom-card img.card-img {
        min-height: 150px;
        max-height: 220px;
    }
    .card-overlay p.card-text {
        font-size: 0.85rem;
    }
}

/* ============================================================
   PARIHARASTHALAM CARDS
   ============================================================ */
@media (max-width: 576px) {
    .temple2-card {
        padding: 15px !important;
    }
    .temple2-card img {
        max-height: 60px;
    }
    .temple2-card h5 {
        font-size: 0.85rem;
    }
}

/* ============================================================
   HOW IT WORKS / STEPS
   ============================================================ */
@media (max-width: 576px) {
    .step-item .circle-icon {
        width: 55px;
        height: 55px;
    }
    .step-item .circle-icon i {
        font-size: 22px;
    }
    .step-item .title {
        font-size: 0.9rem;
    }
    .step-item .desc {
        font-size: 0.8rem;
    }
}

/* ============================================================
   FAQ SECTION
   ============================================================ */
@media (max-width: 768px) {
    .temple6-con .accordion-button {
        font-size: 0.9rem;
        padding: 12px 15px;
    }
    .temple6-con .accordion-body {
        font-size: 0.85rem;
        padding: 10px 15px;
    }
    .contact-box {
        margin-top: 20px;
    }
}

/* ============================================================
   RSS NEWS CARDS
   ============================================================ */
@media (max-width: 576px) {
    .rss-news-card .rss-img-wrap {
        height: 160px;
    }
    .rss-news-card .rss-body {
        padding: 14px;
    }
    .rss-news-card .rss-title {
        font-size: 0.9rem;
    }
}

/* ============================================================
   TEMPLE DETAILS PAGE
   ============================================================ */

/* Gallery */
@media (max-width: 576px) {
    .f_temple2-con {
        padding-top: 20px !important;
        margin-top: 70px !important;
    }
    .gallery-main-img {
        max-height: 250px !important;
        object-fit: cover;
    }
    .gallery-thumbs img {
        width: 50px !important;
        height: 50px !important;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .f_temple2-con {
        margin-top: 80px !important;
    }
    .gallery-main-img {
        max-height: 320px !important;
    }
}

/* Temple Title */
.temple-title-main {
    font-size: clamp(1.4rem, 4vw, 2.4rem) !important;
}

/* Vertical Timeline */
@media (max-width: 576px) {
    .details-timeline {
        padding-left: 22px;
    }
    .timeline-icon {
        width: 16px;
        height: 16px;
        left: -22px;
        font-size: 0.5rem !important;
    }
    .timeline-icon i {
        font-size: 0.5rem;
    }
    .timeline-label {
        font-size: 0.7rem;
    }
    .timeline-value {
        font-size: 0.95rem;
    }
}

/* Horizontal Timeline */
@media (max-width: 576px) {
    .horizontal-timeline-wrap {
        padding: 25px 10px;
    }
    .ht-icon {
        width: 55px;
        height: 55px;
    }
    .ht-icon i {
        font-size: 24px;
    }
    .ht-title {
        font-size: 0.85rem;
    }
    .ht-desc {
        font-size: 0.75rem;
    }
}

/* Temple Tabs (History/Description) */
@media (max-width: 576px) {
    .temple-tabs .nav-link {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    .temple-text-content {
        font-size: 0.9rem;
    }
    .btn-read-more {
        font-size: 0.8rem;
    }
}

/* Nearby Temples / You Might Also Consider */
@media (max-width: 576px) {
    .nearby-temple-card,
    .also-consider-card {
        margin-bottom: 10px;
    }
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
@media (max-width: 576px) {
    .about-page .card-body h5 {
        font-size: 1rem;
    }
    .about-page .card-body p {
        font-size: 0.85rem;
    }
    #templeCarousel img {
        max-height: 200px !important;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    #templeCarousel img {
        max-height: 280px !important;
    }
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
@media (max-width: 576px) {
    .contact-form {
        padding: 15px !important;
    }
    .contact-form input,
    .contact-form textarea {
        font-size: 0.9rem;
    }
}

/* ============================================================
   FOOTER
   ============================================================ */
@media (max-width: 576px) {
    .footer .container {
        padding: 20px 15px;
    }
    .footer h4 {
        font-size: 1rem;
    }
    .footer p, .footer a {
        font-size: 0.85rem;
    }
    .footer .newsletter input {
        font-size: 0.85rem;
    }
}

/* ============================================================
   TEMPLE LISTINGS PAGE
   ============================================================ */
@media (max-width: 576px) {
    .temple-listing-card {
        margin-bottom: 15px;
    }
    .temple-listing-card img {
        max-height: 180px;
        object-fit: cover;
    }
}

/* ============================================================
   GLOBAL: Prevent overflow on all screen sizes
   ============================================================ */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    min-width: 320px;
}

main.main {
    overflow-x: hidden;
}

section {
    overflow-x: hidden;
}

/* ============================================================
   GLOBAL: Fluid text scaling
   ============================================================ */
@media (max-width: 576px) {
    h1 { font-size: clamp(1.3rem, 5vw, 2rem) !important; }
    h2 { font-size: clamp(1.2rem, 4vw, 1.8rem) !important; }
    h3 { font-size: clamp(1rem, 3.5vw, 1.5rem) !important; }
    h4 { font-size: clamp(0.95rem, 3vw, 1.3rem) !important; }
    h5 { font-size: clamp(0.85rem, 2.5vw, 1.1rem) !important; }
    p, li, span, a { font-size: clamp(0.8rem, 2vw, 1rem); }
}

@media (min-width: 577px) and (max-width: 768px) {
    h1 { font-size: clamp(1.5rem, 4vw, 2.2rem) !important; }
    h2 { font-size: clamp(1.3rem, 3.5vw, 2rem) !important; }
}
