/* Shared public pages. Interactive viewers keep their own image palettes. */
.apple-design {
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --serif: var(--sans);
  --color-text: #25232a;
  --color-muted: #56535d;
  --color-surface: #fff;
  --color-surface-soft: #f5f4f6;
  --color-surface-hover: #f2eaed;
  --color-border: #e1dee3;
  --color-control-border: #827985;
  --color-focus: #762742;
  --color-table-head: #f4edf0;
  --radius-small: .52rem;
  --radius-panel: 1rem;
  --font-body: 1rem;
  --line-body: 1.65;
  --portal-heading: #25212a;
  --portal-paper: #f8f7f9;
  --portal-card-shadow: 0 2px 9px rgb(37 29 43 / 5%);
  --portal-lift-shadow: 0 5px 20px rgb(37 29 43 / 10%);
  --portal-display: clamp(2.15rem, 4.8vw, 4rem);
  --portal-title: clamp(2rem, 3.7vw, 3.4rem);
  font-optical-sizing: auto;
}

.apple-design .seo-breadcrumbs {
  font-size: .83rem;
  line-height: 1.45;
  margin-block: .7rem .85rem;
}
.apple-design .seo-breadcrumbs a { text-underline-offset: .18em; }
.apple-design :is(.page-head, .directory-header, .clinical-head, .ek-detail-head, .ek-index-head,
  .fw-category-head, .team-hero, .team-profile-head, .score-heading, .news-head,
  .news-article-head, .rehab-detail-head, .therapy-intro) h1 {
  max-width: 23ch;
  color: var(--portal-heading);
  font-size: var(--portal-title);
  font-weight: 720;
  letter-spacing: -.044em;
  line-height: 1.08;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.apple-design :is(.page-head, .directory-header, .news-head, .team-hero, .score-heading) h1 {
  font-size: var(--portal-display);
}
.apple-design :is(.page-head, .clinical-head, .ek-detail-head, .fw-category-head, .news-head, .news-article-head) {
  padding-block: clamp(1.45rem, 4vw, 3.45rem) clamp(1.55rem, 3vw, 2.6rem);
}
.apple-design :is(.page-head, .directory-header, .clinical-head, .ek-detail-head,
  .ek-index-head, .news-head, .fw-category-head) :is(.lead, .ek-intro) {
  max-width: 65ch;
  color: var(--color-muted);
  font-size: clamp(1rem, 1.34vw, 1.15rem);
  line-height: 1.62;
}
.apple-design :is(.page-head, .section-hero, .home-portal, .directory-header) .eyebrow {
  letter-spacing: .035em;
}
.apple-design .section-hero {
  --hero-surface: #f5f3f2;
  --hero-title: #2b2429;
  --hero-edge: #e1dadd;
}
.apple-design .section-hero--imaging {
  --hero-title: #fff;
  --hero-edge: #5c5463;
  background: #28242e;
}
.apple-design .section-hero--biomechanics {
  --hero-surface: #edf2ee;
  --hero-edge: #d5dfd8;
}
.apple-design .section-hero h1 {
  font-weight: 720;
  letter-spacing: -.049em;
}
.apple-design .section-hero--classification { border-radius: var(--radius-panel); }

/* Photo, portal search and the two learning tools form the first home section. */
.apple-design .home-cover-inner {
  min-height: clamp(370px, 36vw, 525px);
  padding-block: clamp(2.6rem, 5vw, 5.05rem) clamp(3.15rem, 5vw, 5.4rem);
}
.apple-design .home-cover h1 {
  font-size: clamp(2.7rem, 4.9vw, 4.7rem);
  font-weight: 730;
  letter-spacing: -.058em;
}
.apple-design .home-cover-lead { max-width: 37ch; line-height: 1.55; }
.apple-design .home-search {
  border-radius: .95rem;
  box-shadow: 0 .45rem 1.5rem rgb(20 12 19 / 15%);
}
.apple-design .home-search button { border-radius: .65rem; }
.apple-design .home-tools { margin-top: -1.75rem; }
.apple-design .home-tool {
  border-radius: 1.05rem;
  border-color: #e4dfe4;
  box-shadow: var(--portal-card-shadow);
  min-height: 7rem;
}
.apple-design .home-tool-photo { border-radius: .61rem; }
.apple-design .home-tool-copy strong { letter-spacing: -.035em; }
.apple-design .home-tool-arrow { background: #f2edf0; }
.apple-design #home-access-title { color: var(--portal-heading); }
.apple-design .home-topics { background: var(--portal-paper); }
.apple-design :is(.home-topic, .home-service, .home-feature, .home-atlas-card) { border-radius: .95rem; }

/* Apply the same controls and feedback to search, filters and directory cards. */
.apple-design :is(.directory-controls, .search-shell, .ek-search, .score-page)
  :is(input[type="search"], input[type="text"], select, textarea) {
  border-radius: .62rem;
}
.apple-design .ek-search-form { border-radius: .82rem; }
.apple-design .ek-search-form :is(.ek-search-submit, .ek-search-clear) { border-radius: .6rem; }
.apple-design :is(.directory-view, .atlas-categories, .ek-search-filters, .search-filters)
  button { border-radius: .62rem; min-height: 2.55rem; }
.apple-design :is(.button, button.filter-reset, .section-hero-action) { border-radius: .58rem; }
.apple-design :is(.home-path, .home-tool, .atlas-entry, .condition-card, .directory-results .article-row,
  .rehab-card, .news-card, .team-card, .team-location, .fw-domain-card, .fw-guide-card,
  .therapy-card, .ek-route-card, .ek-foundation-card, .ek-method-card) {
  border-radius: var(--radius-panel);
  overflow-wrap: anywhere;
}
.apple-design :is(.atlas-entry, .condition-card, .directory-results .article-row,
  .rehab-card, .news-card, .team-card, .fw-domain-card, .fw-guide-card,
  .therapy-card, .ek-route-card, .ek-foundation-card, .ek-method-card) {
  box-shadow: var(--portal-card-shadow);
}
.apple-design :is(a.home-path, a.home-tool, a.home-atlas-card, a.atlas-entry, a.news-card,
  a.team-card, a.fw-domain-card, a.fw-guide-card, a.ek-route-card, a.ek-foundation-card,
  a.ek-method-card, a.button, button.filter-reset, .section-hero-action, .home-search button,
  .directory-view button, .atlas-categories button, .ek-search-submit, .ek-search-filters button) {
  transition: background-color .14s, border-color .14s, box-shadow .14s, transform .14s;
}
@media (hover: hover) {
  .apple-design :is(a.home-path, a.home-tool, a.home-atlas-card, a.atlas-entry, a.news-card,
    a.team-card, a.fw-domain-card, a.fw-guide-card, a.ek-route-card, a.ek-foundation-card,
    a.ek-method-card):hover { box-shadow: var(--portal-lift-shadow); }
}
.apple-design :is(a.home-path, a.home-tool, a.home-atlas-card, a.atlas-entry, a.news-card,
  a.team-card, a.fw-domain-card, a.fw-guide-card, a.ek-route-card, a.ek-foundation-card,
  a.ek-method-card, a.button, button.filter-reset, .section-hero-action, .home-search button,
  .directory-view button, .atlas-categories button, .ek-search-submit, .ek-search-filters button)
  :where(svg, img) { flex-shrink: 0; }
@media (prefers-reduced-motion: no-preference) {
  .apple-design :is(a.home-path, a.home-tool, a.home-atlas-card, a.atlas-entry, a.news-card,
    a.team-card, a.fw-domain-card, a.fw-guide-card, a.ek-route-card, a.ek-foundation-card,
    a.ek-method-card, a.button, button.filter-reset, .section-hero-action, .home-search button,
    .directory-view button, .atlas-categories button, .ek-search-submit, .ek-search-filters button):active:not(:disabled) {
    transform: scale(.985);
    transition-duration: 0s;
  }
}

/* Keep prose, controls and medical figures on stable, legible surfaces. */
.apple-design :is(.clinical-article, .ek-article, .therapy-article, .news-article) {
  font-size: clamp(1rem, .97rem + .18vw, 1.1rem);
  line-height: 1.68;
}
.apple-design :is(.clinical-article, .ek-article, .therapy-article, .news-article) :is(h2, h3) {
  color: var(--portal-heading);
  letter-spacing: -.028em;
  line-height: 1.2;
  text-wrap: balance;
}
.apple-design :is(.clinical-article, .ek-article) :is(.article-section, .ek-article-section) > p {
  max-width: 74ch;
}
.apple-design :is(.clinical-article, .ek-article, .therapy-article, .news-article) p a {
  text-underline-offset: .18em;
}
.apple-design :is(.clinical-article, .ek-article) :is(.ek-takeaways, .fw-takeaways, .medical-keypoints) {
  border-radius: var(--radius-panel);
}
.apple-design :is(.ek-toc, .medical-toc) nav a { border-radius: .38rem; }
.apple-design :is(.ek-table-scroll, .table-wrap, .table-scroll) {
  border-radius: var(--radius-small);
  overscroll-behavior-inline: contain;
}
.apple-design :is(.ek-figure, .medical-figure) { border-radius: .65rem; }
.apple-design :is(.ek-figure, .medical-figure) figcaption {
  font-size: .875rem;
  line-height: 1.5;
}
.apple-design .xr { border-radius: .9rem; }
.apple-design .xr :is([data-xray-expand], [data-xray-reset], [data-xray-label]) {
  min-height: 2.75rem;
  border-radius: .52rem;
}
.apple-design .xr [data-xray-label]:active { background: #e6f2ee; }
.apple-design .xr [data-xray-expand]:active { background: #39474e; }
.apple-design main :where(a, button, input, select, textarea, summary):focus-visible {
  outline-offset: 3px;
}

@media (max-width: 740px) {
  .apple-design {
    --portal-display: clamp(2rem, 7.1vw, 2.8rem);
    --portal-title: clamp(1.85rem, 6.4vw, 2.65rem);
  }
  .apple-design .seo-breadcrumbs { margin-block: .5rem .55rem; }
  .apple-design :is(.page-head, .clinical-head, .ek-detail-head, .fw-category-head, .news-head, .news-article-head) {
    padding-block: 1.35rem 1.5rem;
  }
}
@media (max-width: 700px) {
  .apple-design .home-cover-inner {
    min-height: 0;
    padding-block: clamp(140px, 43vw, 213px) 1.5rem;
  }
  .apple-design .home-cover h1 { font-size: clamp(2.05rem, 7.1vw, 3.05rem); }
  .apple-design .home-tools { margin-top: .8rem; }
  .apple-design .home-tool { min-height: 0; border-radius: .88rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .apple-design main :where(a, button, input, select, summary),
  .apple-design main :where(a, button, input, select, summary):active {
    scroll-behavior: auto;
    transition-duration: 0s;
  }
}
@media (prefers-contrast: more) {
  .apple-design {
    --color-muted: #34303a;
    --color-border: #8c858f;
    --color-control-border: #544854;
    --portal-card-shadow: none;
    --portal-lift-shadow: none;
  }
}
@media print {
  .apple-design { --portal-display: 24pt; --portal-title: 22pt; }
  .apple-design :is(.home-tool, .atlas-entry, .rehab-card, .news-card, .team-card) { box-shadow: none; }
}
