/*
 * ELICA Genetics — supplemental styles.
 * Design tokens (color, type, spacing, radius) live in theme.json and are read
 * here as CSS custom properties (--wp--preset--* / --wp--custom--*). Keep this
 * file to what theme.json can't express: custom block styles, the language
 * switcher, chips, and small component polish. Loaded on the front end AND in
 * the Site Editor canvas.
 */

/* ---------- Custom block styles ---------- */

/* "Card" group style */
.wp-block-group.is-style-card,
.elica-location.is-style-card {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 8%, transparent);
	border-radius: var(--wp--custom--radius--lg);
	padding: var(--wp--preset--spacing--40);
	box-shadow: var(--wp--custom--shadow--soft);
	height: 100%;
}

/* "Soft panel" group style */
.wp-block-group.is-style-soft-panel {
	background-color: var(--wp--preset--color--sand);
	border-radius: var(--wp--custom--radius--lg);
}

/* "Extra rounded" image style */
.wp-block-image.is-style-rounded-lg img {
	border-radius: var(--wp--custom--radius--lg);
}

/* Portrait "leaf" frame — asymmetric rounded corners + soft white border */
.elica-portrait img {
	border-radius: 90px 14px 90px 14px;
	border: 5px solid var(--wp--preset--color--surface);
	box-shadow: 0 14px 32px rgba(46, 43, 40, 0.12);
	object-fit: cover;
}

/* Accordion — native core/details block styled as a soft card by the theme */
.wp-block-details {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 8%, transparent);
	border-radius: var(--wp--custom--radius--md);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	box-shadow: var(--wp--custom--shadow--soft);
}
.wp-block-details + .wp-block-details {
	margin-top: var(--wp--preset--spacing--30);
}
.wp-block-details summary {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}
.wp-block-details summary::-webkit-details-marker {
	display: none;
}
.wp-block-details summary::after {
	content: "+";
	flex: none;
	font-size: 1.6rem;
	line-height: 1;
	color: var(--wp--preset--color--primary);
}
.wp-block-details[open] summary {
	margin-bottom: var(--wp--preset--spacing--30);
}
.wp-block-details[open] summary::after {
	content: "–";
}

/* ---------- Eyebrow / chips ---------- */
.elica-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.8rem;
	font-weight: 700;
	margin-bottom: var(--wp--preset--spacing--20);
}

.elica-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	margin: 0;
	padding: 0.5em 1em;
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary-strong);
	font-size: 0.85rem;
	font-weight: 600;
	box-shadow: var(--wp--custom--shadow--soft);
}

/* Legacy emoji badge (kept for patterns) */
.elica-card-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--primary-tint);
	font-size: 1.6rem;
	line-height: 1;
	margin: 0 0 var(--wp--preset--spacing--30);
}

/*
 * Modern themed icon badge — a soft brand-colored circle with a line icon.
 * The SVG lives here (theme), tinted via mask with a theme color; the page just
 * uses a class like `elica-ico elica-ico--calendar`. Centered by default.
 */
.elica-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin: 0 auto var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--primary-tint);
}
.elica-ico::before {
	content: "";
	width: 1.65rem;
	height: 1.65rem;
	background-color: var(--wp--preset--color--primary-strong);
	-webkit-mask: var(--elica-ico) center / contain no-repeat;
	mask: var(--elica-ico) center / contain no-repeat;
}
.elica-ico--calendar {
	--elica-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}
.elica-ico--mail {
	--elica-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E");
}
.elica-ico--phone {
	--elica-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}
.elica-ico--dna {
	--elica-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 15c6.667-6 13.333 0 20-6'/%3E%3Cpath d='M9 22c1.798-1.998 2.518-3.995 2.807-5.993'/%3E%3Cpath d='M15 2c-1.798 1.998-2.518 3.995-2.807 5.993'/%3E%3Cpath d='m17 6-2.5-2.5'/%3E%3Cpath d='m14 8-1-1'/%3E%3Cpath d='m7 18 2.5 2.5'/%3E%3Cpath d='m3.5 14.5.5.5'/%3E%3Cpath d='m20 9 .5.5'/%3E%3Cpath d='m6.5 12.5 1 1'/%3E%3Cpath d='m16.5 10.5 1 1'/%3E%3Cpath d='m10 16 1.5 1.5'/%3E%3C/svg%3E");
}

/* Centered cards (home quick-links + contact methods) */
.elica-quicklinks .wp-block-group.is-style-card,
.elica-contact-cards .wp-block-group.is-style-card {
	text-align: center;
}

/* ---------- Location card ----------
   Both columns stretch to a shared top and bottom edge, so the map defines the
   card's height and no dead space is left under the text. */
.elica-location__grid {
	display: grid;
	grid-template-columns: minmax(0, 41fr) minmax(0, 59fr);
	gap: var(--wp--preset--spacing--50);
	align-items: stretch;
}
@media (max-width: 781px) {
	.elica-location__grid {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--40);
	}
}

.elica-location__details {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

/* One quiet label, in the same voice as the hero eyebrow. */
.elica-location__label {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--wp--preset--color--primary-strong);
	margin: 0 0 var(--wp--preset--spacing--20);
}

.elica-location__address {
	font-style: normal;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
	text-wrap: pretty; /* Progressive: evens out the rag where supported. */
}
.elica-location__venue {
	color: var(--wp--preset--color--ink);
	font-weight: 600;
	text-wrap: balance;
}

/* Calling is the action, so the phone is the only filled button here. */
.elica-location__actions {
	margin: var(--wp--preset--spacing--40) 0 0;
}
.elica-location__phone {
	font-size: 1.0625rem;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.elica-location__email {
	margin: var(--wp--preset--spacing--30) 0 0;
	font-size: 0.95rem;
}

/* Sits with the address: both answer "where and when", before the actions. */
.elica-location__hours {
	margin: var(--wp--preset--spacing--40) 0 0;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	font-size: 0.95rem;
	color: var(--wp--preset--color--muted);
}
.elica-location__hours .elica-location__label {
	margin-bottom: 0.15rem;
}

/* flex-basis 0 stops the iframe's height attribute from dictating the row: the
   text column sets the card's height and the map fills whatever that is. */
.elica-location__map {
	display: flex;
	flex-direction: column;
	min-height: 360px;
}
.elica-location__map iframe {
	flex: 1 1 0;
	width: 100%;
	height: auto;
	min-height: 0;
	border: 0;
	border-radius: var(--wp--custom--radius--md);
	display: block;
}
.elica-location__directions {
	margin: var(--wp--preset--spacing--30) 0 0;
	font-size: 0.95rem;
}

/* ---------- Doctor card ---------- */
.elica-doctor {
	text-align: center;
}
.elica-doctor .elica-doctor__avatar {
	margin-left: auto;
	margin-right: auto;
}
.elica-doctor .elica-doctor__avatar img {
	background-color: var(--wp--preset--color--primary-tint);
}

/* ---------- Language switcher (segmented toggle) ---------- */
.elica-lang-switcher {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--sand);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 8%, transparent);
	line-height: 1;
}
.elica-lang-switcher .elica-lang {
	display: inline-flex;
	align-items: center;
	padding: 0.34rem 0.72rem;
	border-radius: var(--wp--custom--radius--pill);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	transition: color 0.15s ease, background-color 0.15s ease;
}
.elica-lang-switcher .elica-lang:hover:not(.is-current),
.elica-lang-switcher .elica-lang:focus-visible {
	color: var(--wp--preset--color--primary-strong);
}
.elica-lang-switcher .elica-lang.is-current {
	color: var(--wp--preset--color--primary-strong);
	background-color: var(--wp--preset--color--surface);
	box-shadow: 0 1px 2px rgba(46, 43, 40, 0.14);
	cursor: default;
}

/* ---------- Footer NAP & hours ---------- */
.elica-nap {
	font-style: normal;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	color: var(--wp--preset--color--muted);
	font-size: 0.95rem;
}
.elica-nap a {
	color: inherit;
}
.elica-nap a:hover {
	color: var(--wp--preset--color--primary-strong);
}

.elica-hours {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.95rem;
	color: var(--wp--preset--color--muted);
}
.elica-hours li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}
.elica-hours__day {
	font-weight: 600;
	color: var(--wp--preset--color--ink);
}
.elica-hours__time {
	font-variant-numeric: tabular-nums;
}

/* ---------- Header polish ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.site-header.is-scrolled {
	box-shadow: 0 1px 0 color-mix(in srgb, var(--wp--preset--color--ink) 8%, transparent),
		0 8px 24px rgba(46, 43, 40, 0.06);
}
.site-header__actions {
	gap: var(--wp--preset--spacing--40);
}
/* Stack the header actions vertically on mobile: language bar → upload → Superdoc */
@media (max-width: 782px) {
	.site-header__actions {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--wp--preset--spacing--20);
	}
	.site-header__actions .wp-block-buttons,
	.site-header__actions .elica-lang-switcher {
		width: auto;
	}
}

/* ---------- Primary navigation (language-aware, from theme) ---------- */
.elica-nav {
	margin-top: var(--wp--preset--spacing--30);
}
.elica-nav__toggle {
	display: none;
	align-items: center;
	gap: 0.55rem;
	margin: 0 auto;
	padding: 0.5rem 1rem;
	background: transparent;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 14%, transparent);
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--ink);
	font: inherit;
	cursor: pointer;
}
.elica-nav__bars,
.elica-nav__bars::before,
.elica-nav__bars::after {
	display: block;
	width: 20px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
}
.elica-nav__bars {
	position: relative;
}
.elica-nav__bars::before,
.elica-nav__bars::after {
	content: "";
	position: absolute;
	left: 0;
}
.elica-nav__bars::before { top: -6px; }
.elica-nav__bars::after { top: 6px; }
.elica-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--wp--preset--spacing--40);
}
.elica-nav__item a {
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	font-weight: 500;
}
.elica-nav__item a:hover,
.elica-nav__item a:focus-visible,
.elica-nav__item a[aria-current="page"] {
	color: var(--wp--preset--color--primary-strong);
}
@media (max-width: 900px) {
	.elica-nav__toggle { display: inline-flex; }
	.elica-nav__list {
		display: none;
		flex-direction: column;
		align-items: center;
		gap: var(--wp--preset--spacing--30);
		margin-top: var(--wp--preset--spacing--30);
	}
	.elica-nav.is-open .elica-nav__list { display: flex; }
}

/* Upload button — white with a soft border so it reads on the light header */
.elica-upload-btn {
	border: 1.5px solid var(--wp--preset--color--primary-soft);
}
.elica-upload-btn:hover,
.elica-upload-btn:focus-visible {
	background-color: var(--wp--preset--color--primary-tint) !important;
	color: var(--wp--preset--color--primary-strong) !important;
}

/* Symbol-only logo (dark-grey mark) */
.elica-logo {
	display: inline-flex;
	align-items: center;
	line-height: 0;
}
.elica-logo img {
	width: 54px;
	height: 54px;
	display: block;
}

/* Brand wordmark (header + footer) — no underline, larger, brand font */
.elica-brand {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 1.6rem;
	line-height: 1.1;
}
.elica-brand a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.elica-brand a:hover,
.elica-brand a:focus-visible {
	color: var(--wp--preset--color--primary-strong);
}

/* ---------- Footer (translated bits) ---------- */
.elica-footer-tagline {
	color: var(--wp--preset--color--muted);
	font-size: 0.95rem;
	line-height: 1.7;
	margin-top: var(--wp--preset--spacing--20);
}
.elica-footer-links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	font-size: 0.95rem;
}
.elica-footer-links a { text-decoration: none; }
.elica-footer-links a:hover { color: var(--wp--preset--color--primary-strong); }
.elica-footer-fine {
	color: var(--wp--preset--color--muted);
	font-size: 0.85rem;
	margin: 0;
}
/* Footer column titles.
   These are <h2> so the page keeps a logical heading order (the last content
   heading is an h2), but they must stay the small uppercase labels the design
   calls for — so the h4 look is reproduced here rather than inherited. */
.site-footer .elica-footer-heading {
	font-size: var(--wp--preset--font-size--medium);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin: 0 0 var(--wp--preset--spacing--40);
}
.site-footer .elica-footer-links,
.site-footer .elica-nap {
	margin-top: 0;
}

/* ---------- Accessibility ---------- */
a:focus-visible,
button:focus-visible,
.wp-element-button:focus-visible,
.wp-block-navigation__responsive-container-open:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.site-header {
		transition: none;
	}
	* {
		scroll-behavior: auto !important;
	}
}

/* ---------- Contact Form 7 — themed to match the site ---------- */
.wpcf7-form p {
	margin-bottom: var(--wp--preset--spacing--30);
}
.wpcf7-form label {
	display: block;
	font-weight: 600;
	color: var(--wp--preset--color--ink);
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form input[type="number"],
.wpcf7-form textarea,
.wpcf7-form select {
	width: 100%;
	box-sizing: border-box;
	margin-top: 0.4rem;
	padding: 0.7rem 0.9rem;
	font: inherit;
	color: var(--wp--preset--color--ink);
	background-color: var(--wp--preset--color--surface);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 15%, transparent);
	border-radius: var(--wp--custom--radius--sm);
}
.wpcf7-form textarea {
	min-height: 140px;
	resize: vertical;
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 3px var(--wp--preset--color--primary-tint);
}
.wpcf7-form input[type="checkbox"],
.wpcf7-form input[type="radio"] {
	accent-color: var(--wp--preset--color--primary);
	margin-right: 0.45rem;
}
.wpcf7-form .wpcf7-acceptance .wpcf7-list-item {
	margin: 0;
}
.wpcf7-form input[type="submit"],
.wpcf7-form button[type="submit"] {
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	color: var(--wp--preset--color--surface);
	background-color: var(--wp--preset--color--primary);
	border: 0;
	border-radius: var(--wp--custom--radius--pill);
	padding: 0.75rem 1.85rem;
	margin-top: var(--wp--preset--spacing--20);
	transition: background-color 0.15s ease, transform 0.15s ease;
}
.wpcf7-form input[type="submit"]:hover,
.wpcf7-form button[type="submit"]:hover {
	background-color: var(--wp--preset--color--primary-strong);
	transform: translateY(-1px);
}
.wpcf7-form input[type="submit"]:focus-visible,
.wpcf7-form button[type="submit"]:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}
.wpcf7-response-output {
	border-radius: var(--wp--custom--radius--sm);
	margin: var(--wp--preset--spacing--30) 0 0 !important;
	padding: 0.7rem 0.9rem !important;
}
.wpcf7-form .wpcf7-not-valid-tip {
	color: #b4322a;
	font-size: 0.85rem;
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
	.site-header__actions {
		gap: var(--wp--preset--spacing--30);
	}
	.elica-hours li {
		font-size: 0.9rem;
	}
}

/* ---------- Home "Location" section (#lokatsiya) ----------
   Blend the section with the page background (drop the sand block), make the
   address/map columns equal, and centre the "Open in Google Maps" button.
   Scoped to #lokatsiya so it applies on all languages without editing content. */
#lokatsiya {
	/* WP preset bg classes are !important, so match them to override sand */
	background-color: var(--wp--preset--color--base) !important;
}
#lokatsiya .wp-block-buttons {
	justify-content: center;
	/* more breathing room between the email line and the button (inline sets spacing--20) */
	margin-top: var(--wp--preset--spacing--50) !important;
}
@media (min-width: 782px) {
	/* equal columns on desktop; below 782px WP still stacks them full-width */
	#lokatsiya .wp-block-columns > .wp-block-column {
		flex-basis: 50% !important;
	}
}
