/*
 * The contacts page.
 *
 * Section shells (.sx-home-block, .sx-tiles, .sx-tile) come from
 * home-sections.css, which every page already loads — only what is specific to
 * this page is here.
 */

/* ---- 01 The opening line ---- */

.sx-contacts-hero {
	padding-top: var( --wp--preset--spacing--40 );
}

.sx-contacts-hero__title {
	margin: 10px 0 16px;
	font-size: var( --sx-title-page );
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.sx-contacts-hero__lead {
	margin: 0;
	max-width: 56ch;
	color: var( --sx-text-secondary );
	font-size: 1.0625rem;
	line-height: 1.6;
}

/* ---- 02 The four ways to reach us ---- */

.sx-contact-cards {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 20px;
	margin-top: var( --wp--preset--spacing--60 );
}

.sx-contact-card {
	display: flex;
	flex-direction: column;
	padding: 24px;
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	background: var( --sx-white );
	transition: border-color var( --sx-transition-fast ) var( --sx-ease ),
		box-shadow var( --sx-transition-fast ) var( --sx-ease );
}

.sx-contact-card:hover {
	border-color: var( --sx-brand-200 );
	box-shadow: var( --sx-shadow-card );
}

.sx-contact-card__icon {
	display: inline-flex;
	margin-bottom: 14px;
	color: var( --sx-brand-text );
}

.sx-contact-card__icon svg {
	width: 26px;
	height: 26px;
}

.sx-contact-card__title {
	margin: 0 0 10px;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --sx-text-muted );
}

.sx-contact-card__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sx-contact-card__list li + li {
	margin-top: 8px;
}

.sx-contact-card__list a {
	color: inherit;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
}

.sx-contact-card__list a:hover {
	color: var( --sx-brand-text );
}

.sx-contact-card__note {
	display: block;
	margin: 2px 0 0;
	color: var( --sx-text-muted );
	font-size: 0.8125rem;
	line-height: 1.4;
}

/*
 * A number and its mark on one line. The mark tells the networks apart at a
 * glance, which a column of grey captions under the numbers did not.
 */
.sx-phone {
	display: block;
}

/* The operator's own logo, beside the number. */
.sx-phone__badge {
	display: inline-flex;
	margin-left: 8px;
	vertical-align: -5px;
}

.sx-phone__badge img {
	width: 21px;
	height: 21px;
	border-radius: 50%;
	object-fit: contain;
	transition: filter var( --sx-transition-base ) var( --sx-ease ),
		opacity var( --sx-transition-base ) var( --sx-ease );
}

/*
 * Operator marks rest in grey and give up their own colours only while the
 * row is hovered or focused.
 *
 * The kit's rule (see tokens.css) is that vendor palettes do not live in the
 * shared UI: three logos in Vodafone red, Kyivstar blue and lifecell yellow
 * sitting permanently in the contacts card put more colours on that page than
 * the whole rest of the site uses. Greyed, they read as one set of marks; on
 * hover the real logo comes back, so nobody loses the ability to tell the
 * networks apart at a glance.
 *
 * Only on devices that actually have a pointer. Where there is no hover there
 * is no way to reveal anything, so touch keeps the colours outright rather
 * than being left with three grey circles it can never resolve.
 */
@media ( hover: hover ) {
	.sx-phone__badge img {
		filter: grayscale( 1 );
		opacity: 0.55;
	}

	.sx-phone:hover .sx-phone__badge img,
	.sx-phone:focus-within .sx-phone__badge img {
		filter: none;
		opacity: 1;
	}
}

/*
 * A network whose logo is only a word keeps the word, in its own colours, on
 * its own line: beside the number it fitted for "lifecell" and wrapped for
 * longer names, so one card ended up with two different rhythms.
 */
.sx-phone__chip {
	display: flex;
	width: fit-content;
	align-items: center;
	height: 22px;
	margin-top: 3px;
	padding-inline: 10px;
	border-radius: 999px;
	background: var( --sx-neutral-100 );
	color: var( --sx-text-secondary );
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	white-space: nowrap;
	transition: background-color var( --sx-transition-base ) var( --sx-ease ),
		color var( --sx-transition-base ) var( --sx-ease );
}

/*
 * The word-only fallback follows the badge above: neutral at rest, the
 * network's own colours while the row is hovered or focused.
 *
 * This is also the more legible resting state. Set in their own palettes these
 * read 3.34:1 for lifecell and 4.33:1 for Kyivstar; the grey chip is 5.45:1,
 * so the colours that miss the mark now appear only in passing rather than
 * being what the page is set in.
 */
@media ( hover: hover ) {
	.sx-phone:hover .sx-phone__chip--kyivstar,
	.sx-phone:focus-within .sx-phone__chip--kyivstar {
		background: #0d7fc4;
		color: var( --sx-white );
	}

	.sx-phone:hover .sx-phone__chip--lifecell,
	.sx-phone:focus-within .sx-phone__chip--lifecell {
		background: #ffdd00;
		color: #e6007e;
	}

	.sx-phone:hover .sx-phone__chip--vodafone,
	.sx-phone:focus-within .sx-phone__chip--vodafone {
		background: #e60000;
		color: var( --sx-white );
	}
}

/* No pointer, no reveal: keep the colours rather than leaving three grey
   pills a touch user can never resolve. */
@media ( hover: none ) {
	.sx-phone__chip--kyivstar {
		background: #0d7fc4;
		color: var( --sx-white );
	}

	.sx-phone__chip--lifecell {
		background: #ffdd00;
		color: #e6007e;
	}

	.sx-phone__chip--vodafone {
		background: #e60000;
		color: var( --sx-white );
	}
}

.sx-phone__icon {
	display: inline-flex;
	margin-left: 8px;
	color: var( --sx-text-muted );
	vertical-align: -4px;
}

.sx-phone__icon svg {
	width: 19px;
	height: 19px;
}

.sx-phone:hover .sx-phone__icon {
	color: var( --sx-brand-text );
}

.sx-contact-card__text {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.sx-contact-card__link {
	margin-top: auto;
	padding-top: 12px;
	color: var( --sx-brand-text );
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
}

/* ---- 03 The map, with the route button ---- */

.sx-contacts-map {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) minmax( 280px, 360px );
	gap: 0;
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	overflow: hidden;
	background: var( --sx-white );
}

/* The frame holds the ratio, so the iframe can fill it without the map
   collapsing to nothing on a narrow screen. */
.sx-contacts-map__frame {
	position: relative;
	min-height: 420px;
}

.sx-contacts-map__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.sx-contacts-map__panel {
	display: flex;
	flex-direction: column;
	padding: 32px;
	border-left: 1px solid var( --sx-border );
	background: var( --sx-surface );
}

.sx-contacts-map__title {
	margin: 10px 0 16px;
	font-size: 1.5rem;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.sx-contacts-map__address {
	margin: 0 0 16px;
	font-size: 1rem;
	line-height: 1.5;
}

.sx-contacts-map__hours {
	margin: 0 0 24px;
	padding: 16px 0 0;
	border-top: 1px solid var( --sx-border );
	list-style: none;
	color: var( --sx-text-secondary );
	font-size: 0.9375rem;
	line-height: 1.7;
}

/*
 * The button this section exists for. Big, filled and last in the panel, so it
 * is the thing the eye lands on after reading the address.
 */
.sx-contacts-map__route {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: auto;
	min-height: 52px;
	padding-inline: 24px;
	border-radius: var( --sx-radius-btn );
	background: var( --sx-brand );
	color: var( --sx-white );
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color var( --sx-transition-fast ) var( --sx-ease );
}

.sx-contacts-map__route:hover {
	background: var( --sx-brand-hover );
	color: var( --sx-white );
}

.sx-contacts-map__route svg {
	width: 20px;
	height: 20px;
}

/* ---- 04 The request form ---- */

.sx-contacts-form {
	display: grid;
	grid-template-columns: minmax( 260px, 380px ) minmax( 0, 1fr );
	gap: 56px;
	align-items: start;
}

.sx-contacts-form__title {
	margin: 10px 0 14px;
	font-size: clamp( 1.6rem, 1.2rem + 1.4vw, 2.25rem );
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.sx-contacts-form__lead {
	margin: 0;
	color: var( --sx-text-secondary );
	font-size: 0.9375rem;
	line-height: 1.6;
}

.sx-contacts-form__form {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 16px 20px;
	padding: 28px;
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	background: var( --sx-surface );
}

.sx-field {
	margin: 0;
}

.sx-field--wide {
	grid-column: 1 / -1;
}

.sx-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.8125rem;
	font-weight: 600;
}

/* Ground, line and focus come from .sx-form--filled in tokens.css, shared with
   the popup and the CV form. */
.sx-field input,
.sx-field textarea {
	width: 100%;
	padding: 11px 14px;
	font: inherit;
	font-size: 0.9375rem;
}


.sx-field--consent label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.5;
	color: var( --sx-text-secondary );
}

.sx-field--consent input {
	width: auto;
	margin-top: 2px;
}

/* Off screen rather than display:none — a bot reading the markup fills what it
   can see in the source, and this one is there to be filled. */
.sx-contacts-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.sx-contacts-form__submit {
	min-height: 48px;
	padding-inline: 28px;
	border: 0;
	border-radius: var( --sx-radius-btn );
	background: var( --sx-brand );
	color: var( --sx-white );
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color var( --sx-transition-fast ) var( --sx-ease );
}

.sx-contacts-form__submit:hover {
	background: var( --sx-brand-hover );
}

.sx-contacts-form__done,
.sx-contacts-form__error {
	margin: 0;
	padding: 16px 20px;
	border-radius: var( --sx-radius-lg );
	font-size: 0.9375rem;
}

.sx-contacts-form__done {
	border: 1px solid var( --sx-success-100 );
	background: var( --sx-success-50 );
}

.sx-contacts-form__error {
	grid-column: 1 / -1;
	border: 1px solid var( --sx-brand-200 );
	background: var( --sx-brand-50 );
	color: var( --sx-brand-text );
}

/* ---- 05 The office ---- */

.sx-contacts-office {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) minmax( 260px, 420px );
	gap: 48px;
	align-items: center;
}

.sx-contacts-office__media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var( --sx-radius-lg );
}

.sx-contacts-office__title {
	margin: 10px 0 14px;
	font-size: clamp( 1.6rem, 1.2rem + 1.4vw, 2.25rem );
	line-height: 1.15;
}

.sx-contacts-office__lead {
	margin: 0;
	color: var( --sx-text-secondary );
	font-size: 0.9375rem;
	line-height: 1.65;
}

.sx-contacts-office__hours {
	margin: 20px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var( --sx-border );
	list-style: none;
	font-size: 0.9375rem;
	line-height: 1.7;
}

/* ---- 06 Who to write to ---- */

/* home-sections.css ships a 4-across and a 2-across grid; this section wants
   three, so it brings its own. */
.sx-contacts-channels .sx-tiles--3 {
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
}

@media ( max-width: 900px ) {
	.sx-contacts-channels .sx-tiles--3 {
		grid-template-columns: minmax( 0, 1fr );
	}
}

.sx-channel-card__icon {
	display: inline-flex;
	color: var( --sx-brand-text );
}

.sx-channel-card__icon svg {
	width: 26px;
	height: 26px;
}

.sx-channel-card__text {
	margin: 0;
	color: var( --sx-text-secondary );
	font-size: 0.9375rem;
	line-height: 1.55;
}

.sx-channel-card__link {
	margin-top: auto;
	padding-top: 14px;
	color: var( --sx-brand-text );
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
}

.sx-channel-card__link:hover {
	text-decoration: underline;
}

/* ---- Narrower screens ---- */

@media ( max-width: 1100px ) {
	.sx-contact-cards {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 900px ) {
	.sx-contacts-map,
	.sx-contacts-form,
	.sx-contacts-office {
		grid-template-columns: minmax( 0, 1fr );
		gap: 0;
	}

	/* The panel sits under the map, so its border belongs on top. */
	.sx-contacts-map__panel {
		border-left: 0;
		border-top: 1px solid var( --sx-border );
	}

	.sx-contacts-map__frame {
		min-height: 320px;
	}

	.sx-contacts-form {
		gap: 28px;
	}

	.sx-contacts-office {
		gap: 28px;
	}

	/* Picture first on a phone: it says "this is the place" faster than the
	   paragraph does. */
	.sx-contacts-office__media {
		order: -1;
	}
}

@media ( max-width: 560px ) {
	.sx-contact-cards {
		grid-template-columns: minmax( 0, 1fr );
	}

	.sx-contacts-form__form {
		grid-template-columns: minmax( 0, 1fr );
		padding: 20px;
	}
}

/* The subject a CTA button carried here in ?tema=, shown above the fields so
   the visitor reads what the office will be told. */
.sx-contacts-form__context {
	grid-column: 1 / -1;
	margin: 0;
	padding: 12px 16px;
	border-radius: var( --sx-radius-md );
	background: var( --sx-brand-50 );
	font-size: 0.9375rem;
	line-height: 1.5;
	overflow-wrap: break-word;
}

.sx-contacts-form__context span {
	color: var( --sx-text-muted );
	font-size: 0.8125rem;
}

.sx-contacts-form__context strong {
	display: block;
	margin-top: 2px;
	color: var( --sx-brand-text );
}
