/*
 * Καστανούλα: everything theme.json cannot express.
 *
 * 1. Base
 * 2. Header and footer
 * 3. Shared pieces: tags, pills, cards, details, links
 * 4. Block styles on core blocks
 * 5. News listing
 * 6. Motion
 */

/* 1. Base ----------------------------------------------------------------- */

html {
	scroll-behavior: smooth;
	scrollbar-color: var(--wp--custom--color--sage-600) transparent;
	scrollbar-width: thin;
}

/* overflow: clip hides the overhang of the parallax layers without creating a
   scroll container that would break sticky positioning. The column layout lets
   short pages (404, empty search) fill the screen: <main> takes up the slack,
   so the footer sits on the bottom edge instead of floating above it. */
.wp-site-blocks {
	overflow: clip;
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > .k-main {
	flex: 1 0 auto;
}

/* Header, main and footer butt up against each other; sections carry their own space. */
.wp-site-blocks > * {
	margin-block: 0;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

::selection {
	background: rgba(198, 113, 57, 0.3);
}

.k-main {
	position: relative;
	padding-top: var(--wp--custom--header-height);
}

/* A page that opens with the full-screen hero runs it under the header. */
.k-main:has(> .wp-block-post-content > .is-style-kastanoula-hero:first-child) {
	padding-top: 0;
}

/* Paragraph block styles come first so every contextual variant below overrides them. */
.is-style-kastanoula-kicker {
	color: var(--wp--preset--color--accent-deep);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	line-height: 1.4;
	text-transform: uppercase;
}

.is-style-kastanoula-lede {
	max-width: 52ch;
	color: var(--wp--preset--color--muted);
	font-size: 1.09375rem;
	line-height: 1.66;
	text-wrap: pretty;
}

.wp-block-cover .is-style-kastanoula-lede:not(.has-text-color) {
	color: #e7e2d2;
}

.is-style-kastanoula-letter {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-bottom: 18px;
	border-radius: 999px;
	background: var(--wp--custom--color--accent-200);
	color: var(--wp--custom--color--accent-800);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.1875rem;
	line-height: 1;
}

/* 2. Header and footer ------------------------------------------------------ */

.k-header {
	position: fixed;
	z-index: 50;
	top: var(--wp-admin--admin-bar--height, 0);
	right: 0;
	left: 0;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.06),
		var(--wp--preset--shadow--md);
	transition: transform 0.32s var(--wp--custom--ease);
}

.k-header.is-hidden {
	transform: translateY(-110%);
}

/* Keyboard focus on a header link brings the header back. */
.k-header.is-hidden:has(:focus-visible) {
	transform: none;
}

.k-header__bar {
	min-height: var(--wp--custom--header-height);
}

.k-brand {
	padding-block: 12px;
}

.k-brand .wp-block-site-title a {
	color: var(--wp--preset--color--cream);
	text-decoration: none;
}

.k-brand__altitude {
	color: var(--wp--custom--color--accent-300);
	font-size: 0.625rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.k-header .wp-block-navigation .wp-block-navigation-item__content {
	padding: 9px 14px;
	border-radius: var(--wp--custom--radius--sm);
	color: var(--wp--custom--color--footer-text);
	text-decoration: none;
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
}

.k-header .wp-block-navigation .wp-block-navigation-item__content:hover {
	background: rgba(255, 255, 255, 0.09);
	color: var(--wp--preset--color--cream);
}

.k-header
	.wp-block-navigation
	.current-menu-item
	> .wp-block-navigation-item__content,
.k-header .wp-block-navigation [aria-current="page"] {
	background: var(--wp--custom--color--accent-400);
	color: var(--wp--custom--color--accent-900);
}

.k-header .wp-block-navigation__container {
	gap: 2px;
}

.k-header .wp-block-navigation__responsive-container-open,
.k-header .wp-block-navigation__responsive-container-close {
	color: var(--wp--preset--color--cream);
}

.k-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--cream);
}

.k-header .is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.75rem;
}

.k-footer {
	color: var(--wp--custom--color--footer-text);
}

.k-footer a {
	color: var(--wp--custom--color--footer-text);
	text-decoration: none;
}

.k-footer a:hover {
	color: var(--wp--custom--color--accent-300);
}

.k-footer .wp-block-navigation {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
}

.k-footer__brand {
	margin: 0 0 12px;
	color: var(--wp--preset--color--cream);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.875rem;
	line-height: 1.2;
}

.k-footer .is-style-kastanoula-kicker {
	margin-bottom: 16px;
	color: var(--wp--custom--color--accent-300);
	font-weight: 400;
	letter-spacing: 0.18em;
}

.k-footer__fine {
	color: #9e9a8a;
	font-size: 0.78125rem;
}

.k-to-top {
	display: flex;
	position: fixed;
	z-index: 60;
	right: clamp(16px, 3vw, 34px);
	bottom: clamp(16px, 3vw, 34px);
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	background: var(--wp--custom--color--sage-800);
	box-shadow: var(--wp--preset--shadow--md);
	color: var(--wp--preset--color--cream);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition:
		opacity 0.28s ease,
		transform 0.28s ease,
		visibility 0.28s,
		background-color 0.2s ease;
}

.k-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.k-to-top:hover {
	background: var(--wp--preset--color--accent-deep);
}

/* 3. Shared pieces ---------------------------------------------------------- */

.k-tag {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.6875rem;
	letter-spacing: 0.02em;
	line-height: 1.55;
}

.k-tag.is-accent {
	background: var(--wp--custom--color--accent-100);
	color: var(--wp--custom--color--accent-800);
}

.k-tag.is-sage {
	background: var(--wp--custom--color--sage-100);
	color: var(--wp--custom--color--sage-800);
}

.k-tag.is-neutral {
	background: var(--wp--preset--color--surface);
	color: var(--wp--custom--color--neutral-800);
}

.k-post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.k-post-meta__date {
	color: var(--wp--custom--color--neutral-600);
	font-size: 0.75rem;
}

.k-post-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--preset--color--surface);
	box-shadow: var(--wp--preset--shadow--sm);
	color: inherit;
	text-decoration: none;
	transition:
		transform 0.35s var(--wp--custom--ease),
		box-shadow 0.35s ease;
}

.k-post-card:hover {
	box-shadow: 0 6px 16px -7px rgba(32, 30, 29, 0.24);
	color: inherit;
	transform: translateY(-6px) scale(1.012);
}

.k-post-card__media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--wp--custom--color--neutral-200);
}

.k-post-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.k-post-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 20px 22px 24px;
}

.k-post-card__title {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.2;
}

.k-post-card__excerpt {
	margin: 0;
	color: var(--wp--preset--color--muted);
	font-size: 0.90625rem;
	line-height: 1.55;
	text-wrap: pretty;
}

.k-pill {
	display: inline-block;
	padding: 9px 18px;
	border: 1px solid var(--wp--custom--color--divider);
	border-radius: 999px;
	color: var(--wp--custom--color--neutral-800);
	font-size: 0.84375rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition:
		border-color 0.2s ease,
		background-color 0.2s ease;
}

.k-pill:hover {
	border-color: var(--wp--custom--color--sage-600);
	color: var(--wp--custom--color--neutral-800);
}

.k-pill.is-active {
	border-color: var(--wp--custom--color--sage-700);
	background: var(--wp--custom--color--sage-700);
	color: var(--wp--preset--color--cream);
}

.wp-block-kastanoula-category-filter__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Author under a post title: profile picture in a small circle, then the name.
   No "by" word, since Greek would need the article and a declined name. */
.k-byline {
	align-items: center;
}

.k-byline .wp-block-post-author__avatar {
	display: flex;
	margin-right: 10px;
}

/* Settings → Discussion → avatars off leaves an empty wrapper; drop it so the name
   lines up with the title. */
.k-byline .wp-block-post-author__avatar:empty {
	display: none;
}

.k-byline .wp-block-post-author__avatar img {
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: var(--wp--custom--color--neutral-200);
	box-shadow: 0 0 0 2px var(--wp--preset--color--surface);
}

.k-byline .wp-block-post-author__name {
	color: var(--wp--custom--color--neutral-800);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.4;
}

/* border-box keeps the padded box inside the text column instead of 26px wider on each side. */
.k-details {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 18px;
	margin-block: 0 32px;
	padding: 22px 26px;
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--preset--color--sage-light);
}

.k-details__item {
	margin: 0;
}

.k-details__label {
	margin-bottom: 6px;
	color: var(--wp--custom--color--sage-800);
	font-size: 0.65625rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.k-details__value {
	margin: 0;
	color: var(--wp--preset--color--forest);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.1875rem;
	line-height: 1.3;
}

.k-details__hint {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--wp--custom--color--sage-800);
	font-size: var(--wp--preset--font-size--small);
}

.k-more-link a,
.is-style-kastanoula-more a {
	color: var(--wp--preset--color--accent-deep);
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
}

.k-more-link a:hover,
.is-style-kastanoula-more a:hover {
	color: var(--wp--custom--color--accent-600);
}

/* 4. Block styles on core blocks -------------------------------------------- */

/* Covers: content sits in the wide column whatever the content position. */
.wp-block-cover:is(
	.is-style-kastanoula-hero,
	.is-style-kastanoula-page-hero,
	.is-style-kastanoula-band,
	.is-style-kastanoula-closer
) {
	padding-inline: var(--wp--style--root--padding-left, 20px);
	overflow: hidden;
}

.wp-block-cover.wp-block-cover.wp-block-cover:is(
		.is-style-kastanoula-hero,
		.is-style-kastanoula-page-hero,
		.is-style-kastanoula-band,
		.is-style-kastanoula-closer
	)
	> .wp-block-cover__inner-container {
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
}

.wp-block-cover:is(
		.is-style-kastanoula-hero,
		.is-style-kastanoula-page-hero,
		.is-style-kastanoula-band
	)
	> .wp-block-cover__inner-container.is-layout-constrained
	> * {
	margin-left: 0 !important;
}

.wp-block-cover:is(
		.is-style-kastanoula-hero,
		.is-style-kastanoula-page-hero,
		.is-style-kastanoula-band
	)
	:is(h1, h2, p) {
	text-shadow: 0 2px 20px rgba(20, 26, 14, 0.7);
}

/* The veils are dark, so text stays light even if core marks a bright photo as light. */
.wp-block-cover.is-light:is(
		.is-style-kastanoula-hero,
		.is-style-kastanoula-page-hero,
		.is-style-kastanoula-band,
		.is-style-kastanoula-closer
	)
	.wp-block-cover__inner-container {
	color: #fff;
}

.wp-block-cover:is(
		.is-style-kastanoula-hero,
		.is-style-kastanoula-page-hero,
		.is-style-kastanoula-band,
		.is-style-kastanoula-closer
	)
	.is-style-kastanoula-kicker:not(.has-text-color) {
	color: #f3e6d2;
}

/* Hero: full screen, pinned while the rest of the page slides over it. The
   admin bar pushes the page down for logged-in users, so the hero pins just
   below it; otherwise it would first scroll up by the bar's height. */
.wp-block-cover.is-style-kastanoula-hero {
	min-height: max(
		420px,
		calc(100vh - var(--wp-admin--admin-bar--height, 0px))
	) !important;
	min-height: max(
		420px,
		calc(100dvh - var(--wp-admin--admin-bar--height, 0px))
	) !important;
	padding-block: 0 clamp(120px, 14vh, 150px);
}

.wp-block-post-content > .is-style-kastanoula-hero:first-child {
	position: sticky;
	z-index: 0;
	top: var(--wp-admin--admin-bar--height, 0px);
}

/* Everything after the hero is the sheet that covers it. A margin between
   sections would open a see-through gap onto the pinned hero, so spacing
   between them has to come from padding. */
.wp-block-post-content > .is-style-kastanoula-hero:first-child ~ * {
	position: relative;
	z-index: 1;
	margin-block: 0 !important;
	background-color: var(--wp--preset--color--base);
}

/* A narrower block dropped between sections still covers the hero edge to edge. */
.wp-block-post-content
	> .is-style-kastanoula-hero:first-child
	~ :not(.alignfull) {
	box-shadow: 0 0 0 100vmax var(--wp--preset--color--base);
	clip-path: inset(0 -100vmax);
}

.wp-block-post-content > .is-style-kastanoula-hero:first-child + * {
	border-radius: 26px 26px 0 0;
	box-shadow: 0 -16px 40px -18px rgba(20, 26, 14, 0.45);
}

/* Its own compositing layer keeps the slow zoom smooth; Firefox otherwise
   steps it a whole pixel at a time. It pauses once the page covers the hero. */
.is-style-kastanoula-hero .wp-block-cover__image-background {
	animation: k-drift 28s ease-in-out infinite alternate;
	will-change: transform, translate, scale;
}

.is-style-kastanoula-hero.is-covered .wp-block-cover__image-background {
	animation-play-state: paused;
}

/* The scroll cue positions against the cover itself, not the text column. */
.wp-block-cover.is-style-kastanoula-hero > .wp-block-cover__inner-container {
	position: static;
}

.is-style-kastanoula-hero > .wp-block-cover__inner-container > * {
	position: relative;
	z-index: 1;
}

.is-style-kastanoula-hero .wp-block-heading {
	margin-block: 0 22px;
	line-height: 0.92;
	letter-spacing: -0.03em;
}

.is-style-kastanoula-hero .is-style-kastanoula-kicker {
	margin-bottom: 18px;
}

.is-style-kastanoula-hero .is-style-kastanoula-lede {
	max-width: 32ch;
	margin: 0;
	font-size: clamp(1.0625rem, 2.1vw, 1.375rem);
	line-height: 1.45;
}

.is-style-kastanoula-hero .is-style-kastanoula-lede:not(.has-text-color) {
	color: #f6ecdb;
}

@keyframes k-drift {
	from {
		scale: 1.05;
	}

	to {
		scale: 1.13;
	}
}

.wp-block-cover__inner-container > .is-style-kastanoula-scroll-cue {
	position: absolute;
	z-index: 3;
	bottom: 24px;
	left: 50%;
	margin: 0;
	transform: translateX(-50%);
}

.is-style-kastanoula-scroll-cue a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	color: #f3e6d2;
	font-size: 0.65625rem;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-decoration: none;
	text-transform: uppercase;
}

.is-style-kastanoula-scroll-cue a:hover {
	color: #fff;
}

.is-style-kastanoula-scroll-cue a::after {
	content: "";
	display: block;
	width: 1px;
	height: 36px;
	background: linear-gradient(
		180deg,
		rgba(243, 230, 210, 0),
		rgba(243, 230, 210, 0.95)
	);
	transform-origin: top;
	animation: k-cue 2.1s ease-in-out infinite;
}

@keyframes k-cue {
	0%,
	100% {
		opacity: 0.45;
		transform: scaleY(0.4);
	}

	55% {
		opacity: 1;
		transform: scaleY(1);
	}
}

/* Page hero and band */
.wp-block-cover.is-style-kastanoula-page-hero {
	min-height: 380px;
	padding-block: 0 clamp(36px, 6vh, 64px);
}

.wp-block-cover.is-style-kastanoula-band {
	min-height: clamp(340px, 52vh, 620px);
}

.is-style-kastanoula-band .wp-block-cover__inner-container > p {
	max-width: 20ch;
}

.wp-block-cover.is-style-kastanoula-closer {
	padding-block: clamp(72px, 10vw, 130px);
	text-align: center;
}

.is-style-kastanoula-closer .wp-block-cover__inner-container > * {
	margin-inline: auto;
}

.is-style-kastanoula-closer .wp-block-heading {
	max-width: 18ch;
	margin-bottom: 20px;
	line-height: 1.06;
}

.is-style-kastanoula-closer .is-style-kastanoula-lede {
	max-width: 50ch;
}

/* Group styles */
.wp-block-group.is-style-kastanoula-card {
	padding: 30px 28px 34px;
	border-radius: var(--wp--custom--radius--lg);
	background-color: var(--wp--preset--color--surface);
	box-shadow: var(--wp--preset--shadow--sm);
}

.wp-block-group.is-style-kastanoula-card-sage {
	padding: 30px 28px 34px;
	border-radius: var(--wp--custom--radius--lg);
	background-color: var(--wp--preset--color--sage-light);
	color: var(--wp--preset--color--forest);
}

.is-style-kastanoula-card-sage .is-style-kastanoula-kicker {
	color: var(--wp--custom--color--sage-800);
	font-weight: 400;
	letter-spacing: 0.16em;
}

:is(.is-style-kastanoula-card, .is-style-kastanoula-card-sage) > :first-child {
	margin-top: 0;
}

:is(.is-style-kastanoula-card, .is-style-kastanoula-card-sage) > :last-child {
	margin-bottom: 0;
}

.wp-block-group.is-style-kastanoula-figure {
	position: relative;
}

.wp-block-group.is-style-kastanoula-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 132px;
	height: 132px;
	padding: 0;
	gap: 5px;
	border-radius: 999px;
	background-color: var(--wp--preset--color--sage-soft);
	box-shadow: var(--wp--preset--shadow--md);
	text-align: center;
}

.is-style-kastanoula-badge > * {
	margin: 0 !important;
	line-height: 1;
}

.is-style-kastanoula-figure > .is-style-kastanoula-badge {
	position: absolute;
	right: -10px;
	bottom: -26px;
}

.wp-block-group.is-style-kastanoula-framed {
	overflow: hidden;
	border-radius: var(--wp--custom--radius--lg);
	background-color: var(--wp--custom--color--neutral-200);
	box-shadow: var(--wp--preset--shadow--lg);
}

.is-style-kastanoula-framed iframe {
	display: block;
	width: 100%;
	height: auto;
	border: 0;
	aspect-ratio: 4 / 3;
}

/* Image and button styles */
.wp-block-image.is-style-kastanoula-rounded img {
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--preset--shadow--md);
}

.is-style-kastanoula-figure .wp-block-image.is-style-kastanoula-rounded img {
	box-shadow: var(--wp--preset--shadow--lg);
}

.wp-block-button.is-style-kastanoula-light .wp-block-button__link {
	background: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--forest);
}

.wp-block-button.is-style-kastanoula-light .wp-block-button__link:hover {
	background: var(--wp--custom--color--accent-200);
	color: var(--wp--preset--color--forest);
}

/* 5. News listing ----------------------------------------------------------- */

.k-news-grid .wp-block-post-template {
	gap: 34px 26px;
}

.k-news-grid .wp-block-post {
	display: flex;
	position: relative;
	flex-direction: column;
}

.k-news-grid .wp-block-post-featured-image {
	margin-bottom: 18px;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--custom--color--neutral-200);
	box-shadow: var(--wp--preset--shadow--sm);
}

.k-news-grid .wp-block-post-featured-image img {
	transition: transform 0.6s var(--wp--custom--ease);
}

.k-news-grid .wp-block-post:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

.k-news-grid .wp-block-post-title {
	margin: 11px 0 9px;
	font-size: 1.5rem;
	line-height: 1.16;
}

.k-news-grid .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

/* The title link covers the whole card. */
.k-news-grid .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.k-news-grid .wp-block-post-excerpt__excerpt {
	margin: 0;
	text-wrap: pretty;
}

.wp-block-query-pagination {
	gap: 12px;
	margin-top: var(--wp--preset--spacing--60);
}

.wp-block-query-pagination a {
	text-decoration: none;
}

.wp-block-query-pagination-numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	border-radius: 999px;
}

.wp-block-query-pagination-numbers .current {
	background: var(--wp--custom--color--sage-700);
	color: var(--wp--preset--color--cream);
}

/* 6. Motion ----------------------------------------------------------------- */

/* Set by site.js only when the visitor has not asked for reduced motion. */
.k-motion .k-reveal {
	opacity: 0;
	transform: translateY(34px);
	transition:
		opacity 1s var(--wp--custom--ease),
		transform 1s var(--wp--custom--ease);
	transition-delay: var(--k-delay, 0s);
}

.k-motion .k-reveal.is-in {
	opacity: 1;
	transform: none;
}

/* Parallax layers get taller than their frame so moving them shows no edge.
   The hero photo travels exactly its top overhang by the time the page covers
   it, so this 25% also sets the strength of its parallax. */
.k-motion .is-style-kastanoula-hero .wp-block-cover__image-background {
	top: -25%;
	bottom: auto;
	height: 150%;
}

.k-motion
	:is(
		.is-style-kastanoula-page-hero,
		.is-style-kastanoula-band,
		.is-style-kastanoula-closer
	)
	.wp-block-cover__image-background {
	top: -16%;
	bottom: auto;
	height: 132%;
}

/* Home page close. site.js moves the last cover out of <main>, then <main>
   sticks with its bottom edge on the bottom of the screen while the cover and
   the footer rise over it. --k-pin-top is the screen height minus the height
   of <main>. */
.k-pin .k-main {
	position: sticky;
	z-index: 0;
	top: var(--k-pin-top, 0);
}

.k-pin .k-main + .is-style-kastanoula-closer {
	position: relative;
	z-index: 2;
	min-height: calc(100vh - var(--k-footer-h, 0px));
	box-shadow: 0 -18px 44px -18px rgba(20, 26, 14, 0.5);
}

/* The page pins when the cover reaches the bottom of the screen, so the last
   section needs room below its content: otherwise that content is frozen at
   the very bottom and covered straight away. */
.k-pin .k-main .wp-block-post-content > :last-child {
	padding-bottom: max(var(--wp--preset--spacing--80), 45vh) !important;
}

.k-pin footer.wp-block-template-part {
	position: relative;
	z-index: 2;
}

/* site.js swaps the page scrollbar for one drawn over the page on mouse and
   trackpad devices, so dark sections run under it instead of beside a strip
   of page background. */
html.k-scrollbar {
	scrollbar-width: none;
}

html.k-scrollbar::-webkit-scrollbar {
	display: none;
}

.k-scrollbar-track {
	position: fixed;
	z-index: 70;
	top: var(--wp-admin--admin-bar--height, 0);
	right: 0;
	bottom: 0;
	width: 14px;
}

.k-scrollbar-thumb {
	position: absolute;
	top: 0;
	right: 3px;
	width: 6px;
	border-radius: 999px;
	background: var(--wp--custom--color--sage-600);
	box-shadow: 0 0 0 1px rgba(245, 234, 216, 0.25);
	opacity: 0.8;
	transition:
		width 0.15s ease,
		opacity 0.15s ease;
}

.k-scrollbar-track:hover .k-scrollbar-thumb,
.k-scrollbar-track.is-dragging .k-scrollbar-thumb {
	width: 8px;
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.is-style-kastanoula-hero .wp-block-cover__image-background,
	.is-style-kastanoula-scroll-cue a::after {
		animation: none;
	}
}
