/*
 * Hospitals directory · Figma "Website Pages" → Hospitals (node 511:2118; frames 1440, 768, 390).
 * Loaded only where liv/hospital-directory renders (registered in inc/hospitals.php, after doctors.css).
 * The boxes, titles and the chip row are the ones of the doctors directory (.liv-doctors__*, doctors.css);
 * the page pattern (patterns/page-hospitals.php) reuses its hero, intro line and closing action.
 * The rules here cover what is specific to hospitals: search field, fixed-width chips, count line, cards.
 */

/* ---------- Find a hospital ---------- */
.liv-hospdir__search { position: relative; display: flex; align-items: center; gap: 12px; box-sizing: border-box; inline-size: min(100%, 480px); block-size: var(--wp--custom--field--height); padding-inline: var(--wp--custom--field--padding-x); border: 1px solid var(--wp--preset--color--field-border); border-radius: var(--wp--custom--radius--sm); background: var(--wp--preset--color--surface); }
.liv-hospdir__search:focus-within { border-color: var(--wp--preset--color--focus); box-shadow: 0 0 0 1px var(--wp--preset--color--focus); }
.liv-hospdir__search-icon { flex: none; display: grid; place-items: center; inline-size: 24px; block-size: 24px; color: var(--wp--preset--color--ink); }
.liv-hospdir__search-icon svg { inline-size: 24px; block-size: 24px; }
/* The frame is the form: the field inside it carries none of the theme field styles. */
.liv-hospdir .liv-hospdir__search input[type="search"] { flex: 1; min-inline-size: 0; inline-size: auto; block-size: 100%; min-block-size: 0; margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0; background: none; box-shadow: none; font: inherit; font-size: var(--wp--preset--font-size--small); line-height: 1.5; color: var(--wp--preset--color--ink); }
.liv-hospdir .liv-hospdir__search input[type="search"]::placeholder { color: #566F7A; opacity: 1; }
.liv-hospdir__search input::-webkit-search-cancel-button { cursor: pointer; }
/* Chips: 172px each, label at the start (Liv / Navigation / Filter as drawn on this page). */
.liv-hospdir .liv-doctors__chip { inline-size: 172px; justify-content: flex-start; }

/* ---------- All Hospitals ---------- */
.liv-hospdir__count { font-size: var(--wp--preset--font-size--small); line-height: 1.5; font-weight: 400; -webkit-text-stroke-width: 0; text-transform: uppercase; color: var(--wp--preset--color--text-secondary); }
.liv-hospdir__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.liv-hospdir__grid > li { display: flex; min-inline-size: 0; margin: 0; }
.liv-hospdir__grid > li[hidden] { display: none; }
.liv-hospdir__card { flex: 1; min-inline-size: 0; }
.liv-hospdir__card .liv-hcard__media { margin: 0; }
/* Photo 341 x 194 in the design: the same shape at any card width. */
.liv-hospdir__card .liv-hcard__media img { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 341 / 194; object-fit: cover; background: var(--wp--preset--color--divider); }
.liv-hospdir__card .liv-hcard__media.is-empty { aspect-ratio: 341 / 194; background: var(--wp--preset--color--divider); }
.liv-hospdir__card .liv-hcard__body { justify-content: flex-start; gap: 12px; padding: 16px; }
.liv-hospdir__name { margin: 0; font-size: var(--wp--preset--font-size--card-title); line-height: 1.35; font-weight: 600; -webkit-text-stroke-width: 0; color: var(--wp--preset--color--ink); }
.liv-hospdir__name a { color: inherit; text-decoration: none; }
.liv-hospdir__name a:hover { text-decoration: underline; }
/* Address and phone: room for three lines on every width (cards of one height, 392 / 508px in the design); shorter text sits in the middle of that room. */
.liv-hospdir__meta { flex: 1; display: flex; flex-direction: column; justify-content: center; min-block-size: 4.5em; margin: 0; font-size: var(--wp--preset--font-size--small); line-height: 1.5; color: #526B78; }
.liv-hospdir__phone { align-self: flex-start; color: inherit; text-decoration: none; }
.liv-hospdir__phone:hover { color: var(--wp--preset--color--action); text-decoration: underline; }
.liv-hospdir__card .wp-block-buttons { margin: 0; }
.liv-hospdir__card .wp-block-button { flex: 1; inline-size: 100%; }
.liv-hospdir__card .wp-block-button__link { display: flex; align-items: center; justify-content: center; box-sizing: border-box; inline-size: 100%; min-block-size: 52px; padding: 0 20px; border-radius: var(--wp--custom--radius--control); background: var(--wp--preset--color--divider); color: var(--wp--preset--color--ink); font-size: var(--wp--preset--font-size--body); line-height: 1.4; font-weight: 700; -webkit-text-stroke-width: 0; }
.liv-hospdir__card .wp-block-button__link:hover { background: var(--wp--preset--color--border-subtle); color: var(--wp--preset--color--ink); }
.liv-hospdir__empty[hidden] { display: none; }

/* ---------- Page pattern: hero photo 1088 x 495 in the design; in the wider column it keeps the design's height
 * (495px), so the hero stays 654px high and its title and action are in view without scrolling ---------- */
@media (min-width: 1024px) {
	.liv-hospitals-hero .liv-cat-hero__media .liv-cat-hero__image img { block-size: auto; aspect-ratio: 1088 / 495; max-block-size: 495px; }
}

/* ---------- A hospital's own page (Figma 511:3017: Hospital Detail) ----------
 * templates/single-liv-hospitals.html: hero (patterns/hospital-hero.php), the hospital's sections
 * (its content), "Contact this hospital", "Other hospitals", closing action. All section cards are grey. */
/* Fact and department cards (Liv / Card / Process Step): white, 16px, title 20 and text 14. */
.liv-hospital .liv-tiles .liv-tile { box-sizing: border-box; gap: 12px; min-block-size: 113px; padding: 16px; background: var(--wp--preset--color--surface); border-radius: var(--wp--custom--radius--card); }
.liv-hospital .liv-tiles .liv-tile p { color: var(--wp--preset--color--text-secondary); }
.liv-hospital .liv-tiles .liv-tile :is(ul, ol) { margin: 0; padding-inline-start: 18px; font-size: var(--wp--preset--font-size--small); line-height: 1.5; color: var(--wp--preset--color--text-secondary); }
/* Actions under the facts: one primary, the others secondary. */
.liv-hospital .wp-block-buttons.liv-hospital__actions { gap: 12px; }
.liv-hospital__actions .wp-block-button__link { display: flex; align-items: center; justify-content: center; min-block-size: 52px; padding: 0 20px; border-radius: var(--wp--custom--radius--control); font-size: var(--wp--preset--font-size--body); line-height: 1.4; font-weight: 700; -webkit-text-stroke-width: 0; }
.liv-hospital__actions .wp-block-button.is-secondary .wp-block-button__link { background: var(--wp--preset--color--divider); color: var(--wp--preset--color--ink); }
.liv-hospital__actions .wp-block-button.is-secondary .wp-block-button__link:hover { background: var(--wp--preset--color--border-subtle); color: var(--wp--preset--color--ink); }
/* Contact form card: 720px. */
.liv-hospital-contact .liv-cat-opinion__card { box-sizing: border-box; inline-size: min(100%, 720px); }
/* The form card with the hospital photo beside it (Contact "Get in touch"): assets/css/clinic.css, .liv-contact-touch__row. */
/* Other hospitals: the directory cards, three in a row. */
.liv-hospital-others > * { margin: 0 !important; }
/* The cards are a list inside a section card: the section's list styles (bullets, indent) must not reach it. */
.liv-hospital-others .liv-hospdir__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.liv-hospital-others .liv-hospdir__grid > li { display: flex; min-inline-size: 0; margin: 0; padding: 0; }
.liv-hospital-others .liv-hospdir__grid > li::marker { content: ""; }
.liv-hospital .wp-block-gallery { margin: 0; }
/* Photo on a card (technology cards): full card width, a 16:9 box. */
.liv-hospital .liv-tiles .liv-tile .wp-block-image { margin: 0; }
/* The whole picture shows (device photos on white would lose their edges with a crop). */
.liv-hospital .liv-tiles .liv-tile .wp-block-image img { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 16 / 9; object-fit: contain; border-radius: var(--wp--custom--radius--sm); background: var(--wp--preset--color--surface); }
/* Videos: players as cards, three in a row, 16:9 with the card radius (the design has no video section;
   this follows its media cards). */
.liv-hospital__videos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.liv-hospital__videos > * { margin: 0 !important; max-inline-size: none !important; min-inline-size: 0; }
.liv-hospital__videos .wp-block-embed__wrapper { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--wp--custom--radius--card); background: var(--wp--preset--color--action); }
.liv-hospital__videos .wp-block-embed__wrapper::before { content: none !important; }
.liv-hospital__videos .wp-block-embed__wrapper iframe { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; }

@media (max-width: 1023.98px) {
	/* Tablet: two columns, the search field as wide as the box. */
	.liv-hospital .liv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.liv-hospital__videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	/* Two other hospitals fit the row. */
	.liv-hospital-others .liv-hospdir__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.liv-hospital-others .liv-hospdir__grid > li:nth-child(n+3) { display: none; }
	.liv-hospdir__search { inline-size: 100%; }
	.liv-hospdir__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	/* Tablet: the photo keeps the 194px of the design in the 336px card (336 x 392). */
	.liv-hospdir__card .liv-hcard__media img, .liv-hospdir__card .liv-hcard__media.is-empty { block-size: 194px; aspect-ratio: auto; }
}

@media (max-width: 767.98px) {
	/* Phone: one column of portrait cards (Liv / Card / Media · Portrait 4:5): tint card, tall photo, primary button. */
	.liv-hospital .liv-tiles { grid-template-columns: minmax(0, 1fr); }
	.liv-hospital__videos { grid-template-columns: minmax(0, 1fr); }
	.liv-hospital .liv-tiles .liv-tile { padding: 16px; }
	.liv-hospital-others .liv-hospdir__grid { grid-template-columns: minmax(0, 1fr); }
	.liv-hospital__actions { flex-direction: column; align-items: stretch; }
	/* Phone: a section title stays 28px and the form card keeps its padding (Hospital Detail · 390 Mobile). */
	.liv-hospital :is(.is-style-section, .is-style-section-white) :where(h2.wp-block-heading) { font-size: var(--wp--preset--font-size--heading-2); line-height: 1.25; letter-spacing: -0.003em; }
	.liv-hospital-contact .liv-cat-opinion__card { padding: 16px; }
	.liv-hospital-contact .liv-cat-opinion__card h3 { font-size: var(--wp--preset--font-size--heading-3); line-height: 1.3; }
	.liv-hospital__actions .wp-block-button, .liv-hospital__actions .wp-block-button__link { inline-size: 100%; box-sizing: border-box; }
	.liv-hospdir__grid { grid-template-columns: minmax(0, 1fr); }
	.liv-hospdir__card { background: var(--wp--preset--color--surface-tint); }
	.liv-hospdir__card .liv-hcard__media img, .liv-hospdir__card .liv-hcard__media.is-empty { block-size: 310px; aspect-ratio: auto; }
	.liv-hospdir__card .wp-block-button__link { background: var(--wp--preset--color--action); color: var(--wp--preset--color--surface); }
	.liv-hospdir__card .wp-block-button__link:hover { background: var(--wp--preset--color--action-hover); color: var(--wp--preset--color--surface); }
}
