/**
 * IVY Location Hero - frontend and editor styles.
 *
 * The gradient reuses the Brand Gradient colours (#2379BC blue, #4AC1BA teal)
 * but is this block's own: teal glows in the top-right and bottom-left over a
 * blue base. The Brand Gradient block style itself is left untouched.
 *
 * Selectors that set text colour are doubled (.ivy-location.ivy-location) so
 * they beat the theme's heading/link ink and the editor's
 * `.editor-styles-wrapper h2` at (0,1,1).
 */

.ivy-location {
	--ivy-location-radius: 15px;
	--ivy-location-gutter: clamp(20px, 4vw, 40px);
	--ivy-location-star: #fff;
	--ivy-location-star-empty: rgba(255, 255, 255, 0.35);

	position: relative;
	box-sizing: border-box;
	padding: clamp(48px, 7vw, 96px) var(--ivy-location-gutter);
	border-radius: 0 0 var(--ivy-location-radius) var(--ivy-location-radius);
	background-color: #2379bc;
	background-image:
		radial-gradient(ellipse 55% 65% at 100% 0%, rgba(74, 193, 186, 0.9) 0%, rgba(74, 193, 186, 0) 100%),
		radial-gradient(ellipse 55% 65% at 0% 100%, rgba(74, 193, 186, 0.9) 0%, rgba(74, 193, 186, 0) 100%),
		linear-gradient(#2379bc, #2379bc);
	background-repeat: no-repeat;
	color: #fff;
	font-size: 16px;
	line-height: 1.6;
	overflow: hidden;
}

.ivy-location *,
.ivy-location *::before,
.ivy-location *::after {
	box-sizing: border-box;
}

.ivy-location__inner {
	display: flex;
	flex-direction: column;
	gap: 40px;
	max-width: 1200px;
	margin: 0 auto;
}

.ivy-location__info {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

/* Status banner */

/* A pill sized to its text: align-self keeps the flex column from stretching
 * it to full width. The column's 24px gap gives it the same space below as
 * between the rating row and the title. max-width lets long text wrap. */
.ivy-location.ivy-location .ivy-location__status {
	--ivy-location-status-color: var(--ivy-color-teal, #4ac1ba);

	display: inline-block;
	align-self: flex-start;
	max-width: 100%;
	margin: 0;
	padding: 6px 12px;
	border-radius: 4px;
	background-color: #fff;
	color: var(--ivy-location-status-color);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}

/* Rating */

.ivy-location__rating {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}

.ivy-location.ivy-location .ivy-location__status {
	align-self: flex-start;
	margin: 0;
	padding: 7px 12px;
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.2px;
	line-height: 1.2;
	text-transform: uppercase;
}

.ivy-location__stars {
	display: inline-flex;
	gap: 4px;
}

.ivy-location__star {
	position: relative;
	display: inline-flex;
	width: 16px;
	height: 16px;
	color: var(--ivy-location-star-empty);
}

.ivy-location__star svg {
	display: block;
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.ivy-location__star-fill {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	color: var(--ivy-location-star);
}

.ivy-location__star--half .ivy-location__star-fill {
	width: 50%;
}

.ivy-location.ivy-location .ivy-location__rating-text {
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}

/* Title and brand */

.ivy-location.ivy-location .ivy-location__title {
	margin: 0;
	color: #fff;
	font-family: "Adelle", serif;
	font-size: clamp(30px, 4vw, 48px);
	font-weight: 600;
	line-height: 1.15;
}

.ivy-location.ivy-location .ivy-location__brand {
	margin: -12px 0 0;
	color: #fff;
	font-size: 18px;
	font-weight: 300;
	line-height: 1.5;
}

/* Address, phone, hours */

/* Column gap is 24px, so +16px margins give 40px from the brand line above
 * and from the social icons / buttons below. */
.ivy-location__details {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
	margin: 16px 0;
}

.ivy-location__contact {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.ivy-location__item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-width: 0;
}

.ivy-location__icon {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 1.6em;
	color: #fff;
}

.ivy-location__icon svg {
	display: block;
	width: auto;
	max-width: 20px;
	height: 18px;
}

.ivy-location__icon svg path {
	fill: currentColor;
}

.ivy-location.ivy-location .ivy-location__address {
	margin: 0;
	color: #fff;
	font-weight: 300;
	font-style: normal;
}

.ivy-location__line {
	display: block;
	font-weight: 300;
	overflow-wrap: anywhere;
}

.ivy-location__numbers {
	font-weight: 300;
}

.ivy-location.ivy-location .ivy-location__numbers a {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ivy-location.ivy-location .ivy-location__numbers a:hover,
.ivy-location.ivy-location .ivy-location__numbers a:focus-visible {
	text-decoration-thickness: 2px;
}

.ivy-location.ivy-location .ivy-location__hours-label {
	margin: 0 0 4px;
	color: #fff;
	font-weight: 600;
}

.ivy-location__hours-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0;
}

.ivy-location__hours-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0 8px;
}

.ivy-location.ivy-location .ivy-location__hours-row dt,
.ivy-location.ivy-location .ivy-location__hours-row dd {
	margin: 0;
	color: #fff;
	font-weight: 300;
}

.ivy-location__coming-soon-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 16px 0;
	padding-left: 1.25rem;
	color: #fff;
}

.ivy-location__coming-soon-list li {
	padding-left: 4px;
	font-weight: 300;
}

/* Social */

.ivy-location__social {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ivy-location__social li {
	margin: 0;
	padding: 0;
}

.ivy-location.ivy-location .ivy-location__social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: #fff;
	border-radius: 50%;
	transition: opacity 150ms ease;
}

.ivy-location__social-link svg {
	display: block;
	width: 24px;
	height: 24px;
}

.ivy-location.ivy-location .ivy-location__social-link:hover {
	opacity: 0.75;
}

.ivy-location.ivy-location .ivy-location__social-link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Buttons */

.ivy-location__actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 20px;
	margin-top: 8px;
}

.ivy-location.ivy-location .ivy-location__appointment {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3.25rem;
	padding: var(--ivy-button-padding-y, 14px) var(--ivy-button-padding-x, 28px);
	border: 2px solid #fff;
	border-radius: var(--ivy-button-radius, 3px);
	background-color: transparent;
	color: #fff;
	font-size: var(--ivy-button-font-size, 14px);
	font-weight: var(--ivy-button-font-weight, 600);
	line-height: 1;
	letter-spacing: 1.4px;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
}

/* Hover, focus and transition: shared Tertiary button rules in
   css/buttons-links.css. */

.ivy-location__directions {
	display: flex;
	justify-content: center;
	margin: 0;
}

/* Look comes from the Arrow Link button style, in its white variant
   (.ivy-text-button--on-dark, css/buttons-links.css); only layout is set here. */
.ivy-location .ivy-location__directions .wp-block-button__link {
	width: auto;
	min-width: 0;
	min-height: 0;
}

/* Map */

.ivy-location__map {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 24px;
	overflow: hidden;
	background-color: rgba(255, 255, 255, 0.12);
}

.ivy-location__map iframe {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.ivy-location__map--coming-soon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ivy-location__map--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px dashed rgba(255, 255, 255, 0.5);
	font-weight: 600;
	letter-spacing: 1.4px;
	text-transform: uppercase;
}

/* Tablet and up */

@media (min-width: 782px) {
	.ivy-location--has-map .ivy-location__inner {
		display: grid;
		grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
		align-items: start;
		gap: calc(clamp(32px, 4vw, 64px) + 20px);
	}

	.ivy-location__map {
		align-self: center;
		aspect-ratio: 1 / 1;
		max-height: 560px;
	}

	.ivy-location__actions {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 16px 32px;
	}

	.ivy-location__directions {
		justify-content: flex-start;
	}
}

/*
 * Address and hours side by side only once the info column is wide enough.
 * Below 1280px it is too narrow (two ~230px columns at 1100px), so hours stack
 * under the address.
 */
@media (min-width: 1280px) {
	.ivy-location__details--split {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 24px 60px;
	}
}

/* Without a map the info spans the full width, so split from tablet up. */
@media (min-width: 782px) {
	.ivy-location:not(.ivy-location--has-map) .ivy-location__details--split {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 24px 60px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ivy-location__social-link,
	.ivy-location__appointment {
		transition: none;
	}
}
