/* APRENDE v4.44 · tablet/laptop/desktop diagnostic polish
   Mobile <=820px intentionally untouched/frozen. */

@media (min-width:821px){
  /* Global readable width and rhythm */
  .portal-wrap,.id-wrap{width:min(calc(100% - 56px),1240px);margin-inline:auto}
  .id-page-top,.portal-page-hero{padding-block:42px!important}
  .id-page-top h1,.portal-page-hero h1,.gt-hero h1,.sb-hero h1,.apr-priority-hero h2{
    text-wrap:balance;
  }
  .id-page-top p,.portal-page-hero p,.gt-lead,.sb-lead,.apr-priority-hero p{
    text-wrap:pretty;
  }
  .id-section,.portal-section{padding-block:46px}
  .id-article{max-width:900px;margin-top:28px}
  .id-article p,.id-article li{line-height:1.68}
  .portal-card,.id-card,.apr-stage,.guide-card,.gt-mini,.sb-choice,.sb-facts article{min-width:0}
  .portal-card strong,.id-card strong,.guide-card strong,.gt-step-title strong,.sb-choice strong{
    overflow-wrap:anywhere;
  }

  /* Protected guided tutorials */
  .gt-wrap{width:min(1180px,calc(100% - 64px))}
  .gt-hero{padding:42px 0 38px}
  .gt-hero-grid{grid-template-columns:minmax(0,1.12fr) minmax(300px,.88fr);gap:32px}
  .gt-hero h1{font-size:clamp(2.55rem,4vw,3.75rem);max-width:780px}
  .gt-lead{max-width:760px}
  .gt-route-card{align-self:stretch;display:flex;flex-direction:column;justify-content:center}
  .gt-section{padding:46px 0}
  .gt-step summary{min-height:78px}
  .gt-step-body{line-height:1.62}
  .apr-selfhelp{width:min(980px,calc(100% - 64px));margin-block:30px 48px}

  /* Learning hub / protected library */
  .apr-priority-wrap{max-width:1240px;padding-inline:30px}
  .apr-priority-hero{padding:30px 0 22px}
  .apr-bonus-panel{padding:26px}
  .apr-task-card{min-height:178px}
  .apr-start-panel{padding:24px}

  /* SiteBuilder / technical walkthrough */
  .sb-wrap{width:min(1180px,calc(100% - 64px))}
  .sb-hero{padding:42px 0 38px}
  .sb-hero h1{font-size:clamp(2.55rem,4.2vw,3.9rem)}
  .sb-section{padding:50px 0}
  .sb-choice,.sb-support-grid a,.sb-next-grid a,.sb-facts article{padding:20px}

  /* Public guides and protected content cards */
  .guide-grid{gap:16px}
  .guide-access-strip{gap:22px}
  .guide-pager{gap:14px}
  .portal-grid,.portal-tech-grid,.portal-paths{gap:16px}
  .portal-path-card{min-width:0}

  /* English tends to run longer; give headings/card labels graceful wrapping. */
  html[lang="en"] .id-page-top h1,
  html[lang="en"] .portal-page-hero h1,
  html[lang="en"] .gt-hero h1,
  html[lang="en"] .sb-hero h1,
  html[lang="en"] .apr-welcome h1{
    letter-spacing:-.035em;
    overflow-wrap:normal;
  }
  html[lang="en"] .gt-step-title strong,
  html[lang="en"] .apr-task-card strong,
  html[lang="en"] .sb-choice strong,
  html[lang="en"] .portal-path-card strong{
    line-height:1.28;
  }
}

/* Tablet / small laptop: remove cramped 3–6-column layouts. */
@media (min-width:821px) and (max-width:1050px){
  .portal-wrap,.id-wrap{width:min(calc(100% - 48px),980px)}
  .id-page-top,.portal-page-hero{padding-block:36px!important}
  .id-section,.portal-section{padding-block:40px}

  .gt-wrap,.sb-wrap{width:min(calc(100% - 48px),960px)}
  .gt-hero-grid,.sb-hero-grid{grid-template-columns:1fr;gap:22px}
  .gt-route-card,.sb-hero-card{max-width:760px}
  .gt-prep{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .gt-compare{grid-template-columns:repeat(2,minmax(0,1fr))}
  .gt-final{grid-template-columns:repeat(2,minmax(0,1fr))}
  .apr-selfhelp-list{grid-template-columns:repeat(2,minmax(0,1fr))}

  .apr-bonus-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .apr-start-flow{grid-template-columns:repeat(2,minmax(0,1fr))}
  .apr-start-card.recommended{grid-column:1/-1}
  .apr-secondary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}

  .sb-fast-route{grid-template-columns:repeat(3,minmax(0,1fr))}
  .sb-choice-grid,.sb-next-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sb-choice-grid .sb-choice:last-child,.sb-next-grid a:last-child{grid-column:1/-1}
  .sb-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sb-facts article:last-child{grid-column:1/-1}

  .guide-journey-links{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;overflow:visible}
  .guide-journey-links a{min-width:0}
  .guide-flow{grid-template-columns:repeat(2,minmax(0,1fr))}
  .guide-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .portal-grid,.portal-tech-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .portal-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}

  html[lang="en"] .gt-hero h1,html[lang="en"] .sb-hero h1{font-size:clamp(2.35rem,5.3vw,3.25rem)}
}

/* Laptop / standard desktop */
@media (min-width:1051px) and (max-width:1439px){
  .gt-wrap,.sb-wrap{width:min(1120px,calc(100% - 64px))}
  .gt-hero-grid{grid-template-columns:minmax(0,1.16fr) minmax(310px,.84fr)}
  .sb-hero-grid{grid-template-columns:minmax(0,1.18fr) minmax(320px,.82fr)}
  .gt-prep{gap:14px}
  .apr-priority-wrap{max-width:1180px}
  .apr-bonus-grid{gap:12px}
  .guide-journey-links{gap:8px}
}

/* Large desktop: use the space, but keep line lengths controlled. */
@media (min-width:1440px){
  .portal-wrap,.id-wrap{max-width:1320px}
  .gt-wrap,.sb-wrap{max-width:1220px}
  .id-article{max-width:940px}
  .gt-lead,.sb-lead{max-width:790px}
  .apr-priority-wrap{max-width:1280px}
  .apr-selfhelp{max-width:1020px}
}
