/*
 * Doctors directory · Figma "Website Pages" → Doctors Directory (node 83:1129; frames 1440, 768, 390).
 * Loaded only where liv/doctor-directory renders (registered in inc/doctors.php, after clinic.css).
 * The doctor card is .liv-dcard from sections.css; the rules here are scoped to .liv-doctors (the block)
 * and to the .liv-doctors-* modifiers of the page pattern (patterns/page-doctors.php: hero, intro, closing
 * action), so the second opinion page that shares the hero keeps its own behaviour.
 * Breakpoints as elsewhere in the theme: tablet up to 1023.98px, phone up to 767.98px.
 */

/* ---------- Block: two boxes, 24px apart ---------- */
.liv-doctors { display: flex; flex-direction: column; gap: 24px; min-inline-size: 0; }
.liv-doctors__panel { display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; min-inline-size: 0; margin: 0; padding: 32px; border-radius: var(--wp--custom--radius--card); background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); }
.liv-doctors__panel.is-results { background: var(--wp--preset--color--surface-subtle); }
.liv-doctors__panel > *, .liv-doctors__body > * { margin: 0; max-inline-size: none; }
.liv-doctors__body { display: flex; flex-direction: column; gap: 16px; min-inline-size: 0; }
.liv-doctors__title { font-size: var(--wp--preset--font-size--heading-2); line-height: 1.25; font-weight: 700; -webkit-text-stroke-width: 0; letter-spacing: -0.003em; color: var(--wp--preset--color--ink); }
.liv-doctors__lead { font-size: var(--wp--preset--font-size--body); line-height: 1.55; color: var(--wp--preset--color--text-secondary); }
.liv-doctors__label { font-size: var(--wp--preset--font-size--small); line-height: 1.5; font-weight: 400; -webkit-text-stroke-width: 0; letter-spacing: 0; text-transform: uppercase; color: var(--wp--preset--color--text-secondary); }

/* ---------- Chip row (Liv / Navigation / Filter): one line that scrolls sideways ---------- */
.liv-doctors__chips { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; scroll-padding-inline: 16px; }
.liv-doctors__chips::-webkit-scrollbar { display: none; }
.liv-doctors__chips > li { flex: none; margin: 0; }
/* position: relative keeps the screen-reader prefix of a list chip ("Specialty:") inside the scrolling row. */
.liv-doctors__chip { position: relative; display: inline-flex; align-items: center; box-sizing: border-box; min-block-size: 48px; margin: 0; padding: 0 16px; border: 0; border-radius: var(--wp--custom--radius--control); background: var(--wp--preset--color--divider); color: var(--wp--preset--color--ink); font: inherit; font-size: var(--wp--preset--font-size--small); line-height: 1.5; font-weight: 400; -webkit-text-stroke-width: 0; text-decoration: none; white-space: nowrap; list-style: none; cursor: pointer; }
.liv-doctors__chip::-webkit-details-marker { display: none; }
.liv-doctors__chip::marker { content: ""; }
.liv-doctors__chip:hover { background: var(--wp--preset--color--border-subtle); color: var(--wp--preset--color--ink); text-decoration: none; }
.liv-doctors__chip.is-current { background: var(--wp--preset--color--action); color: var(--wp--preset--color--surface); }
.liv-doctors__chip.is-current:hover { background: var(--wp--preset--color--action-hover); color: var(--wp--preset--color--surface); }
/* Inset ring (the row clips an outside outline); white inner band keeps it visible on the blue chip. */
.liv-doctors__chip:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--wp--preset--color--focus), inset 0 0 0 4px var(--wp--preset--color--surface); }

/* ---------- Specialty / hospital list ----------
 * Without the script: <details> whose panel opens as a sheet at the bottom of the screen.
 * With it: the same list inside the theme dialog (.liv-dialog, interactive.css). */
.liv-doctors__menu > .liv-doctors__sheet { display: none; }
.liv-doctors__menu[open] > .liv-doctors__sheet { position: fixed; inset: auto 0 0; z-index: 1000; display: block; box-sizing: border-box; max-block-size: 70vh; padding: 24px; overflow-y: auto; border-start-start-radius: var(--wp--custom--radius--card); border-start-end-radius: var(--wp--custom--radius--card); background: var(--wp--preset--color--surface); box-shadow: 0 -12px 32px rgb(0 130 185 / 0.24); }
.liv-doctors__sheet-title { margin: 0 0 16px; padding-inline-end: 48px; font-size: var(--wp--preset--font-size--card-title); line-height: 1.35; font-weight: 700; -webkit-text-stroke-width: 0; color: var(--wp--preset--color--ink); }
.liv-doctors__options { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.liv-doctors__options > li { margin: 0; }
.liv-doctors__option { display: flex; align-items: center; box-sizing: border-box; min-block-size: var(--wp--custom--field--height); padding: 8px 16px; border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--control); background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); font-size: var(--wp--preset--font-size--body); line-height: 1.4; text-decoration: none; }
.liv-doctors__option:hover { background: var(--wp--preset--color--surface-subtle); color: var(--wp--preset--color--ink); text-decoration: none; }
.liv-doctors__option[aria-current] { background: var(--wp--preset--color--action); border-color: var(--wp--preset--color--action); color: var(--wp--preset--color--surface); }
.liv-doctors__option:focus-visible { outline: 0; box-shadow: 0 0 0 2px var(--wp--preset--color--surface), 0 0 0 4px var(--wp--preset--color--focus); }
/* Wider than the theme dialog for the two-column specialty list; below 600px it stays the full-width bottom sheet. */
@media (min-width: 600px) {
	.liv-doctors__dialog { inline-size: min(100% - 32px, 760px); }
	.liv-doctors__options.is-long { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Results: 4 columns (desktop and tablet), 1 on the phone ---------- */
.liv-doctors__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.liv-doctors__grid > li { display: flex; min-inline-size: 0; margin: 0; }
.liv-doctors__grid .liv-dcard { flex: 1; min-inline-size: 0; }
/* Portrait photo: the doctor from the head to the chest (the photos are 3:4 portraits; a wide box showed only the head). */
.liv-doctors .liv-dcard__photo { aspect-ratio: 4 / 5; block-size: auto; }
.liv-doctors .liv-dcard__photo.is-empty { display: grid; place-items: center; color: var(--wp--preset--color--border); }
.liv-doctors .liv-dcard__photo.is-empty svg { inline-size: 56px; block-size: 56px; }
/* Name: two lines at most (owner list items 15/16) but no reserved second line: the chips follow the name as drawn. */
.liv-doctors .liv-dcard__name { min-block-size: 0; }
.liv-doctors .liv-dcard__chips { margin: 0; padding: 0; list-style: none; }
.liv-doctors .liv-dcard__chip { max-inline-size: 100%; box-sizing: border-box; }
.liv-doctors .liv-dcard__chip svg { flex: none; }
.liv-doctors .liv-dcard__chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.liv-doctors__more { display: flex; margin: 0; }
.liv-doctors__prev a { color: var(--wp--preset--color--action); font-size: var(--wp--preset--font-size--small); font-weight: var(--liv-fw-label, 600); -webkit-text-stroke-width: var(--liv-ts-label, 0); }
.liv-doctors__empty { flex-wrap: wrap; }
.liv-doctors__empty a { color: var(--wp--preset--color--action); }
@media (prefers-reduced-motion: no-preference) {
	.liv-doctors__grid { transition: opacity 0.15s; }
}
.liv-doctors__panel[aria-busy="true"] .liv-doctors__grid { opacity: 0.55; }

/* ---------- Page pattern: hero, intro line, closing action ---------- */
/* Bar over the photo: 12px radius, frosted (the second opinion bar has 8px and no blur). */
.liv-doctors-hero .liv-accred.is-bar { min-block-size: 44px; padding: 6px 16px; border-radius: var(--wp--custom--radius--md); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.liv-doctors-hero .liv-accred.is-bar .liv-accred__label { font-size: var(--wp--preset--font-size--small); line-height: 1.4; }
.liv-cat__content > .liv-doctors-intro { color: var(--wp--preset--color--text-secondary); }
/* Hero photo (Website Pages · Doctors Directory, 83:1145): in the wide desktop slot the picture is cut from the top,
 * so the doctors stay in view down to the coat pockets and their heads sit below the accreditation bar. */
@media (min-width: 1024px) { .liv-doctors-hero .liv-cat-hero__image img[src*="doctors-team"] { object-position: 50% 75%; } }

@media (max-width: 1023.98px) {
	.liv-doctors__panel { padding: 24px; }
	/* Four narrow columns: the full name is drawn (up to four lines), the button only as wide as its text. */
	.liv-doctors .liv-dcard__name { display: block; -webkit-line-clamp: none; overflow: visible; overflow-wrap: break-word; }
	.liv-doctors .liv-dcard .wp-block-button { flex: none; }
	.liv-doctors .liv-dcard .wp-block-button__link { inline-size: auto; }

	/* Hero: the bar stays on the photo, without its eyebrow; the four badges spread over it. */
	.liv-doctors-hero .liv-cat-hero__media .liv-cat-hero__image img { block-size: auto; aspect-ratio: 704 / 402; }
	.liv-doctors-hero .liv-accred.is-bar { position: absolute; inset: 12px 12px auto; flex-wrap: nowrap; justify-content: center; margin: 0 !important; padding: 6px 16px; background: rgb(255 255 255 / 0.92); }
	.liv-doctors-hero .liv-accred.is-bar .liv-accred__eyebrow { display: none; }
	.liv-doctors-hero .liv-accred.is-bar .liv-accred__badges { flex: 1; flex-wrap: nowrap; justify-content: space-between; gap: 8px; }
}

@media (max-width: 767.98px) {
	/* The design keeps 24px between the page blocks on the phone too. */
	.liv-cat__content:has(> .liv-doctors) { gap: 24px; }
	.liv-cat__content > .liv-doctors-intro { font-size: var(--wp--preset--font-size--large); }
	.liv-doctors__panel { padding: 16px; }
	.liv-doctors__grid { grid-template-columns: minmax(0, 1fr); }
	/* One column: a square photo keeps the card from growing too long. */
	.liv-doctors .liv-dcard__photo { aspect-ratio: 1 / 1; }
	.liv-doctors .liv-dcard__name { display: -webkit-box; -webkit-line-clamp: 2; overflow: hidden; }
	.liv-doctors .liv-dcard .wp-block-button { flex: 1; }
	.liv-doctors .liv-dcard .wp-block-button__link { inline-size: 100%; }
	.liv-doctors__more .wp-block-button { flex: 1; }
	.liv-doctors__more .wp-block-button__link { inline-size: 100%; }

	/* Hero: the portrait phone form of every inner page (clinic.css, "Phone hero of every inner page"). */
	.liv-cat-cta.liv-doctors-cta { padding: 16px; }
}
