﻿/* ==========================================================================
   MBBSinDhaka.in — Responsive overrides
   Mobile-first content is authored in style.css / components.css at desktop
   defaults; this file steps the layout down. Breakpoints:
   1100 · 992 · 768 · 560 · 400
   ========================================================================== */

/* --------------------------------------------------------------------------
   ≤ 1100px — navigation collapses to off-canvas drawer
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; order: 3; }

  /* `backdrop-filter` on an ancestor makes it the containing block for
     position:fixed descendants — which would trap the drawer inside the
     header's own 72px box. The header is 94% opaque anyway, so on mobile it
     simply goes solid. */
  .site-header {
    backdrop-filter: none;
    background: #fff;
  }
  /* Keep the logo and the close button above the drawer panel. */
  .brand,
  .nav-actions { position: relative; z-index: 215; }

  .nav-list {
    position: fixed;
    top: var(--header-h);   /* navbar.js measures the real value on open */
    right: 0;
    bottom: 0;
    left: auto;
    width: min(360px, 86vw);
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 16px 120px;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: -12px 0 40px rgba(8, 46, 80, 0.16);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    /* Under the header (210) but over the scrim (195) and the page. */
    z-index: 205;
  }
  .nav-list.open { transform: translateX(0); }

  /* Items slide in behind the panel for a bit of depth. */
  .nav-list > li {
    opacity: 0;
    transform: translateX(14px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  }
  .nav-list.open > li { opacity: 1; transform: none; }
  .nav-list.open > li:nth-child(1) { transition-delay: 0.06s; }
  .nav-list.open > li:nth-child(2) { transition-delay: 0.09s; }
  .nav-list.open > li:nth-child(3) { transition-delay: 0.12s; }
  .nav-list.open > li:nth-child(4) { transition-delay: 0.15s; }
  .nav-list.open > li:nth-child(5) { transition-delay: 0.18s; }
  .nav-list.open > li:nth-child(6) { transition-delay: 0.21s; }
  .nav-list.open > li:nth-child(7) { transition-delay: 0.24s; }
  .nav-list.open > li:nth-child(n + 8) { transition-delay: 0.27s; }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 13px 14px;
    font-size: 0.98rem;
    border-radius: var(--r-sm);
  }
  .nav-list > li + li { border-top: 1px solid var(--line-soft); }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0 0 8px 12px;
    min-width: 0;
    display: none;
    background: transparent;
  }
  .nav-item.open > .nav-dropdown { display: block; }
  .nav-dropdown a { padding: 10px 12px; font-size: 0.9rem; }
  .nav-dropdown .dd-head { padding-top: 12px; }

  .nav-scrim {
    position: fixed;
    inset: 0;
    background: rgba(6, 28, 48, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s var(--ease), visibility 0.28s;
    /* Below the drawer (205) and the header (210), above the page. */
    z-index: 195;
  }
  .nav-scrim.open { opacity: 1; visibility: visible; }

  .nav-actions .btn-cta-desktop { display: none; }
  body.nav-open { overflow: hidden; }

  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; row-gap: var(--sp-6); }
}

/* --------------------------------------------------------------------------
   ≤ 992px
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  :root { --sp-9: 68px; --sp-8: 52px; }

  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .hero-visual { max-width: 560px; margin-inline: auto; width: 100%; }
  .hero-card.a { left: 8px; bottom: 12px; }
  .hero-sub { max-width: none; }

  .article-layout { grid-template-columns: 1fr; gap: var(--sp-6); }
  .article-body { max-width: none; }
  .toc { position: static; }
  .toc-wrap { order: -1; }

  .feature-split { grid-template-columns: 1fr; gap: var(--sp-6); }
  .feature-split.reverse .fs-visual { order: 0; }

  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .value-row { grid-template-columns: repeat(2, 1fr); }
  .filter-row { grid-template-columns: 1fr 1fr; }
  .timeline-2col { grid-template-columns: 1fr; }

  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
}

/* --------------------------------------------------------------------------
   ≤ 768px — phones / small tablets
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --sp-9: 56px;
    --sp-8: 44px;
    --sp-7: 34px;
  }

  body { font-size: 16px; padding-bottom: 66px; } /* room for the sticky bar */

  .mobile-bar { display: block; }
  .wa-float { display: none; }

  .announce { font-size: 0.76rem; }
  .announce .container { gap: 8px; }
  .hide-sm { display: none !important; }

  .hero { padding: var(--sp-6) 0 var(--sp-7); }
  .hero-trust li { font-size: 0.77rem; padding: 6px 11px; }
  .hero-card { display: none; }
  .btn-group .btn { flex: 1 1 100%; }

  .grid-2, .grid-3, .grid-4, .compare-grid, .split-panel, .promise-grid,
  .form-grid, .cc-specs, .filter-row {
    grid-template-columns: 1fr;
  }
  .value-row { grid-template-columns: 1fr; padding: var(--sp-4); gap: var(--sp-2); }
  .value-item { display: flex; align-items: flex-start; gap: 14px; text-align: left; padding: 12px 4px; }
  .value-item .ico { margin: 0; flex: none; }

  .col-6, .col-4, .col-3, .col-8 { flex: 0 0 100%; max-width: 100%; }

  .section-head { margin-bottom: var(--sp-6); }
  .page-head { padding: var(--sp-5) 0 var(--sp-6); }

  .card { padding: var(--sp-4); }
  .card-lg, .form-card { padding: var(--sp-5); }
  .cta-band { padding: var(--sp-6) var(--sp-5); border-radius: var(--r-lg); }

  .timeline::before { left: 19px; }
  .timeline > li { padding-left: 56px; }
  .timeline .step-dot { width: 40px; height: 40px; border-radius: 12px; }

  .faq-q { padding: 15px var(--sp-4); font-size: 0.94rem; }
  .faq-a { padding: 0 var(--sp-4) 17px; }

  .scroll-hint { display: block; }
  table.data { font-size: 0.85rem; }
  table.data th, table.data td { padding: 11px 13px; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }

  .article-meta { gap: var(--sp-3); font-size: 0.8rem; }
  .anchor-strip { position: static; }
}

/* --------------------------------------------------------------------------
   ≤ 560px
   -------------------------------------------------------------------------- */
@media (max-width: 560px) {
  .container { padding-inline: 16px; }

  .brand-logo { height: 37px; }
  .footer-about .brand-logo { height: 42px; }

  .btn { padding: 13px 20px; }
  .btn-lg { padding: 15px 22px; font-size: 0.97rem; }

  .promise { padding: var(--sp-5) var(--sp-4); }
  .college-card .cc-foot { flex-direction: column; }
  .chip { font-size: 0.77rem; padding: 6px 12px; }

  .link-grid { grid-template-columns: 1fr; }
  .grid-auto, .grid-auto-sm, .grid-auto-lg { grid-template-columns: 1fr; }

  .post-card .pc-body { padding: var(--sp-4); }
  .team-card { padding: var(--sp-4); }
}

/* --------------------------------------------------------------------------
   ≤ 400px — very small phones
   -------------------------------------------------------------------------- */
@media (max-width: 400px) {
  body { font-size: 15.5px; }
  .mobile-bar a { font-size: 0.7rem; }
  .hero-trust li { font-size: 0.74rem; }
}

/* --------------------------------------------------------------------------
   Large screens
   -------------------------------------------------------------------------- */
@media (min-width: 1400px) {
  :root { --wrap: 1220px; }
}
