/*
 * WordPress additions to the design stylesheet (kim-flower.css).
 */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.kf-skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100;
	width: auto;
	height: auto;
	padding: 8px 12px;
	clip: auto;
	background: var(--background);
	color: var(--foreground);
	border-radius: 6px;
}

/* Keep the sticky header below the admin bar when logged in. */
body.admin-bar .kf-site-header {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .kf-site-header {
		top: 46px;
	}
}

/* Post content from the WordPress editor. */
.kf-entry p {
	margin: 1em 0;
}

.kf-entry h2,
.kf-entry h3 {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 1.5rem;
	line-height: 1.25;
	margin: 1.5em 0 0.5em;
}

.kf-entry a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.kf-entry img {
	height: auto;
	margin: 1em 0;
}

.kf-entry ul {
	list-style: disc;
	padding-left: 1.25em;
	margin: 1em 0;
}

.kf-entry ol {
	list-style: decimal;
	padding-left: 1.25em;
	margin: 1em 0;
}

/* Page links for the shop and the blog. paginate_links() outputs the links directly inside the nav. */
.kf-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
}

.kf-pagination .nav-links {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
}

.kf-pagination .page-numbers {
	display: inline-flex;
	min-width: 36px;
	height: 36px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0 10px;
	font-size: 0.875rem;
}

.kf-pagination a.page-numbers:hover {
	background: var(--secondary);
}

.kf-pagination .page-numbers.current {
	background: var(--primary);
	border-color: var(--primary);
	color: var(--primary-foreground);
}

/* Product photos with several images: a horizontal slider. Swiping works without the script; the buttons need it. */
.kf-gallery {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--muted);
}

.kf-gallery-track {
	display: flex;
	height: 100%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.kf-gallery-track::-webkit-scrollbar {
	display: none;
}

.kf-gallery-slide {
	flex: 0 0 100%;
	height: 100%;
	scroll-snap-align: start;
}

.kf-gallery-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Product photos: the whole photo is shown, with a blurred copy of it behind (the compiled Tailwind file has no
   object-contain, so the fit is set here). */
.kf-photo-frame {
	position: relative;
	overflow: hidden;
	background: var(--muted);
}

.kf-photo-frame > .kf-photo-backdrop {
	position: absolute;
	top: -10%;
	left: -10%;
	width: 120%;
	height: 120%;
	max-width: none;
	object-fit: cover;
	filter: blur(24px);
	opacity: 0.55;
}

.kf-photo-frame > .kf-photo-main {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.kf-gallery-nav {
	position: absolute;
	top: 50%;
	display: inline-flex;
	width: 36px;
	height: 36px;
	align-items: center;
	justify-content: center;
	transform: translateY(-50%);
	border: 1px solid var(--border);
	border-radius: 9999px;
	background: rgb(255 255 255 / 0.9);
	color: var(--foreground);
	cursor: pointer;
	box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.kf-gallery-nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.kf-gallery-nav:focus-visible {
	outline: 2px solid var(--ring);
	outline-offset: 2px;
}

.kf-gallery-prev {
	left: 12px;
}

.kf-gallery-next {
	right: 12px;
}

.kf-gallery-count {
	position: absolute;
	right: 12px;
	bottom: 12px;
	margin: 0;
	padding: 2px 10px;
	border-radius: 9999px;
	background: rgb(0 0 0 / 0.55);
	color: #fff;
	font-size: 0.75rem;
	line-height: 1.25rem;
}

/* The ring colour is the theme's primary colour (rgb values), so it works in every browser. */
:root {
	--kf-ping: 96 38 63;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--kf-ping: 217 147 174;
	}
}

/* Ping ring on the call-to-action buttons (Mua ngay, Gọi), only while the button is hovered or has keyboard focus.
   The ring is a box-shadow that spreads 8px, so it stays inside the card padding and is not clipped. Off for
   visitors who ask for less motion. */
.kf-cta:hover,
.kf-cta:focus-visible {
	animation: kf-cta-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes kf-cta-ping {
	0% {
		box-shadow: 0 0 0 0 rgb(var(--kf-ping) / 0.45);
	}
	100% {
		box-shadow: 0 0 0 8px rgb(var(--kf-ping) / 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.kf-cta {
		animation: none;
	}
}

/* Product lists inside a post (the [products] shortcode): the shop's card, in a grid. The .kf-entry selectors beat the
   list and paragraph rules that the post body sets. */
.kf-product-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem 1rem;
	list-style: none;
	margin: 2rem 0;
	padding: 0;
}

@media (min-width: 640px) {
	.kf-product-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.kf-product-list--cols-1 {
	grid-template-columns: minmax(0, 260px);
}

.kf-product-list--cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kf-entry ul.kf-product-list {
	list-style: none;
	margin: 2rem 0;
	padding: 0;
}

.kf-entry ul.kf-product-list > li {
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.kf-entry .kf-product-list p,
.kf-entry .kf-product-list img {
	margin: 0;
}

.kf-entry .kf-product-list a {
	text-decoration: none;
}

/* Every card in a row is as tall as the tallest, so the buy buttons line up. */
.kf-product-list > li {
	display: flex;
	flex-direction: column;
}

.kf-product-list > li > article {
	flex: 1 1 auto;
}

