/* ==========================================================================
   SANGRAM SEVABHAVI SANSTHA - RESPONSIVE STYLESHEET
   Comprehensive multi-device adaptivity with zero horizontal overflow.
   ========================================================================== */

/* --- Prevent any horizontal overflow on all screen sizes --- */
html,
body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* --- Tablet Breakpoint (Max-width: 1024px) --- */
@media (max-width: 1024px) {
  :root {
    --header-height: 76px;
  }

  .nav-menu {
    gap: 18px;
  }

  .nav-link {
    font-size: 0.875rem;
  }

  .hero-grid {
    gap: 40px;
  }

  .journey-grid,
  .journey-grid--3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .work-grid,
  .work-grid--5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .donation-layout,
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* --- Mobile / Tablet Transition Breakpoint (Max-width: 860px) --- */
@media (max-width: 860px) {
  .nav-menu {
    display: none;
  }

  .header-actions .btn-donate-header {
    display: none;
  }

  .navbar .brand-sub {
    display: none;
  }

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

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-media {
    order: -1;
    max-width: 520px;
    margin-inline: auto;
    width: 100%;
  }

  .hero-floating-card {
    position: relative;
    bottom: auto;
    left: auto;
    margin-top: -30px;
    margin-inline: auto;
    width: calc(100% - 30px);
    max-width: 320px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .intro-grid > * {
    width: 100%;
    max-width: 100%;
  }

  .editorial-image-frame {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .editorial-image-frame img,
  .split-feature-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .split-feature {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .split-feature-media {
    order: -1;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--radius-lg);
  }

  .form-row-2col {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* --- Standard Mobile (Max-width: 768px) --- */
@media (max-width: 768px) {
  :root {
    --section-padding: 50px;
    --section-padding-sm: 35px;
  }

  .container,
  .container--narrow,
  .container--wide {
    width: calc(100% - 32px);
    max-width: 100%;
    box-sizing: border-box;
  }

  .brand {
    gap: 8px;
  }

  .brand-title {
    font-size: 0.875rem;
    line-height: 1.18;
    max-width: 170px;
    font-weight: 700;
  }

  .brand-emblem img {
    width: 32px;
    height: 32px;
  }

  .header-actions {
    gap: 8px;
  }

  .lang-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  /* Home Hero on Mobile */
  .hero {
    padding-top: calc(var(--header-height) + 20px);
    padding-bottom: 40px;
    min-height: auto;
  }

  .hero-title {
    font-size: clamp(32px, 8vw, 46px);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .scroll-indicator {
    display: none;
  }

  /* Inner Page Hero on Mobile */
  .page-hero {
    padding-top: calc(var(--header-height) + 26px);
    padding-bottom: 40px;
  }

  .page-hero-title {
    font-size: clamp(28px, 7vw, 42px);
    line-height: 1.2;
    margin-bottom: 14px;
    word-break: break-word;
  }

  body.lang-mr .page-hero-title {
    font-size: clamp(26px, 6.5vw, 36px);
    line-height: 1.35;
  }

  .page-hero-content {
    width: 100%;
    max-width: 100%;
  }

  .page-hero-content .large-p {
    font-size: 1.05rem;
    line-height: 1.6;
  }

  /* Registration Table transforms to Card View on Mobile */
  .registration-wrapper {
    padding: 20px 16px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .registration-table,
  .registration-table tbody,
  .registration-table tr,
  .registration-table th,
  .registration-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .registration-table tr {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--surface);
  }

  .registration-table th {
    background-color: var(--secondary);
    padding: 10px 14px;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border);
    color: var(--accent-dark);
    width: 100%;
  }

  .registration-table td {
    padding: 12px 14px;
    font-size: 0.9375rem;
    border-bottom: none;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .registration-table code {
    word-break: break-all;
    overflow-wrap: anywhere;
    font-size: 0.92rem !important;
    display: inline-block;
    max-width: 100%;
  }

  .mission-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px 16px;
  }

  .mission-item-num {
    font-size: 1.35rem;
  }

  .work-grid,
  .work-grid--5,
  .team-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .journey-grid,
  .journey-grid--3 {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .journey-card {
    padding: 22px 18px;
  }

  /* Donation / Support Page on Mobile */
  .donation-layout {
    grid-template-columns: 1fr !important;
    gap: 28px;
    width: 100%;
  }

  .donation-card,
  .contact-form-wrapper,
  .editorial-quote-box {
    padding: 24px 18px;
    width: 100%;
    box-sizing: border-box;
  }

  .donation-card h2 {
    font-size: clamp(1.4rem, 5vw, 1.85rem) !important;
    line-height: 1.25;
  }

  .donation-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .donation-field-label {
    font-size: 0.8rem;
  }

  .donation-field-value {
    font-size: 0.95rem;
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  .donation-btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
  }

  .donation-btn-group .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
    padding: 12px 16px;
  }

  .qr-box {
    padding: 16px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .qr-box .qr-image {
    width: min(200px, 60vw);
    height: min(200px, 60vw);
    margin-inline: auto;
  }

  .qr-box .qr-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .qr-box [data-i18n="support.upiValue"] {
    word-break: break-all;
    overflow-wrap: anywhere;
    font-size: clamp(0.95rem, 3.8vw, 1.15rem);
    display: block;
    max-width: 100%;
  }

  .tax-benefit-banner {
    padding: 14px 16px;
    margin-top: 20px;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .tax-benefit-banner p {
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
  }

  /* Contact Cards on Mobile */
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .contact-card {
    padding: 20px 16px;
    gap: 14px;
  }

  .contact-card-icon {
    width: 42px;
    height: 42px;
  }

  .contact-card-icon img,
  .contact-icon-img {
    width: 24px;
    height: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .final-cta-actions {
    flex-direction: column;
    width: 100%;
  }

  .final-cta-actions .btn {
    width: 100%;
  }

  .modal-container {
    padding: 24px 18px;
    width: calc(100% - 32px);
    max-width: 480px;
  }

  .modal-tabs {
    flex-direction: column;
  }

  /* Interactive Map Card (Tablet & Mobile) */
  .map-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 22px 18px;
  }

  .map-card-action {
    width: 100%;
  }

  .map-directions-btn {
    width: 100%;
    justify-content: center;
  }

  .map-frame-wrapper {
    height: 350px;
  }

  .map-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
  }
}

/* --- Small Mobile Phones (Max-width: 480px) --- */
@media (max-width: 480px) {
  .container,
  .container--narrow,
  .container--wide {
    width: calc(100% - 24px);
    max-width: 100%;
  }

  .brand-title {
    font-size: 0.8rem;
    max-width: 145px;
  }

  .brand-emblem img {
    width: 28px;
    height: 28px;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .hero-location {
    font-size: 0.775rem;
  }

  .hero-title {
    font-size: 30px;
  }

  .hero-marathi-tagline {
    font-size: 1.05rem;
    padding-left: 10px;
  }

  .page-hero {
    padding-top: calc(var(--header-height) + 18px);
    padding-bottom: 32px;
  }

  .page-hero-title {
    font-size: clamp(24px, 8vw, 32px);
  }

  .section-title {
    font-size: 26px;
  }

  .btn {
    padding: 12px 18px;
    font-size: 0.875rem;
    white-space: normal;
  }

  .donation-card {
    padding: 20px 14px;
  }

  .registration-wrapper {
    padding: 16px 12px;
  }

  .qr-box .qr-image {
    width: 160px;
    height: 160px;
  }

  /* Interactive Map Card (Small Mobile) */
  .map-frame-wrapper {
    height: 300px;
  }

  .map-card-info {
    gap: 14px;
  }

  .map-pin-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    font-size: 1.2rem;
  }

  .map-address {
    font-size: 0.88rem;
  }

  .map-coords-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
  }
}
