/* =================================================================
   PTEClasses — Responsive
   ================================================================= */

@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid {
    grid-template-columns: minmax(250px, 1.15fr) minmax(150px, .7fr) minmax(165px, .8fr);
    gap: 42px;
  }
  .footer-newsletter { grid-column: 1 / -1; }
  .footer-newsletter > p { max-width: 640px; margin-bottom: 24px; }
  .newsletter-control { max-width: 620px; }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }

  .nav-wrap { width: 100%; gap: 10px; justify-content: flex-start; }
  .site-brand { margin-right: auto; min-width: 0; }
  .site-brand img,
  .site-brand .custom-logo { max-width: 138px; max-height: 36px; }
  .nav-actions { margin-left: auto; gap: 4px; flex: 0 0 auto; }
  .nav-search-toggle { order: 1; width: 42px; height: 42px; align-items: center; justify-content: center; }

  /* Nav → mobile drawer. The header stays above the backdrop so the drawer is never dimmed or blocked. */
  .nav-toggle {
    display: flex;
    order: 2;
    margin: 0 0 0 2px;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1020;
  }
  .primary-nav {
    position: fixed;
    top: var(--pte-mobile-nav-top, var(--header-h));
    right: 0;
    bottom: 0;
    width: min(88vw, 380px);
    height: calc(100vh - var(--pte-mobile-nav-top, var(--header-h)));
    background: #fff;
    box-shadow: -18px 20px 50px rgba(15,27,61,.2);
    padding: 18px 16px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translate3d(105%, 0, 0);
    visibility: hidden;
    pointer-events: none;
    transition: transform .3s var(--ease), visibility 0s linear .3s;
    margin-left: 0;
    z-index: 1010;
  }
  @supports (height: 100dvh) {
    .primary-nav { height: calc(100dvh - var(--pte-mobile-nav-top, var(--header-h))); }
  }
  .nav-open .primary-nav {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .primary-nav > ul { flex-direction: column; align-items: stretch; gap: 3px; width: 100%; }
  .primary-nav li { width: 100%; }
  .primary-nav a {
    color: var(--c-ink);
    justify-content: flex-start;
    width: 100%;
    min-height: 46px;
    padding: 12px;
    position: relative;
    z-index: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(36,86,230,.12);
  }
  .primary-nav > ul > li > a:hover,
  .primary-nav > ul > li > a:focus,
  .primary-nav .current-menu-item > a,
  .primary-nav .current_page_item > a { background: var(--c-primary-050); color: var(--c-primary); }
  .primary-nav .menu-item-has-children { position: relative; }
  .primary-nav .menu-item-has-children > a { padding-right: 56px; }
  .primary-nav .menu-item-has-children > a::after { display: none; }
  .primary-nav .submenu-toggle {
    display: inline-flex;
    position: absolute;
    top: 3px;
    right: 2px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: var(--c-ink);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(36,86,230,.12);
  }
  .primary-nav .submenu-toggle:hover,
  .primary-nav .submenu-toggle:focus-visible { background: var(--c-primary-050); color: var(--c-primary); }
  .primary-nav .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--c-primary-100);
    border-radius: 0;
    padding: 0 0 0 12px;
    margin: 0 0 5px 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s var(--ease);
  }
  .primary-nav .sub-menu.open,
  .primary-nav .submenu-open > .sub-menu { max-height: 900px; }
  .primary-nav .sub-menu a { min-height: 42px; padding: 10px 12px; }
  .nav-backdrop {
    position: fixed;
    top: var(--pte-mobile-nav-top, var(--header-h));
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(8,14,34,.5);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s var(--ease), visibility 0s linear .25s;
  }
  body.nav-open { overflow: hidden; }
  .nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  /* Hero + splits stack */
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-inline: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
  .hero-visual { max-width: 420px; margin: 0 auto; }
  .split, .split--rev .split-media,
  .about-grid, .module-hero-grid, .contact-grid, .blog-layout { grid-template-columns: 1fr; }
  .split--rev .split-media { order: 0; }
  .split-media { max-width: 480px; margin: 0 auto; }

  .cards-3, .pricing-grid, .testi-grid, .intro-3, .related-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .posts-grid { grid-template-columns: 1fr; }

  .task-card { grid-template-columns: 1fr; }
  .task-card:nth-child(even) .task-media { order: 0; }
  .task-media { max-width: 100%; }

  .footer-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px 56px; }
  .footer-newsletter { grid-column: auto; }
  .newsletter-control { max-width: none; }
  .footer-bottom { text-align: center; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .form-row { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-main { padding-top: 46px; }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-logo { margin-bottom: 26px; }
  .footer-address { line-height: 1.8; }
  .footer-heading { margin-bottom: 16px; }
  .footer-links { gap: 14px; }
  .footer-newsletter > p { margin-bottom: 22px; }
  .footer-bottom { margin-top: 48px; padding: 25px 0 20px; }
  .phone-mock { width: 130px; }
  .phone-mock:nth-child(2) { transform: translateY(-14px); }
  .inline-cta { flex-direction: column; text-align: center; align-items: stretch; }
  .sticky-cta .inner { gap: 12px; }
  .sticky-cta .msg span { display: none; }
  .store-badge img, .store-badge svg { height: 44px; }
  .pricing-grid { gap: 30px; }
  .price-card.is-featured { transform: none; }
  .section { padding-block: 44px; }
}

@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
  .newsletter-control { grid-template-columns: 1fr; gap: 10px; }
  .newsletter-control input {
    height: 52px;
    border-right: 1px solid rgba(255,255,255,.26);
    border-radius: 5px;
  }
  .newsletter-control button { width: 100%; height: 52px; border-radius: 5px; }
  .newsletter-status { min-height: 0; }
  .footer-social a { width: 46px; height: 46px; }
}

@media (max-width: 420px) {
  .site-brand img,
  .site-brand .custom-logo { max-width: 122px; max-height: 32px; }
  .hero-stats { gap: 18px; }
  .sticky-cta .btn--sm { padding: 9px 12px; }
}


@media (max-width: 700px) {
  /* Convert wide module comparison tables into readable mobile cards. */
  .overview-table-wrap { overflow: visible; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  table.overview-table { display: block; min-width: 0; }
  table.overview-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  table.overview-table tbody, table.overview-table tr, table.overview-table td { display: block; width: 100%; }
  table.overview-table tbody tr { margin-bottom: 16px; background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
  table.overview-table tbody tr + tr { border-top: 1px solid var(--c-line); }
  table.overview-table th, table.overview-table td { padding: 11px 14px; font-size: .88rem; }
  table.overview-table td { display: grid; grid-template-columns: minmax(112px, 40%) minmax(0, 1fr); gap: 12px; border-bottom: 1px solid var(--c-line-soft); }
  table.overview-table td:last-child { border-bottom: 0; }
  table.overview-table td::before { content: attr(data-label); font-family: var(--font-head); font-weight: 600; color: var(--c-ink); }
  table.overview-table tbody tr:hover { background: #fff; }

  .task-card { padding: 22px; }
  .task-card--text .task-blocks { grid-template-columns: 1fr; gap: 12px; }
  .faq-item summary { padding: 17px 18px; align-items: flex-start; }
  .faq-answer { padding: 0 18px 18px; }
  .module-hero .module-intro p { font-size: .96rem; }
  .task-card--text h2 { font-size: 1.35rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Print */
@media print {
  .site-header, .site-footer, .sticky-cta, .to-top, .pte-modal, .inline-cta { display: none !important; }
}

/* =================================================================
   v1.10.0 — Mobile App Store Badge Alignment
   Keep the homepage hero download buttons centred at every mobile width.
   ================================================================= */
@media (max-width: 900px) {
  .hero-copy { width: 100%; min-width: 0; }
  .hero-copy > .store-badges {
    width: 100%;
    margin-inline: auto;
    justify-content: center;
    align-items: center;
  }
  .hero-copy > .store-badges .store-badge {
    flex: 0 0 auto;
  }
}

@media (max-width: 360px) {
  .hero-copy > .store-badges { gap: 8px; }
  .hero-copy > .store-badges .store-badge img,
  .hero-copy > .store-badges .store-badge svg { height: 39px; }
}

/* Imported article tables remain usable on smaller screens. */
@media (max-width: 767px) {
  .entry-content { overflow-wrap: anywhere; }
  .entry-content table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .entry-content th,
  .entry-content td { min-width: 145px; }
}

/* =================================================================
   v1.14.0 — Editorial Blog Responsive Rules
   ================================================================= */
@media (max-width: 760px) {
  .article-hero { padding-block: 30px 42px; }
  .article-hero .crumbs { margin-bottom: 24px; white-space: normal; }
  .article-hero__content h1 { font-size: clamp(1.8rem, 8vw, 2.55rem); }
  .article-hero__content .entry-meta { gap: 10px 14px; }
  .article-content-card { padding: 25px 20px; border-radius: 18px; }
  .entry-content { line-height: 1.75; }
  .entry-content h2 { margin-top: 2.35em; }
  .entry-content ul,
  .entry-content ol { padding: 1em 1em 1em 2.35em; }
  .article-faq { margin-inline: -4px; padding: 20px 14px; border-radius: 18px; }
  .article-faq__question { padding: 16px; font-size: .94rem; }
  .article-faq__answer { padding: 0 16px 17px; }
  .article-toc__summary { padding: 16px; }
  .entry-content .article-toc__list { padding: 0 16px 16px; }
  .entry-content .article-toc__item--h3 { padding-left: 10px; }
  .author-card { align-items: flex-start; padding: 21px; }
  .author-card__avatar { flex-basis: 58px; width: 58px; height: 58px; }
}

@media (max-width: 480px) {
  .single-article { padding-top: 30px; }
  .article-content-card { padding: 22px 16px; }
  .entry-content .article-lead { font-size: 1.06rem; }
  .entry-content h2 { font-size: 1.45rem; }
  .entry-content h3 { font-size: 1.2rem; }
  .entry-content blockquote { padding: 20px 18px; }
  .article-faq { margin-inline: 0; padding: 18px 12px; }
  .article-faq__question { gap: 12px; padding: 15px 14px; }
  .article-faq__toggle { flex-basis: 28px; width: 28px; height: 28px; }
  .article-faq__answer { padding: 0 14px 15px; }
  .article-tags { align-items: flex-start; }
  .article-tags__label { width: 100%; }
  .author-card { flex-direction: column; gap: 14px; }
  .article-content-card .share-row { align-items: flex-start; flex-wrap: wrap; }
}

@media print {
  .article-toc,
  .article-tags,
  .author-card,
  .share-row { display: none !important; }
  .article-content-card { padding: 0; border: 0; box-shadow: none; }
  .article-faq__item { break-inside: avoid; }
  .article-faq__item .article-faq__answer { display: block !important; }
}

/* =================================================================
   v1.15.0 — Core Page Responsive Rules
   ================================================================= */
@media (max-width: 1024px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .legal-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-module-grid,
  .benefit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-layout-enhanced,
  .mock-register-layout { grid-template-columns: 1fr; }
  .mock-register-copy { position: static; }
}

@media (max-width: 900px) {
  .app-steps-layout,
  .about-story-grid,
  .mock-hero .hero-inner { grid-template-columns: 1fr; }
  .app-steps-layout { text-align: left; }
  .app-page-phones { max-width: 460px; margin-inline: auto; }
  .mock-hero-card { max-width: 620px; margin-inline: auto; text-align: left; }
  .contact-layout-enhanced { max-width: 760px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-legal-links { justify-content: center; }
}

@media (max-width: 700px) {
  .legal-document { padding: 24px 19px; border-radius: 18px; }
  .legal-summary { padding: 18px; }
  .legal-toc ol { grid-template-columns: 1fr; }
  .mock-location-grid { grid-template-columns: 1fr; }
  .mock-location-card dl > div { grid-template-columns: 105px minmax(0, 1fr); }
  .contact-answer-card { flex-direction: column; }
}

@media (max-width: 560px) {
  .legal-summary { flex-direction: column; }
  .legal-block ul,
  .legal-block ol { padding: 15px 15px 15px 33px; }
  .about-module-grid,
  .benefit-grid { grid-template-columns: 1fr; }
  .process-list li { grid-template-columns: 38px minmax(0, 1fr); padding: 15px; }
  .process-list li > span { width: 38px; height: 38px; }
  .contact-details-panel,
  .contact-form--enhanced,
  .mock-registration-form { padding: 23px 18px; }
  .contact-answer-card > .ico { flex-basis: 54px; width: 54px; height: 54px; }
  .mock-location-card { padding: 23px 19px; }
  .mock-location-card dl > div { grid-template-columns: 1fr; gap: 4px; }
  .location-card-head { align-items: flex-start; }
  .footer-legal-links { flex-direction: column; align-items: center; gap: 10px; }
}

@media print {
  .legal-toc,
  .legal-review-note,
  .mock-registration-form,
  .contact-form--enhanced { display: none !important; }
  .legal-layout,
  .contact-layout-enhanced,
  .mock-register-layout { display: block; }
  .legal-document { padding: 0; border: 0; box-shadow: none; }
}

/* Writing module responsive refinements — v1.17.0 */
@media (max-width: 767px) {
  .task-card--text .task-lead { padding: 14px 15px; margin-bottom: 15px; }
  .task-card--text .tc-block { padding: 15px; }
  .task-card--text .tc-block ul { padding-left: 18px; }
  .module-importance-card { padding: 24px 20px; border-radius: var(--r-lg); }
}


/* Reading module responsive refinements — v1.18.0 */
@media (max-width: 900px) {
  .module-guidance-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .module-guidance-grid { gap: 16px; }
  .module-guidance-card { padding: 23px 19px; border-radius: var(--r-lg); }
  .module-guidance-card h2 { font-size: 1.38rem; }
}
