/**
 * Anand Financial Services (AFS)
 * Comprehensive Responsive CSS & Mobile Navigation Styles
 * Ensures pixel-perfect alignment, zero horizontal overflow, and pristine visual hierarchy across all devices.
 */

/* ==========================================================================
   1. Mobile Drawer Navigation Styles
   ========================================================================== */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 1050;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(85vw, 380px);
  height: 100%;
  background-color: var(--color-white);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-normal);
  overflow-y: auto;
  padding: 1.75rem 1.5rem;
}

.mobile-drawer.active {
  right: 0;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.mobile-drawer-logo {
  height: 40px;
  width: auto;
}

.mobile-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-charcoal);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-charcoal);
  text-decoration: none;
}

.mobile-nav-link.active {
  color: var(--color-emerald);
}

.mobile-submenu-toggle {
  background: none;
  border: none;
  color: var(--color-slate);
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-submenu {
  list-style: none;
  padding: 0.5rem 0 0.75rem 1rem;
  margin: 0;
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  border-left: 2px solid var(--color-pale-green);
}

.mobile-submenu.open {
  display: flex;
}

.mobile-sub-link {
  font-size: 0.92rem;
  color: var(--color-slate);
  text-decoration: none;
  display: block;
  padding: 0.35rem 0;
}

.mobile-sub-link:hover,
.mobile-sub-link.active {
  color: var(--color-emerald);
}

.mobile-drawer-footer {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ==========================================================================
   2. Large Desktops / Laptops (max-width: 1280px)
   ========================================================================== */
@media (max-width: 1280px) {
  .hero-headline {
    font-size: clamp(3.2rem, 5vw, 4.6rem);
  }
  .hero-grid {
    grid-template-columns: 1.12fr 0.98fr;
    gap: 2.25rem;
  }
}

/* ==========================================================================
   3. Medium Desktops / Laptops (max-width: 1199px)
   ========================================================================== */
@media (max-width: 1199px) {
  .trust-band-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
  }
  .trust-band-col {
    padding: 0.5rem 1rem;
  }
  .trust-band-col:first-child {
    padding-left: 0;
  }
  .trust-band-col:last-child {
    padding-right: 0;
  }
  .trust-val {
    font-size: clamp(1.2rem, 1.55vw, 1.45rem);
    white-space: nowrap;
  }
  .trust-label {
    font-size: 0.76rem;
    margin-top: 5px;
  }
  .trust-hover-line {
    left: 1rem;
  }
  .trust-band-col:first-child .trust-hover-line {
    left: 0;
  }

  .global-footprint-grid {
    grid-template-columns: 40% 60%;
    gap: 2.5rem;
  }
}

/* ==========================================================================
   4. Laptop / Medium Desktops (max-width: 1100px)
   ========================================================================== */
@media (max-width: 1100px) {
  .hero-headline {
    font-size: clamp(2.85rem, 4.8vw, 3.85rem);
  }

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

  .philosophy-editorial-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .solution-flagship-card {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 2.5rem;
  }

  .supporting-solutions-grid,
  .solutions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .editorial-timeline-wrapper,
  .journey-timeline {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-top: 0;
  }
  .editorial-timeline-wrapper::before {
    display: none;
  }
  .timeline-step-indicator::before {
    display: none;
  }

  .why-editorial-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .audience-editorial-row {
    grid-template-columns: 0.8fr 1.2fr;
    gap: 2rem;
  }

  .insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-top-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

/* ==========================================================================
   5. Tablets (max-width: 900px)
   ========================================================================== */
@media (max-width: 900px) {
  :root {
    --header-height: 72px;
  }

  .nav-desktop,
  .btn-header-wa {
    display: none !important;
  }

  .mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .hero-section {
    min-height: auto;
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 3.5rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.75rem;
  }

  .hero-visual-wrapper {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
  }

  .hero-editorial-card {
    left: 10px;
    bottom: -15px;
  }

  .trust-band-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 0;
  }

  .trust-band-col {
    padding: 0.75rem 1.75rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  .trust-band-col:nth-child(1),
  .trust-band-col:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.75rem;
  }

  .trust-band-col:nth-child(2n) {
    border-right: none;
    padding-right: 0;
  }

  .trust-band-col:nth-child(2n+1) {
    padding-left: 0;
  }

  .trust-val {
    font-size: clamp(1.35rem, 2.6vw, 1.75rem);
    white-space: nowrap;
  }

  .trust-label {
    font-size: 0.8rem;
    margin-top: 6px;
  }

  .trust-hover-line {
    left: 1.75rem;
  }

  .trust-band-col:nth-child(2n+1) .trust-hover-line {
    left: 0;
  }

  .philosophy-section-editorial {
    padding: 5rem 0;
  }

  .founder-split {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .founder-frame {
    max-width: 380px;
    margin: 0 auto;
  }

  .audience-editorial-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.75rem 0;
  }

  .editorial-timeline-wrapper,
  .journey-timeline {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    position: relative;
    padding-left: 1.75rem;
    border-left: 2px solid var(--color-pale-green);
  }

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

  .calc-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Global Footprint Mobile Hierarchy */
  .global-footprint-section {
    padding: 5rem 0;
  }
  .global-footprint-grid {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
  }
  .global-footprint-col-text {
    display: contents;
  }
  .global-footprint-header {
    order: 1;
  }
  .global-stats-group {
    order: 2;
    margin-bottom: 0;
    padding-bottom: 1.5rem;
  }
  .global-footprint-visual {
    order: 3;
    margin: 0.5rem 0;
    width: 100%;
  }
  .global-stat-supporting {
    order: 4;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.25rem;
    width: 100%;
  }
}

/* ==========================================================================
   6. Small Tablets & Large Phones (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Universal Responsive Grid Collapse */
  .grid-2,
  .grid-3,
  .grid-4,
  .solutions-grid,
  .supporting-solutions-grid,
  .insights-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .grid {
    gap: 1.5rem !important;
  }

  .grid-gap-lg,
  .grid-gap-md,
  .grid-gap-sm {
    gap: 1.5rem !important;
  }

  /* Section Spacings */
  .section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .section-sm {
    padding-top: 2.75rem;
    padding-bottom: 2.75rem;
  }

  .section-hero {
    padding-top: calc(var(--header-height) + 1.5rem);
    padding-bottom: 3.25rem;
  }

  .section-header {
    margin-bottom: 2.25rem;
  }

  /* Typography Scale */
  h1, .h1-display {
    font-size: clamp(2rem, 6.5vw, 2.75rem);
    line-height: 1.15;
  }

  h2, .h2-display, .section-title {
    font-size: clamp(1.55rem, 5.2vw, 2rem);
    line-height: 1.22;
  }

  .statement-display,
  .philosophy-display-title {
    font-size: clamp(1.75rem, 5.5vw, 2.35rem);
    line-height: 1.18;
  }

  h3, .h3-display {
    font-size: clamp(1.2rem, 3.8vw, 1.45rem);
  }

  p.lead {
    font-size: 1.08rem;
    line-height: 1.65;
  }

  .global-footprint-section {
    padding: 4.5rem 0;
  }
  .global-footprint-title {
    font-size: clamp(1.9rem, 5.5vw, 2.4rem);
    margin-bottom: 1.15rem;
  }
  .global-footprint-lead {
    font-size: 0.98rem;
    line-height: 1.65;
    margin-bottom: 1.75rem;
  }
  .global-stat-num {
    font-size: clamp(2.35rem, 6vw, 3rem);
  }
  .world-map-wrapper {
    padding: 1rem 0.5rem;
  }
}

/* ==========================================================================
   7. Mobile Devices (max-width: 640px)
   ========================================================================== */
@media (max-width: 640px) {
  body {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }

  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .section-hero {
    padding-top: calc(var(--header-height) + 1.25rem);
    padding-bottom: 3rem;
  }

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

  /* Buttons & Action Groups */
  .hero-cta-group,
  .btn-group,
  .cta-banner-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.75rem;
  }

  .hero-cta-group .btn,
  .hero-cta-group .btn-hero-primary,
  .btn-group .btn,
  .cta-banner-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 0.9rem 1.5rem;
  }

  .hero-cta-group .btn-hero-secondary {
    justify-content: center;
    padding: 0.65rem 0;
  }

  /* Hero Visual & Cards */
  .hero-visual-editorial {
    max-width: 100%;
  }

  .hero-editorial-backdrop {
    top: -8px;
    right: -8px;
    bottom: 8px;
    left: 8px;
  }

  .hero-editorial-card {
    position: absolute;
    left: 8px;
    bottom: -15px;
    padding: 0.85rem 1.15rem;
    max-width: calc(100% - 16px);
  }

  .editorial-card-value {
    font-size: 1.05rem;
  }

  .editorial-card-label {
    font-size: 0.72rem;
  }

  /* Trust Credibility Band */
  .trust-band-integrated {
    padding: 2.25rem 0;
  }

  .trust-band-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 0.5rem;
  }

  .trust-band-col {
    padding: 0.5rem 0.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  .trust-band-col:nth-child(1),
  .trust-band-col:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.25rem;
  }

  .trust-band-col:nth-child(2n) {
    border-right: none;
    padding-right: 0;
  }

  .trust-band-col:nth-child(2n+1) {
    padding-left: 0;
  }

  .trust-val {
    font-size: clamp(0.95rem, 3.4vw, 1.25rem);
    line-height: 1.15;
    white-space: nowrap;
  }

  .trust-label {
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    margin-top: 4px;
  }

  /* Philosophy Section */
  .philosophy-section-editorial {
    padding: 4rem 0;
  }

  .philosophy-marker {
    margin-bottom: 1rem;
    font-size: 0.74rem;
  }

  .philosophy-lead-p {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 0.85rem;
  }

  .philosophy-body-p {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .philosophy-caption {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    flex-wrap: wrap;
  }

  /* Founder Spotlight Card */
  .founder-frame {
    max-width: 320px;
    margin: 0 auto;
  }

  .founder-badge-card {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 1.25rem;
    width: 100%;
    max-width: 100%;
    box-shadow: var(--shadow-card);
  }

  .founder-pillars {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Solution Flagship & Cards */
  .solution-flagship-card {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
  }

  .flagship-title {
    font-size: clamp(1.2rem, 5vw, 1.38rem);
    line-height: 1.25;
  }

  .flagship-desc {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
  }

  .flagship-right {
    padding: 1.25rem;
  }

  .flagship-pillars-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .solution-card,
  .supporting-card,
  .why-card {
    padding: 1.5rem 1.25rem;
  }

  .solution-card-desc,
  .supporting-card-desc,
  .why-desc {
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
  }

  /* Timeline & Methodology */
  .editorial-timeline-wrapper,
  .journey-timeline {
    padding-left: 1.25rem;
    gap: 1.5rem;
  }

  .timeline-step-num,
  .step-num {
    font-size: 2.2rem;
  }

  .timeline-step-title,
  .step-title {
    font-size: 1.2rem;
  }

  .timeline-step-desc,
  .step-desc {
    font-size: 0.86rem;
    line-height: 1.5;
  }

  /* Form & Interactive Box */
  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-card {
    padding: 1.75rem 1.25rem;
  }

  .contact-info-card {
    padding: 1.75rem 1.25rem;
  }

  .calculator-box {
    padding: 1.75rem 1.25rem;
  }

  .calc-summary-card {
    padding: 1.75rem 1.25rem;
  }

  /* CTA Banner */
  .cta-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .cta-banner-title {
    font-size: 1.75rem;
  }

  .cta-banner-desc {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  /* Footer */
  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .footer-legal-links {
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }

  /* WhatsApp Widget */
  .floating-wa-btn {
    bottom: 18px;
    right: 18px;
    width: 48px;
    height: 48px;
  }

  .floating-wa-btn svg {
    width: 24px;
    height: 24px;
  }
}

/* ==========================================================================
   8. Small Mobile Screens (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
  html, body {
    overflow-x: hidden;
  }

  .container {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  h1, .h1-display {
    font-size: clamp(1.85rem, 7vw, 2.35rem);
  }

  h2, .h2-display, .section-title {
    font-size: clamp(1.4rem, 5.5vw, 1.75rem);
  }

  .statement-display,
  .philosophy-display-title {
    font-size: clamp(1.6rem, 5.8vw, 2.1rem);
  }

  .cta-banner-title {
    font-size: 1.6rem;
  }

  .breadcrumb-list {
    font-size: 0.78rem;
    gap: 0.35rem;
  }

  .btn-lg {
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
  }

  .map-container {
    height: 200px;
  }

  .global-footprint-section {
    padding: 3.5rem 0;
  }
  .global-stats-group {
    gap: 1.25rem;
  }
  .global-stat-num {
    font-size: clamp(2.1rem, 7.5vw, 2.6rem);
  }
  .supporting-stat-num {
    font-size: 1.75rem;
  }
  .world-map-wrapper {
    padding: 0.75rem 0.25rem;
  }
  .map-origin-label {
    display: none;
  }
}

/* ==========================================================================
   9. Ultra Compact Mobile (max-width: 390px, 375px, 360px)
   ========================================================================== */
@media (max-width: 390px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-headline {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .hero-editorial-card {
    position: relative;
    left: auto;
    bottom: auto;
    margin-top: 1rem;
    max-width: 100%;
  }

  .trust-band-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    text-align: center;
  }

  .trust-band-col {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 0.75rem 0 !important;
  }

  .trust-band-col:last-child {
    border-bottom: none !important;
  }

  .trust-hover-line {
    display: none;
  }

  .calc-highlight-val {
    font-size: 1.65rem;
  }

  .floating-wa-btn {
    bottom: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
  }

  .floating-wa-btn svg {
    width: 22px;
    height: 22px;
  }
}
