/* Greenekka V10.7 | Mobile editorial experience
   Additive, mobile/tablet only. Load after V10.6 and other page styles.
   No data, publishing, desktop, or newsroom modifications. */

@media (max-width: 960px) {
  /* Prevent grid tracks and embeds from forcing horizontal scrolling. */
  :where(#home-root, #story-root, #category-root, main, .wrap,
         .hero-layout, .hero-feature, .hero-side, .content-grid,
         .category-grid, .story-card, .side-story, .article-layout,
         .article-body, .gk-datalab-shell, .gk-datalab-visual) {
    min-width: 0;
  }
  :where(main, .article-body) :is(img, video, iframe, svg, canvas) {
    max-width: 100%;
  }
  :where(.article-body, .story-card, .side-story) {
    overflow-wrap: break-word;
  }
  .wrap { width: 100%; padding-inline: clamp(16px, 4vw, 28px); }

  /* Keep the compact masthead intact and show clear touch controls. */
  .gk-header .gk-v92-desktop-nav { display: none; }
  .gk-header .gk-v92-masthead {
    display: flex;
    align-items: center;
    height: 68px;
    min-height: 0;
    gap: 10px;
    padding-inline: clamp(16px, 4vw, 28px);
  }
  .gk-header.gk-v92-scrolled .gk-v92-masthead { height: 56px; }
  .gk-header .gk-v92-wordmark {
    flex: 0 1 180px;
    width: min(180px, 47vw);
    min-width: 0;
    max-width: 100%;
  }
  .gk-header .gk-v92-wordmark svg { width: 100%; max-width: 100%; }
  .gk-header .gk-masthead-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
  }
  .gk-header .gk-v92-masthead .gk-mobile-toggle {
    display: inline-grid;
  }
  .gk-header .gk-icon-action,
  .gk-header .gk-v92-masthead .gk-icon-action {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: inline-grid;
    place-items: center;
  }
  .gk-header .gk-mobile-menu.open {
    position: fixed;
    inset: 68px 0 auto;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    padding: 14px clamp(16px, 4vw, 28px) max(22px, env(safe-area-inset-bottom));
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f8f7ef;
    border-top: 1px solid #d9dfd5;
    box-shadow: 0 20px 35px rgba(16, 56, 46, .15);
  }
  .gk-header.gk-v92-scrolled .gk-mobile-menu.open {
    top: 56px;
    max-height: calc(100dvh - 56px);
  }
  .gk-header .gk-mobile-menu.open a {
    display: flex;
    align-items: center;
    font-size: 15px;
    line-height: 1.35;
    min-height: 48px;
    padding: 12px 10px;
    border-bottom: 1px solid #e1e8df;
  }
  .gk-header .gk-search.open {
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .gk-header .gk-search input { min-height: 46px; font-size: 16px; }

  /* The story always leads. Secondary cards do not stretch to match it. */
  #home-root .gk-v92-hero { padding-block: 22px 12px; }
  #home-root .gk-v92-hero .hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  #home-root .gk-v92-hero .hero-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 14px;
    align-items: start;
  }
  #home-root .gk-v92-hero .side-story {
    height: auto;
    min-height: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
  }
  #home-root .gk-v92-side-image { aspect-ratio: 16 / 10; }
  #home-root .gk-v92-lead-image { aspect-ratio: 16 / 10; }
  #home-root .gk-v92-hero .hero-copy h1 {
    font-size: clamp(2.1rem, 5.2vw, 3.1rem);
    line-height: 1.08;
    overflow-wrap: break-word;
  }
  #home-root .gk-v92-hero .hero-copy .deck {
    font-size: 16px;
    line-height: 1.55;
  }
  #home-root .gk-v92-side-copy { padding: 12px 13px 14px; }
  #home-root .gk-v92-hero .side-story h3 {
    font-size: clamp(1.15rem, 2.6vw, 1.45rem);
    line-height: 1.2;
  }

  /* A consistent two-column rhythm on smaller tablets. */
  #home-root .content-grid,
  #category-root .category-grid,
  #story-root .gk-v99-read-next .content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 18px;
  }
  #home-root .section,
  #home-root .section.compact { padding-block: 22px; }
  #home-root .section-title { margin-bottom: 18px; }
  #home-root .section-title h2 { font-size: clamp(1.85rem, 4vw, 2.45rem); }
  :where(#home-root, #category-root) .story-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
  }
  .story-card .excerpt { line-height: 1.48; }

  /* Data Lab and promotion sections stack without oversized panels. */
  #home-root .gk-datalab-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 20px;
  }
  #home-root .gk-datalab-copy h2 { font-size: clamp(1.65rem, 4.2vw, 2.1rem); }
  #home-root .gk-datalab-abstract-chart { height: auto; max-height: 115px; }
  #home-root .featurestrip { grid-template-columns: minmax(0, 1fr); }
  #home-root .newsletter { gap: 16px; }
  #home-root .newsletter form { min-width: 0; max-width: 100%; }

  /* Article text and related stories fit the viewport. */
  #story-root.gk-v99-story .article-layout { grid-template-columns: minmax(0, 1fr); }
  #story-root.gk-v99-story .article-body { max-width: 68ch; }
  #story-root.gk-v99-story .article-side { position: static; }
  #story-root.gk-v99-story .gk-v99-read-next .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .article-body :is(table, pre) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .article-body :is(a, code) { overflow-wrap: anywhere; }
  .article-body iframe { width: 100%; }

  /* Forms and card layouts on other public pages. */
  :where(main, .newsletter) :is(input, select, textarea) { max-width: 100%; }
  :where(main, .newsletter) :is(button, .btn) { min-height: 44px; }
  .page-intro { padding-top: 32px; }
  .page-intro h1 { font-size: clamp(2.5rem, 6vw, 3.6rem); overflow-wrap: break-word; }
  .chips { gap: 8px; }
  .chip { min-height: 40px; }
  .gk-compact-footer .footer-grid { min-width: 0; }
}

@media (max-width: 640px) {
  .wrap { padding-inline: 18px; }
  .gk-header .gk-v92-masthead {
    height: 64px;
    padding-inline: 14px;
  }
  .gk-header .gk-v92-wordmark { flex: 0 1 170px; width: min(170px, 46vw); }
  .gk-header .gk-v92-masthead .gk-subscribe { display: none; }
  .gk-header .gk-masthead-right { gap: 4px; }
  .gk-header .gk-mobile-menu.open {
    top: 64px;
    max-height: calc(100dvh - 64px);
    grid-template-columns: minmax(0, 1fr);
    padding: 9px 18px max(16px, env(safe-area-inset-bottom));
  }
  .gk-header.gk-v92-scrolled .gk-mobile-menu.open {
    top: 56px;
    max-height: calc(100dvh - 56px);
  }
  .gk-header .gk-mobile-menu.open a { font-size: 16px; min-height: 48px; }
  .gk-header .gk-search.open { max-height: calc(100dvh - 64px); }

  #home-root .gk-v92-hero { padding-block: 18px 8px; }
  #home-root .gk-v92-hero-overline { margin-bottom: 12px; }
  #home-root .gk-v92-hero .hero-layout { gap: 18px; }
  #home-root .gk-v92-hero .hero-copy { padding: 13px 0 0; }
  #home-root .gk-v92-hero .hero-copy h1 {
    margin: 8px 0 9px;
    font-size: clamp(2rem, 8.5vw, 2.7rem);
    line-height: 1.07;
  }
  #home-root .gk-v92-hero .hero-copy .deck { font-size: 15px; line-height: 1.55; }
  #home-root .gk-v92-hero .hero-side {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  /* Image left, headline right: compact scan-friendly secondary stories. */
  #home-root .gk-v92-hero .side-story {
    display: grid;
    grid-template-columns: minmax(98px, 34%) minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    overflow: hidden;
  }
  #home-root .gk-v92-side-image { width: 100%; height: 100%; aspect-ratio: auto; }
  #home-root .gk-v92-side-image img {
    width: 100%;
    height: 100%;
    min-height: 116px;
    object-fit: cover;
  }
  #home-root .gk-v92-side-copy { min-width: 0; padding: 11px 12px; }
  #home-root .gk-v92-hero .side-story h3 {
    font-size: clamp(1.05rem, 4.3vw, 1.25rem);
    line-height: 1.18;
  }
  #home-root .gk-v92-side-copy .article-label { font-size: 9px; }
  #home-root .section,
  #home-root .section.compact { padding-block: 16px; }
  #home-root .section-title {
    gap: 10px;
    align-items: baseline;
    flex-wrap: wrap;
    padding-bottom: 10px;
    margin-bottom: 17px;
  }
  #home-root .section-title h2 { font-size: clamp(1.75rem, 7.1vw, 2.1rem); }
  #home-root .section-title a { font-size: 12px; }

  #home-root .content-grid,
  #category-root .category-grid,
  #story-root.gk-v99-story .gk-v99-read-next .content-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  :where(#home-root, #category-root) .story-card h3 {
    font-size: clamp(1.33rem, 5.7vw, 1.6rem);
    line-height: 1.15;
    margin: 9px 0;
  }
  :where(#home-root, #category-root) .story-card img { border-radius: 13px; }
  :where(#home-root, #category-root) .story-card .excerpt { font-size: 13px; margin-top: 5px; }

  /* Give the data showcase less visual weight than the reporting cards. */
  #home-root .gk-datalab-showcase { padding-block: 9px; }
  #home-root .gk-datalab-shell { padding: 16px; gap: 12px; border-radius: 15px; }
  #home-root .gk-datalab-copy h2 { font-size: clamp(1.55rem, 6.5vw, 1.95rem); }
  #home-root .gk-datalab-copy p { font-size: 14px; line-height: 1.52; margin-bottom: 12px; }
  #home-root .gk-datalab-visual { padding: 11px 12px; }
  #home-root .gk-datalab-abstract-chart { max-height: 94px; }
  #home-root .gk-datalab-actions { gap: 8px; }
  #home-root .gk-datalab-actions .gk-datalab-primary { min-height: 44px; }

  /* Newsletter is full-width and buttons never compress text fields. */
  #home-root .newsletter { display: block; padding: 20px 17px; border-radius: 14px; }
  #home-root .newsletter h2 { font-size: clamp(1.7rem, 6.6vw, 2rem); }
  #home-root .newsletter form { display: flex; flex-direction: column; gap: 9px; margin-top: 15px; }
  #home-root .newsletter form :is(input, button) { width: 100%; min-width: 0; min-height: 46px; }

  /* Article cover, sharing, narration, and read-next. */
  #story-root.gk-v99-story .page-intro { padding: 24px 0 20px !important; }
  #story-root.gk-v99-story .article-title {
    font-size: clamp(2.2rem, 8.3vw, 3rem);
    line-height: 1.07;
    letter-spacing: -.025em;
  }
  #story-root.gk-v99-story .page-intro .deck { font-size: 16px; line-height: 1.55; }
  #story-root.gk-v99-story .gk-v99-head-foot { gap: 12px; padding-top: 13px; }
  #story-root.gk-v99-story .gk-story-actions { gap: 8px; }
  #story-root.gk-v99-story .gk-story-actions :is(a, button) { min-height: 44px; }
  #story-root.gk-v99-story .story-cover { aspect-ratio: 16 / 10; border-radius: 12px; }
  #story-root.gk-v99-story .article-layout { margin-top: 20px; gap: 26px; }
  #story-root.gk-v99-story .article-body { font-size: 17px; line-height: 1.72; }
  #story-root.gk-v99-story .article-body h2 { font-size: clamp(1.75rem, 6.5vw, 2.1rem); }
  #story-root.gk-v99-story .article-body h3 { font-size: 1.45rem; }
  #story-root.gk-v99-story .audio-player {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 13px;
    gap: 12px;
  }
  #story-root.gk-v99-story .audio-player .btn { min-height: 44px; margin-top: 0; }
  #story-root.gk-v99-story .gk-v99-read-next { margin-top: 42px; padding-top: 18px; }
  #story-root.gk-v99-story .gk-v99-read-next .story-card img { aspect-ratio: 16 / 10; }
  #story-root.gk-v99-story .article-side .sidebar-box { padding: 16px; }

  /* Category filters wrap instead of spilling off the phone. */
  #category-root .page-intro { padding: 26px 0 18px; }
  #category-root .page-intro h1 { font-size: clamp(2.25rem, 8vw, 2.8rem); }
  #category-root .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
  #category-root .chip { min-height: 42px; padding: 9px 13px; }

  /* Simple feature cards and footer; no horizontal squeezing. */
  #home-root .featuretile { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 15px; }
  #home-root .featuretile h3 { font-size: clamp(1.15rem, 5vw, 1.45rem); }
  .gk-compact-footer .footer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .gk-compact-footer .gk-footer-brand { grid-column: 1 / -1; }
  .gk-compact-footer .copyright { margin-top: 23px; }
}

@media (max-width: 390px) {
  .gk-header .gk-v92-wordmark { flex-basis: 146px; width: min(146px, 41vw); }
  .gk-header .gk-masthead-right { gap: 2px; }
  .gk-header .gk-icon-action,
  .gk-header .gk-v92-masthead .gk-icon-action {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }
  #home-root .gk-v92-hero .side-story { grid-template-columns: minmax(90px, 33%) minmax(0, 1fr); }
  #home-root .gk-v92-side-copy { padding: 9px 10px; }
  #home-root .gk-v92-hero .side-story h3 { font-size: 1.05rem; }
  #home-root .featuretile { grid-template-columns: minmax(0, 1fr); }
  #home-root .featuretile img { max-height: 155px; aspect-ratio: 16 / 8; }
  #home-root .gk-datalab-actions { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .gk-header .gk-v92-masthead,
  #home-root .gk-v92-side-image img,
  #home-root .gk-v92-lead-image img,
  :where(#home-root, #category-root, #story-root) .story-card img {
    transition: none !important;
    animation: none !important;
  }
}
