/*
 * Shared mobile presentation for the public directory.
 * This file is intentionally loaded last: individual page styles still own the
 * desktop design while this layer gives every primary page the same compact,
 * touch-friendly mobile rhythm.
 */
@media (max-width: 700px) {
  :root {
    --mobile-page-gutter: 18px;
    --mobile-card-radius: 14px;
    --mobile-section-space: 34px;
  }

  body:not(.home) .shell,
  body:not(.home) .finder-shell,
  body:not(.home) .finder-shell.finder-wide,
  body:not(.home) .article-single-layout {
    width: calc(100% - (var(--mobile-page-gutter) * 2));
  }

  body:not(.home) main,
  body:not(.home) article,
  body:not(.home) aside,
  body:not(.home) section,
  body:not(.home) form,
  body:not(.home) nav {
    min-width: 0;
  }

  body:not(.home) h1,
  body:not(.home) h2,
  body:not(.home) h3,
  body:not(.home) p,
  body:not(.home) li,
  body:not(.home) a,
  body:not(.home) span,
  body:not(.home) dd {
    overflow-wrap: anywhere;
  }

  body:not(.home) .breadcrumbs {
    gap: 6px;
    padding-block: 13px;
    overflow-x: auto;
    color: #637487;
    font-size: 11px;
    white-space: nowrap;
    scrollbar-width: none;
  }

  body:not(.home) .breadcrumbs::-webkit-scrollbar { display: none; }

  body:not(.home) .page-intro,
  body:not(.home) .profile-intro,
  body:not(.home) .about-intro {
    margin-bottom: 24px;
    padding-block: 29px 26px;
  }

  body:not(.home) .page-intro h1,
  body:not(.home) .profile-intro h1,
  body:not(.home) .about-heading h1 {
    margin-bottom: 12px;
    font-size: clamp(32px, 10vw, 40px);
    line-height: 1.06;
  }

  body:not(.home) .page-intro > p,
  body:not(.home) .about-heading > p,
  body:not(.home) .profile-summary {
    font-size: 15px;
    line-height: 1.62;
  }

  body:not(.home) .content-layout,
  body:not(.home) .directory-layout,
  body:not(.home) .condition-layout,
  body:not(.home) .condition-library-layout,
  body:not(.home) .treatment-library-layout,
  body:not(.home) .practitioner-layout,
  body:not(.home) .practitioner-profile-layout,
  body:not(.home) .article-library-layout,
  body:not(.home) .article-single-layout,
  body:not(.home) .about-body,
  body:not(.home) .legal-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  body:not(.home) .content-layout,
  body:not(.home) .directory-layout,
  body:not(.home) .condition-layout,
  body:not(.home) .condition-library-layout,
  body:not(.home) .treatment-library-layout,
  body:not(.home) .practitioner-layout,
  body:not(.home) .practitioner-profile-layout,
  body:not(.home) .article-library-layout,
  body:not(.home) .article-single-layout,
  body:not(.home) .about-body {
    padding-top: 24px;
    padding-bottom: 54px;
  }

  body:not(.home) .content-sidebar,
  body:not(.home) .directory-sidebar,
  body:not(.home) .condition-sidebar,
  body:not(.home) .practitioner-sidebar,
  body:not(.home) .article-library-aside,
  body:not(.home) .article-single-aside,
  body:not(.home) .about-aside,
  body:not(.home) .legal-rail {
    position: static;
  }

  /* A bottom mobile contact bar is always available, so avoid repeating a
     long form in the flow of content pages. Important page-specific forms,
     including Find a Clinic, remain visible. */
  body:not(.home):not(.page-find-a-clinic) .content-sidebar > .inquiry-card,
  body:not(.home):not(.page-find-a-clinic) .directory-sidebar > .inquiry-card,
  body:not(.home):not(.page-find-a-clinic) .condition-sidebar > .inquiry-card,
  body:not(.home):not(.page-find-a-clinic) .practitioner-sidebar > .inquiry-card,
  body:not(.home):not(.page-find-a-clinic) .article-single-aside > .inquiry-card,
  body:not(.home):not(.page-find-a-clinic) .resources-hero > .inquiry-card,
  body.single-atlas_clinic .clinic-profile-hero-contact {
    display: none;
  }

  body:not(.home) .btn,
  body:not(.home) button,
  body:not(.home) input,
  body:not(.home) select,
  body:not(.home) textarea {
    max-width: 100%;
  }

  body:not(.home) .btn {
    min-height: 46px;
    justify-content: center;
  }

  body:not(.home) .profile-jump-nav,
  body:not(.home) .condition-jump-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-inline: calc(var(--mobile-page-gutter) * -1);
    padding: 14px var(--mobile-page-gutter) 17px;
    overflow-x: auto;
    border-block: 1px solid #dce5ef;
    scrollbar-width: none;
  }

  body:not(.home) .profile-jump-nav::-webkit-scrollbar,
  body:not(.home) .condition-jump-nav::-webkit-scrollbar { display: none; }

  body:not(.home) .profile-jump-nav span,
  body:not(.home) .profile-jump-nav a,
  body:not(.home) .condition-jump-nav span,
  body:not(.home) .condition-jump-nav a {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid #d2deeb;
    border-radius: 999px;
    background: #fff;
    font-size: 11px;
    line-height: 1.35;
  }

  body:not(.home) .profile-jump-nav span,
  body:not(.home) .condition-jump-nav span {
    background: #edf4fb;
    color: #234f88;
    font-weight: 800;
  }

  /* Clinic directory */
  body.post-type-archive-atlas_clinic .directory-intro {
    padding-block: 26px 18px;
  }

  body.post-type-archive-atlas_clinic .directory-intro h1 {
    font-size: 34px;
    line-height: 1.08;
  }

  body.post-type-archive-atlas_clinic .directory-paths {
    grid-template-columns: 1fr;
  }

  body.post-type-archive-atlas_clinic .filter-form,
  body.post-type-archive-atlas_clinic .selected-filters {
    padding: 16px;
    border-radius: 12px;
  }

  body.post-type-archive-atlas_clinic .filters,
  body.post-type-archive-atlas_clinic .filters.filters-primary {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  body.post-type-archive-atlas_clinic .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  body.post-type-archive-atlas_clinic .filter-actions .btn { width: 100%; }

  body.post-type-archive-atlas_clinic .atlas-map-shell {
    margin-inline: calc(var(--mobile-page-gutter) * -1);
    border-radius: 0;
  }

  body.post-type-archive-atlas_clinic .atlas-map-canvas { height: 340px; }

  body.post-type-archive-atlas_clinic .results-heading {
    align-items: flex-start;
    gap: 7px;
    flex-direction: column;
  }

  body.post-type-archive-atlas_clinic .clinic-results .clinic-card {
    border-radius: var(--mobile-card-radius);
  }

  /* Individual clinic profiles */
  body.single-atlas_clinic .profile-intro {
    padding-top: 12px;
  }

  body.single-atlas_clinic .clinic-profile-hero {
    display: block;
  }

  body.single-atlas_clinic .clinic-profile-hero-main {
    border-radius: var(--mobile-card-radius);
    box-shadow: 0 12px 32px rgba(21, 48, 72, .09);
  }

  body.single-atlas_clinic .clinic-profile-visual,
  body.single-atlas_clinic .clinic-profile-visual.has-photo img,
  body.single-atlas_clinic .clinic-profile-visual-placeholder {
    min-height: 230px;
    max-height: 300px;
  }

  body.single-atlas_clinic .clinic-profile-hero-copy {
    padding: 23px 19px 24px;
  }

  body.single-atlas_clinic .profile-intro .clinic-profile-title-row h1 {
    font-size: 32px;
    line-height: 1.06;
  }

  body.single-atlas_clinic .clinic-profile-primary-actions,
  body.single-atlas_clinic .profile-save-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  body.single-atlas_clinic .clinic-profile-primary-actions .btn { width: 100%; }

  body.single-atlas_clinic .clinic-profile-primary-actions > span,
  body.single-atlas_clinic .profile-save-row > span { max-width: none; }

  body.single-atlas_clinic .clinic-location-actions {
    display: grid;
    gap: 0;
    margin-top: 17px;
    padding-top: 0;
    border: 1px solid #d8e3ed;
    border-radius: 12px;
    background: #fff;
  }

  body.single-atlas_clinic .clinic-location-actions > * {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
  }

  body.single-atlas_clinic .clinic-location-actions > * + * { border-top: 1px solid #e3e9ef; }
  body.single-atlas_clinic .google-review-summary { border: 0; border-radius: 0; }

  body.single-atlas_clinic .profile-content section {
    margin-bottom: var(--mobile-section-space);
    padding-bottom: var(--mobile-section-space);
  }

  body.single-atlas_clinic .profile-content h2 { font-size: 28px; }

  body.single-atlas_clinic .fact-grid,
  body.single-atlas_clinic .sunridge-care-grid,
  body.single-atlas_clinic .clinic-research-detail-grid {
    grid-template-columns: 1fr;
  }

  /* Cancer and treatment libraries */
  body.post-type-archive-atlas_condition .condition-library-intro,
  body.post-type-archive-atlas_treatment .treatment-library-intro {
    min-height: 0;
    margin-top: 14px;
    padding: 25px 19px;
  }

  body.post-type-archive-atlas_condition .condition-library-intro::before,
  body.post-type-archive-atlas_treatment .treatment-library-intro::before {
    left: 48%;
    opacity: .36;
  }

  body.post-type-archive-atlas_condition .condition-library-intro::after,
  body.post-type-archive-atlas_treatment .treatment-library-intro::after {
    background: linear-gradient(90deg, #f7fbff 0%, #f7fbff 62%, rgba(247,251,255,.8) 82%, rgba(247,251,255,.25) 100%);
  }

  body.post-type-archive-atlas_condition .condition-library-intro h1,
  body.post-type-archive-atlas_treatment .treatment-library-intro h1 {
    max-width: 94%;
    font-size: 34px;
  }

  body.post-type-archive-atlas_condition .condition-intro-values,
  body.post-type-archive-atlas_treatment .treatment-intro-values {
    max-width: 92%;
  }

  body.post-type-archive-atlas_condition .condition-search,
  body.post-type-archive-atlas_treatment .treatment-library-search {
    padding: 14px;
    border-radius: 12px;
  }

  body.post-type-archive-atlas_condition .condition-system-nav,
  body.post-type-archive-atlas_treatment .treatment-category-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.post-type-archive-atlas_condition .condition-system-nav a,
  body.post-type-archive-atlas_treatment .treatment-category-nav a {
    flex: 0 0 auto;
    min-height: 44px;
  }

  body.post-type-archive-atlas_condition .condition-name-index,
  body.post-type-archive-atlas_treatment .treatment-name-index {
    padding: 20px 17px;
    border-radius: 12px;
  }

  body.single-atlas_condition .condition-intro-with-callback { grid-template-columns: 1fr; }
  body.single-atlas_condition .condition-hero-callback { display: none; }
  body.single-atlas_condition .condition-intro h1 { font-size: 34px; line-height: 1.06; }
  body.single-atlas_condition .condition-hero-image { min-height: 230px; border-radius: var(--mobile-card-radius); }
  body.single-atlas_condition .condition-content h2,
  body.single-atlas_treatment .profile-content h2 { font-size: 28px; }

  body.single-atlas_condition .condition-featured-clinic,
  body.single-atlas_treatment .treatment-featured-clinic {
    border-radius: var(--mobile-card-radius);
  }

  /* Resource hub and articles */
  body.page-resources .resources-hero {
    grid-template-columns: 1fr;
    padding-block: 27px 22px;
  }

  body.page-resources .resources-hero-copy { padding-top: 0; }
  body.page-resources .resources-hero-copy h1 { font-size: 36px; }
  body.page-resources .resources-hero-links { grid-template-columns: 1fr; }
  body.page-resources .resources-welcome,
  body.page-resources .resource-group,
  body.page-resources .resource-callout { padding: 20px 18px; border-radius: var(--mobile-card-radius); }
  body.page-resources .resource-links { grid-template-columns: 1fr; }

  body.blog .article-library-hero,
  body.single-post .article-single-hero {
    padding-block: 34px 32px;
  }

  body.blog .article-library-hero h1,
  body.single-post .article-single-hero h1 {
    font-size: 38px;
    line-height: 1.02;
  }

  body.single-post .article-single-hero-grid { gap: 24px; }
  body.single-post .article-single-hero figure { border-radius: var(--mobile-card-radius); }
  body.single-post .article-deck { font-size: 17px; }
  body.single-post .article-byline { margin-top: 18px; }
  body.single-post .article-body { font-size: 16px; line-height: 1.72; }
  body.single-post .article-body h2 { font-size: 28px; }
  body.single-post .resource-share {
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  body.single-post .resource-share > div {
    flex-wrap: nowrap;
    max-width: 100%;
    padding-bottom: 3px;
    overflow-x: auto;
  }

  body.single-post .resource-share button,
  body.single-post .resource-share a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.single-post .article-single-aside > div:not(.inquiry-card) {
    position: static;
    padding: 22px;
    border-radius: var(--mobile-card-radius);
  }

  body.blog .article-card { border-radius: var(--mobile-card-radius); }

  /* About, practitioner, location and ordinary information pages */
  body.page-about .about-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  body.page-about .about-heading { padding-block: 0; }
  body.page-about .about-hero-visual { min-height: 260px; }
  body.page-about .about-proof { grid-template-columns: 1fr; margin-bottom: 34px; }
  body.page-about .about-principle-grid,
  body.page-about .about-aside { grid-template-columns: 1fr; }

  body.post-type-archive-atlas_practitioner .practitioner-hero,
  body.single-atlas_practitioner .practitioner-profile-hero { padding-block: 31px; }
  body.post-type-archive-atlas_practitioner .practitioner-hero h1,
  body.single-atlas_practitioner .practitioner-profile-hero h1 { font-size: 36px; }
  body.post-type-archive-atlas_practitioner .practitioner-card { border-radius: 12px; }

  body.page-locations .location-grid { grid-template-columns: 1fr; }
  body.page-locations .location-search-context { margin-top: 30px; padding: 22px 18px; }

  body.page-find-a-clinic .finder-hero { padding-block: 31px 34px; }
  body.page-find-a-clinic .finder-hero h1 { font-size: 38px; }
  body.page-find-a-clinic .finder-callback-card { margin-inline: 0; }
  body.page-find-a-clinic .finder-intake-intro,
  body.page-find-a-clinic .finder-intake-form { padding-inline: 18px; }
  body.page-find-a-clinic .finder-process { padding-block: 42px; }
  body.page-find-a-clinic .finder-process-heading h2 { font-size: 33px; }
  body.page-find-a-clinic .finder-coverage { grid-template-columns: 1fr; }
  body.page-find-a-clinic .finder-coverage div,
  body.page-find-a-clinic .finder-coverage div + div {
    padding: 16px 0;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.2);
  }
  body.page-find-a-clinic .finder-map-section .atlas-map-canvas { height: 320px; }

  body:not(.home) .prose > :first-child { margin-top: 0; }
  body:not(.home) .prose img { height: auto; border-radius: 10px; }
  body:not(.home) .table-scroll { margin-inline: calc(var(--mobile-page-gutter) * -1); padding-inline: var(--mobile-page-gutter); }
}

@media (max-width: 390px) {
  :root { --mobile-page-gutter: 15px; }

  body:not(.home) .page-intro h1,
  body:not(.home) .profile-intro h1,
  body:not(.home) .about-heading h1,
  body.single-atlas_clinic .profile-intro .clinic-profile-title-row h1 {
    font-size: 30px;
  }

  body.post-type-archive-atlas_clinic .filter-actions { grid-template-columns: 1fr; }
  body.single-atlas_clinic .clinic-profile-visual,
  body.single-atlas_clinic .clinic-profile-visual.has-photo img,
  body.single-atlas_clinic .clinic-profile-visual-placeholder { min-height: 205px; }
}
