/* Breakpoints for the shared shell (header/nav/footer/dashboard) ONLY —
   every selector here must be one whose base (non-media-query) rule lives
   in style.css. style.css loads before this file, so an override here
   correctly wins at the breakpoint; a selector whose base rule lives in
   magazine.css or any other page-specific sheet would NOT be safe to
   override here, because those sheets load AFTER this one (as
   $extraStylesheets, added last in includes/header.php) — a later,
   unconditional rule beats an earlier media-query rule of equal
   specificity regardless of which one the viewport currently matches.
   (This bit the article page and the homepage top-story/news grids once
   already — see the @media blocks at the bottom of magazine.css, where
   their responsive overrides now correctly live instead.) */

@media (max-width: 960px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  .sidebar-toggle { display: inline-flex; }
  .portal-header__label { display: none; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    background: var(--color-white);
    border-radius: 0;
    box-shadow: 2px 0 18px rgba(16,42,67,0.18);
    z-index: 250;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .dashboard-sidebar.is-open { transform: translateX(0); }
  .dashboard-sidebar__close { display: block; }
  .dashboard-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16,42,67,0.45);
    z-index: 240;
  }
  .dashboard-sidebar-backdrop.is-open { display: block; }

  .header-bar { flex-wrap: wrap; }
  .brand__logo { height: 28px; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 17px; height: 17px; }
  .account-menu__avatar { width: 26px; height: 26px; font-size: 0.7rem; }
  .header-tools { gap: 0.1rem; }
  .nav-toggle { padding: 0.4rem; }

  .main-nav {
    order: 10;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255,255,255,0.15);
  }
  .main-nav.is-open { display: flex; }
  .main-nav > a, .main-nav .has-dropdown > a {
    padding: 0.75rem 0.25rem; border-bottom: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.85);
  }
  .main-nav > a.is-active { border-bottom-color: var(--color-orange); }
  .has-dropdown { display: block; }
  .has-dropdown > a { justify-content: space-between; }
  .has-dropdown__arrow { display: inline-block; width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.2s ease; }
  .has-dropdown.is-open .has-dropdown__arrow { transform: rotate(180deg); }
  .has-dropdown .dropdown {
    display: none; position: static; box-shadow: none; padding: 0 0 0 1rem;
    background: transparent; border: none;
  }
  .has-dropdown.is-open .dropdown {
    display: block;
  }
  .has-dropdown .dropdown li a { padding: 0.6rem 0; color: rgba(255,255,255,0.7); }
  .dropdown__divider { display: none; }

  .main-nav__mobile-extra { display: flex; flex-direction: column; padding-top: 0.25rem; }
  .main-nav__mobile-extra a { padding: 0.75rem 0.25rem; border-bottom: 1px solid rgba(255,255,255,0.15); font-weight: 600; font-size: 0.88rem; color: rgba(255,255,255,0.85); }

  .hide-on-mobile { display: none; }
}

@media (max-width: 600px) {
  .portal-header__alert-chip, .portal-header__wallet-chip { padding: 0.3rem 0.5rem; font-size: 0.75rem; }
  .header-bar { gap: 0.75rem; }
  .brand__logo { height: 22px; }
  .icon-btn { width: 30px; height: 30px; }
  .icon-btn svg { width: 15px; height: 15px; }
  .account-menu__avatar { width: 24px; height: 24px; font-size: 0.65rem; }

  .site-footer__grid { grid-template-columns: 1fr; }
  .newsletter-form__row { flex-direction: column; }
  .ad-slot__card { padding: 1rem 1.1rem 1.25rem; }
  .ad-slot__headline { font-size: 1.15rem; }
  .ad-slot__card--with-image .ad-slot__body { flex-direction: column; align-items: flex-start; }
  .ad-slot__card--with-image .ad-slot__image { width: 100%; height: auto; aspect-ratio: 16 / 9; }

  .site-footer__bottom-inner { flex-direction: column; text-align: center; gap: 0.4rem; }
}
