/* 
 * All-on-4 Super Pillar CSS
 * Namespace: a4-
 * Palette: Titanium Blue (#1e3a8a), Medical Gold (#f59e0b), Light Gray (#f8fafc)
 */

/* -------------------------------------------------------------------------- */
/* Base & Typography
/* -------------------------------------------------------------------------- */
.a4-wrapper {
    font-family: 'Inter', sans-serif;
    color: #334155;
    line-height: 1.6;
    background: #f8fafc;
}

.a4-wrapper h1, .a4-wrapper h2, .a4-wrapper h3, .a4-wrapper h4 {
    color: #1e3a8a;
    font-weight: 700;
    line-height: 1.3;
}

/* -------------------------------------------------------------------------- */
/* Layout Grid (Container + Sidebar)
/* -------------------------------------------------------------------------- */
.a4-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box; /* Ensure padding does not expand beyond viewport */
}


.a4-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}


.a4-main-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 40px;
    min-width: 0;
}

.a4-sidebar {
    position: sticky;
    top: 100px; /* Account for sticky header */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 992px) {
    .a4-layout {
        grid-template-columns: 1fr;
    }
    .a4-sidebar {
        position: static;
        order: 2;
    }
    .a4-main-content {
        order: 1;
        padding: 24px;
    }
}

/* Tablet-to-mobile gap (768px) — missing in original */
@media (max-width: 768px) {
    .a4-main-content {
        padding: 20px;
    }
    .a4-section h2 {
        font-size: 1.6rem;
    }
    .a4-section h3 {
        font-size: 1.25rem;
    }
}


/* -------------------------------------------------------------------------- */
/* Hero Section
/* -------------------------------------------------------------------------- */
.a4-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    border-radius: 0 0 24px 24px;
    margin-bottom: -40px; /* Overlap effect */
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent any child overflow from bleeding */
}


.a4-hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 20px;
}

.a4-hero .a4-hero-price {
    font-size: 1.5rem;
    color: #fbbf24;
    font-weight: 700;
    margin-bottom: 30px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 24px;
    border-radius: 999px;
}

.a4-hero-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* -------------------------------------------------------------------------- */
/* Buttons
/* -------------------------------------------------------------------------- */
.a4-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    gap: 8px;
    box-sizing: border-box;
    max-width: 100%;
}

.a4-btn-primary {
    background: #25D366; /* WhatsApp Green */
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.a4-btn-primary:hover {
    background: #128C7E;
    transform: translateY(-2px);
    color: white;
}

.a4-btn-secondary {
    background: #f59e0b; /* Medical Gold */
    color: white;
}

.a4-btn-secondary:hover {
    background: #d97706;
    color: white;
}

.a4-btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.a4-btn-outline:hover {
    background: white;
    color: #1e3a8a;
}

/* -------------------------------------------------------------------------- */
/* General Content Sections
/* -------------------------------------------------------------------------- */
.a4-section {
    margin-bottom: 60px;
}

.a4-section:last-child {
    margin-bottom: 0;
}

.a4-section h2 {
    font-size: 2rem;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.a4-section h3 {
    font-size: 1.5rem;
    margin-top: 32px;
    margin-bottom: 16px;
}

.a4-img-responsive {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* -------------------------------------------------------------------------- */
/* Comparison & Pricing Tables
/* -------------------------------------------------------------------------- */
.a4-table-wrapper {
    overflow-x: auto;
    margin: 32px 0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    width: 100%;
}

.a4-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.a4-table th, .a4-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.a4-table th {
    background: #1e3a8a;
    color: white;
    font-weight: 600;
}

.a4-table tr:last-child td {
    border-bottom: none;
}

.a4-table tbody tr:hover {
    background-color: #f8fafc;
}

/* -------------------------------------------------------------------------- */
/* AIO Quick Answer Boxes
/* -------------------------------------------------------------------------- */
.a4-aio-box {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 20px;
    border-radius: 0 8px 8px 0;
    margin: 24px 0;
}

.a4-aio-box h4 {
    color: #166534;
    margin-top: 0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* -------------------------------------------------------------------------- */
/* Callout/Warning Boxes
/* -------------------------------------------------------------------------- */
.a4-callout-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    padding: 20px;
    border-radius: 4px;
    margin: 24px 0;
}

.a4-callout-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    padding: 20px;
    border-radius: 4px;
    margin: 24px 0;
}

/* -------------------------------------------------------------------------- */
/* Timeline (2-Trip Protocol)
/* -------------------------------------------------------------------------- */
.a4-timeline {
    position: relative;
    padding-left: 32px;
    margin: 32px 0;
}

.a4-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #cbd5e1;
}

.a4-timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.a4-timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1e3a8a;
    border: 4px solid white;
    box-shadow: 0 0 0 2px #1e3a8a;
}

.a4-timeline-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 8px;
}

/* -------------------------------------------------------------------------- */
/* Candidacy Checker (JS Widget)
/* -------------------------------------------------------------------------- */
.a4-candidacy-widget {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    margin: 40px 0;
    text-align: center;
}

.a4-candidacy-question {
    display: none;
}

.a4-candidacy-question.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.a4-candidacy-options {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

.a4-candidacy-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.a4-candidacy-btn:hover {
    border-color: #1e3a8a;
    color: #1e3a8a;
}

.a4-candidacy-result {
    display: none;
    margin-top: 24px;
    padding: 24px;
    border-radius: 8px;
}

.a4-candidacy-result.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.a4-candidacy-result.good {
    background: #dcfce7;
    border: 1px solid #86efac;
}

.a4-candidacy-result.maybe {
    background: #fffbeb;
    border: 1px solid #fde047;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------- */
/* FAQ Accordion
/* -------------------------------------------------------------------------- */
.a4-faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.a4-faq-question {
    padding: 16px 20px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.a4-faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: #1e3a8a;
    transition: transform 0.3s;
}

.a4-faq-item.active .a4-faq-question::after {
    transform: rotate(45deg);
}

.a4-faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #f8fafc;
}

.a4-faq-item.active .a4-faq-answer {
    padding: 16px 20px;
    max-height: 500px;
}

/* -------------------------------------------------------------------------- */
/* Sidebar Cards
/* -------------------------------------------------------------------------- */
.a4-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.a4-card-whatsapp {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    color: white;
}

.a4-card-whatsapp h3 {
    color: white;
    margin-top: 0;
}

.a4-card-price {
    background: #1e3a8a;
    color: white;
}

.a4-card-price h3 {
    color: white;
    margin-top: 0;
}

.a4-price-highlight {
    font-size: 2rem;
    font-weight: 700;
    color: #fbbf24;
    margin: 16px 0;
}

.a4-author-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.a4-author-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

/* Responsive utilities */
.a4-hide-desktop { display: none; }
@media (max-width: 992px) {
    .a4-hide-mobile { display: none; }
    .a4-hide-desktop { display: block; }
}

/* -------------------------------------------------------------------------- */
/* Responsive Layout Alignment & Utility Classes
/* -------------------------------------------------------------------------- */

/* Responsive Grid System replacing inline styles */
.a4-toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px 20px;
    font-size: 0.9rem;
}


.a4-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
}
.a4-gap-xs {
    gap: 8px;
}

@media (max-width: 768px) {
    .a4-grid-2col {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Doctor Profile Section */
.a4-doctor-profile {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.a4-doctor-profile img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .a4-doctor-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .a4-doctor-profile img {
        margin-bottom: 16px;
    }
    .a4-doctor-profile ul {
        text-align: left;
        display: inline-block;
    }
}

/* Hero Trust Strip */
.a4-hero-trust-strip {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 36px;
    font-size: 0.9rem;
    color: #cbd5e1;
}

@media (max-width: 600px) {
    .a4-hero-trust-strip {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        font-size: 0.85rem;
    }
}

/* Hero & Final CTA Button Stacking */
@media (max-width: 600px) {
    .a4-hero-ctas,
    .a4-final-cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .a4-hero-ctas .a4-btn,
    .a4-final-cta-buttons .a4-btn {
        width: 100%;
    }
}

/* Candidacy Checker Buttons Wrap */
@media (max-width: 768px) {
    .a4-candidacy-options {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .a4-candidacy-btn {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
    .a4-candidacy-widget {
        padding: 20px 16px;
        margin: 24px 0;
    }
}

/* Table Horizontal Scroll Enforcement */
@media (max-width: 768px) {
    .a4-table {
        min-width: 650px;
    }
}

/* Layout Padding Adjustment on Small Mobile Screens */
@media (max-width: 480px) {
    .a4-main-content {
        padding: 16px;
    }
    .a4-container {
        padding: 0 16px; /* Wider content area on very small phones */
    }
    .a4-hero {
        padding: 50px 0 60px; /* Reduce hero height on small phones */
    }
    .a4-hero h1 {
        font-size: 1.75rem; /* clamp already handles this but force fallback */
    }
    .a4-section h2 {
        font-size: 1.4rem;
    }
    .a4-timeline {
        padding-left: 24px;
    }
    .a4-timeline-item::before {
        left: -24px;
        width: 20px;
        height: 20px;
    }
}


/* Final CTA block */
.a4-final-cta-block {
    background: linear-gradient(135deg, #1e3a8a, #172554);
    color: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-top: 40px;
}
.a4-final-cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .a4-final-cta-block {
        padding: 24px 16px;
    }
}

