/* "Препоръки" as letters brought by the birds (parts/letters.php): the birds of the site fly by with envelopes; every
   testimonial is an envelope with its sender, a stamp and a postmark – it opens (its flap turns up) and the letter
   slides out and unfolds under it. */

/* clip, not hidden: a hidden box can still be scrolled sideways (bringing a letter into view moved the whole page) */
.post { position: relative; padding: 0 0 80px; overflow: hidden; overflow: clip; display: flow-root; }
.bg .post .post__title, .bg .post .letter__from { font-family: 'Neucha', Arial, sans-serif; }

/* ---------- The sky with the birds ---------- */
.post__sky { position: relative; min-height: 150px; padding: 110px 0 20px; }
.post__birds i { position: absolute; top: 8px; left: 100%; width: 74px; height: 41px; animation: post-fly 18s linear infinite; }
.post__birds i:nth-child(2) { top: 44px; width: 56px; height: 31px; animation-duration: 23s; animation-delay: -10s; }
.post__birds i::before { content: ''; position: absolute; inset: 0; background: url('../images/bird-2.svg') no-repeat center / contain; transform-origin: 50% 32%; animation: post-wings .4s ease-in-out infinite alternate; }
/* the envelope each bird carries, hanging under it */
.post__birds b { position: absolute; left: 40%; top: 72%; width: 30px; height: 21px; border-radius: 2px; background: linear-gradient(to bottom right, transparent 47%, #e2d3bd 47% 53%, transparent 53%) 0 0 / 50% 60% no-repeat, linear-gradient(to bottom left, transparent 47%, #e2d3bd 47% 53%, transparent 53%) 100% 0 / 50% 60% no-repeat, #fff; box-shadow: 0 2px 3px rgba(0, 0, 0, .2); transform-origin: 50% 0; animation: post-swing 1.2s ease-in-out infinite alternate; }
@keyframes post-fly { 0% { transform: translate(0, 0); } 50% { transform: translate(-55vw, 16px); } 100% { transform: translate(calc(-100vw - 220px), -6px); } }
@keyframes post-wings { from { transform: scaleY(1); } to { transform: scaleY(.62) translateY(3px); } }
@keyframes post-swing { from { rotate: -8deg; } to { rotate: 8deg; } }
.post .post__title { margin: 0 auto 18px; font: 400 44px/1.2 'Cabin Sketch', Arial, sans-serif; text-align: center; color: #ff5736; opacity: 0; transform: translateY(20px); transition: opacity .8s, transform 1s cubic-bezier(.34, 1.4, .64, 1); }
.post__intro { max-width: 860px; text-align: center; opacity: 0; transition: opacity .8s .3s; }
.post .post__title.is-in, .post__intro.is-in { opacity: 1; transform: none; }
.post .post__intro p { margin: 0; font-size: 18px; line-height: 1.8; color: #3c4741; }

/* ---------- The letters ---------- */
.post__letters { display: flex; flex-direction: column; gap: 30px; max-width: 880px; margin-top: 50px; padding: 0; list-style: none; }
.letter { position: relative; rotate: var(--r); opacity: 0; transform: translateX(-70px); transition: opacity .7s calc(var(--k) * .12s), transform 1s cubic-bezier(.34, 1.3, .64, 1) calc(var(--k) * .12s), rotate .5s; }
.letter.is-right { transform: translateX(70px); }
.letter.is-in { opacity: 1; transform: none; }
.letter.is-open { rotate: 0deg; }
.letter__env { position: relative; z-index: 2; display: block; width: 100%; height: 150px; margin: 0; padding: 0 130px 0 40px; border: 0; border-radius: 10px; background: linear-gradient(to top right, rgba(0, 0, 0, .03) 49.6%, transparent 50%) 0 100% / 50% 62% no-repeat, linear-gradient(to top left, rgba(0, 0, 0, .03) 49.6%, transparent 50%) 100% 100% / 50% 62% no-repeat, #fbf3e6; box-shadow: 0 18px 30px -18px rgba(70, 40, 20, .5), inset 0 0 0 1px rgba(0, 0, 0, .04); text-align: left; cursor: pointer; transition: translate .4s cubic-bezier(.34, 1.5, .64, 1); }
.letter__env:hover, .letter__env:focus-visible { translate: 0 -5px; }
.letter:first-child.is-in:not(.is-open) .letter__env { animation: post-wiggle .9s ease-in-out 1.6s 2; }
@keyframes post-wiggle { 0%, 100% { rotate: 0deg; } 25% { rotate: -1.6deg; } 75% { rotate: 1.6deg; } }
/* the flap: it points down while closed and turns up when the envelope opens */
.letter__flap { position: absolute; z-index: 1; left: 0; right: 0; top: 0; height: 78px; border-radius: 10px 10px 0 0; background: linear-gradient(#f3e4cc, #efdcbf); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .05)); transform-origin: 50% 0; transition: transform .55s cubic-bezier(.5, 0, .3, 1.3), background .3s .2s; }
.letter__env:hover .letter__flap { transform: scaleY(.86); }
.letter.is-open .letter__flap { transform: scaleY(-1); background: linear-gradient(#e7d4b4, #f3e4cc); }
.letter__from { position: absolute; z-index: 2; left: 40px; right: 130px; bottom: 22px; font: 400 26px/1.25 'Cabin Sketch', Arial, sans-serif; color: #3c4741; }
.letter__from::after { content: ''; display: block; height: 2px; margin-top: 6px; width: 60%; border-radius: 1px; background: color-mix(in srgb, var(--c) 60%, transparent); }
/* the stamp with its toothed edge, and the postmark beside it */
/* (the holes are punched all over, but the solid content box covers the middle: only the edge keeps its teeth) */
.letter__stamp { position: absolute; z-index: 2; right: 26px; top: 22px; display: grid; place-items: center; width: 66px; height: 78px; padding: 7px; background: #fff; -webkit-mask: radial-gradient(circle 4px at 4px 4px, transparent 98%, #000) -4px -4px / 9px 9px, linear-gradient(#000 0 0) content-box; mask: radial-gradient(circle 4px at 4px 4px, transparent 98%, #000) -4px -4px / 9px 9px, linear-gradient(#000 0 0) content-box; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .15)); rotate: 4deg; }
.letter__stamp b { display: grid; place-items: center; width: 52px; height: 64px; background: var(--c); color: #fff; font-size: 30px; font-weight: 400; line-height: 1; }
.letter__mark { position: absolute; z-index: 3; right: 64px; top: 40px; width: 70px; height: 46px; border: 2px solid rgba(60, 71, 65, .35); border-radius: 50%; opacity: 0; transform: scale(1.8) rotate(-30deg); }
.letter__mark::after { content: ''; position: absolute; left: -56px; top: 10px; width: 54px; height: 22px; background: repeating-linear-gradient(transparent 0 4px, rgba(60, 71, 65, .3) 4px 6px); -webkit-mask: radial-gradient(circle 8px at 50% 0, transparent 98%, #000) 0 0 / 16px 100%; mask: radial-gradient(circle 8px at 50% 0, transparent 98%, #000) 0 0 / 16px 100%; }
.letter.is-in .letter__mark { animation: post-stamp .5s cubic-bezier(.5, 0, .3, 1.4) calc(.8s + var(--k) * .12s) forwards; }
@keyframes post-stamp { to { opacity: 1; transform: rotate(-12deg); } }
/* the letter unfolds under the envelope */
.letter__fold { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .7s cubic-bezier(.4, 0, .2, 1), visibility 0s .7s; }
.letter.is-open .letter__fold { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .7s cubic-bezier(.4, 0, .2, 1); }
.letter__paper { min-height: 0; overflow: hidden; margin: -8px 26px 0; padding: 0 36px; border-radius: 0 0 10px 10px; background: linear-gradient(90deg, transparent 22px, color-mix(in srgb, var(--c) 45%, transparent) 22px 24px, transparent 24px), repeating-linear-gradient(transparent 0 31px, #e3ecf4 31px 32px) 0 30px, #fffef9; box-shadow: 0 18px 30px -20px rgba(70, 40, 20, .45); opacity: 0; transform: translateY(-30px); transition: opacity .5s, transform .7s cubic-bezier(.34, 1.2, .64, 1), padding .7s; }
.letter.is-open .letter__paper { padding: 34px 36px 26px; opacity: 1; transform: none; transition-delay: .15s; }
.post .letter__paper p { margin: 0 0 14px; font-size: 16px; line-height: 32px; color: #3c4741; }
.post .letter__paper p:last-child { margin-bottom: 0; }

/* ---------- The reviews on Google and Facebook: two postage stamps under the letters (parts/review-links.php) ---------- */
/* (the toothed edge is a mask on the link; its shadow is on the item, or the mask would cut it away) */
.reviews { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px 44px; margin: 60px auto 0; padding: 0; list-style: none; }
.reviews--stamps .reviews__item { display: flex; filter: drop-shadow(0 3px 2px rgba(70, 40, 20, .12)) drop-shadow(0 14px 16px rgba(70, 40, 20, .12)); rotate: -3deg; transition: rotate .45s cubic-bezier(.34, 1.5, .64, 1), translate .45s cubic-bezier(.34, 1.5, .64, 1); }
.reviews--stamps .reviews__item:nth-child(2) { rotate: 2.5deg; }
.reviews--stamps .reviews__item:hover, .reviews--stamps .reviews__item:focus-within { rotate: 0deg; translate: 0 -6px; }
.reviews--stamps .reviews__link { display: grid; align-content: start; justify-items: center; gap: 10px; width: 224px; padding: 9px 9px 14px; background: #fff; text-decoration: none; -webkit-mask: radial-gradient(circle 3.5px at 4px 4px, transparent 98%, #000) -4px -4px / 9px 9px, linear-gradient(#000 0 0) content-box; mask: radial-gradient(circle 3.5px at 4px 4px, transparent 98%, #000) -4px -4px / 9px 9px, linear-gradient(#000 0 0) content-box; }
.reviews--stamps .reviews__link:focus-visible { outline: none; }
.reviews--stamps .reviews__item:focus-within { outline: 3px solid #52aae8; outline-offset: 4px; }
.reviews--stamps .reviews__icon { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; background: #fff6dc; }
.reviews--stamps .reviews__item--facebook .reviews__icon { background: #e4f1fc; }
.reviews--stamps .reviews__icon svg { width: 70px; height: 70px; transition: scale .45s cubic-bezier(.34, 1.5, .64, 1); }
.reviews--stamps .reviews__item:hover .reviews__icon svg { scale: 1.08; }
.reviews--stamps .reviews__label { font: 400 22px/1.2 'Cabin Sketch', Arial, sans-serif; color: #3c4741; text-align: center; }
.bg .reviews--stamps .reviews__label { font-family: 'Neucha', Arial, sans-serif; }

/* ---------- Smaller screens ---------- */
@media only screen and (max-width: 768px) {
	.reviews { gap: 22px; margin-top: 44px; }
	.reviews--stamps .reviews__link { width: 152px; }
	.reviews--stamps .reviews__icon svg { width: 56px; height: 56px; }
	.reviews--stamps .reviews__label { font-size: 19px; }
	.post__sky { padding-top: 96px; }
	.post .post__title { padding: 0 16px; font-size: 30px; }
	.post .post__intro p { font-size: 16px; }
	.post__letters { gap: 22px; margin-top: 34px; }
	.letter__env { height: 134px; }
	.letter__flap { height: 64px; }
	/* the name keeps clear of the stamp and of its postmark, also when it takes two lines */
	.letter__from { left: 20px; right: 112px; bottom: 16px; font-size: 19px; line-height: 1.2; }
	.letter__stamp { right: 16px; top: 16px; width: 54px; height: 64px; }
	.letter__stamp b { width: 42px; height: 52px; font-size: 24px; }
	.letter__mark { right: 44px; top: 18px; width: 54px; height: 36px; }
	.letter__mark::after { display: none; }
	.letter__paper { margin: -8px 10px 0; }
	.letter.is-open .letter__paper { padding: 28px 18px 20px 34px; }
}
@media (prefers-reduced-motion: reduce) {
	.post *, .post *::before, .post *::after { animation: none !important; transition: none !important; }
	.post .post__title, .post__intro, .letter { opacity: 1 !important; transform: none !important; }
	.letter__mark { opacity: 1; transform: rotate(-12deg); }
	.post__birds { display: none; }
}
