/* ============================================================
   Covenant Matrimony — Responsive Fixes v2
   Load AFTER style.css in base.html:
   <link rel="stylesheet" href="{% static 'css/responsive-fixes.css' %}">
   ============================================================ */

/* ── 1. SAFE OVERFLOW PREVENTION ──────────────────────────── */
html,
body {
    overflow-x: hidden;
    max-width: none;
}

/* Never put overflow:hidden on .container — kills Bootstrap row margins */

/* ── 2. UNIVERSAL IMAGE GUARD ─────────────────────────────── */
img,
video,
canvas,
iframe,
svg {
    max-width: 100%;
    height: auto;
}

/* ── 3. NAVBAR — fluid scaling, no overflow at 1024px ──────── */
.navbar-main {
    min-width: 0;
}

.brand-logo-text .main-name {
    font-size: clamp(1.2rem, 2.8vw, 2.2rem);
    white-space: nowrap;
}

.brand-logo-text .sub-tag {
    font-size: clamp(0.52rem, 0.8vw, 0.65rem);
    white-space: nowrap;
}

@media (min-width: 992px) {
    .navbar-nav .nav-link {
        margin-left: clamp(0.4rem, 1.1vw, 2rem);
        font-size: clamp(0.72rem, 0.88vw, 0.9rem);
        white-space: nowrap;
    }

    .navbar-brand img {
        height: clamp(36px, 4.5vw, 50px) !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   4. HERO — MOBILE COMPLETE REWORK
   On ≤768px:
   • Hide the slider images entirely (no landscape photo on mobile)
   • Card sits centered, max-width 420px, with comfortable padding
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 991px) {

    /* Hide the background slide images — user requested no slider on mobile */
    .hero-slide,
    .hero-slide.active {
        display: none !important;
        position: absolute !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Slider dots unnecessary without images */
    .slider-dots {
        display: none !important;
    }

    /* Overlay becomes the section itself — dark gradient background */
    .hero-overlay {
        position: relative !important;
        display: block !important;
        background: linear-gradient(160deg, #0f0f0f 0%, #1a1400 50%, #0a0a0a 100%) !important;
        padding: 2.5rem 1rem 3rem !important;
        height: auto !important;
        min-height: auto !important;
    }

    /* Hero slider wrapper height resets so it doesn't leave dead space */
    .hero-slider {
        height: auto !important;
        min-height: auto !important;
        background: #0f0f0f !important;
    }

    /* Full-width container fluid */
    .hero-overlay .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Row & col — stack vertically, full width */
    .hero-overlay .row {
        justify-content: center !important;
    }

    .hero-overlay [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Card container: centered, max-width, not edge-to-edge */
    .reg-card-container {
        max-width: 420px !important;
        width: 100% !important;
        margin: 0 auto !important;
        border-radius: 16px !important;
        overflow: hidden !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
    }

    /* Dark header strip inside card */
    .reg-card-container>div:first-child {
        padding: 1.25rem 1.25rem 0.75rem !important;
    }

    /* White form body */
    .reg-card-white {
        padding: 1.25rem 1.25rem 1.5rem !important;
        border-radius: 0 !important;
    }

    /* Form inputs full-width */
    .reg-card-white input,
    .reg-card-white .custom-select-trigger {
        font-size: 15px !important;
    }
}

/* Extra-small phones (375px) — slightly tighter */
@media (max-width: 400px) {
    .reg-card-container {
        max-width: 100% !important;
        border-radius: 12px !important;
    }

    .hero-overlay {
        padding: 2rem 0.75rem 2.5rem !important;
    }
}

/* ── 5. MATCHING PROCESS IMAGE — completely natural scaling ──────── */
.matching-process img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── 6. WHY CHOOSE US — unstick left panel on mobile ───────── */
@media (max-width: 991px) {
    .cv-why-section .col-lg-5 {
        position: relative !important;
        top: 0 !important;
        text-align: center;
        margin-bottom: 2.5rem;
    }

    .cv-why-section .btn-premium-cta {
        justify-content: center;
    }

    .why-feature-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem 1.25rem !important;
    }

    .why-feature-item::before {
        width: 100% !important;
        height: 4px !important;
        top: 0 !important;
        left: 0 !important;
    }
}

/* ── 7. FLUID TYPOGRAPHY ───────────────────────────────────── */
.cv-section-head h2,
.cv-process-section h2,
.cv-faq-left h2,
.cv-cta-inner h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem) !important;
    line-height: 1.25;
}

.cv-why-section h2 {
    font-size: clamp(1.6rem, 4vw, 3rem) !important;
}

/* ── 8. SECTION PADDING — breathe on mobile ────────────────── */
@media (max-width: 767px) {

    .cv-process-section,
    .cv-why-section,
    .cv-stories-section,
    .cv-faq-section,
    .cv-plans-section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .cv-cta-inner {
        padding: 2.5rem 1.25rem !important;
    }
}

/* ── 9. PROCESS CARD — capstone mobile fix ─────────────────── */
@media (max-width: 767px) {
    .process-card {
        padding: 1.75rem 1.25rem !important;
    }

    .process-card-horizontal {
        flex-direction: column !important;
        text-align: center;
        padding: 1.75rem 1.25rem !important;
    }

    .process-card-horizontal .process-step-num {
        top: -15px !important;
        right: -10px !important;
        transform: none !important;
        font-size: 8rem !important;
    }

    .process-card-horizontal:hover .process-step-num {
        transform: scale(1.05) translate(-10px, 10px) !important;
    }
}

/* ── 10. STORY CARDS ────────────────────────────────────────── */
.cv-story-img-wrap img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* ── 11. FAQ ────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .cv-faq-left {
        padding-right: 0 !important;
        text-align: center;
        margin-bottom: 2rem;
    }
}

/* ── 12. FOOTER — flex-wrap fixes ──────────────────────────── */
.site-footer {
    overflow-x: hidden;
}

.site-footer-newsletter-group {
    display: flex;
    flex-wrap: nowrap;
}

.site-footer-newsletter-input {
    flex: 1 1 180px;
    min-width: 0;
}

.site-footer-newsletter-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.site-footer-contact-item {
    display: flex;
    gap: 0.75rem;
    word-break: break-word;
}

.site-footer-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

/* ── 13. PHONE INPUT — don't shrink country code ───────────── */
.country-code-wrap {
    flex-shrink: 0;
    min-width: 58px;
}

/* ── 14. STATS — tiny phone safety ─────────────────────────── */
@media (max-width: 380px) {
    .cv-stat-number {
        font-size: 1.6rem;
    }

    .cv-stat-label {
        font-size: 0.7rem;
    }
}

/* ── 15. BACK-TO-TOP ────────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
}

/* ── 16. PLAN CARDS on tiny phones ─────────────────────────── */
@media (max-width: 480px) {
    .cv-plan-card {
        padding: 1.75rem 1.25rem;
    }
}