/* ==========================================================================
   RESPONSIVE BREAKPOINTS — DESKTOP (1360x768), TABLET (<=1024px) & MOBILE (<=767px)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Compact Laptop & 1360x768 Screens (max-width: 1440px)
   -------------------------------------------------------------------------- */
@media (max-width: 1440px) {
  :root {
    --container-max: 1120px;
    --container-wide: 1200px;
    --header-height: 82px;
    --section-py: clamp(3.25rem, 5.5vw, 4.75rem);
  }

  .brand-logo-img {
    height: 62px;
    max-height: 64px;
    max-width: 200px;
  }

  .site-footer .brand-logo-img,
  .footer-brand-logo-img {
    height: 88px;
    max-height: 92px;
    max-width: 220px;
  }

  .hero-section {
    padding-top: calc(var(--header-height) + 12px);
    padding-bottom: 16px;
  }

  .apple-hero-stage {
    min-height: clamp(440px, calc(100vh - var(--header-height) - 26px), 700px);
    min-height: clamp(440px, calc(100svh - var(--header-height) - 26px), 700px);
    padding: clamp(32px, 5vh, 56px) clamp(26px, 4.2vw, 56px);
    margin-bottom: 0;
  }

  .hero-headline {
    font-size: clamp(2.05rem, 1.4rem + 2.2vw, 3.25rem);
    margin-bottom: 14px;
  }

  .hero-lead {
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .apple-services-bento {
    gap: 18px;
  }

  .apple-srv-bento-card {
    padding: clamp(24px, 2.6vw, 32px);
  }
}

/* --------------------------------------------------------------------------
   2. Tablet Landscape & Small Laptops (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --header-height: 76px;
  }

  .brand-logo-img,
  .mobile-brand-logo-img {
    height: 56px;
    max-height: 58px;
    max-width: 185px;
  }

  .site-footer .brand-logo-img,
  .footer-brand-logo-img {
    height: 80px;
    max-height: 84px;
    max-width: 200px;
  }

  .desktop-nav {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: inline-flex !important;
  }

  .hero-section {
    padding-top: calc(var(--header-height) + 12px);
    padding-bottom: 16px;
  }

  .apple-hero-stage {
    min-height: clamp(420px, calc(100vh - var(--header-height) - 28px), 640px);
    min-height: clamp(420px, calc(100svh - var(--header-height) - 28px), 640px);
    border-radius: 24px;
    padding: 40px 32px;
    margin-bottom: 0;
  }

  .apple-hero-scrim {
    background:
      linear-gradient(
        90deg,
        rgba(8, 9, 12, 0.94) 0%,
        rgba(8, 9, 12, 0.86) 38%,
        rgba(8, 9, 12, 0.56) 72%,
        rgba(8, 9, 12, 0.22) 100%
      ),
      linear-gradient(
        180deg,
        rgba(8, 9, 12, 0.24) 0%,
        rgba(8, 9, 12, 0.1) 45%,
        rgba(8, 9, 12, 0.56) 100%
      );
  }

  /* Apple Services Bento: Balanced 2x3 Grid on Tablet */
  .apple-services-bento,
  .apple-services-bento.is-filtered {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .apple-srv-bento-card,
  .apple-srv-bento-card--span-7,
  .apple-srv-bento-card--span-5,
  .apple-srv-bento-card--span-4,
  .apple-srv-bento-card--span-12 {
    grid-column: span 1 !important;
  }

  .apple-services-bento:not(.is-filtered) .apple-srv-bento-card--split,
  .apple-services-bento:not(.is-filtered) .apple-srv-bento-card--span-12.apple-srv-bento-card--split {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  .apple-services-bento:not(.is-filtered) .apple-srv-bento-card--split .apple-srv-card-media {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .apple-spec-ribbon {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .apple-spec-ribbon-item:nth-child(2) {
    border-right: none;
    padding-right: 0;
  }

  /* Apple Packages Chapter Dock on Tablet & Smaller */
  .apple-pkg-dock-track {
    display: flex;
    flex-wrap: nowrap;
  }

  .apple-pkg-chapter-tab {
    flex: 0 0 auto;
    min-inline-size: 168px;
  }

  /* Bento 3-Column, Blog 12-Grid & Services Catalog -> 2 Columns on Tablet */
  .bento-three-grid,
  .services-catalog-grid,
  .packages-grid,
  .blog-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Process 4-Column -> 2x2 on Tablet */
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Subpage & Detail Split Layouts */
  .detail-hero-grid,
  .service-detail-layout,
  .package-detail-layout,
  .about-story-grid,
  .contact-layout-grid,
  .rfp-wizard-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .detail-breadcrumb-left,
  .detail-pills-left,
  .detail-actions-left {
    justify-content: center;
  }

  .detail-hero-grid > div:first-child {
    text-align: center;
  }

  .detail-lead-left {
    margin-left: auto;
    margin-right: auto;
  }

  .service-sidebar-card,
  .package-sticky-sidebar,
  .rfp-summary-card {
    position: static;
  }

  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

/* --------------------------------------------------------------------------
   3. Mobile Phones & Tablet Portrait (max-width: 767px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  :root {
    --header-height: 70px;
    --section-py: 3.25rem;
    --section-py-sm: 2.25rem;
  }

  .container,
  .container-wide {
    padding-left: 18px;
    padding-right: 18px;
  }

  .brand-logo-img,
  .mobile-brand-logo-img {
    height: 52px;
    max-height: 54px;
    max-width: 165px;
  }

  .site-footer .brand-logo-img,
  .footer-brand-logo-img {
    height: 72px;
    max-height: 76px;
    max-width: 185px;
  }

  .brand-name {
    font-size: 0.9rem;
  }

  .brand-symbol {
    width: 28px;
    height: 28px;
    border-radius: 7px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .btn-pill-primary {
    min-height: 34px;
    padding: 6px 14px;
    font-size: 0.78rem;
  }

  /* Noble Editorial Hero on Mobile */
  .hero-section {
    padding-top: calc(var(--header-height) + 10px);
    padding-bottom: 14px;
  }

  .apple-hero-stage {
    min-height: clamp(420px, calc(100vh - var(--header-height) - 24px), 580px);
    min-height: clamp(420px, calc(100svh - var(--header-height) - 24px), 580px);
    border-radius: 22px;
    padding: 32px 22px;
    margin-bottom: 0;
    align-items: flex-end;
  }

  .apple-hero-scrim {
    background:
      linear-gradient(
        180deg,
        rgba(8, 9, 12, 0.28) 0%,
        rgba(8, 9, 12, 0.64) 42%,
        rgba(8, 9, 12, 0.92) 100%
      );
  }

  .hero-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
  }

  .hero-eyebrow::before {
    width: 20px;
  }

  .hero-headline {
    font-size: clamp(1.85rem, 7.5vw, 2.4rem);
    line-height: 1.08;
    margin-bottom: 14px;
    letter-spacing: -0.03em;
  }

  .hero-lead {
    font-size: 0.96rem;
    line-height: 1.48;
    margin-bottom: 22px;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .hero-cta-group .btn-pill-primary,
  .hero-cta-group .btn-pill-outline {
    width: 100%;
    justify-content: center;
  }

  /* Apple Services Bento & Segmented Pill Bar on Mobile */
  .apple-segmented-dock-wrap {
    margin-top: 20px;
    width: 100%;
  }

  .apple-segmented-dock {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .apple-segmented-dock::-webkit-scrollbar {
    display: none;
  }

  .apple-segmented-pill {
    flex: 0 0 auto;
    padding: 8px 15px;
    font-size: 0.82rem;
    scroll-snap-align: start;
  }

  .apple-pkg-chapter-bar {
    padding: 9px 0;
  }

  .apple-pkg-chapter-tab {
    min-block-size: 48px;
    min-inline-size: 152px;
    padding: 8px 12px;
    border-radius: 14px;
  }

  .apple-pkg-tab-icon {
    width: 30px;
    height: 30px;
  }

  .apple-pkg-tab-title {
    font-size: 0.82rem;
  }

  .apple-pkg-tab-sub {
    font-size: 0.68rem;
  }

  .apple-services-bento,
  .apple-services-bento.is-filtered {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .apple-srv-bento-card {
    border-radius: 24px;
    padding: 24px 20px;
    gap: 18px;
  }

  .apple-srv-title,
  .apple-srv-bento-card--span-4 .apple-srv-title {
    font-size: 1.38rem;
  }

  .apple-srv-actions {
    width: 100%;
  }

  .apple-srv-actions .btn-pill-primary,
  .apple-srv-actions .btn-pill-outline {
    flex: 1 1 135px;
    justify-content: center;
  }

  .apple-srv-glass-metric {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 9px 12px;
    border-radius: 12px;
  }

  .apple-srv-metric-val {
    font-size: 0.86rem;
  }

  .apple-srv-metric-label {
    font-size: 0.72rem;
  }

  .apple-spec-ribbon {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 20px;
    border-radius: 22px;
  }

  .apple-spec-ribbon-item {
    padding-right: 0;
    padding-bottom: 12px;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  /* Section Headers on Mobile */
  .section-header-block,
  .section-header-centered {
    margin-bottom: 28px;
    text-align: center;
  }

  .section-title {
    font-size: clamp(1.65rem, 6.8vw, 2.1rem);
    line-height: 1.12;
  }

  .section-desc,
  .section-lead {
    font-size: 0.96rem;
  }

  /* Single Column Grids on Mobile */
  .bento-three-grid,
  .services-catalog-grid,
  .service-feature-grid,
  .packages-grid,
  .process-grid,
  .blog-card-grid,
  .package-checklist-grid,
  .form-grid-two,
  .rfp-choice-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Pricing Tabs & Blog Category Filter Pills on Mobile */
  .package-category-tabs,
  .apple-filter-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    margin-top: 16px;
    margin-bottom: 24px;
    padding: 2px 2px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .package-category-tabs::-webkit-scrollbar,
  .apple-filter-nav::-webkit-scrollbar {
    display: none;
  }

  .package-tab-btn,
  .apple-filter-pill {
    flex: 0 0 auto;
    padding: 9px 16px;
    font-size: 0.84rem;
  }

  .blog-results-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 18px;
  }

  .apple-pagination {
    gap: 8px;
    margin-top: 32px;
    padding-top: 22px;
  }

  .apple-page-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .apple-page-num {
    width: 36px;
    height: 36px;
    font-size: 0.84rem;
  }

  .pricing-card,
  .bento-value-card,
  .service-catalog-card,
  .process-step-card,
  .package-content-block,
  .package-sticky-sidebar,
  .service-sidebar-card,
  .contact-form-card,
  .rfp-step-section,
  .rfp-summary-card {
    padding: 24px 20px;
    border-radius: 24px;
  }

  /* Subpage Hero */
  .page-hero-section,
  .detail-hero-section {
    padding-top: calc(var(--header-height) + 26px);
    padding-bottom: 28px;
  }

  .page-hero-title {
    font-size: clamp(1.85rem, 7.5vw, 2.35rem);
    line-height: 1.1;
  }

  .page-hero-lead {
    font-size: 0.98rem;
  }

  .detail-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-hero-actions .btn-pill-primary,
  .detail-hero-actions .btn-pill-outline {
    width: 100%;
    justify-content: center;
  }

  .contact-wa-banner {
    flex-direction: column;
    align-items: stretch !important;
  }

  .contact-wa-banner a {
    width: 100%;
    justify-content: center;
  }

  /* Article Reader on Mobile */
  .article-reader-layout {
    padding: 20px 0 48px;
  }

  .article-hero-visual {
    margin: 18px 0 24px;
    border-radius: 18px;
  }

  .article-body-content {
    font-size: 1rem;
  }

  .article-body-content h2 {
    font-size: 1.4rem;
    margin: 28px 0 10px;
  }

  .article-body-content ul {
    padding: 18px 20px;
  }

  /* FAQ (Apple Support Hairline List) */
  .faq-header-btn {
    min-height: 58px;
    padding: 18px 2px;
  }

  .faq-question-title {
    font-size: 1rem;
  }

  .faq-answer-content {
    padding: 0 24px 0 2px;
    font-size: 0.94rem;
  }

  .faq-accordion-item.is-open .faq-answer-content {
    padding-bottom: 20px;
  }

  /* CTA Banner */
  .cta-banner-wrapper {
    padding: 36px 20px;
    border-radius: 26px;
  }

  .cta-content-layout h2 {
    font-size: clamp(1.6rem, 6.5vw, 2rem);
  }

  .cta-actions-side {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }

  .cta-actions-side .btn-pill-primary,
  .cta-actions-side .btn-pill-yellow,
  .cta-actions-side .btn-pill-outline {
    width: 100%;
    justify-content: center;
  }

  /* Apple Collapsible Global Footer on Mobile */
  .site-footer {
    padding: 32px 0 max(24px, env(safe-area-inset-bottom));
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding-bottom: 16px;
    border-bottom: none;
  }

  .footer-brand-col {
    padding-bottom: 22px;
    border-bottom: 1px solid #D2D2D7;
  }

  .footer-col-details {
    border-bottom: 1px solid #D2D2D7;
  }

  .footer-col-details .footer-col-title {
    margin: 0;
    padding: 14px 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
  }

  .footer-col-details .footer-col-title::after {
    content: '+';
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    transition: transform var(--transition-fast);
  }

  .footer-col-details[open] .footer-col-title::after {
    transform: rotate(45deg);
  }

  .footer-col-details .footer-links-list {
    padding: 0 4px 16px;
    gap: 10px;
  }

  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 18px;
  }

  /* Modal & Contact Channels */
  .contact-channel-duo {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-dialog {
    padding: 24px 18px;
    border-radius: 24px;
    max-height: 92vh;
  }

  .choice-tiles-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-submit-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-submit-footer .btn-pill-primary {
    width: 100%;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   4. Small Phones (max-width: 400px)
   -------------------------------------------------------------------------- */
@media (max-width: 400px) {
  :root {
    --header-height: 64px;
  }

  .brand-logo-img,
  .mobile-brand-logo-img {
    height: 46px;
    max-height: 48px;
    max-width: 145px;
  }

  .site-footer .brand-logo-img,
  .footer-brand-logo-img {
    height: 64px;
    max-height: 68px;
    max-width: 165px;
  }

  .choice-tiles-grid {
    grid-template-columns: 1fr;
  }

  .package-specs-table tr {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
  }

  .package-specs-table td,
  .package-specs-table td:first-child {
    width: 100%;
    padding: 2px 0;
  }
}

/* --------------------------------------------------------------------------
   5. Apple Long-Form SEO Landing Page Responsive Rules
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .apple-lp-metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .apple-lp-bento-card,
  .apple-lp-bento-card--dark,
  .apple-lp-bento-card--wide,
  .apple-lp-bento-card--accent {
    grid-column: span 6;
  }

  .apple-lp-story-grid {
    grid-template-columns: 1fr;
  }

  .apple-lp-story-grid.is-reversed .apple-lp-story-content,
  .apple-lp-story-grid.is-reversed .apple-lp-story-visual {
    order: unset;
  }

  .apple-lp-process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .apple-lp-reader-layout {
    grid-template-columns: 1fr;
  }

  .apple-lp-toc-sidebar {
    position: static;
  }

  .apple-lp-conversion-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .apple-lp-subnav-brand {
    display: none;
  }

  .apple-lp-subnav-inner {
    gap: 10px;
    min-height: 46px;
  }

  .apple-lp-metrics-strip,
  .apple-lp-process-grid,
  .apple-lp-direct-cards {
    grid-template-columns: 1fr;
  }

  .apple-lp-bento-card,
  .apple-lp-bento-card--dark,
  .apple-lp-bento-card--wide,
  .apple-lp-bento-card--accent {
    grid-column: span 12;
    padding: 24px 20px;
  }

  .apple-lp-hero-actions .btn-pill-primary,
  .apple-lp-hero-actions .btn-pill-outline {
    width: 100%;
    justify-content: center;
  }

  .apple-lp-stage-floating-pill {
    left: 14px;
    right: 14px;
    bottom: 14px;
    font-size: 0.76rem;
  }
}

