/*
 * Cards: the whole card is the link (the heading link stretches over it); one ↗ chip in the top-right
 * corner. On hover the chip fills plum and the arrow nudges 4px north-east; the image scales 1.03.
 */

.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink) {
	--chip-inset: 12px;
	position: relative;
}

.wp-block-group.is-style-card {
	--chip-inset: 16px;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--base-2);
}

.wp-block-group.is-style-card-ink {
	--chip-inset: 0px;
	border-radius: var(--wp--custom--radius--media);
	background: var(--wp--preset--color--surface-dark);
	color: var(--wp--preset--color--on-dark);
}

/* chip */
.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink)::before {
	content: "";
	position: absolute;
	top: var(--chip-inset);
	right: var(--chip-inset);
	z-index: 2;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--wp--custom--chip--bg);
	box-shadow: 0 0 0 1px rgb(35 33 43 / 0.1);
	pointer-events: none;
	transition: background-color var(--wp--custom--motion--fill) var(--wp--custom--motion--ease), box-shadow var(--wp--custom--motion--fill) var(--wp--custom--motion--ease);
}

.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink)::after {
	content: "";
	position: absolute;
	top: calc(var(--chip-inset) + 11px);
	right: calc(var(--chip-inset) + 11px);
	z-index: 2;
	width: 18px;
	height: 18px;
	background: var(--wp--custom--chip--fg);
	-webkit-mask: var(--bt-ar-ne-18) 0 0 / 100% 100% no-repeat;
	mask: var(--bt-ar-ne-18) 0 0 / 100% 100% no-repeat;
	pointer-events: none;
	transition: background-color var(--wp--custom--motion--fill) var(--wp--custom--motion--ease), transform var(--wp--custom--motion--fill) var(--wp--custom--motion--ease);
}

.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink):is(:hover, :focus-within)::before {
	background: var(--wp--custom--chip--hover-bg);
	box-shadow: none;
}

.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink):is(:hover, :focus-within)::after {
	background: var(--wp--custom--chip--hover-fg);
	transform: translate(4px, -4px);
}

/* the stretched link */
.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink) :is(h2, h3, h4) a {
	color: inherit;
	text-decoration: none;
}

.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink) :is(h2, h3, h4) a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink) :is(h2, h3, h4) a:focus-visible {
	outline: none;
}

.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink):has(:is(h2, h3, h4) a:focus-visible) {
	outline: var(--wp--custom--focus--width) solid var(--bt-focus);
	outline-offset: 4px;
}

.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink):is(:hover, :focus-within) :is(h2, h3, h4) a {
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.18em;
}

/* other interactive things inside a card stay clickable above the stretched link */
.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink) :is(a, button):not(:is(h2, h3, h4) a) {
	position: relative;
	z-index: 3;
}

/* media */
.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink) .wp-block-image {
	overflow: hidden;
}

.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink) .wp-block-image img {
	transition: transform var(--wp--custom--motion--media) ease-out;
}

.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink):hover .wp-block-image img {
	transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink):is(:hover, :focus-within)::after,
	.wp-block-group:is(.is-style-card, .is-style-card-plain, .is-style-card-ink):hover .wp-block-image img {
		transform: none !important;
	}
}

/* ================= Home sections (patterns) ================= */

/* hero */
:root .bt-hero {
	padding-top: clamp(36px, 4.4vw, 64px);
}

:root .bt-hero__row {
	gap: clamp(36px, 5vw, 96px);
}

:root .bt-hero__text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding-block: clamp(0px, 2vw, 32px);
}

:root .bt-hero__text > * {
	margin-block: 0;
}

:root .bt-hero h1 {
	margin: 0;
}

:root .bt-hero__lede {
	max-width: 34em;
	margin-top: clamp(20px, 2vw, 28px) !important;
	line-height: 1.5;
}

:root .bt-hero__actions {
	gap: 12px 32px;
	margin-top: clamp(32px, 3vw, 44px) !important;
}

:root .bt-hero__note {
	margin-top: clamp(28px, 3vw, 40px) !important;
}

:root .bt-hero__figure {
	flex: 1 1 25rem;
	min-width: 0;
	max-width: 560px;
}

/* practical strip */
:root .bt-practical {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)) !important;
	margin-top: clamp(48px, 5vw, 72px) !important;
	border-top: 1px solid var(--wp--preset--color--line);
	gap: 0 32px !important;
}

:root .bt-practical > .wp-block-group {
	padding: 26px 0 30px;
}

:root .bt-practical .is-style-eyebrow {
	margin: 0;
	line-height: 1.6;
}

:root .bt-practical p:not(.is-style-eyebrow) {
	margin: 8px 0 0;
	color: var(--wp--preset--color--contrast-2);
}

:root .bt-practical strong {
	color: var(--wp--preset--color--contrast);
}

:root .bt-practical p a:first-child {
	font-weight: 600;
	color: var(--wp--preset--color--contrast);
}

:root .bt-practical .wp-block-buttons {
	margin-top: 8px;
	gap: 0;
}

:root .bt-practical .is-style-text-link .wp-block-button__link {
	min-height: 36px;
}

/* shared section heading block (eyebrow + h2) */
:root .bt-heading .is-style-eyebrow,
:root .bt-who .is-style-eyebrow,
:root .bt-osh .is-style-eyebrow,
:root .bt-members .is-style-eyebrow,
:root .bt-sister-band .is-style-eyebrow {
	margin-top: 0;
	margin-bottom: clamp(16px, 1.6vw, 22px);
}

:root :is(.bt-who, .bt-gen, .bt-highlights, .bt-osh, .bt-moments, .bt-members, .bt-sister-band, .bt-cards) h2 {
	margin-bottom: 0;
}

/* eyebrow followed by a heading: the canvas gap everywhere (after the reset above) */
:root :is(p, h2).is-style-eyebrow + :is(h1, h2) {
	margin-top: clamp(16px, 1.6vw, 22px);
}

/* who we are */
:root .bt-who__row {
	gap: 48px clamp(48px, 7vw, 128px);
}

:root .bt-who__text {
	flex: 1 1 25rem;
	min-width: 0;
	max-width: 520px;
}

:root .bt-who__text > * {
	margin-block: 0;
}

:root .bt-who__text h2 + p {
	margin-top: 24px;
	color: var(--wp--preset--color--contrast-2);
}

:root .bt-who__text .wp-block-buttons {
	margin-top: 20px;
}

:root .bt-who__card > * {
	margin-block: 0;
}

/* the card's photographs: community life across the years, each at its own ratio in a 16:9 frame (never
   cropped through a group). The carousel sits above the card's stretched link, so swiping and its buttons
   never open Our Heritage. */
:root .bt-who__card .bt-carousel--single {
	--bt-ratio: 16 / 9;
	position: relative;
	z-index: 3;
}

:root .bt-who__card .is-style-eyebrow {
	margin: 28px 0 10px;
}

:root .bt-who__card h3 + p {
	max-width: 34em;
	margin-top: 12px;
	color: var(--wp--preset--color--contrast-2);
}

/* a place for every generation */
:root .bt-gen {
	padding-bottom: var(--wp--preset--spacing--section);
}

:root .bt-gen__head {
	gap: 16px 48px;
	margin-bottom: clamp(32px, 3.4vw, 48px);
	padding-top: clamp(56px, 6vw, 88px);
	border-top: 1px solid var(--wp--preset--color--line);
}

:root .bt-gen__title {
	flex: 1 1 32.5rem;
	min-width: 0;
}

:root .bt-gen__title > * {
	margin-block: 0;
}

:root .bt-gen__head > p {
	flex: 0 1 30em;
	margin: 0;
	color: var(--wp--preset--color--contrast-2);
}

:root .bt-gen__grid {
	gap: clamp(16px, 1.7vw, 24px) !important;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)) !important;
}

:root .bt-tile {
	display: grid;
	grid-template-areas: "photo" "body";
	grid-template-rows: auto 1fr;
}

:root .bt-tile > * {
	margin-block: 0;
}

/* the photograph, then the generation's illustration as a round emblem badge over its lower-left corner
   (Sprint 11, owner decision): photo and badge share the first grid row */
:root .bt-tile > .bt-tile__photo {
	grid-area: photo;
	margin: 0;
	overflow: hidden;
	background: var(--wp--preset--color--base-3);
}

:root .bt-tile > .bt-tile__photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

:root .bt-tile > .bt-tile__badge {
	grid-area: photo;
	z-index: 2;
	place-self: end start;
	width: 88px;
	height: 88px;
	margin: 0 0 -44px 20px;
	overflow: hidden;
	border: 4px solid var(--wp--preset--color--base-2);
	border-radius: 50%;
	background: var(--wp--preset--color--base);
	box-shadow: 0 6px 18px rgb(35 33 43 / 0.14);
}

:root .bt-tile > .bt-tile__badge img {
	display: block;
	width: 100%;
	height: 100%;
	/* the drawings carry their own margin: scale it away so the object fills the circle (scale, not
	   transform, so the card's hover zoom still composes with it) */
	scale: 1.3;
}

:root .bt-tile__body {
	grid-area: body;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 58px 24px 26px;
}

:root .bt-tile__body > * {
	margin: 0;
}

:root .bt-tile__body h3 {
	font-size: var(--wp--preset--font-size--heading-xs);
	line-height: 1.15;
}

:root .bt-tile__sub {
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 500;
	color: var(--wp--preset--color--muted);
}

:root .bt-tile__body p:last-child {
	margin-top: 6px;
	font-size: var(--wp--preset--font-size--body-s);
	line-height: 1.5;
	color: var(--wp--preset--color--contrast-2);
}

/* phones: one column; the photo goes wide (16:9, about 200px tall at 390px) so the text is never squeezed */
@media (max-width: 600px) {
	:root .bt-tile > .bt-tile__photo img {
		aspect-ratio: 16 / 9;
	}

	:root .bt-tile > .bt-tile__badge {
		width: 76px;
		height: 76px;
		margin: 0 0 -38px 16px;
	}

	:root .bt-tile__body {
		padding: 50px 18px 22px;
	}

	:root .bt-tile.is-style-card {
		--chip-inset: 12px;
	}

	:root .bt-tile__body h3 {
		font-size: 1.3125rem;
	}
}

/* section heading (eyebrow + h2) */
:root .bt-heading {
	margin-bottom: clamp(32px, 3.4vw, 48px);
}

:root .bt-heading > * {
	margin-block: 0;
}

/* highlights: six photo cards in the carousel (Sprint 11), on paper over the sand band */
:root .bt-highlights h2 {
	max-width: 16em;
}

:root .bt-highlights .bt-feature.is-style-card {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--base);
}

:root .bt-feature > * {
	margin-block: 0;
}

:root .bt-feature__media {
	margin: 0;
}

:root .bt-feature__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 2;
	object-fit: cover;
}

:root .bt-feature__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 20px 24px 26px;
}

:root .bt-feature__body > * {
	margin: 0;
}

:root .bt-feature__body h3 {
	padding-right: 8px;
	line-height: 1.2;
}

:root .bt-feature__body h3 + p {
	color: var(--wp--preset--color--contrast-2);
	font-size: var(--wp--preset--font-size--body-s);
	line-height: 1.55;
}

/* our shared home band */
:root .bt-osh__row {
	gap: 48px clamp(48px, 6vw, 112px);
}

:root .bt-osh__text {
	flex-basis: 26.25rem;
}

:root .bt-osh__text > * {
	margin-block: 0;
}

:root .bt-osh__text h2 + p {
	max-width: 32em;
	margin-top: 22px;
	color: var(--wp--preset--color--on-dark-2);
}

:root .bt-osh__figures {
	margin-top: 36px !important;
	padding-top: 28px;
	border-top: 1px solid var(--wp--preset--color--muted);
}

:root .bt-osh__figures > * {
	margin-block: 0;
}

:root .bt-osh__amount {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	line-height: 0.96;
	letter-spacing: -0.012em;
	font-variant-numeric: lining-nums tabular-nums;
}

:root .bt-osh__amount + p {
	margin: 12px 0 18px !important;
	font-size: var(--wp--preset--font-size--body);
	color: var(--wp--preset--color--on-dark-2);
}

:root .bt-osh__meta {
	justify-content: space-between;
	gap: 12px;
	margin-top: 10px !important;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--on-dark-muted);
}

:root .bt-osh__meta > p {
	margin: 0;
}

:root .bt-osh-progress .bt-osh__meta {
	display: flex;
	flex-wrap: wrap;
}

/* before the committee sets real figures: the project's history (blocks/osh-progress) */
:root .bt-osh__history {
	max-width: 30em;
	color: var(--wp--preset--color--on-dark);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--lede);
	line-height: 1.45;
}

:root .bt-osh__history + .bt-osh__meta {
	margin-top: 16px !important;
}

:root .bt-osh__actions {
	gap: 12px 32px;
	margin-top: 36px !important;
}

/* moments */
:root .bt-moments {
	overflow: hidden;
	padding-block: var(--wp--preset--spacing--section) clamp(64px, 7vw, 104px);
}

:root .bt-moments__head {
	gap: 20px 48px;
	margin-bottom: clamp(28px, 3vw, 40px);
}

:root .bt-moments__head > .wp-block-group:first-child {
	flex: 1 1 26.25rem;
	min-width: 0;
}

:root .bt-moments__head > .wp-block-group:first-child > .is-style-eyebrow {
	margin-block: 0;
}

:root .bt-moments__tools {
	gap: 12px 24px;
}

/* members band */
:root .bt-members {
	padding-block: var(--wp--preset--spacing--section-s);
}

:root .bt-members__row {
	gap: 32px clamp(48px, 6vw, 112px);
}

:root .bt-members__text {
	flex: 1 1 32.5rem;
	min-width: 0;
}

:root .bt-members__text > * {
	margin-block: 0;
}

:root .bt-members__text h2 {
	max-width: 18em;
}

:root .bt-members__text h2 + p {
	max-width: 34em;
	margin-top: 18px;
	color: var(--wp--preset--color--contrast-2);
}

:root .bt-members .wp-block-buttons {
	gap: 12px;
}

/* sister charity */
:root .bt-sister__row {
	gap: 40px clamp(48px, 6vw, 112px);
}

:root .bt-sister__logo {
	flex: 1 1 18.75rem;
	min-width: 0;
	max-width: 400px;
	margin: 0;
}

:root .bt-sister__logo img {
	display: block;
	width: 100%;
	max-width: 260px;
	height: auto;
}

:root .bt-sister__text > * {
	margin-block: 0;
}

:root .bt-sister__text h2 + p {
	max-width: 34em;
	margin-top: 20px;
	color: var(--wp--preset--color--contrast-2);
}

:root .bt-sister__text .wp-block-buttons {
	margin-top: 24px;
}

:root .bt-help {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 20px;
	margin-top: 28px !important;
	color: var(--wp--preset--color--muted);
}

:root .bt-help strong:first-child {
	color: var(--wp--preset--color--contrast);
}

:root .bt-help a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	color: var(--wp--preset--color--contrast-2);
	text-decoration: none;
}

:root .bt-help a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.35em;
}

/* 404 */
:root .bt-404 {
	padding-block: clamp(56px, 7vw, 112px) var(--wp--preset--spacing--section);
}

:root .bt-404__row {
	gap: 48px clamp(48px, 7vw, 128px);
}

:root .bt-404__text {
	flex: 1.2 1 32.5rem;
	min-width: 0;
}

:root .bt-404__text > * {
	margin-block: 0;
}

:root .bt-404__text h1 {
	line-height: 1.04;
}

:root .bt-404__text h1 + p {
	max-width: 32em;
	margin-top: 22px;
	font-size: clamp(1.1875rem, 1.5vw, 1.3125rem);
	color: var(--wp--preset--color--contrast-2);
}

:root .bt-404__text .bt-tr {
	margin-top: 10px;
	color: var(--wp--preset--color--muted);
}

:root .bt-404__text .wp-block-search {
	max-width: 560px;
	margin-top: 32px;
}

:root .bt-404__text .wp-block-buttons {
	gap: 12px 32px;
	margin-top: 32px;
}

:root .bt-404__art {
	flex: 1 1 22.5rem;
	min-width: 0;
	max-width: 480px;
	margin: 0;
}

:root .bt-404__art img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}

/* quote */
:root .bt-quote {
	padding-block: var(--wp--preset--spacing--section);
}

/* generic card grid */
:root .bt-cards__grid {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
	gap: 32px !important;
}

:root .bt-cards .bt-card > * {
	margin-block: 0;
}

:root .bt-cards .bt-card .wp-block-image {
	border-radius: var(--wp--custom--radius--media);
}

:root .bt-cards .bt-card h3 {
	margin-top: 18px;
}

:root .bt-cards .bt-card h3 + p {
	margin-top: 10px;
	color: var(--wp--preset--color--contrast-2);
}

/* members gate (atam-core template) and page heads */
:root .bt-gate,
:root .bt-page-head {
	padding-block: clamp(56px, 7vw, 112px);
}

:root .bt-gate > *,
:root .bt-page-head > * {
	margin-block: 0;
}

:root .bt-gate h1,
:root .bt-page-head h1 {
	max-width: 18em;
	font-size: var(--wp--preset--font-size--display-s);
}

/* a page head is a constrained group: a long title (an album such as "İlyas Yalçıntaş concert 2018") keeps
   to the content column and lines up with its date and text instead of spreading 18em wide (Sprint 11) */
:root .bt-page-head.is-layout-constrained > h1 {
	max-width: min(18em, var(--wp--style--global--content-size));
}

/* the single template's article (albums and other single entries) is a page head holding the whole entry:
   the photo or album, the text and the links below keep their distance from the title and each other */
:root article.bt-page-head > .wp-block-post-title ~ * {
	margin-block-start: clamp(28px, 4vw, 48px);
}

:root article.bt-page-head > .wp-block-post-navigation-link + .wp-block-post-navigation-link {
	margin-block-start: 12px;
}

:root .bt-gate h1 + p,
:root .bt-page-head h1 + p {
	max-width: 34em;
	margin-top: 22px;
	color: var(--wp--preset--color--contrast-2);
}

:root .bt-gate .wp-block-buttons {
	margin-top: 32px;
}

/* Home, below the fold (Sprint 10, ADR-059): the browser skips laying out and painting these sections
   until they come near the screen, so the first screen (hero and practical strip) is ready sooner. Each
   keeps a size close to its real one, and remembers its real size once shown, so the scrollbar holds still.
   Content stays in the page for search, find-in-page, links to sections and assistive technology. */
:root .bt-hero--slides ~ .bt-practical-sec ~ section.alignfull {
	content-visibility: auto;
	contain-intrinsic-size: auto var(--bt-defer-h, 900px);
}

:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-who {
	--bt-defer-h: 920px;
}

:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-gen {
	--bt-defer-h: 1570px;
}

:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-highlights {
	--bt-defer-h: 1070px;
}

:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-osh {
	--bt-defer-h: 870px;
}

:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-moments {
	--bt-defer-h: 740px;
}

:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-members {
	--bt-defer-h: 410px;
}

:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-sister-band {
	--bt-defer-h: 600px;
}

:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-sponsor-strip {
	--bt-defer-h: 175px;
}

@media (max-width: 600px) {
	:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-who {
		--bt-defer-h: 1040px;
	}

	:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-gen {
		--bt-defer-h: 1490px;
	}

	:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-highlights {
		--bt-defer-h: 1100px;
	}

	:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-osh {
		--bt-defer-h: 1080px;
	}

	:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-moments {
		--bt-defer-h: 600px;
	}

	:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-members {
		--bt-defer-h: 540px;
	}

	:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-sister-band {
		--bt-defer-h: 650px;
	}

	:root .bt-hero--slides ~ .bt-practical-sec ~ .bt-sponsor-strip {
		--bt-defer-h: 270px;
	}
}
