/* Public-site phone and tablet refinements. Desktop styles remain in heritage.css. */
@media screen and (max-width: 1050px) {
  @supports (overflow: clip) and selector(html:has(body.menu-open)) {
    /* Clip decoration without creating a body scroll container that breaks sticky headers. */
    html, body { overflow-x: clip; }
    body.menu-open { overflow: clip; }
    html:has(body.menu-open) { overflow-y: hidden; }
  }
  .topbar { display: none; }
  .header-main { min-height: 88px; gap: 20px; }
  .nav-row { flex-shrink: 0; }
  .menu-toggle { min-width: 68px; min-height: 44px; border-radius: 3px; }
  .main-nav {
    inset: var(--cpa-header-bottom, 88px) 0 0;
    max-height: calc(100dvh - var(--cpa-header-bottom, 88px));
    padding: 12px 24px calc(24px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .main-nav a { min-height: 48px; white-space: normal; line-height: 1.4; padding: 15px 0; }
  .main-nav .sub-menu { margin-bottom: 8px; padding: 4px 12px; border-radius: 3px; }
  .main-nav .sub-menu a { min-height: 44px; padding: 12px 8px; }
  .main-nav .sub-menu .sub-menu { margin-left: 8px; }
  .submenu-toggle { width: 48px; height: 48px; top: 3px; }
  .main-nav .mobile-portal-link { margin-top: 20px; }

  /* A shared grid reserves space for the longest slide without layering visible text. */
  .hero-slider { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; background: #fbf8f2; }
  .hero-slider .hero-slide {
    position: relative;
    inset: auto;
    grid-area: 1 / 1;
    min-width: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: none;
    background-position: 65% center;
  }
  .hero-slider .hero-slide.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
  .hero-slide .hero-layout { width: min(100% - 48px, 760px); padding: 56px 0 36px; }
  .hero-slide .hero-inner { max-width: 650px; }
  .hero-slider .hero-slide h1, .hero-slider .hero-slide h2 { font-size: clamp(2.15rem, 5.5vw, 3.4rem); line-height: 1.2; }
  .hero-slide p:not(.eyebrow) { line-height: 1.7; }
  .hero-slider .slider-controls {
    position: relative;
    inset: auto;
    grid-area: 2 / 1;
    width: min(100% - 48px, 760px);
    min-width: 0;
    gap: 12px;
    padding: 16px 0;
    margin: 0 auto;
  }
  .slider-arrow { width: 44px; height: 44px; flex: 0 0 44px; }
  .slider-dots { flex: 1; min-width: 0; justify-content: center; gap: 4px; }
  .slider-dots button, .slider-dots button.is-active {
    width: 30px; height: 44px; min-height: 44px; flex: 0 1 30px; background: transparent; transition: none;
  }
  .slider-dots button::before { inset: 19px 5px; background: #a8b2b6; border-radius: 3px; }
  .slider-dots button.is-active::before { background: #875e24; }
  .slider-pause { min-width: 58px; padding: 0 10px; border-radius: 3px; }

  .breadcrumb .wrap { flex-wrap: wrap; gap: 6px 10px; }
  .breadcrumb a { overflow-wrap: anywhere; }
  :is(.about-nav-links, .membership-nav-links, .academic-nav-links) { max-width: 100%; }
  :is(.about-nav-links, .membership-nav-links, .academic-nav-links) a { min-height: 44px; display: inline-flex; align-items: center; }
  .protected-library-card .button { white-space: normal; text-align: center; }
  :is(.welcome-grid, .portal-grid, .syllabus-layout, .entry-layout, .policy-layout, .information-grid,
      .resource-application, .resource-hub-hero-grid, .support-hero-grid, .contact-main-grid,
      .level-layout, .membership-story-grid, .about-story-grid) > * { min-width: 0; }
  .information-table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
  .policy-sidebar, .faq-topic-nav { top: 104px; }
  section[id], header[id], details[id], .policy-content h2 { scroll-margin-top: 104px; }
}

/* WordPress keeps the signed-in toolbar fixed above 600px. */
@media screen and (min-width: 783px) and (max-width: 1050px) {
  body.admin-bar .site-header { top: 32px; }
}
@media screen and (min-width: 601px) and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}

@media screen and (max-width: 720px) {
  .wrap { width: calc(100% - 40px); }
  .header-main { min-height: 80px; gap: 12px; }
  .brand-lockup { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; width: min(240px, calc(100vw - 120px)); min-width: 0; }
  .brand-seal { width: 48px; height: 48px; }
  .brand-name strong { font-size: 1.38rem; }
  .brand-name b { font-size: .52rem; }
  .brand-title { font-size: .39rem; line-height: 1.5; }
  .main-nav { --cpa-header-bottom: 80px; padding-inline: 20px; }
  .hero-slide .hero-layout { width: calc(100% - 40px); padding: 40px 0 28px; }
  .hero-slider .hero-slide h1, .hero-slider .hero-slide h2 { font-size: clamp(2rem, 8.3vw, 2.8rem); margin-bottom: 20px; }
  .hero-slider .hero-slide .eyebrow { font-size: .69rem; letter-spacing: .13em; margin-bottom: 16px; }
  .hero-slide p:not(.eyebrow) { font-size: 1rem; margin-bottom: 0; }
  .hero-slide .hero-actions { gap: 12px; margin-top: 24px; }
  .hero-actions .button { min-height: 48px; padding: 12px 16px; text-align: center; }
  .hero-slider .slider-controls { width: calc(100% - 40px); gap: 8px; padding-block: 12px 16px; }
  .slider-dots { gap: 0; }
  .slider-dots button, .slider-dots button.is-active { flex-basis: 26px; width: 26px; }
  .quick-nav a { min-width: 0; min-height: 64px; padding: 16px 12px; justify-content: center; }
  .quick-nav strong { font-size: .91rem; line-height: 1.4; }

  .section, .support-page .section { padding-block: 48px; }
  .section-head { gap: 16px; margin-bottom: 28px; }
  .section-head .lead, .lead { font-size: 1.05rem; line-height: 1.75; }
  .inner-page .page-hero h1, .about-hub .about-hero h1, .about-detail-page .about-detail-hero h1,
  .membership-hub .membership-hero h1, .membership-detail-page .membership-detail-hero h1,
  .academic-page .academic-hero h1, .support-hero h1, .resource-hub-hero h1, .information-hero h1 {
    font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.25; overflow-wrap: normal;
  }
  .inner-page .page-hero, .about-hub .about-hero, .membership-hub .membership-hero,
  .about-detail-page .about-detail-hero, .membership-detail-page .membership-detail-hero,
  .academic-page .academic-hero { min-height: 0; padding-block: 44px; }
  .about-hero-layout, .membership-hero-layout { min-height: 0; }
  .level-card { min-height: 0; padding: 24px; }
  .level-card > a { padding-top: 12px; }
  .level-top { margin-bottom: 24px; flex-wrap: wrap; }
  .principles-card, .academic-panels article { padding: 24px; }
  .home-resource-teaser { gap: 28px; }
  .home-resource-paths { grid-template-columns: minmax(0, 1fr); }
  .home-resource-paths a { padding: 20px; }
  .resource-choice-grid { grid-template-columns: minmax(0, 1fr); }
  .resource-hub-nav, .support-nav { gap: 4px 18px; padding-block: 12px; }
  .resource-hub-nav a, .support-nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .resource-portal-actions, .resource-portal-actions .button { width: 100%; }
  .resource-portal-actions .button { text-align: center; }
  .information-card, .contact-email-card, .news-event-details { padding: 24px; }
  .newspaper-grid { grid-template-columns: minmax(0, 1fr); }
  .newspaper-masthead h1 { font-size: clamp(2.2rem, 9vw, 3rem); line-height: 1.15; }
  .newspaper-tabs { gap: 4px 20px; }
  .newspaper-tabs a { min-height: 44px; display: inline-flex; align-items: center; }
  .news-search input, .news-search select { font-size: 16px; }
  .fees-page .information-table { min-width: 360px; }
  .policy-content h2 { font-size: 1.45rem; }
  .information-actions .button, .contact-faq-card .button { width: 100%; text-align: center; }
  .cta-inner { gap: 20px; padding-block: 36px; }
  .cta .button { width: 100%; text-align: center; }
  .site-footer .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .site-footer .footer-intro, .site-footer .footer-grid > div:last-child { grid-column: 1 / -1; }
  .site-footer .footer-intro { display: block; }
  .site-footer li a { display: inline-flex; align-items: center; min-height: 44px; line-height: 1.4; }
  .site-footer ul { gap: 0; }
  .site-footer address a { padding-block: 8px; overflow-wrap: anywhere; }
  .footer-bottom { gap: 12px; align-items: flex-start; }
  .footer-bottom nav a { padding-block: 8px; }
}
