/* Doctors' public pages (/dr/…, HTML made by server/doctor-pages.js; no scripts, no data-theme: light and dark follow the OS).
 * iPhone / iPad / Mac look of the patient app (web/src/app/ios/base.css, contract .ai/ios-panels-plan.md): the brand's emerald
 * gradient page, one white grouped section per block (radius 24, no shadow), a large title, capsule buttons, a Contacts-style
 * index and an Apple-News-style article. These pages have no data-entry hook, so the rules are plain .dp-* selectors; the
 * token blocks below port the patient tokens with the same values under a --dp- prefix (tokens.css is only read for the tone
 * pairs and the motion curves). Sections: tokens, page, top bar, layout, sections, hero, text, rows, article, mini card,
 * empty states, footer, interaction, responsive, accessibility, print.
 */
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/css/vazirmatn.woff2') format('woff2'); }

/* ---------------------------------------------------------------- tokens: light */
:root {
  --dp-font: -apple-system, BlinkMacSystemFont, 'SF Arabic', Vazirmatn, system-ui, sans-serif;
  /* page, sections, text (patient --ios-bg, --ios-card, --ios-label…) */
  --dp-bg: #f2f5f4;
  --dp-a1: rgba(52, 211, 153, 0.55); --dp-a2: rgba(56, 189, 248, 0.32); --dp-a3: rgba(167, 139, 250, 0.24);
  --dp-aurora: radial-gradient(60% 46% at 92% 4%, var(--dp-a1), transparent 72%), radial-gradient(54% 42% at 4% 38%, var(--dp-a2), transparent 72%), radial-gradient(64% 50% at 60% 102%, var(--dp-a3), transparent 74%);
  --dp-card: #ffffff;
  --dp-card-2: #f2f2f7;
  --dp-label: #000000;
  --dp-label-2: #636366;
  --dp-label-3: #aeaeb2;
  /* secondary text straight on the gradient (its greenest corner is darker than the plain page, so a shade deeper than label-2) */
  --dp-sub: #48484a;
  --dp-sep: rgba(60, 60, 67, 0.29);
  --dp-fill-2: rgba(118, 118, 128, 0.12);
  --dp-fill-press: rgba(0, 0, 0, 0.08);
  /* the one accent; tint-ink is the shade for small text on the gradient or on the tinted fill (4.5:1 there) */
  --dp-tint: #047857;
  --dp-on-tint: #ffffff;
  --dp-tint-soft: rgba(4, 120, 87, 0.12);
  --dp-tint-ink: #065f46;
  /* material of the top bar, a photo's lift, shape */
  --dp-bar: rgba(242, 242, 247, 0.8);
  --dp-blur: blur(22px) saturate(180%);
  --dp-photo-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.28);
  --dp-r-group: 24px;
  /* type scale (rem: on iPhone and iPad the root follows Dynamic Type, see the end of the page block) */
  --dp-t-large: 2rem;
  --dp-t-title3: 1.25rem;
  --dp-t-body: 1rem;
  --dp-t-subhead: 0.9375rem;
  --dp-t-footnote: 0.8125rem;
  --dp-t-caption: 0.75rem;
  --dp-bar-h: 3.5rem;
}

/* ---------------------------------------------------------------- tokens: dark (OS preference) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --dp-bg: #050a09;
    --dp-a1: rgba(52, 211, 153, 0.24); --dp-a2: rgba(56, 189, 248, 0.14); --dp-a3: rgba(167, 139, 250, 0.11);
    --dp-card: #1c1c1e;
    --dp-card-2: #2c2c2e;
    --dp-label: #ffffff;
    --dp-label-2: #aeaeb2;
    --dp-label-3: #636366;
    --dp-sub: #aeaeb2;
    --dp-sep: rgba(84, 84, 88, 0.65);
    --dp-fill-2: rgba(118, 118, 128, 0.24);
    --dp-fill-press: rgba(255, 255, 255, 0.1);
    --dp-tint: #34d399;
    --dp-on-tint: #03251b;
    --dp-tint-soft: rgba(52, 211, 153, 0.16);
    --dp-tint-ink: #6ee7b7;
    --dp-bar: rgba(0, 0, 0, 0.72);
    --dp-photo-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.8);
  }
}

/* more contrast: darker secondary text, stronger hairlines and fills, a deeper tint (later than the dark block, same specificity) */
@media (prefers-contrast: more) {
  :root:root {
    --dp-label-2: #48484a; --dp-label-3: #8e8e93; --dp-sub: #3a3a3c; --dp-sep: rgba(60, 60, 67, 0.6);
    --dp-fill-2: rgba(118, 118, 128, 0.22);
    --dp-tint: #065f46; --dp-tint-soft: rgba(6, 95, 70, 0.16); --dp-tint-ink: #064e3b;
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --dp-label-2: #d1d1d6; --dp-label-3: #8e8e93; --dp-sub: #d1d1d6; --dp-sep: rgba(235, 235, 245, 0.45);
    --dp-fill-2: rgba(118, 118, 128, 0.36);
    --dp-tint: #6ee7b7; --dp-tint-soft: rgba(110, 231, 183, 0.2); --dp-tint-ink: #a7f3d0;
  }
}

/* ---------------------------------------------------------------- page */
*, *::before, *::after { box-sizing: border-box; }
html { background-color: var(--dp-bg); font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* iPhone and iPad: the root takes the reader's Dynamic Type size, so every rem follows it (touch only: on a Mac the same keyword is the small 13px desktop size) */
@media (pointer: coarse) {
  @supports (font: -apple-system-body) { html { font: -apple-system-body; } }
}
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--dp-label);
  font-family: var(--dp-font); font-size: 1rem; font-weight: 400; line-height: 1.75; -webkit-font-smoothing: antialiased;
}
/* the emerald gradient stays pinned to the screen while the page scrolls (fixed backgrounds are ignored on iOS, a fixed layer is not) */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--dp-aurora), var(--dp-bg); pointer-events: none; }
a { color: var(--dp-tint-ink); -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
/* a photo that is still loading (or failed) shows a quiet fill and a small alt text instead of a hole */
:is(.dp-photo, .dp-cover, .dp-list img, .dp-byline img, .dp-gallery img) { background-color: var(--dp-card-2); color: var(--dp-label-2); font-size: var(--dp-t-caption); line-height: 1.3; }

/* ---------------------------------------------------------------- top bar: translucent material, a hairline once content scrolls under it */
.dp-top {
  position: sticky; inset-block-start: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: var(--dp-bar-h); margin: 0; padding-block: 6px; padding-inline: max(16px, calc((100% - 720px) / 2));
  background: var(--dp-bar); -webkit-backdrop-filter: var(--dp-blur); backdrop-filter: var(--dp-blur);
}
.dp-top::after { content: ''; position: absolute; inset-inline: 0; inset-block-end: 0; height: 0.5px; background: var(--dp-sep); pointer-events: none; }
/* where the page's own scroll can drive an animation, the hairline fades in over the first 48px; elsewhere it is always there */
@supports (animation-timeline: scroll()) {
  .dp-top::after { opacity: 0; animation: dp-bar-line linear both; animation-timeline: scroll(root block); animation-range: 0 48px; }
}
@keyframes dp-bar-line { to { opacity: 1; } }
.dp-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--dp-label); font-size: 1.0625rem; font-weight: 700; line-height: 1.3; text-decoration: none; }
/* the logo file is the wide lockup (icon, name, tagline) on white; the markup squeezes it into a square, so the icon alone is cut out of it:
   the file is 236×132 and the icon sits at 14,24 and is 84px square, scaled here to 32px (84px → 32px = ×0.381) */
.dp-brand img { display: none; }
.dp-brand::before {
  content: ''; flex: none; width: 32px; height: 32px; border-radius: 22.37%;
  background: var(--dp-card-2) url('/assets/img/logo.webp') no-repeat -5.33px -9.14px / 89.9px 50.3px;
}
.dp-all {
  position: relative; display: inline-flex; align-items: center; flex: none; min-height: 36px; padding-inline: 14px; border-radius: 999px;
  background: var(--dp-tint-soft); color: var(--dp-tint-ink); font-size: var(--dp-t-subhead); font-weight: 600; line-height: 1.3; text-decoration: none; white-space: nowrap;
  transition: transform 320ms var(--spring, cubic-bezier(0.22, 1.12, 0.36, 1)), opacity 200ms ease;
}
/* 36px to the eye, 44px to the finger */
.dp-all::before { content: ''; position: absolute; inset: -4px 0; }

/* ---------------------------------------------------------------- layout: one centred 720px column */
.dp { display: grid; align-content: start; gap: 24px; width: min(100% - 32px, 720px); margin-inline: auto; padding-block: 8px 24px; overflow-wrap: anywhere; }
.dp > * { min-width: 0; margin: 0; }
.dp-crumbs { display: flex; flex-wrap: wrap; align-items: center; margin-block-end: -8px; color: var(--dp-sub); font-size: var(--dp-t-footnote); line-height: 1.6; }
.dp-crumbs a { color: var(--dp-tint-ink); text-decoration: none; }
.dp-crumbs [aria-current] { min-width: 0; max-width: 100%; overflow: hidden; color: var(--dp-label); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
/* the separator glyph is hidden and a chevron toward the line's end is drawn instead */
.dp-crumbs > [aria-hidden='true'] {
  display: inline-block; flex: none; width: 6px; height: 6px; margin-inline: 9px; font-size: 0;
  border-block-start: 1.5px solid var(--dp-label-3); border-inline-end: 1.5px solid var(--dp-label-3); border-radius: 1px;
  transform: rotate(calc(var(--flip, 1) * -45deg));
}

/* ---------------------------------------------------------------- sections: a title on the page, the content in a white group */
.dp-card { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.dp-card h1 { margin: 0; font-size: var(--dp-t-large); font-weight: 700; line-height: 1.4; text-wrap: balance; }
.dp-card h2 { margin: 0 0 8px; padding-inline: 4px; font-size: var(--dp-t-title3); font-weight: 600; line-height: 1.5; text-wrap: balance; }
.dp-card:not(.dp-article) > h1 + p { margin: 6px 0 0; color: var(--dp-sub); font-size: var(--dp-t-body); line-height: 1.7; }
/* the shared white group */
:is(.dp-facts, .dp-timeline, .dp-list, .dp-articles) { margin: 0; padding: 0; list-style: none; overflow: hidden; border-radius: var(--dp-r-group); background: var(--dp-card); }
:is(.dp-chips, .dp-gallery) { margin: 0; border-radius: var(--dp-r-group); background: var(--dp-card); }

/* ---------------------------------------------------------------- hero: a contact card on the gradient (phone: centred) */
.dp-hero { display: grid; justify-items: center; gap: 14px; text-align: center; }
.dp-photo { display: block; flex: none; width: 112px; height: 112px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--dp-card), var(--dp-photo-shadow); }
.dp-id { display: grid; justify-items: center; justify-self: stretch; gap: 4px; min-width: 0; }
.dp-id p { margin: 0; }
.dp-spec { color: var(--dp-tint-ink); font-size: 1.0625rem; font-weight: 600; line-height: 1.5; }
.dp-headline { color: var(--dp-sub); font-size: var(--dp-t-body); line-height: 1.7; }
.dp-id > .dp-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 0; }
.dp-id > .dp-badges:empty { display: none; }
.dp-badge {
  position: relative; display: inline-flex; align-items: center; min-height: 32px; padding-inline: 12px; border-radius: 999px;
  background: var(--dp-fill-2); color: var(--dp-label); font-size: var(--dp-t-footnote); font-weight: 500; line-height: 1.4; text-decoration: none;
}
.dp-badge.ok { background: var(--tone-ok-bg); color: var(--tone-ok-ink); }
a.dp-badge { background: var(--dp-tint-soft); color: var(--dp-tint-ink); }
/* 32px to the eye, 44px to the finger */
a.dp-badge::before { content: ''; position: absolute; inset: -6px -4px; }
.dp-facts { justify-self: stretch; text-align: start; font-variant-numeric: tabular-nums; }
.dp-facts li { position: relative; padding: 14px 16px; font-size: var(--dp-t-body); line-height: 1.5; }
.dp-facts li + li::before, .dp-timeline li + li::before { content: ''; position: absolute; inset-block-start: 0; inset-inline: 16px 0; height: 0.5px; background: var(--dp-sep); }
.dp-facts b { font-weight: 600; }
.dp-facts small { color: var(--dp-label-2); font-size: var(--dp-t-footnote); }
/* the call to action: a capsule, flat tint, springs on press */
.dp-cta {
  display: flex; align-items: center; justify-content: center; justify-self: stretch; min-height: 50px; padding-inline: 22px; border: 0; border-radius: 999px;
  background: var(--dp-tint); color: var(--dp-on-tint); font-size: 1.0625rem; font-weight: 600; line-height: 1.3; text-align: center; text-decoration: none;
  transition: transform 320ms var(--spring, cubic-bezier(0.22, 1.12, 0.36, 1)), opacity 200ms ease, background-color 200ms ease;
}
/* the doctor's own site: a quieter capsule under the call to action */
.dp-site {
  display: flex; align-items: center; justify-content: center; justify-self: stretch; min-height: 50px; margin-block-start: -6px; padding-inline: 22px; border-radius: 999px;
  background: var(--dp-tint-soft); color: var(--dp-tint-ink); font-size: 1.0625rem; font-weight: 600; line-height: 1.3; text-align: center; text-decoration: none;
  transition: transform 320ms var(--spring, cubic-bezier(0.22, 1.12, 0.36, 1)), opacity 200ms ease, background-color 200ms ease;
}

/* ---------------------------------------------------------------- text blocks */
.dp-card:not(.dp-hero) > .dp-text { padding: 16px 18px; border-radius: var(--dp-r-group); background: var(--dp-card); }
.dp-text { line-height: 1.9; }
.dp-card .dp-text > :first-child { margin-block-start: 0; }
.dp-card .dp-text > :last-child { margin-block-end: 0; }
.dp-text p { margin: 0 0 1em; text-wrap: pretty; }
.dp-card .dp-text h2 { margin: 1.5em 0 0.4em; padding-inline: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.6; }
.dp-text h3 { margin: 1.3em 0 0.4em; font-size: 1.0625rem; font-weight: 600; line-height: 1.6; }
.dp-text ul { margin: 0 0 1em; padding-inline-start: 1.4em; }
.dp-text li { margin-block: 0.3em; }
.dp-text li::marker { color: var(--dp-tint-ink); }
.dp-text a { color: var(--dp-tint-ink); text-decoration: underline; text-decoration-thickness: from-font; text-underline-offset: 0.2em; }
.dp-text strong { font-weight: 700; }
.dp-text img { display: block; max-width: 100%; height: auto; margin: 1.2em auto; border-radius: 18px; }

/* education: rows with the year at the end */
.dp-timeline li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 12px 16px; line-height: 1.5; }
.dp-timeline li > :not(small) { grid-column: 1; }
.dp-timeline b { font-weight: 600; }
.dp-timeline span { color: var(--dp-label-2); font-size: var(--dp-t-footnote); }
.dp-timeline small { grid-column: 2; grid-row: 1 / span 2; color: var(--dp-label-2); font-size: var(--dp-t-footnote); font-variant-numeric: tabular-nums; }

/* insurances and languages: two groups side by side where there is room */
.dp-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 24px 16px; }
.dp-two > div { min-width: 0; }
.dp-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; }
.dp-chips span { display: inline-flex; align-items: center; min-height: 32px; padding-inline: 14px; border-radius: 999px; background: var(--dp-fill-2); color: var(--dp-label); font-size: var(--dp-t-subhead); font-weight: 500; line-height: 1.4; }

.dp-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 8px; padding: 8px; }
.dp-gallery img { display: block; width: 100%; aspect-ratio: 1; border-radius: 16px; object-fit: cover; }

/* ---------------------------------------------------------------- rows: the doctors index (Contacts) and a doctor's articles (Notes) */
:is(.dp-list, .dp-articles) a {
  position: relative; display: grid; align-items: center; padding-block: 10px; padding-inline: 16px 44px; color: var(--dp-label); text-decoration: none;
  transition: background-color 280ms ease;
}
/* the hairline starts at the text */
:is(.dp-list, .dp-articles) li + li a::before { content: ''; position: absolute; inset-block-start: 0; inset-inline: 16px 0; height: 0.5px; background: var(--dp-sep); pointer-events: none; }
.dp-list li + li a::before { inset-inline-start: 76px; }
/* disclosure chevron toward the line's end */
:is(.dp-list, .dp-articles) a::after {
  content: ''; position: absolute; inset-block-start: 50%; inset-inline-end: 18px; width: 8px; height: 8px;
  border-block-start: 2px solid var(--dp-label-3); border-inline-end: 2px solid var(--dp-label-3); border-radius: 1px;
  transform: translateY(-50%) rotate(calc(var(--flip, 1) * -45deg));
}
:is(.dp-list, .dp-articles) a:focus-visible { outline-offset: -3px; }

.dp-list a { grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; min-height: 68px; }
.dp-list img { display: block; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.dp-list span { display: grid; min-width: 0; }
.dp-list b { font-size: var(--dp-t-body); font-weight: 600; line-height: 1.5; }
.dp-list small { color: var(--dp-label-2); font-size: var(--dp-t-footnote); line-height: 1.5; }

.dp-articles a { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-block: 12px; }
.dp-articles b { font-size: var(--dp-t-body); font-weight: 600; line-height: 1.5; }
.dp-articles span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; color: var(--dp-label-2); font-size: var(--dp-t-subhead); line-height: 1.6; }
.dp-articles small { color: var(--dp-label-2); font-size: var(--dp-t-footnote); line-height: 1.5; }

/* ---------------------------------------------------------------- article: one white sheet, a full-width cover, a 40em reading column */
.dp-article { --dp-pad: clamp(18px, 5vw, 32px); overflow: hidden; padding-block-end: var(--dp-pad); border-radius: var(--dp-r-group); background: var(--dp-card); }
.dp-article > :not(.dp-cover) { width: calc(100% - 2 * var(--dp-pad)); max-inline-size: 40em; margin-inline: auto; }
.dp-cover { display: block; width: 100%; max-height: 360px; aspect-ratio: 16 / 9; border-radius: 0; object-fit: cover; }
.dp-article > h1 { margin-block: var(--dp-pad) 12px; font-size: clamp(1.625rem, 1.3rem + 1.3vw, 2rem); line-height: 1.5; }
.dp-byline { display: flex; align-items: center; gap: 12px; margin-block: 0 20px; color: var(--dp-label-2); font-size: var(--dp-t-subhead); line-height: 1.5; }
.dp-byline img { display: block; flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.dp-byline > span { display: grid; min-width: 0; }
.dp-byline small { font-size: var(--dp-t-footnote); }
.dp-byline a { position: relative; color: var(--dp-label); font-weight: 600; text-decoration: none; }
.dp-byline a::before { content: ''; position: absolute; inset-inline: -4px; inset-block: min(0px, calc((100% - 44px) / 2)); }
.dp-lead { margin-block: 0 20px; color: var(--dp-label); font-size: 1.125rem; font-weight: 600; line-height: 1.9; text-wrap: pretty; }
.dp-article .dp-text { font-size: 1.0625rem; line-height: 2; }
.dp-note { margin-block: 28px 0; padding: 12px 14px; border-radius: 16px; background: var(--tone-warn-bg); color: var(--tone-warn-ink); font-size: var(--dp-t-footnote); line-height: 1.7; }

/* ---------------------------------------------------------------- the author card at the end of an article (a smaller .dp-hero, one white row) */
.dp-hero.dp-mini {
  grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; justify-items: stretch; column-gap: 14px; row-gap: 12px;
  padding: 16px; border-radius: var(--dp-r-group); background: var(--dp-card); text-align: start;
}
.dp-mini .dp-photo { width: 56px; height: 56px; box-shadow: none; }
.dp-mini .dp-id { justify-items: start; gap: 0; }
.dp-mini .dp-id b { font-size: var(--dp-t-body); font-weight: 600; line-height: 1.5; }
.dp-mini .dp-spec { font-size: var(--dp-t-subhead); font-weight: 400; color: var(--dp-label-2); }
.dp-mini .dp-cta { justify-self: auto; min-height: 44px; padding-inline: 20px; font-size: var(--dp-t-subhead); }

/* ---------------------------------------------------------------- empty states (404, gone): a title, a line, a capsule, centred */
.dp-card:not(.dp-hero):has(> .dp-cta) { display: grid; justify-items: center; gap: 4px; padding: 56px 8px 24px; text-align: center; }
.dp-card:not(.dp-hero):has(> .dp-cta) > .dp-cta { justify-self: center; min-width: min(240px, 100%); margin-block-start: 20px; }

/* ---------------------------------------------------------------- footer */
.dp-foot { width: min(100% - 32px, 720px); margin-inline: auto; padding-block: 16px calc(32px + env(safe-area-inset-bottom, 0px)); color: var(--dp-sub); font-size: var(--dp-t-footnote); line-height: 1.6; text-align: center; }
.dp-foot p { margin: 0 0 4px; }
.dp-foot nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; }
.dp-foot a { color: var(--dp-tint-ink); padding-inline: 6px; text-decoration: none; }

/* ---------------------------------------------------------------- interaction: press, hover (pointer devices only), focus */
.dp-cta:active, .dp-all:active, .dp-site:active { opacity: 0.7; transform: scale(0.97); transition-duration: 90ms; transition-timing-function: ease-out; }
.dp-crumbs a:active, .dp-foot a:active, .dp-byline a:active, a.dp-badge:active, .dp-brand:active { opacity: 0.6; }
@media (hover: hover) {
  .dp-cta:hover { background: color-mix(in srgb, var(--dp-tint) 88%, var(--dp-label)); }
  .dp-all:hover, .dp-site:hover { background: color-mix(in srgb, var(--dp-tint) 18%, transparent); }
  :is(.dp-list, .dp-articles) a:hover { background: color-mix(in srgb, var(--dp-fill-press) 55%, transparent); }
  .dp-crumbs a:hover, .dp-foot a:hover, .dp-text a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
  .dp-byline a:hover { color: var(--dp-tint-ink); text-decoration: underline; text-underline-offset: 0.2em; }
  a.dp-badge:hover { background: color-mix(in srgb, var(--dp-tint) 18%, transparent); }
}
:is(.dp-list, .dp-articles) a:active { background: var(--dp-fill-press); transition-duration: 0s; }
a:focus-visible { outline: 3px solid var(--dp-tint); outline-offset: 2px; }

/* ---------------------------------------------------------------- touch: 44px to the finger for the small links */
@media (pointer: coarse) {
  .dp-crumbs a, .dp-foot a { display: inline-flex; align-items: center; min-height: 44px; }
  .dp-crumbs a { padding-inline: 2px; }
}

/* ---------------------------------------------------------------- tablet and desktop: the contact card sits beside its photo */
@media (min-width: 640px) {
  .dp-hero:not(.dp-mini) { grid-template-columns: auto minmax(0, 1fr); justify-items: stretch; align-items: center; column-gap: 24px; text-align: start; }
  .dp-hero:not(.dp-mini) .dp-photo { width: 128px; height: 128px; justify-self: start; }
  .dp-hero:not(.dp-mini) .dp-id { justify-items: start; }
  .dp-hero:not(.dp-mini) .dp-id > .dp-badges { justify-content: flex-start; }
  .dp-hero:not(.dp-mini) :is(.dp-facts, .dp-cta) { grid-column: 1 / -1; }
}
/* phones: the facts group spans the card with start-aligned text, the author card's button gets its own row */
@media (max-width: 560px) {
  .dp-hero .dp-facts { justify-self: stretch; width: 100%; text-align: start; }
  .dp-hero.dp-mini { grid-template-columns: auto minmax(0, 1fr); }
  .dp-mini .dp-cta { grid-column: 1 / -1; justify-self: stretch; }
}

/* ---------------------------------------------------------------- accessibility */
@media (prefers-reduced-motion: reduce) {
  .dp-cta, .dp-all, :is(.dp-list, .dp-articles) a { transition: none; }
  .dp-cta:active, .dp-all:active { transform: none; }
}
/* reduced transparency: the bar is solid */
@media (prefers-reduced-transparency: reduce) {
  .dp-top { background: var(--dp-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dp-top { background: var(--dp-bg); }
}
/* more contrast: a visible edge on every surface and control, a solid bar (:where keeps these below the focus ring, which also draws with outline) */
@media (prefers-contrast: more) {
  .dp-top { background: var(--dp-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  :where(.dp-facts, .dp-timeline, .dp-list, .dp-articles, .dp-chips, .dp-gallery, .dp-article, .dp-mini, .dp-card:not(.dp-hero) > .dp-text, .dp-all, .dp-badge, .dp-chips span, .dp-note) { outline: 1px solid var(--dp-sep); outline-offset: -1px; }
}
/* Windows high contrast: surfaces and capsules get real borders */
@media (forced-colors: active) {
  :is(.dp-facts, .dp-timeline, .dp-list, .dp-articles, .dp-chips, .dp-gallery, .dp-article, .dp-mini, .dp-card:not(.dp-hero) > .dp-text, .dp-cta, .dp-all, .dp-badge, .dp-chips span, .dp-note) { border: 1px solid CanvasText; }
  .dp-top::after { opacity: 1; animation: none; background: CanvasText; }
}

/* ---------------------------------------------------------------- print: the article and profile as plain text */
@media print {
  /* paper is light whatever the screen theme was */
  :root:root { color-scheme: light; --dp-label: CanvasText; --dp-label-2: GrayText; --dp-sub: GrayText; --dp-tint-ink: CanvasText; --dp-sep: GrayText; }
  body::before, .dp-top, .dp-crumbs, .dp-cta, .dp-foot nav { display: none; }
  html, body { background: none; color: CanvasText; }
  .dp { width: 100%; gap: 16px; padding-block: 0; }
  :is(.dp-facts, .dp-timeline, .dp-list, .dp-articles, .dp-chips, .dp-gallery, .dp-article, .dp-mini, .dp-card:not(.dp-hero) > .dp-text) { background: none; break-inside: avoid; }
  .dp-article { overflow: visible; }
}
