/* ========================================
   AVIR ACADEMY - RESPONSIVE DESIGN
   ======================================== */

/* ========== LARGE DESKTOP (1440px+) ========== */
@media (min-width: 1440px) {
    .container {
        max-width: 1300px;
    }

    .container-wide {
        max-width: 1500px;
    }

    .hero-container {
        max-width: 1500px;
    }
}

/* ========== DESKTOP (1280px - 1439px) ========== */
@media (max-width: 1439px) {
    .hero-container {
        max-width: 1200px;
        gap: 3rem;
    }

    .beliefs-layout {
        gap: 3rem;
    }

    .promise-layout {
        gap: 3rem;
    }
}

/* ========== LAPTOP (1024px - 1279px) ========== */
@media (max-width: 1279px) {
    .nav-container {
        padding: 1rem 1.5rem;
    }

    .container,
    .container-wide,
    .section-container,
    .section-wide {
        padding: 0 1.5rem;
    }

    .hero-container {
        padding: 0 1.5rem;
        gap: 2.5rem;
    }

    .avir-section {
        padding: 5rem 0;
    }

    .beliefs-layout,
    .promise-layout,
    .why-matters-layout {
        gap: 2.5rem;
    }

    .who-grid {
        gap: 2rem;
    }

    .declaration-item {
        padding: 1.5rem 0;
    }
}

/* ========== TABLET (768px - 1023px) ========== */
@media (max-width: 1023px) {

    /* Navigation */
    .top-bar {
        display: none;
    }
    
    .mobile-only {
        display: inline-flex !important;
    }
    
    .header-actions .btn-consultation {
        display: none; /* Hide desktop CTA on mobile */
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(100%);
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 3rem;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
    }

    .header-nav.active {
        transform: translateX(0);
    }

    .nav-hamburger {
        display: flex;
        z-index: 1001;
    }

    .nav-hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .nav-link {
        font-size: 1.5rem;
        text-align: center;
    }

    /* Hero Section */
    .hero-container {
        display: flex;
        justify-content: center;
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
        padding-top: 2rem;
    }

    .hero-visual {
        order: -1;
    }

    .hero-image {
        max-width: 400px;
    }

    /* Layout Changes */
    .editorial-beliefs {
        padding: 4rem 0;
    }

    .editorial-header {
        margin-bottom: 3rem;
    }

    .editorial-card {
        padding: 3rem 2rem 2rem;
    }

    .quote-icon {
        font-size: 2rem;
        top: 1.5rem;
        left: 1.5rem;
    }

    .promise-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .promise-visual {
        order: -1;
        padding: 4rem 2rem;
    }

    .why-matters-layout {
        flex-direction: column;
        text-align: left;
        padding: 0 0.5rem;
        gap: 3rem;
    }

    .why-matters-content {
        padding: 1.5rem !important; /* Overrides the huge 2.5rem padding from desktop */
        max-width: 100%; /* Ensure it can take full width */
    }

    /* Marquee Adjustments */
    .who-item {
        width: 320px;
        padding: 2rem 1.5rem;
    }

    /* Sections */
    .avir-section {
        padding: 4rem 0;
    }

    .manifesto-statement,
    .final-statement {
        padding: 4rem 0;
    }

    .refuse-list {
        grid-template-columns: 1fr;
    }


}

/* ========== MOBILE LARGE (480px - 767px) ========== */
@media (max-width: 767px) {

    .container,
    .container-wide,
    .section-container,
    .section-wide {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 1rem;
    }

    .header-container {
        padding: 0.5rem 1.25rem;
    }

    .logo-link {
        height: 68px;
    }

    .header-logo-img {
        height: 100%;
        width: auto;
        transform: scale(1.75);
        transform-origin: left center;
    }

    .hero-container {
        padding: 0 1rem;
        gap: 2rem;
    }

    .avir-hero {
        padding-top: 0;
        padding-bottom: 0;
        min-height: 100vh;
    }

    .hero-content.glass-card {
        padding: 1.5rem 1.25rem;
        margin: 0 auto;
        width: 100%;
        max-width: 340px;
    }

    /* Typography Adjustments */
    .hero-title {
        font-size: clamp(1.75rem, 6vw, 2.25rem);
        margin-bottom: 0.75rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .hero-tagline {
        font-size: clamp(0.9rem, 3.5vw, 1rem);
        margin-bottom: 1.5rem;
    }

    .hero-cta-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .hero-cta-group .btn {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .editorial-header {
        margin-bottom: 2rem;
    }

    .editorial-card {
        padding: 2.5rem 1.5rem 1.5rem;
    }

    .slide-statement {
        font-size: 1rem;
    }

    .quote-icon {
        font-size: 1.5rem;
        top: 1rem;
        left: 1rem;
    }

    .editorial-controls {
        gap: 1rem;
        padding: 0.5rem 0.5rem 1.5rem;
    }

    .ed-nav-btn {
        width: 44px;
        height: 44px;
    }

    /* Sections */
    .avir-section {
        padding: 3rem 0;
    }

    .manifesto-statement,
    .final-statement {
        padding: 3rem 0;
    }

    /* Marquee Adjustments */
    .who-item {
        width: 280px;
        padding: 1.5rem 1.25rem;
    }

    /* Declarations Layout Reordering */
    .declarations-container {
        display: flex;
        flex-direction: column;
    }
    
    .carousel-header {
        display: contents; 
    }
    
    .declarations-title { 
        order: 1; 
        margin-bottom: 1rem; 
    }
    
    .scroll-hint { 
        order: 2; 
        justify-content: center; 
        margin-bottom: 1rem; 
        width: 100%; 
    }
    
    .declarations-list { 
        order: 3;
        padding: 0.5rem 0.5rem 2rem 0.5rem; /* Reduced horizontal padding to make card wider */
        gap: 0.5rem;
    }
    
    .carousel-controls { 
        order: 4; 
        justify-content: center; 
        margin-top: 0.5rem; 
        width: 100%; 
    }

    .declaration-item {
        padding: 2.5rem 2rem !important; /* Forced padding to prevent text from touching the edge */
        flex: 0 0 100%;
        min-width: unset !important;
        min-height: auto !important;
    }

    .declaration-number {
        font-size: 2.5rem !important;
    }

    .declaration-title {
        font-size: 1.15rem !important;
        padding-left: 0.5rem; /* Extra safety padding to keep it away from the orange line */
    }

    /* Promise Section */
    .promise-visual {
        padding: 3rem 1.5rem;
    }

    .promise-number {
        font-size: clamp(5rem, 15vw, 6rem); /* Reduced from 8rem */
    }

    .promise-content {
        padding: 0 1rem; /* Give text breathing room on sides */
    }

    .promise-content h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .promise-content .highlight {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .promise-content p {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Refuse Section */
    .refuse-text {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .refuse-item {
        padding: 1.5rem;
    }

    /* Images */
    .hero-image,
    .why-matters-image {
        max-width: 100%;
    }

    /* Footer */
    .footer-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-link {
        font-size: 0.95rem;
    }
}

/* ========== MOBILE MEDIUM (390px - 479px) ========== */
@media (max-width: 479px) {

    .container,
    .container-wide,
    .section-container,
    .section-wide {
        padding: 0 0.75rem;
    }

    .nav-container {
        padding: 0.75rem;
    }

    .hero-container {
        padding: 0 0.75rem;
        gap: 1.5rem;
    }

    /* Typography */
    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title,
    .beliefs-title,
    .who-section-title,
    .declarations-title,
    .refuse-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    /* Content Adjustments */
    .beliefs-content,
    .promise-content p,
    .why-matters-content p {
        font-size: 1rem;
    }

    .declaration-title {
        font-size: 1.125rem;
    }

    .refuse-item {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: left;
    }

    .refuse-marker {
        align-self: flex-start;
    }

    /* Spacing */
    .avir-section {
        padding: 2.5rem 0;
    }

    .manifesto-statement,
    .final-statement {
        padding: 2.5rem 0;
    }
}

/* ========== MOBILE SMALL (375px and below) ========== */
@media (max-width: 375px) {

    .container,
    .container-wide,
    .section-container,
    .section-wide {
        padding: 0 0.5rem;
    }

    .nav-container {
        padding: 0.5rem;
    }

    .hero-container {
        padding: 0 0.5rem;
        gap: 1rem;
    }

    .logo-link {
        height: 48px;
    }

    .header-logo-img {
        height: 100%;
        width: auto;
        transform: scale(1.3);
        transform-origin: left center;
    }

    /* Ultra-compact typography */
    .hero-title {
        font-size: clamp(1.5rem, 8vw, 2rem);
        margin-bottom: 0.5rem;
    }

    .hero-tagline {
        font-size: clamp(0.85rem, 4.5vw, 0.95rem);
        margin-bottom: 1.25rem;
    }

    .manifesto-quote {
        font-size: clamp(1.125rem, 7vw, 1.5rem);
    }

    /* Minimal spacing */
    .avir-section {
        padding: 2rem 0;
    }

    .manifesto-statement,
    .final-statement {
        padding: 2rem 0;
    }

    .who-item {
        padding: 1.25rem 0.75rem;
    }

    .declaration-item {
        padding: 1rem 0;
    }

    .promise-number {
        font-size: clamp(4rem, 25vw, 6rem);
    }
}

/* ========== LANDSCAPE MOBILE ========== */
@media (max-width: 767px) and (orientation: landscape) {
    .avir-hero {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 2rem;
    }

    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: center;
    }

    .hero-visual {
        order: 0;
    }

    .hero-image {
        max-width: 300px;
    }
}

/* ========== ACCESSIBILITY & HIGH CONTRAST ========== */
@media (prefers-contrast: high) {
    :root {
        --navy-dark: #000080;
        --navy-medium: #000066;
        --orange-accent: #ff4500;
        --text-primary: #000080;
        --text-secondary: #000066;
    }

    .nav-link::after,
    .beliefs-highlight::after {
        height: 4px;
    }

    .who-item,
    .refuse-item {
        border-width: 2px;
    }
}

/* ========== PRINT STYLES ========== */
@media print {

    .avir-navigation,
    .nav-hamburger,
    .avir-footer {
        display: none;
    }

    .avir-hero {
        padding-top: 0;
    }

    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }

    .hero-image,
    .why-matters-image {
        max-width: 300px;
        margin: 1rem auto;
        display: block;
    }
}

/* ========== ABOUT PAGE RESPONSIVE ========== */
@media (max-width: 992px) {
    .founder-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .founder-image-col {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .pillars-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Programs Page */
    .program-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .programs-grid {
        grid-template-columns: 1fr;
    }
    .senior-card.ibdp-card {
        grid-column: 1;
    }
    .ibdp-subprograms {
        grid-template-columns: 1fr;
    }
    .why-method-content {
        padding: 2rem;
    }
}

@media (max-width: 767px) {
    /* About & Programs Page Mobile Fixes */
    .about-intro-content {
        padding: 0 1.5rem;
        text-align: center !important; /* Restore center alignment for even gap */
    }
    .lead-text {
        font-size: 1.15rem !important;
        line-height: 1.6;
    }
    .founder-content {
        padding: 0 1.5rem;
        text-align: left;
    }
    .founder-content h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    .founder-content p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* Horizontal Scrolling Pillars Mobile Fix */
    .horizontal-track {
        gap: 1.5rem;
        padding: 0 1.5rem;
    }
    .pillar-card {
        width: calc(100vw - 60px); /* Full width safely avoiding sticky button */
        max-width: none;
        padding: 1.5rem; /* Reduced internal padding to shrink height */
    }
    .pillar-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 1.5rem;
    }
    .pillar-card h3 {
        font-size: 1.5rem;
    }
    
    /* Programs Page Cards Mobile Fix */
    .program-card,
    .senior-card,
    .why-method-content.glass-card {
        padding: 2rem 1.5rem; /* Even gap on left and right */
    }
    .program-card h2 {
        font-size: 1.75rem;
    }
    .senior-card-header h3 {
        font-size: 1.5rem;
    }
    .program-features li span {
        font-size: 0.95rem;
    }
    .program-body p, 
    .senior-card-body p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    .pillar-card p {
        font-size: 0.95rem;
    }
}

/* ========== CONTACT PAGE RESPONSIVE ========== */
@media (max-width: 1023px) {
    .contact-grid-layout {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .process-steps-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .faq-accordion-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-booking-card {
        padding: 2.5rem 2rem;
    }

    /* Our Method Page Tablet Styles */
    .foundation-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .foundation-pillars-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .calibration-boards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .loop-flow-diagram {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .loop-flow-arrow {
        transform: rotate(90deg);
        margin-left: 0.5rem;
    }

    /* Outcomes Page Tablet Styles */
    .outcomes-measure-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .expectations-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .curricula-card {
        padding: 3rem 2rem;
    }

    .outcomes-why-wrapper {
        padding: 3.5rem 2.5rem;
    }
}

@media (max-width: 767px) {
    .avir-contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .contact-booking-card {
        padding: 2rem 1.25rem;
        border-radius: 16px;
    }

    .session-type-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-success-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1.25rem;
    }

    .contact-detail-card {
        padding: 1.25rem 1.25rem;
    }

    /* Our Method Page Mobile Styles */
    .method-foundation-section {
        padding: 4.5rem 0 3.5rem;
    }

    .foundation-card {
        padding: 2rem 1.5rem;
    }

    .foundation-quote-banner {
        font-size: 1.1rem;
    }

    .foundation-anchor-pill {
        width: 100%;
        border-radius: 12px;
        padding: 0.85rem 1.2rem;
        font-size: 0.9rem;
    }

    .method-framework-section {
        padding: 4.5rem 0;
    }

    .framework-timeline {
        gap: 2rem;
    }

    .framework-timeline::before {
        left: 24px;
        top: 30px;
        bottom: 30px;
    }

    .step-card {
        gap: 1.25rem;
    }

    .step-indicator {
        width: 50px;
        height: 50px;
        border-width: 2px;
        box-shadow: 0 0 0 4px rgba(255, 112, 67, 0.15);
    }

    .step-num-label {
        display: none;
    }

    .step-num-val {
        font-size: 1.35rem;
    }

    .step-content-box {
        padding: 1.75rem 1.25rem;
        border-radius: 14px;
    }

    .step-card:hover .step-content-box {
        transform: none;
    }

    .step-content-box h3 {
        font-size: 1.35rem;
        line-height: 1.3;
    }

    .step-content-box p {
        font-size: 1.02rem;
        line-height: 1.65;
        margin-bottom: 1.25rem;
    }

    .step-pill-item {
        font-size: 0.8rem;
        padding: 0.35rem 0.75rem;
    }

    .method-calibration-section {
        padding: 4.5rem 0;
    }

    .calibration-card-wrapper {
        padding: 2.75rem 1.5rem;
        border-radius: 18px;
    }

    .calibration-body-text {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    .method-cta-card {
        padding: 3rem 1.25rem;
        border-radius: 16px;
    }

    .method-cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .method-cta-buttons .btn-consultation,
    .method-cta-buttons .btn-whatsapp-method {
        width: 100%;
        text-align: center;
    }

    /* Outcomes Page Mobile Styles */
    .outcomes-measure-section {
        padding: 4.5rem 0 3.5rem;
    }

    .measure-statement-card {
        padding: 2rem 1.5rem;
    }

    .measure-lead-quote {
        font-size: 1.1rem;
    }

    .outcomes-expectations-section {
        padding: 4.5rem 0;
    }

    .expectation-card {
        padding: 2rem 1.5rem;
        flex-direction: column;
        gap: 1.25rem;
    }

    .card-num-badge {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .expectation-card-content h3 {
        font-size: 1.3rem;
    }

    .expectation-card-content p {
        font-size: 1.02rem;
        line-height: 1.65;
    }

    .outcomes-curricula-section {
        padding: 4rem 0;
    }

    .curricula-card {
        padding: 2.5rem 1.5rem;
        border-radius: 16px;
    }

    .curricula-text {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    .outcomes-why-section {
        padding: 4.5rem 0;
    }

    .outcomes-why-wrapper {
        padding: 2.75rem 1.5rem;
        border-radius: 18px;
    }

    .outcomes-why-content p {
        font-size: 1.05rem;
        line-height: 1.7;
    }
}