/*
 * Glacial Blocks — front-end + editor-canvas styles.
 *
 * Loads AFTER the DoctorLogic per-template layer (dep on dl-overrides, see
 * blocks/glacial-blocks.php). DL-faithful classes the blocks emit (masthead,
 * btn, cards, contact_mini, form) are styled by that layer; ONLY the gl-*
 * additions live here. Palette = the DL --color tokens:
 * text #0d0d0d · indigo #4f529b (dark #2d2e57) · berry #b74271 ·
 * orange #f58132 · light #f0f0f0 · Montserrat.
 */

:root {
	--gl-text: #0d0d0d;
	--gl-indigo: #4f529b;
	--gl-indigo-dark: #2d2e57;
	--gl-berry: #b74271;
	--gl-orange: #f58132;
	--gl-light: #f0f0f0;
	--gl-content-width: 1200px;
}

/* ---------------------------------------------------------------- section */

.gl-section {
	padding: 40px 20px;
}

.gl-section > * {
	max-width: min(100%, var(--gl-content-width));
	margin-left: auto;
	margin-right: auto;
}

.gl-section.gl-pad-none { padding: 0 20px; }
.gl-section.gl-pad-small { padding: 20px; }
.gl-section.gl-pad-large { padding: 80px 20px; }

.gl-bg-light { background-color: var(--gl-light); }

.gl-bg-indigo { background-color: var(--gl-indigo); }
.gl-bg-indigo,
.gl-bg-indigo h2,
.gl-bg-indigo h3,
.gl-bg-indigo h4,
.gl-bg-indigo p,
.gl-bg-indigo li {
	color: #fff;
}

/* ------------------------------------------------------------------ grid */

.gl-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: 1fr;
}

.gl-grid.gl-gap-small { gap: 10px; }
.gl-grid.gl-gap-large { gap: 50px; }

@media (min-width: 768px) {
	.gl-cols-2, .gl-cols-3, .gl-cols-4 { grid-template-columns: repeat(2, 1fr); }
	.gl-cols-2-1 { grid-template-columns: 2fr 1fr; }
	.gl-cols-1-2 { grid-template-columns: 1fr 2fr; }
}

@media (min-width: 991px) {
	.gl-cols-3 { grid-template-columns: repeat(3, 1fr); }
	.gl-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.gl-cell { min-width: 0; }

/* ---------------------------------------------------------------- heading */

.gl-heading.gl-center { text-align: center; }
.gl-heading.gl-white { color: #fff; }

/* ----------------------------------------------------------------- button */

.gl-btn-wrap { padding: 10px 0; }

/* --------------------------------------------------- masthead (band look) */
/* The indigo band masthead the markup pages use (Leadership Team, Doctors).
 * The DL originals carried these rules INLINE in each page's content;
 * this is that inline CSS, made portable. */

.gl-masthead-band {
	padding: 20px 0;
	overflow: hidden;
}

.gl-masthead-band .masthead__text {
	max-width: 1600px;
	margin: 0 auto;
	width: 100%;
	padding: 24px;
}

.gl-masthead-band .masthead__text h1 {
	text-align: left;
	color: #fff;
	margin: 0;
}

.gl-masthead-band .breadcrumbs__items { padding: 0; }

.gl-masthead-band .breadcrumbs__item {
	padding: 0;
	margin-right: 24px;
	color: #fff;
	font-size: 0.7rem;
}

.gl-masthead-band .breadcrumbs__item::after { color: #fff; }
.gl-masthead-band .breadcrumbs__item a { color: #fff; }
.gl-masthead-band .breadcrumbs__item a:hover { color: var(--gl-berry) !important; }

/* ------------------------------------------------------------ link cards */
/* Portable port of the DL content-3 photo link cards (aboutus.css scoped
 * them to .about-us; these work on any page type). */

.gl-link-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	padding: 20px 0;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
}

@media (min-width: 768px) {
	.gl-link-cards { grid-template-columns: repeat(3, 1fr); }
}

.gl-link-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	position: relative;
	border-radius: 4px;
	text-decoration: none;
	box-shadow: rgba(255, 255, 255, 0.1) 0 0 0 0 inset, rgba(50, 50, 93, 0.25) 0 0 0 0, rgba(0, 0, 0, 0.3) 0 0 0 0;
	transition: box-shadow 0.3s ease;
}

.gl-link-card:hover {
	box-shadow: rgba(255, 255, 255, 0.1) 0 1px 1px 0 inset, rgba(50, 50, 93, 0.25) 0 50px 100px -20px, rgba(0, 0, 0, 0.3) 0 30px 60px -30px;
}

.gl-link-card__image {
	width: 100%;
	height: 0;
	padding-top: 133.3333%;
	border-radius: 4px;
	position: relative;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.gl-link-card__image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--gl-text);
	opacity: 0.4;
	border-radius: 4px;
	transition: opacity 0.5s ease;
}

.gl-link-card:hover .gl-link-card__image::after { opacity: 0.7; }

.gl-link-card__text {
	width: 100%;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1;
}

.gl-link-card__text h3 {
	text-align: center;
	margin: 0;
	color: #fff;
}

/* -------------------------------------------------- blockified DL scopes */
/* singular.php wraps blockified DL pages in the original <main> scope class
 * (+ gl-blockified). Some scopes are CSS grids (.videoitem = 24 cols) whose
 * auto-placed children collapse — span every direct block child fully. */

main.gl-blockified > * { grid-column: 1 / -1; }

/* ------------------------------------------------------------ video embed */
/* Portable copy of the DL .videoitem__video-item responsive frame. */

/* aspect-ratio instead of the DL padding-top hack (which resolves against the
 * containing block and skews inside grid parents); width:100% because auto
 * margins in a grid parent would otherwise shrink the item to 0 (the iframe
 * is abs-positioned). Overrides .videoitem__video-item — this sheet prints
 * after the DL layer. */
.gl-video-embed {
	position: relative;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	aspect-ratio: 16 / 9;
	padding-top: 0;
	height: auto;
}

.gl-video-embed iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: unset;
}

/* ----------------------------------------------------------- profile grid */
/* Leadership/team profile cards + accessible bio dialog (replaces the DL
 * :target popup). Card look mirrors the markup pages' inline CSS. */

.gl-profile-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	max-width: 1000px;
	margin: 40px auto;
	padding: 20px;
}

@media (min-width: 768px) {
	.gl-profile-grid.gl-cols-2 { grid-template-columns: repeat(2, 1fr); }
	.gl-profile-grid.gl-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.gl-profile {
	background: #fff;
	box-shadow: rgba(0, 0, 0, 0.16) 0 10px 36px 0, rgba(0, 0, 0, 0.06) 0 0 0 1px;
	padding: 40px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.gl-profile__photo {
	width: 150px;
	height: 150px;
	object-fit: cover;
	border-radius: 4px;
}

@media (min-width: 991px) {
	.gl-profile__photo { width: 300px; height: 300px; }
}

.gl-profile__name {
	margin: 10px 0 0;
	color: #000;
	font-family: "Montserrat", sans-serif;
	font-size: 1.3rem;
	font-weight: 600;
	line-height: 1.2;
}

.gl-profile__role {
	margin: 5px 0 20px;
	color: #000;
	font-size: 1rem;
	line-height: 1.2;
}

.gl-profile__bio-btn { cursor: pointer; }

.gl-profile__dialog {
	max-width: 700px;
	width: calc(100% - 40px);
	max-height: 100%;
	border: 0;
	border-radius: 4px;
	padding: 0;
	box-shadow: rgba(0, 0, 0, 0.3) 0 30px 60px -10px;
}

.gl-profile__dialog::backdrop { background: rgba(13, 13, 13, 0.7); }

.gl-profile__dialog-inner {
	padding: 20px 20px 30px;
	overflow-y: auto;
	max-height: inherit;
	text-align: center;
}

.gl-profile__dialog-inner .gl-profile__bio p { text-align: left; font-size: 0.9rem; }

/* the DL page CSS ships img{display:block} and left-aligned headings, which
 * beat the inner's text-align — recenter the photo, name and role explicitly */
.gl-profile__dialog .gl-profile__photo {
	width: 150px !important;
	height: 150px !important;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.gl-profile__dialog-inner .gl-profile__name,
.gl-profile__dialog-inner .gl-profile__role {
	text-align: center;
}

.gl-profile__dialog-close {
	position: sticky;
	bottom: 0;
	display: block;
	margin: 10px auto 0;
	cursor: pointer;
}

.gl-profile__dialog-close:hover {
	background-color: var(--gl-orange);
	color: #fff;
}

/* focus visibility — never strip outlines, replace them */
.gl-profile__bio-btn:focus-visible,
.gl-profile__dialog-close:focus-visible,
.gl-link-card:focus-visible {
	outline: 2px solid var(--gl-orange);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.gl-link-card,
	.gl-link-card__image::after { transition: none; }
}

/* ------------------------------------------------- facility lead helpers */
/* facility.css lays .cards out as a 24-col grid but never spans the cards
 * themselves (the old site shipped the strip empty). */

.form-block .cards .card { grid-column: auto / span 24; }

@media (min-width: 768px) {
	.form-block .cards .card { grid-column: auto / span 12; }
}

/* facility.css never places .card__title in the card's own 24-col grid,
 * so names would auto-place one column wide */
.form-block .cards .card--vertical .card__title { grid-column: auto / span 24; }

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------------------------------------------------------------- editor */
/* Canvas-only affordances. */

.editor-styles-wrapper .gl-profile__dialog {
	display: block;
	position: static;
	margin: 10px auto;
}

.editor-styles-wrapper .gl-link-card { pointer-events: auto; }
