/* Mobile typography & density — moderate scale (≤767px) */
@media (max-width: 767px) {
  :root {
    --gamayun-body-size: 0.9375rem;
    --gamayun-body-lh: 1.6;
    --gamayun-h1-page: 1.45rem;
    --gamayun-h1-post: 1.25rem;
    --gamayun-h1-hero: 2rem;
    --gamayun-h2-section: 1.45rem;
    --gamayun-h2-content: 1.2rem;
    --gamayun-h3-section: 1.125rem;
    --gamayun-h3-content: 1.05rem;
    --gamayun-text-block: 0.9375rem;
    --gamayun-text-small: 0.875rem;
    --gamayun-section-y: 1.35rem;
    --gamayun-content-x: 1.25rem;
  }

  /* Base */
  body,
  .nv-content-wrap.entry-content {
    font-size: var(--gamayun-body-size);
    line-height: var(--gamayun-body-lh);
  }

  h1:not(.gamayun-hero h1) {
    font-size: var(--gamayun-h1-page);
  }

  .neve-main > .container,
  .container.archive-container,
  .container.single-post-container,
  .container.single-page-container {
    padding-left: var(--gamayun-content-x) !important;
    padding-right: var(--gamayun-content-x) !important;
  }

  /* Neve .row uses -15px margins that eat side padding */
  .neve-main > .container > .row,
  .container.archive-container > .row,
  .container.single-post-container > .row,
  .container.single-page-container > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .neve-main > .container > .row > .col,
  .container.archive-container .nv-index-posts.col,
  .container.single-post-container .nv-single-post-wrap.col,
  .container.single-page-container .nv-single-page-wrap.col {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Homepage — hero flush under title bar */
  .home .neve-main {
    padding-top: 0;
  }

  .home .neve-main > .container.single-page-container,
  .home .single-page-container > .row,
  .home .nv-single-page-wrap.col {
    padding-top: 0;
    margin-top: 0;
  }

  .home .nv-content-wrap.entry-content,
  .home .nv-single-page-wrap .nv-content-wrap {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  .home .gamayun-hero {
    margin-top: 0 !important;
    padding-top: 1.35rem;
  }

  /* Header logo + tagline — even line rhythm on mobile */
  .header-main .brand,
  .header-main .site-logo,
  .header-main .nv-title-tagline-wrap,
  .header-main .title-with-logo {
    line-height: 1.2;
  }

  .header-main .site-title,
  .builder-item--logo .site-title {
    font-size: 0.875rem;
    line-height: 1.2;
    margin: 0;
  }

  .header-main .brand small,
  .header-main .nv-title-tagline-wrap small,
  .builder-item--logo .brand small {
    display: block;
    font-size: 0.5625rem;
    line-height: 1.2;
    margin: 0.125rem 0 0;
    letter-spacing: 0.015em;
  }

  .header-main .site-description,
  .header-main .brand .site-description,
  .builder-item--logo .site-description,
  .header-main .title-with-tagline p {
    font-size: 0.5625rem;
    line-height: 1.2;
    margin: 0.125rem 0 0;
  }

  /* Hero padding on mobile */
  .gamayun-hero {
    padding-top: 1.75rem;
    padding-bottom: 1.5rem;
  }

  .gamayun-hero-symbol img,
  .gamayun-hero-symbol svg {
    width: 3.25rem;
  }

  .gamayun-hero-symbol {
    margin-bottom: 0.85rem;
  }

  .gamayun-hero-badge,
  .nv-content-wrap.entry-content .gamayun-hero-badge,
  .nv-content-wrap.entry-content p.gamayun-hero-badge {
    font-size: calc(0.55rem * var(--gamayun-hero-badge-scale, 1.15)) !important;
    letter-spacing: 0.02em;
    padding: calc(0.25rem * var(--gamayun-hero-badge-scale, 1.15)) calc(0.4rem * var(--gamayun-hero-badge-scale, 1.15));
    margin-bottom: 0.75rem;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
    line-height: 1.2;
    max-width: calc(100vw - 2rem);
    box-sizing: border-box;
  }

  .gamayun-hero h1 {
    font-size: var(--gamayun-h1-hero);
    margin-bottom: 0.65rem;
  }

  .gamayun-hero p:not(.gamayun-hero-tagline):not(.gamayun-hero-badge) {
    font-size: var(--gamayun-text-block);
    margin-bottom: 0.4rem;
  }

  .gamayun-hero-tagline {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
  }

  .gamayun-hero-scroll {
    margin-top: 0.85rem !important;
  }

  .gamayun-hero-scroll .wp-block-button__link {
    font-size: 0.875rem;
    padding: 0.6rem 1.25rem;
  }

  /* Sections (homepage columns) */
  .gamayun-section {
    padding: var(--gamayun-section-y) 0;
  }

  .gamayun-section > .wp-block-group__inner-container > .wp-block-heading,
  .gamayun-section > .wp-block-group__inner-container > h2 {
    font-size: var(--gamayun-h2-section);
    margin-bottom: 1rem;
  }

  .gamayun-section .wp-block-columns {
    gap: 1.25rem !important;
  }

  .gamayun-section .wp-block-column h3 {
    font-size: var(--gamayun-h3-section);
    margin-bottom: 0.55rem;
  }

  .gamayun-section .wp-block-column p {
    font-size: var(--gamayun-text-block);
    line-height: 1.62;
    margin-bottom: 0.75rem;
  }

  /* Cards */
  .gamayun-cards {
    gap: 0.85rem;
  }

  .gamayun-card {
    padding: 1rem 0.9rem 0.9rem;
  }

  .gamayun-card h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
  }

  .gamayun-card p {
    font-size: var(--gamayun-text-small);
    line-height: 1.55;
  }

  /* Library list */
  .gamayun-resources li {
    font-size: var(--gamayun-text-block);
    margin: 0.35rem 0;
  }

  /* CTA block — body already clears fixed bottom nav */
  .gamayun-next-step {
    padding: 1.1rem var(--gamayun-content-x) 1.1rem;
    margin-bottom: 0;
  }

  .gamayun-next-step h2 {
    font-size: 1.25rem;
    margin-bottom: 0.55rem;
  }

  .gamayun-next-step > .wp-block-group__inner-container > p {
    font-size: var(--gamayun-text-block);
    line-height: 1.6;
  }

  .gamayun-cta-row .wp-block-button__link {
    font-size: var(--gamayun-text-small);
    padding: 0.65rem 1.15rem;
  }

  .gamayun-next-step .gamayun-cta-row {
    margin-top: 1rem;
  }

  /* Kill Neve's default 60px vertical rhythm on singles / pages */
  .nv-single-post-wrap > div:first-child,
  .nv-single-page-wrap > div:first-child {
    margin-top: 0.65rem !important;
  }

  .nv-single-post-wrap > div:not(:last-child),
  .nv-single-page-wrap > div:not(:last-child) {
    margin-bottom: 0.75rem !important;
  }

  .nv-page-title-wrap {
    margin-top: 0.85rem !important;
    margin-bottom: 0.5rem !important;
  }

  .nv-page-title-wrap .title,
  .nv-page-title-wrap h1,
  .nv-page-title {
    font-size: var(--gamayun-h1-page) !important;
    line-height: 1.25 !important;
    margin: 0 0 0.35rem !important;
  }

  /* Single post / publication — dense mobile layout */
  .single-post-container,
  .archive-container {
    padding-top: 0;
  }

  .gamayun-single-full .single-post-container > .row {
    margin-left: 0;
    margin-right: 0;
  }

  .gamayun-single-full .nv-single-post-wrap.col {
    padding-top: 0 !important;
    padding-left: 0;
    padding-right: 0;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  .gamayun-single-full .nv-single-post-wrap > .entry-header,
  .gamayun-single-full .nv-single-post-wrap > div.entry-header:first-child {
    margin: 0.5rem 0 0.4rem !important;
    padding: 0 !important;
  }

  .gamayun-single-full .entry-header .nv-title-meta-wrap {
    margin: 0 !important;
    padding: 0 !important;
  }

  .gamayun-single-full .title.entry-title,
  .gamayun-single-full h1.entry-title,
  .nv-single-post-wrap .title.entry-title,
  .nv-single-post-wrap h1.entry-title,
  .single .title.entry-title {
    font-size: var(--gamayun-h1-post) !important;
    line-height: 1.28 !important;
    margin: 0 0 0.35rem !important;
    --fontsize: var(--gamayun-h1-post);
    --h1fontsize: var(--gamayun-h1-post);
    --lineheight: 1.28;
  }

  .gamayun-single-full .nv-meta-list:empty,
  .nv-single-post-wrap .nv-meta-list:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
  }

  .gamayun-single-full .nv-content-wrap.entry-content {
    padding-top: 0 !important;
    padding-bottom: 1rem;
  }

  .gamayun-single-full .nv-content-wrap.entry-content > *:first-child {
    margin-top: 0 !important;
  }

  .gamayun-single-full .nv-content-wrap.entry-content > .wp-block-image,
  .gamayun-single-full .nv-content-wrap.entry-content > figure {
    margin: 0.5rem 0 0.85rem !important;
  }

  .gamayun-single-full .nv-content-wrap.entry-content > p,
  .gamayun-single-full .nv-content-wrap.entry-content > .wp-block-paragraph {
    margin-top: 0.55rem !important;
    margin-bottom: 0.55rem !important;
  }

  .gamayun-single-full .nv-content-wrap.entry-content figcaption {
    font-size: 0.8125rem;
    line-height: 1.4;
    margin-top: 0.35rem;
  }

  .nv-single-post-wrap .nv-meta-list:not(:empty) {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem !important;
  }

  /* Archive page title */
  .archive .nv-page-title-wrap,
  .blog .nv-page-title-wrap,
  .category .nv-page-title-wrap {
    margin-top: 0.75rem !important;
    margin-bottom: 0.5rem !important;
  }

  /* Inner content headings */
  .nv-content-wrap.entry-content > .wp-block-heading {
    margin-top: 1.1rem;
    margin-bottom: 0.55rem;
  }

  .nv-content-wrap.entry-content h2.wp-block-heading,
  .nv-content-wrap.entry-content h2 {
    font-size: var(--gamayun-h2-content);
  }

  .nv-content-wrap.entry-content h3.wp-block-heading,
  .nv-content-wrap.entry-content h3 {
    font-size: var(--gamayun-h3-content);
  }

  .nv-content-wrap.entry-content h4 {
    font-size: 1rem;
  }

  .nv-content-wrap.entry-content p,
  .nv-content-wrap.entry-content li {
    font-size: var(--gamayun-text-block);
    line-height: var(--gamayun-body-lh);
  }

  .nv-content-wrap.entry-content ul,
  .nv-content-wrap.entry-content ol {
    padding-left: 1.25rem;
    margin: 0.55rem 0 0.85rem;
  }

  .nv-content-wrap.entry-content blockquote {
    font-size: var(--gamayun-text-block);
    margin: 0.85rem 0;
    padding: 0.65rem 0.85rem;
  }

  .nv-content-wrap.entry-content img,
  .nv-content-wrap.entry-content iframe,
  .nv-content-wrap.entry-content video {
    max-width: 100%;
    height: auto;
  }

  .nv-content-wrap.entry-content .wp-block-table,
  .nv-content-wrap.entry-content pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Archive & category lists — kill Neve 60px top gap + fix width overflow */
  .nv-index-posts {
    margin-top: 0.5rem !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100%;
    overflow-x: clip;
  }

  .nv-index-posts .nv-page-title-wrap {
    margin-top: 0 !important;
    margin-bottom: 0.65rem !important;
  }

  .nv-index-posts .nv-page-title-wrap h1,
  .nv-index-posts .nv-page-title .title {
    font-size: var(--gamayun-h1-page) !important;
    line-height: 1.25 !important;
    margin: 0 !important;
  }

  .nv-index-posts .posts-wrapper {
    gap: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 1.25rem !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .nv-index-posts .layout-grid article,
  .nv-index-posts article.layout-grid,
  .nv-index-posts .posts-wrapper > article {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.65rem 0 !important;
    margin: 0 0 0.65rem !important;
    border-bottom: 1px solid var(--gamayun-border);
  }

  .nv-index-posts article.layout-grid:last-child,
  .nv-index-posts .posts-wrapper > article:last-child {
    border-bottom: 0;
    margin-bottom: 0 !important;
  }

  .nv-index-posts .blog-entry-title,
  .nv-index-posts .blog-entry-title a {
    font-size: 1rem !important;
    line-height: 1.35 !important;
    margin: 0 0 0.35rem !important;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .nv-index-posts .excerpt-wrap {
    font-size: var(--gamayun-text-small);
    line-height: 1.5;
    margin: 0 !important;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .nv-index-posts .excerpt-wrap p {
    margin: 0 !important;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }

  .nv-index-posts .nv-meta-list {
    font-size: 0.8125rem;
  }

  .nv-index-posts .nv-meta-list:empty {
    display: none !important;
    margin: 0 !important;
  }

  .nv-index-posts .article-content-col,
  .nv-index-posts .content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .nv-nav-links,
  .posts-navigation,
  .pagination {
    font-size: var(--gamayun-text-small);
    margin-top: 1rem;
  }

  /* Global mobile text wrap safety */
  .nv-content-wrap,
  .nv-single-post-wrap,
  .nv-index-posts,
  .entry-title,
  .blog-entry-title {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Generic inner page wrap */
  .nv-single-page-wrap .nv-content-wrap {
    padding-top: 0.25rem;
    padding-bottom: 1.5rem;
  }

  /* Search */
  .nv-search-form input[type="search"],
  .nv-search-form input[type="text"] {
    font-size: 1rem;
  }

  /* Footer */
  footer .footer-bottom,
  footer .footer-bottom p,
  footer .footer-bottom a {
    font-size: 0.8125rem;
    line-height: 1.45;
  }

  footer .footer-bottom {
    padding: 0.65rem var(--gamayun-content-x) 0.65rem;
  }

  footer .footer-bottom .nav-ul a {
    padding: 0.25rem 0.4rem;
  }

  /* TOC mobile */
  .gamayun-toc-toggle {
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
  }

  .gamayun-toc-mobile {
    margin-bottom: 1rem;
  }

  .gamayun-toc-mobile-panel {
    padding: 0.65rem 0.85rem;
    font-size: var(--gamayun-text-small);
  }

  /* Accordion (symbols) */
  .gamayun-accordion-item summary {
    padding: 0.7rem 0.85rem;
    font-size: 1rem;
  }

  .gamayun-accordion-body {
    padding: 0 0.85rem 0.85rem;
    font-size: var(--gamayun-text-block);
  }

  .gamayun-accordion-item {
    margin-bottom: 0.5rem;
  }

  /* Hamburger sidebar — full height, submenus expanded, solid scroll bg */
  .header-menu-sidebar {
    width: min(calc(100vw - 2.5rem), 17.5rem) !important;
    max-height: 100dvh;
    overflow: hidden;
    align-self: stretch;
    box-shadow: 4px 0 24px rgba(45, 27, 54, 0.18);
    background-color: var(--gamayun-purple-primary) !important;
  }

  .is-menu-sidebar.menu_sidebar_pull_left > .wrapper {
    left: min(calc(100vw - 2.5rem), 17.5rem) !important;
  }

  .header-menu-sidebar-bg {
    min-height: 100dvh;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--gamayun-purple-primary) !important;
  }

  .header-menu-sidebar .close-sidebar-panel.navbar-toggle-wrapper {
    padding: 0.25rem 0.5rem 0.15rem;
    justify-content: flex-end;
    background-color: var(--gamayun-purple-primary);
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .header-menu-sidebar-inner {
    padding: 0.25rem 0 1.25rem;
    background-color: var(--gamayun-purple-primary) !important;
  }

  .header-menu-sidebar .builder-item--primary-menu {
    --spacing: 0;
    --height: auto;
    --fontsize: 0.9375rem;
    --lineheight: 1.35;
    --padding: 0;
    --margin: 0;
  }

  .header-menu-sidebar .nav-ul.menu-mobile {
    margin: 0;
    padding: 0;
  }

  .header-menu-sidebar .nav-ul.menu-mobile > li {
    margin: 0;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .header-menu-sidebar .nav-ul.menu-mobile > li:last-child {
    border-bottom: 0;
  }

  .header-menu-sidebar .nav-ul li:not([class*="block"]) > .wrap > a {
    padding: 0.5rem 0.85rem;
    min-height: 0;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 0.9375rem;
    font-weight: 500;
  }

  .header-menu-sidebar .nav-ul li.nv-active > .wrap > a,
  .header-menu-sidebar .nav-ul li > .wrap > a:hover,
  .header-menu-sidebar .nav-ul li > .wrap > a:focus-visible {
    color: var(--gamayun-gold) !important;
  }

  .header-menu-sidebar .nav-ul .caret-wrap {
    margin: 0;
    padding: 0.45rem 0.65rem;
  }

  .header-menu-sidebar .nav-ul .sub-menu {
    margin: 0;
    padding: 0 0 0.25rem;
    background: rgba(0, 0, 0, 0.12);
  }

  .header-menu-sidebar .nav-ul .sub-menu:not(.dropdown-open) {
    display: none;
  }

  .header-menu-sidebar .nav-ul .sub-menu.dropdown-open {
    display: block;
  }

  .header-menu-sidebar .nav-ul .sub-menu .wrap > a {
    padding: 0.38rem 0.85rem 0.38rem 1.15rem;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.88) !important;
  }

  .header-menu-sidebar .nav-ul .sub-menu .wrap > a:hover,
  .header-menu-sidebar .nav-ul .sub-menu .wrap > a:focus-visible {
    color: var(--gamayun-gold) !important;
  }

  .header-menu-sidebar .nav-ul li:not([class*="block"]):not(.menu-item-has-children) > .wrap > a {
    padding-right: 0.85rem !important;
  }

  .header-menu-sidebar .nav-ul li.menu-item-has-children:not([class*="block"]) > .wrap > a {
    margin-right: 0 !important;
    padding-right: 0.35rem !important;
  }

  .header-menu-sidebar .nav-ul li .wrap {
    padding: 0;
  }
}
