/* "Контакти" (templates/contacts.php, assets/js/contacts.js): the address on a signpost, the phone as a telephone
   that rings now and then, the e-mails at an "@" on a post that writes itself; they rise out of the grass. The map
   unfolds panel by panel like a paper map and the site's pin drops onto the house. A message sent with the form flies
   off as a letter and the "@" turns round. */

@property --open { syntax: '<number>'; inherits: true; initial-value: 1; }

.ct { position: relative; padding: 20px 0 20px; overflow-x: clip; }
.ct-wrap { padding: 0 30px; }

/* ---------- The three things in the yard ---------- */
.ct-things { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 30px; max-width: 1080px; margin: 0 auto 80px; padding: 0; list-style: none; }
.ct-things::before { content: ''; position: absolute; left: -3%; right: -3%; top: 190px; height: 24px; border-radius: 12px; background: linear-gradient(#8fdc6a, #5fbf4a); }
.ct-things::after { content: ''; position: absolute; left: -3%; right: -3%; top: 178px; height: 20px; background: url('../images/background-grass-top.svg') repeat-x 0 100% / auto 100%; }
.ct-thing { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin: 0; padding: 0; text-align: center; }
.ct-thing::before { display: none; }
.ct-thing__draw { position: relative; display: block; width: 240px; height: 200px; scale: var(--s, 1); transform-origin: 50% 100%; -webkit-tap-highlight-color: transparent; }
.ct .ct-label { display: block; margin-top: 30px; font: 700 18px/1.5 'Open Sans', Arial, sans-serif; color: #3c4741; text-decoration: none; transition: color .25s; }
.ct .ct-label a { color: inherit; text-decoration: none; transition: color .25s; }
.ct a.ct-label:hover, .ct .ct-label a:hover, .ct a.ct-label:focus-visible, .ct .ct-label a:focus-visible { color: #ff5736; }

/* the signpost (the arrows only point: no words are on them) */
.ct-post { position: absolute; left: 50%; bottom: 6px; width: 0; height: 190px; }
.ct-post__pole { position: absolute; left: -9px; bottom: 0; width: 18px; height: 176px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, #8a5a32, #b8814a 45%, #8a5a32); }
.ct-post__pole::before { content: ''; position: absolute; left: -2px; top: -12px; width: 22px; height: 14px; background: #8a5a32; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ct-post__board { position: absolute; height: 34px; background: #7a4c28; transition: rotate .5s cubic-bezier(.34, 1.6, .64, 1); }
.ct-post__board::before { content: ''; position: absolute; inset: 3px; background: repeating-linear-gradient(transparent 0 7px, rgba(122, 76, 40, .18) 7px 9px), linear-gradient(#ebb06a, #d08a45); clip-path: inherit; }
.ct-post__board--a { left: -4px; bottom: 132px; width: 118px; transform-origin: 0 50%; rotate: -3deg; clip-path: polygon(0 0, 84% 0, 100% 50%, 84% 100%, 0 100%); }
.ct-post__board--b { right: -4px; bottom: 92px; width: 104px; transform-origin: 100% 50%; rotate: 4deg; clip-path: polygon(16% 0, 100% 0, 100% 100%, 16% 100%, 0 50%); }
.ct-post__board--c { left: -4px; bottom: 52px; width: 86px; height: 30px; transform-origin: 0 50%; rotate: 2deg; clip-path: polygon(0 0, 80% 0, 100% 50%, 80% 100%, 0 100%); }
.ct-thing--post:hover .ct-post__board--a { rotate: -11deg; }
.ct-thing--post:hover .ct-post__board--b { rotate: 10deg; }
.ct-thing--post:hover .ct-post__board--c { rotate: 8deg; }

/* the telephone: it rings now and then (the handset jumps on its cradle), and under the pointer */
.ct-phone { position: absolute; left: -24px; bottom: 6px; width: 288px; height: 180px; overflow: visible; }
.ct-phone__cord { fill: none; stroke: #3c4741; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ct-phone__base { fill: #ff5736; stroke: #a8321b; stroke-width: 3; stroke-linejoin: round; }
.ct-phone__foot { fill: #c9401f; }
.ct-phone__cradle { fill: none; stroke: #a8321b; stroke-width: 7; stroke-linecap: round; }
.ct-phone__dial > circle:first-child { fill: #fff8f2; stroke: #a8321b; stroke-width: 3; }
.ct-phone__holes circle { fill: #ffd2c6; stroke: #e06a4f; stroke-width: 1.4; }
.ct-phone__hub { fill: #ff5736; }
.ct-phone__dial, .ct-phone__handset { transform-box: fill-box; transform-origin: 50% 50%; }
.ct-phone__handset { transform-origin: 50% 100%; }
.ct-phone__handset path { fill: #52aae8; stroke: #1f4566; stroke-width: 3; stroke-linejoin: round; }
.ct-phone__waves path { fill: none; stroke: #ff5736; stroke-width: 3.4; stroke-linecap: round; opacity: 0; }
.ct-thing--phone:hover .ct-phone__handset, .ct-thing--phone.is-ring .ct-phone__handset { animation: ct-ring .16s linear infinite alternate; }
.ct-thing--phone:hover .ct-phone__waves path, .ct-thing--phone.is-ring .ct-phone__waves path { animation: ct-waves .8s ease-out infinite; }
.ct-phone__waves path:nth-child(2n) { animation-delay: .22s !important; }
.ct-thing--phone:hover .ct-phone__dial { rotate: 50deg; transition: rotate .5s cubic-bezier(.34, 1.4, .64, 1); }
.ct-phone__dial { transition: rotate 1.1s cubic-bezier(.3, .7, .3, 1); }
@keyframes ct-ring { from { translate: 0 -9px; rotate: -5deg; } to { translate: 0 -12px; rotate: 5deg; } }
@keyframes ct-waves { from { opacity: 1; scale: .8; } to { opacity: 0; scale: 1.25; } }
.ct-phone__waves path { transform-box: fill-box; transform-origin: 50% 50%; }

/* the "@" on a post: it writes itself when seen, turns round under the pointer and when a message is sent */
.ct-at { position: absolute; left: 50%; bottom: 6px; width: 150px; height: 190px; margin-left: -75px; }
.ct-at__post { position: absolute; left: 67px; bottom: 0; width: 16px; height: 86px; background: linear-gradient(90deg, #8a5a32, #b8814a 45%, #8a5a32); }
.ct-at__sign { position: absolute; left: 13px; top: 0; width: 124px; height: 124px; overflow: visible; transition: rotate .8s cubic-bezier(.34, 1.4, .64, 1); }
.ct-at__line circle, .ct-at__line path { fill: none; stroke: #52aae8; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; }
.ct-at__line--edge circle, .ct-at__line--edge path { stroke: #1f4566; stroke-width: 17; }
.ct-thing--at:hover .ct-at__sign { rotate: -16deg; }
.ct-at.is-mail .ct-at__sign { animation: ct-turn 1.1s cubic-bezier(.34, 1.3, .64, 1) .6s; }
@keyframes ct-turn { from { rotate: 0deg; } to { rotate: -360deg; } }
/* written: the little "a" first, then the long line round it */
.ct-js .ct-thing--at:not(.is-in) .ct-at__line > * { stroke-dashoffset: 1; }
.ct-thing--at.is-in .ct-at__a { animation: ct-write .6s ease-in-out .55s backwards; }
.ct-thing--at.is-in .ct-at__tail { animation: ct-write 1.1s ease-in-out 1.1s backwards; }
@keyframes ct-write { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* seen: they rise out of the grass one after another */
.ct-js .ct-thing:not(.is-in) .ct-thing__draw { opacity: 0; translate: 0 50px; scale: calc(var(--s, 1) * .7); }
.ct-js .ct-thing:not(.is-in) .ct-label { opacity: 0; }
.ct-thing.is-in .ct-thing__draw { animation: ct-rise .7s cubic-bezier(.3, 1.4, .5, 1) calc(var(--k) * .18s) backwards; }
.ct-thing.is-in .ct-label { animation: ct-fade .5s ease calc(.4s + var(--k) * .18s) backwards; }
@keyframes ct-rise { from { opacity: 0; translate: 0 50px; scale: calc(var(--s, 1) * .7); } to { opacity: 1; translate: 0 0; scale: var(--s, 1); } }
@keyframes ct-fade { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }

/* ---------- The map, unfolded like a paper map ---------- */
.ct-map { --open: 1; clip-path: inset(-44px calc((1 - var(--open)) * 74%) -30px -30px); }
.ct-js .ct-map:not(.is-open) { --open: 0; }
.ct-map.is-open { animation: ct-unfold 1.3s backwards; }
@keyframes ct-unfold {
	0% { --open: 0; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
	33% { --open: .34; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
	66% { --open: .67; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
	100% { --open: 1; }
}
/* the creases (they fade, but a little of them stays) */
.ct-map__folds { position: absolute; z-index: 3; inset: 0; pointer-events: none; opacity: calc(.35 + (1 - var(--open)) * .65); background: linear-gradient(90deg, transparent calc(25% - 16px), rgba(60, 40, 20, .1) 25%, rgba(255, 255, 255, .25) calc(25% + 1px), transparent calc(25% + 16px)), linear-gradient(90deg, transparent calc(50% - 16px), rgba(60, 40, 20, .1) 50%, rgba(255, 255, 255, .25) calc(50% + 1px), transparent calc(50% + 16px)), linear-gradient(90deg, transparent calc(75% - 16px), rgba(60, 40, 20, .1) 75%, rgba(255, 255, 255, .25) calc(75% + 1px), transparent calc(75% + 16px)); }
/* the site's pin over the house (only a drawing: it goes when the map itself is used) */
.ct-pin { position: absolute; z-index: 2; left: 50%; top: 50%; width: 40px; height: 62px; margin: -60px 0 0 -20px; pointer-events: none; filter: drop-shadow(0 5px 3px rgba(0, 0, 0, .3)); transition: opacity .4s; }
.ct-js .ct-map:not(.is-pinned) .ct-pin { opacity: 0; }
.ct-map.is-pinned .ct-pin { animation: ct-drop .9s linear backwards; }
.ct-pin.is-gone { opacity: 0; }
@keyframes ct-drop {
	0% { opacity: 0; translate: 0 -240px; animation-timing-function: cubic-bezier(.5, 0, .9, .5); }
	10% { opacity: 1; }
	55% { translate: 0 0; scale: 1.1 .85; animation-timing-function: cubic-bezier(.2, .6, .4, 1); }
	72% { translate: 0 -26px; scale: 1; animation-timing-function: cubic-bezier(.5, 0, .9, .5); }
	88% { translate: 0 0; scale: 1.04 .94; }
	100% { translate: 0 0; scale: 1; }
}

/* ---------- A message sent: the letter flying off ---------- */
.ct-letter { position: fixed; z-index: 60; width: 60px; height: 40px; border: 2px solid #d8cdbf; border-radius: 3px; background: linear-gradient(to top right, transparent calc(50% - 1px), #d8cdbf 50%, transparent calc(50% + 1px)) 0 0 / 50% 62% no-repeat, linear-gradient(to top left, transparent calc(50% - 1px), #d8cdbf 50%, transparent calc(50% + 1px)) 100% 0 / 50% 62% no-repeat, #fff; box-shadow: 0 8px 16px rgba(0, 0, 0, .2); pointer-events: none; }
.ct-letter::after { content: '♥'; position: absolute; left: 50%; top: 42%; translate: -50% -50%; font: 16px/1 Arial, sans-serif; color: #ff5736; }

@media only screen and (max-width: 900px) {
	.ct-things { grid-template-columns: minmax(0, 1fr); gap: 44px; max-width: 420px; margin-bottom: 60px; }
	.ct-things::before, .ct-things::after { display: none; }
	/* each thing on its own patch of grass */
	.ct-thing__draw::after { content: ''; position: absolute; z-index: -1; left: 10px; right: 10px; bottom: -6px; height: 20px; border-radius: 50%; background: linear-gradient(#8fdc6a, #5fbf4a); }
	.ct .ct-label { margin-top: 18px; }
}
@media only screen and (max-width: 768px) {
	.ct-wrap { padding: 0 16px; }
	.ct-thing__draw { --s: .85; margin-top: -30px; }
	.ct .ct-label { font-size: 16px; }
	.ct-map { clip-path: inset(-44px calc((1 - var(--open)) * 66%) -30px -30px); }
	.ct-things { gap: 30px; }
}
@media only screen and (max-width: 567px) {
	/* "Contact us / Request a visit": two buttons side by side instead of a title and a slash that wrap apart */
	.form-tabs { display: flex; justify-content: center; gap: 8px; margin: 0 0 30px; }
	.form-tabs span { display: none; }
	.form-tabs a { flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 10px; border-radius: 24px; background: #f1ebe4; transition: background-color .2s; -webkit-tap-highlight-color: transparent; }
	.form-tabs a.active { background: #52aae8; box-shadow: 0 6px 12px -6px rgba(30, 90, 150, .6); }
	.form-tabs a h3 { font-size: 20px; line-height: 1.15; text-align: center; color: #7d8380; }
	.form-tabs a.active h3 { color: #fff; }
}
@media (prefers-reduced-motion: reduce) {
	.ct-thing--phone:hover .ct-phone__handset, .ct-thing--phone.is-ring .ct-phone__handset, .ct-phone__waves path, .ct-at__line > *, .ct-at.is-mail .ct-at__sign { animation: none !important; }
}

/* The map before consent (2026-11-13, GDPR/ePrivacy): a drawn map in the colours of the site's styled Google map -
   cream land, green parks, white streets, a yellow boulevard, blue water - with the address and "Покажи картата".
   Google's map comes only after the button or "Приемам всички" (assets/js/contacts.js). */
.ct-gate-host { overflow: hidden; }
.ct-gate {
	position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 18px;
	background-color: #f7f1df;
	background-image:
		radial-gradient(ellipse 22% 30% at 18% 28%, #bde6ab 0 98%, transparent 100%),
		radial-gradient(ellipse 16% 22% at 82% 70%, #d0e3b4 0 98%, transparent 100%),
		linear-gradient(172deg, transparent 0 71%, #a2daf2 71% 79%, transparent 79%),
		linear-gradient(28deg, transparent 0 47.4%, #ffe15f 47.4% 49.6%, transparent 49.6%),
		repeating-linear-gradient(90deg, transparent 0 74px, #fff 74px 80px),
		repeating-linear-gradient(0deg, transparent 0 66px, #fff 66px 71px);
}
.ct-gate__card {
	max-width: 440px; padding: 16px 20px 14px; border-radius: 18px; background: rgba(255, 255, 255, .94);
	box-shadow: 0 10px 24px -12px rgba(40, 60, 30, .45); text-align: center;
}
.ct-gate__addr { margin: 0 0 12px; font: 400 20px/1.3 'Neucha', 'Open Sans', sans-serif; color: #3f4643; }
.en .ct-gate__addr { font-family: 'Cabin Sketch', 'Open Sans', sans-serif; }
.ct-gate__btn { margin: 0 auto; }
.ct-gate__note { margin: 12px 0 0; font: 400 13px/1.45 'Open Sans', sans-serif; color: #6d736f; }
.ct-gate__note a { color: #2f80c8; text-decoration: underline; text-underline-offset: 3px; }
@media only screen and (max-width: 567px) {
	/* the drawn pin would sit on the address and the button: it drops in with the real map */
	.ct-gate-host.is-gated .ct-pin { display: none; }
	.ct-gate { align-items: center; padding: 10px; }
	.ct-gate__card { padding: 12px 14px 10px; }
	.ct-gate__addr { margin-bottom: 8px; font-size: 17px; }
	.ct-gate__note { margin-top: 8px; font-size: 12px; }
}