/* "Партньори" (parts/partners.php, assets/js/partners.js): the words in a cloud; under them our house on a green
   mound with the partners' cards at its sides, each tied to the house by a string in its colour. The strings are drawn
   out of the house when seen and little hearts run along them to the partners; under the pointer a card lifts and its
   string thickens. On narrower screens the house stands on top and the strings come down from it in a bundle, each
   turning off to its card. */

.ptn { position: relative; overflow: hidden; }
.ptn__sky { position: relative; margin-top: 20px; padding: 70px 0 230px; background: linear-gradient(#7cc6fb, #c4e6fd 60%, #e6f5ff); overflow: hidden; }
.ptn__clouds { position: absolute; left: 0; top: 24px; width: 3720px; height: 165px; background: url('../images/clouds3.svg') repeat-x 0 0 / 1860px 165px; opacity: .75; animation: ptn-drift 100s linear infinite; pointer-events: none; }
@keyframes ptn-drift { to { transform: translateX(-1860px); } }

/* ---------- The words in a cloud ---------- */
.ptn__intro { position: relative; z-index: 2; max-width: 880px; padding: 34px 46px; border-radius: 46px; background: #fff; box-shadow: 0 24px 40px -26px rgba(30, 80, 130, .5); text-align: center; opacity: 0; transform: translateY(30px) scale(.95); transition: opacity .8s, transform 1s cubic-bezier(.34, 1.3, .64, 1); }
.ptn__intro::before, .ptn__intro::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; background: #fff; }
.ptn__intro::before { left: 12%; top: -40px; width: 120px; height: 100px; }
.ptn__intro::after { right: 16%; top: -54px; width: 170px; height: 130px; }
/* (centred also where the site's .wrapper keeps only side margins) */
.ptn .ptn__intro { margin-left: auto; margin-right: auto; max-width: min(880px, calc(100% - 40px)); box-sizing: border-box; }
.ptn__intro.is-in { opacity: 1; transform: none; animation: ptn-float 6s ease-in-out 1.2s infinite alternate; }
@keyframes ptn-float { from { translate: 0 0; } to { translate: 0 -8px; } }
.ptn .ptn__intro p { position: relative; margin: 0; font-size: 18px; line-height: 1.8; color: #3c4741; }

/* ---------- The house and the partners at its sides ---------- */
.ptn__net { position: relative; z-index: 4; display: grid; grid-template-columns: minmax(0, 1fr) 290px minmax(0, 1fr); grid-template-rows: repeat(var(--rows), auto); gap: 34px 64px; margin-top: 90px; }
.ptn__cards { display: contents; }
.ptn__strings { position: absolute; z-index: 0; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ptn__string { fill: none; stroke: var(--c); stroke-width: 3.2; stroke-linecap: round; opacity: .9; stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.3s cubic-bezier(.4, 0, .2, 1) calc(.5s + var(--k) * .14s), stroke-width .25s; }
.ptn__strings.is-drawn .ptn__string { stroke-dashoffset: 0; }
.ptn__strings.is-set .ptn__string { transition: stroke-width .25s; }
.ptn__string.is-hot { stroke-width: 6; }
.ptn--bundle .ptn__string { stroke-width: 2.4; }
.ptn--bundle .ptn__string.is-hot { stroke-width: 4.5; }
.ptn__heart { font: 15px/1 Arial, sans-serif; fill: var(--c); paint-order: stroke; stroke: #fff; stroke-width: 3px; }

/* our house on its mound (the fan of the drawing turns) */
.ptn__home { position: relative; z-index: 1; grid-column: 2; grid-row: 1 / -1; align-self: center; justify-self: center; isolation: isolate; padding-bottom: 26px; opacity: 0; transform: translateY(30px) scale(.9); transition: opacity .8s, transform 1s cubic-bezier(.34, 1.4, .64, 1); }
.ptn__home.is-in { opacity: 1; transform: none; }
.ptn__home::before { content: ''; position: absolute; z-index: -1; left: -26px; right: -26px; bottom: 0; height: 64px; border-radius: 50% 50% 46% 46%; background: url('../images/background-grass-top.svg') repeat-x center top / 480px 18px, linear-gradient(transparent 12px, #8fdc6a 12px, #5fbf4a); box-shadow: 0 18px 24px -18px rgba(30, 80, 30, .6); }
.ptn__house { position: relative; display: block; width: 270px; aspect-ratio: 250 / 214; background: url('../images/montessorihouse.svg') no-repeat center bottom / contain; }
.ptn__fan { position: absolute; left: 58%; top: 52.3%; width: 6.43%; height: 7.83%; background: url('../images/fan.svg') no-repeat center / contain; animation: ptn-spin 1.4s linear infinite; }
@keyframes ptn-spin { to { transform: rotate(360deg); } }

/* a partner: a card with its logo (or its name) and the knot where its string is tied */
.ptn__item { position: relative; z-index: 1; width: 100%; max-width: 380px; grid-row: var(--row); opacity: 0; transition: opacity .7s calc(.2s + var(--k) * .12s), transform .9s cubic-bezier(.34, 1.4, .64, 1) calc(.2s + var(--k) * .12s); }
.ptn__item--left { grid-column: 1; justify-self: end; transform: translateX(-40px); }
.ptn__item--right { grid-column: 3; justify-self: start; transform: translateX(40px); }
.ptn__item.is-in { opacity: 1; transform: none; }
.ptn__card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 196px; padding: 22px 24px 20px; box-sizing: border-box; border-top: 6px solid var(--c); border-radius: 22px; background: #fff; box-shadow: 0 22px 32px -24px rgba(20, 60, 100, .6); text-decoration: none; transition: translate .45s cubic-bezier(.34, 1.5, .64, 1), box-shadow .3s; }
.ptn__card:hover, .ptn__card:focus-visible { translate: 0 -6px; box-shadow: 0 30px 36px -24px rgba(20, 60, 100, .7); }
.ptn__logo { display: grid; place-items: center; width: 100%; height: 124px; }
.ptn__logo img { display: block; max-width: 92%; max-height: 124px; width: auto; height: auto; object-fit: contain; transition: scale .45s cubic-bezier(.34, 1.5, .64, 1); }
.ptn__card:hover .ptn__logo img { scale: 1.05; }
.ptn__word { display: block; padding: 0 6px; font: 400 30px/1.2 'Cabin Sketch', Arial, sans-serif; color: var(--c); text-align: center; text-wrap: balance; }
.bg .ptn__word { font-family: 'Neucha', Arial, sans-serif; }
.ptn__name { font: 700 15px/1.35 'Open Sans', Arial, sans-serif; color: #3c4741; text-align: center; }
.ptn__knot { position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px #fff, 0 3px 6px 3px rgba(20, 60, 100, .2); }
.ptn__item--left .ptn__knot { right: -8px; }
.ptn__item--right .ptn__knot { left: -8px; }

/* ---------- The hills ---------- */
.ptn__hill { position: absolute; z-index: 1; left: -5%; right: -5%; background-repeat: no-repeat; background-position: center bottom; background-size: 100% 100%; pointer-events: none; }
.ptn__hill--back { bottom: 60px; height: 210px; background-image: url('../images/hills2.svg'); }
/* (its drawing is empty at the foot, so it reaches below the sky's edge) */
.ptn__hill--front { z-index: 3; bottom: -50px; height: 230px; background-image: url('../images/hills1.svg'); }

/* ---------- Narrower screens: the house on top, the strings come down in a bundle ---------- */
@media only screen and (max-width: 1099px) {
	.ptn__net { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: none; gap: 30px 56px; }
	.ptn__home { grid-column: 1 / -1; grid-row: 1; margin-bottom: 26px; }
	.ptn__item, .ptn__item--left, .ptn__item--right { grid-column: auto; grid-row: auto; max-width: none; justify-self: stretch; }
	.ptn__house { width: 240px; }
}
@media only screen and (max-width: 640px) {
	.ptn__sky { padding: 60px 0 170px; }
	.ptn__intro { padding: 26px 22px; border-radius: 34px; }
	.ptn__intro::before { width: 80px; height: 70px; top: -28px; } .ptn__intro::after { width: 110px; height: 90px; top: -36px; }
	.ptn .ptn__intro p { font-size: 16px; }
	.ptn__net { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 70px; }
	.ptn__item, .ptn__item--left, .ptn__item--right { width: auto; margin-left: 46px; transform: translateX(30px); }
	.ptn__item.is-in { transform: none; }
	.ptn__item--left .ptn__knot, .ptn__item--right .ptn__knot { left: -8px; right: auto; }
	.ptn__house { width: 200px; }
	.ptn__card { min-height: 160px; padding: 18px 18px 16px; }
	.ptn__logo { height: 100px; }
	.ptn__logo img { max-height: 100px; }
	.ptn__word { font-size: 25px; }
	.ptn__name { font-size: 14px; }
	.ptn__hill--back { height: 140px; bottom: 40px; } .ptn__hill--front { height: 160px; bottom: -40px; }
}
@media (prefers-reduced-motion: reduce) {
	.ptn *, .ptn *::before, .ptn *::after { animation: none !important; transition: none !important; }
	.ptn__intro, .ptn__item, .ptn__home { opacity: 1 !important; transform: none !important; }
	.ptn__string { stroke-dashoffset: 0 !important; }
}
