/**
 * sections.css — Della Boutique
 *
 * The eleven homepage builder sections: hero, trust bar, categories, product
 * row, tabbed products, banner, split, testimonials, Instagram, newsletter and
 * rich text. Loaded only where sections render.
 */

/* =========================================================================
   1. Hero slider
   ========================================================================= */

.della-hero {
	position: relative;
	overflow: hidden;
	background: var(--della-surface);
}

.della-hero__track {
	position: relative;
	display: grid;
}

.della-hero__slide {
	position: relative;
	grid-area: 1 / 1;
	display: flex;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--della-dur-slow) var(--della-ease);
}

.della-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

/* Explicit heights keep the hero from collapsing before its image decodes. */
.della-hero--short  .della-hero__slide { min-block-size: 46vh; }
.della-hero--medium .della-hero__slide { min-block-size: 62vh; }
.della-hero--tall   .della-hero__slide { min-block-size: 78vh; }
.della-hero--full   .della-hero__slide { min-block-size: calc(100svh - var(--della-header-h)); }

@media (min-width: 992px) {
	.della-hero--short  .della-hero__slide { min-block-size: 52vh; }
	.della-hero--medium .della-hero__slide { min-block-size: 68vh; }
	.della-hero--tall   .della-hero__slide { min-block-size: 84vh; }
}

.della-hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: var(--della-surface);
}

/*
 * Until the owner has uploaded a slide photograph the media layer is empty.
 * Rather than white text on white, fall back to a warm editorial gradient so
 * the section still reads as intentional.
 */
.della-hero__media:not(:has(img)) {
	background: linear-gradient(160deg, var(--della-heading) 0%, var(--della-accent-alt) 180%);
}

.della-hero__media img,
.della-hero__media .della-media {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	display: block;
}

.della-hero__media .della-media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.della-hero__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, var(--overlay, 0.2));
}

/* Every image della_media_image() prints, in a hero or a banner. */
.della-media__img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.della-hero__content {
	position: relative;
	z-index: 2;
	display: flex;
	inline-size: 100%;
	padding-block: clamp(50px, 9vw, 96px);
}

.della-hero__content.is-start  { justify-content: flex-start; text-align: start; }
.della-hero__content.is-center { justify-content: center; text-align: center; }
.della-hero__content.is-end    { justify-content: flex-end; text-align: end; }

.della-hero__text {
	max-inline-size: 620px;
	display: grid;
	justify-items: center;
	gap: 0;
}

.della-hero__content.is-start .della-hero__text { justify-items: start; }
.della-hero__content.is-end   .della-hero__text { justify-items: end; }

.della-hero__eyebrow {
	font-size: var(--della-fs-sm);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: var(--della-tracking-wide);
	margin-block-end: 16px;
	opacity: 0.9;
}

.della-hero__title {
	font-family: var(--della-font-heading);
	font-size: clamp(var(--della-fs-2xl), 6.4vw, var(--della-fs-4xl));
	font-weight: 500;
	line-height: 1.08;
	letter-spacing: -0.015em;
	text-transform: var(--della-heading-transform);
	text-wrap: balance;
}

.della-hero__sub {
	margin-block-start: 16px;
	font-size: var(--della-fs-md);
	line-height: 1.65;
	max-inline-size: 46ch;
	opacity: 0.92;
}

.della-hero__text .della-btn {
	margin-block-start: 28px;
}

.della-hero__slide.is-light { color: var(--della-bg); }
.della-hero__slide.is-light .della-hero__title { color: var(--della-bg); }
.della-hero__slide.is-dark  { color: var(--della-heading); }
.della-hero__slide.is-dark .della-hero__title { color: var(--della-heading); }

/* --- Arrows and dots ---------------------------------------------------- */

.della-hero__nav {
	position: absolute;
	inset-block-start: 50%;
	transform: translateY(-50%);
	z-index: 4;
	display: none;
	place-items: center;
	inline-size: 48px;
	block-size: 48px;
	border-radius: 50%; /* A genuine circle: shape, not the themed corner radius. */
	background: rgba(255, 255, 255, 0.88);
	color: var(--della-heading);
	transition: background-color var(--della-dur-fast) var(--della-ease);
}

.della-hero__nav:hover {
	background: var(--della-bg);
}

.della-hero__nav--prev { inset-inline-start: 18px; }
.della-hero__nav--next { inset-inline-end: 18px; }

@media (min-width: 768px) {
	.della-hero__nav {
		display: grid;
	}
}

.della-hero__dots {
	position: absolute;
	inset-block-end: 22px;
	inset-inline: 0;
	z-index: 4;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.della-hero__dot {
	inline-size: 26px;
	block-size: 2px;
	background: rgba(255, 255, 255, 0.45);
	transition: background-color var(--della-dur) var(--della-ease),
		transform var(--della-dur) var(--della-ease-out);
}

.della-hero__dot.is-active {
	background: #fff;
	transform: scaleY(2);
}

/* =========================================================================
   2. Trust bar (USP)
   ========================================================================= */

.della-usp {
	padding-block: 0;
}

.della-usp .della-container {
	padding-inline: var(--della-gutter);
}

/*
 * The bar already had dividers between its items but no outer edge, so it read
 * as three floating captions. The hairline frame closes it into one object and
 * matches the card and tile frames.
 */
.della-usp__list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	border: var(--della-line-hair);
	border-radius: var(--della-radius);
}

@media (min-width: 600px) {
	.della-usp__list {
		grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	}
}

.della-usp__item + .della-usp__item {
	border-block-start: var(--della-line-hair);
}

@media (min-width: 600px) {
	.della-usp__item + .della-usp__item {
		border-block-start: 0;
		border-inline-start: var(--della-line-hair);
	}
}

.della-usp__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 26px 24px;
	block-size: 100%;
	color: inherit;
	transition: background-color var(--della-dur-fast) var(--della-ease);
}

@media (min-width: 600px) {
	.della-usp__inner {
		flex-direction: column;
		text-align: center;
		gap: 12px;
		padding-block: 34px;
	}
}

a.della-usp__inner:hover {
	background: rgba(var(--della-border-rgb), 0.35);
	color: inherit;
}

.della-usp__icon {
	flex: none;
	color: var(--della-accent-alt);
	line-height: 0;
}

.della-usp__body {
	display: block;
	min-inline-size: 0;
}

.della-usp__title {
	display: block;
	font-family: var(--della-font-body);
	font-size: var(--della-fs-sm);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: var(--della-tracking);
	color: var(--della-heading);
	line-height: 1.4;
}

.della-usp__text {
	display: block;
	margin-block-start: 5px;
	font-size: var(--della-fs-sm);
	color: var(--della-muted);
	line-height: 1.5;
}

.della-usp.is-dark .della-usp__title { color: var(--della-bg); }
.della-usp.is-dark .della-usp__text { color: var(--della-footer-muted); }
.della-usp.is-dark .della-usp__item + .della-usp__item {
	border-color: rgba(var(--della-border-rgb), 0.16);
}

/* =========================================================================
   3. Category tiles
   ========================================================================= */

/* The tile grid is edge-to-edge inside the container; no extra frame. */
.della-cats {
	overflow: hidden;
}

.della-cats__grid {
	display: grid;
	gap: var(--della-gap);
	grid-template-columns: repeat(2, 1fr);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.della-cats__grid.della-cols-3 { grid-template-columns: repeat(3, 1fr); }
	.della-cats__grid.della-cols-4 { grid-template-columns: repeat(3, 1fr); }
	.della-cats__grid.della-cols-5 { grid-template-columns: repeat(3, 1fr); }
	.della-cats__grid.della-cols-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 992px) {
	.della-cats__grid.della-cols-2 { grid-template-columns: repeat(2, 1fr); }
	.della-cats__grid.della-cols-3 { grid-template-columns: repeat(3, 1fr); }
	.della-cats__grid.della-cols-4 { grid-template-columns: repeat(4, 1fr); }
	.della-cats__grid.della-cols-5 { grid-template-columns: repeat(5, 1fr); }
	.della-cats__grid.della-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

.della-cats__link {
	display: block;
	position: relative;
	color: inherit;
}

/* Same hairline as the product card's media, for one frame weight on the page. */
.della-cats__media {
	display: block;
	position: relative;
	aspect-ratio: var(--tile-ratio, 4/5);
	overflow: hidden;
	background: var(--della-surface);
	border: var(--della-line-hair);
	border-radius: var(--della-radius);
	transition: border-color var(--della-dur) var(--della-ease);
}

.della-cats__link:hover .della-cats__media {
	border-color: rgba(var(--della-border-rgb), 0.9);
}

.della-cats__img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	transition: transform calc(var(--della-dur-slow) * 1.6) cubic-bezier(0, 0, 0.44, 1.18);
}

.della-cats__link:hover .della-cats__img {
	transform: scale(1.05);
}

.della-cats__label {
	display: block;
	text-align: center;
	padding-block-start: 14px;
}

.della-cats__name {
	display: block;
	font-family: var(--della-font-body);
	font-size: var(--della-fs-base);
	font-weight: 700;
	text-transform: capitalize;
	letter-spacing: 0.01em;
	color: var(--della-heading);
	line-height: 1.35;
}

.della-cats__count {
	display: block;
	margin-block-start: 4px;
	font-size: var(--della-fs-xs);
	text-transform: uppercase;
	letter-spacing: var(--della-tracking);
	color: var(--della-muted);
}

/* Overlay label variant: the caption sits on the photograph. */
.della-cats__item.is-label-overlay .della-cats__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 55%);
	transition: opacity var(--della-dur) var(--della-ease);
}

.della-cats__item.is-label-overlay .della-cats__label {
	position: absolute;
	inset-block-end: 18px;
	inset-inline: 12px;
	z-index: 2;
	padding: 0;
}

.della-cats__item.is-label-overlay .della-cats__name {
	color: #fff;
}

.della-cats__item.is-label-overlay .della-cats__count {
	color: rgba(255, 255, 255, 0.75);
}

/*
 * The three label placements the builder offers (inc/sections.php):
 *   below   — the base rule above, caption under the photograph
 *   overlay — caption printed on the photograph
 *   card    — the default: a white card resting over the foot of the photograph
 */
.della-cats__item.is-label-below .della-cats__label {
	position: static;
	background: none;
	padding: 14px 0 0;
}

.della-cats__item.is-label-card .della-cats__label {
	position: absolute;
	inset-block-end: 16px;
	inset-inline: 16px;
	z-index: 2;
	background: var(--della-bg);
	border-radius: var(--della-radius);
	padding: 12px 10px;
	transition: background-color var(--della-dur) var(--della-ease),
		color var(--della-dur) var(--della-ease);
}

.della-cats__item.is-label-card .della-cats__link:hover .della-cats__label {
	background: var(--della-accent);
}

.della-cats__item.is-label-card .della-cats__link:hover .della-cats__name {
	color: var(--della-accent-contrast);
}

/* =========================================================================
   4. Product row
   ========================================================================= */

/* A carousel row must be free to bleed past the container on mobile, so the
   section itself clips instead of the page. */
.della-prow {
	overflow: hidden;
}

.della-prow__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.della-prow__head .della-heading {
	margin-block-end: 20px;
}

.della-prow__all {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-block-end: 30px;
	font-size: var(--della-fs-sm);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: var(--della-tracking);
	color: var(--della-heading);
	border-block-end: 1px solid var(--della-border);
	padding-block-end: 3px;
}

.della-prow__all:hover {
	color: var(--della-heading);
	border-color: var(--della-heading);
}

/* =========================================================================
   5. Banner
   ========================================================================= */

.della-banner {
	padding-block: 0;
}

.della-banner.is-contained {
	padding-block: calc(var(--della-section-gap) * 0.5);
}

.della-banner__bleed {
	inline-size: 100%;
}

.della-banner__inner {
	position: relative;
	display: flex;
	align-items: center;
	overflow: hidden;
	border-radius: var(--della-radius);
	background: var(--della-surface);
}

.della-banner--short  .della-banner__inner { min-block-size: 300px; }
.della-banner--medium .della-banner__inner { min-block-size: 420px; }
.della-banner--tall   .della-banner__inner { min-block-size: 560px; }

@media (min-width: 992px) {
	.della-banner--short  .della-banner__inner { min-block-size: 340px; }
	.della-banner--medium .della-banner__inner { min-block-size: 500px; }
	.della-banner--tall   .della-banner__inner { min-block-size: 660px; }
}

.della-banner__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.della-banner__media:not(:has(img)) {
	background: linear-gradient(160deg, var(--della-heading), var(--della-accent-alt) 190%);
}

.della-banner__media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.della-banner__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, var(--overlay, 0.25));
}

.della-banner__content {
	position: relative;
	z-index: 2;
	inline-size: 100%;
	display: flex;
	padding: clamp(32px, 6vw, 72px);
}

.della-banner__content.is-start  { justify-content: flex-start; text-align: start; }
.della-banner__content.is-center { justify-content: center; text-align: center; }
.della-banner__content.is-end    { justify-content: flex-end; text-align: end; }

.della-banner__text {
	max-inline-size: 560px;
	display: grid;
	justify-items: center;
}

.della-banner__content.is-start .della-banner__text { justify-items: start; }
.della-banner__content.is-end   .della-banner__text { justify-items: end; }

.della-banner__eyebrow {
	font-size: var(--della-fs-sm);
	text-transform: uppercase;
	letter-spacing: var(--della-tracking-wide);
	margin-block-end: 14px;
	opacity: 0.9;
}

.della-banner__title {
	font-size: clamp(var(--della-fs-xl), 5vw, var(--della-fs-3xl));
	line-height: 1.12;
}

.della-banner__sub {
	margin-block-start: 14px;
	font-size: var(--della-fs-md);
	max-inline-size: 46ch;
	opacity: 0.92;
}

.della-banner__text .della-btn {
	margin-block-start: 26px;
}

.della-banner.is-light { color: var(--della-bg); }
.della-banner.is-light .della-banner__title { color: var(--della-bg); }
.della-banner.is-dark  { background: transparent; color: var(--della-heading); }
.della-banner.is-dark .della-banner__title { color: var(--della-heading); }

/* =========================================================================
   6. Split — photo beside text
   ========================================================================= */

.della-split__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(26px, 5vw, 60px);
	align-items: center;
}

@media (min-width: 768px) {
	.della-split__grid {
		grid-template-columns: 1fr 1fr;
	}

	/* Logical order flip — mirrors correctly in Arabic with no extra rule. */
	.della-split.is-media-end .della-split__media {
		order: 2;
	}
}

.della-split__media {
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--della-surface);
	border-radius: var(--della-radius);
}

.della-split__img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.della-split__body {
	max-inline-size: 540px;
}

.della-split__eyebrow {
	font-size: var(--della-fs-sm);
	text-transform: uppercase;
	letter-spacing: var(--della-tracking-wide);
	color: var(--della-muted);
	margin-block-end: 14px;
}

.della-split__title {
	position: relative;
	font-size: clamp(var(--della-fs-xl), 3.6vw, var(--della-fs-2xl));
	padding-block-end: 18px;
	line-height: 1.18;
}

.della-split__title::after {
	content: "";
	position: absolute;
	inset-block-end: 0;
	inset-inline-start: 0;
	inline-size: 30px;
	block-size: 2px;
	background: var(--della-accent-alt);
}

.della-split__text {
	margin-block-start: 18px;
	color: var(--della-muted);
	line-height: 1.85;
}

.della-split__text > * + * {
	margin-block-start: 1em;
}

.della-split__body .della-btn {
	margin-block-start: 26px;
}

.della-split.is-dark .della-split__text { color: var(--della-footer-muted); }
.della-split.is-dark .della-split__eyebrow { color: var(--della-footer-muted); }

/* =========================================================================
   7. Testimonials
   ========================================================================= */

.della-quotes {
	overflow: hidden;
}

.della-quotes__item {
	/* Equal-height cards whether the row is a grid or a scrolling carousel. */
	display: flex;
}

.della-quotes__list {
	display: grid;
	gap: var(--della-gap);
	grid-template-columns: 1fr;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.della-quotes__list {
		grid-template-columns: repeat(3, 1fr);
	}
}

.della-quote {
	position: relative;
	block-size: 100%;
	margin: 0;
	padding: 34px 28px 28px;
	background: var(--della-bg);
	/* Hairline, matched to the card and tile frames. */
	border: var(--della-line-hair);
	border-radius: var(--della-radius);
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: border-color var(--della-dur) var(--della-ease),
		transform var(--della-dur) var(--della-ease-out);
}

.della-quote:hover {
	border-color: rgba(var(--della-border-rgb), 1);
	transform: translateY(-3px);
}

.della-quote__mark {
	color: var(--della-accent-alt);
	opacity: 0.5;
	line-height: 0;
}

.della-quote__text {
	margin: 0;
	font-family: var(--della-font-heading);
	font-size: var(--della-fs-md);
	font-style: italic;
	line-height: 1.6;
	color: var(--della-heading);
	border: 0;
	padding: 0;
	flex: 1 1 auto;
}

.della-quote__by {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-block-start: 14px;
	border-block-start: var(--della-line);
}

.della-quote__avatar {
	flex: none;
	inline-size: 42px;
	block-size: 42px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--della-surface);
}

.della-quote__avatar img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.della-quote__name {
	display: block;
	font-size: var(--della-fs-sm);
	font-weight: 600;
	color: var(--della-heading);
}

.della-quote__meta {
	display: block;
	font-size: var(--della-fs-xs);
	color: var(--della-muted);
}

/* =========================================================================
   8. Instagram row
   ========================================================================= */

.della-insta {
	overflow: hidden;
}

.della-insta__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
	margin-block-end: 30px;
}

.della-insta__title {
	font-size: clamp(var(--della-fs-lg), 3.4vw, var(--della-fs-xl));
}

.della-insta__handle {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: var(--della-fs-sm);
	font-weight: 500;
	letter-spacing: var(--della-tracking);
	text-transform: uppercase;
	color: var(--della-muted);
}

.della-insta__handle:hover {
	color: var(--della-heading);
}

.della-insta__grid {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(3, 1fr);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.della-insta__grid.della-cols-4 { grid-template-columns: repeat(4, 1fr); }
	.della-insta__grid.della-cols-5 { grid-template-columns: repeat(5, 1fr); }
	.della-insta__grid.della-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

.della-insta__item a {
	position: relative;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--della-surface);
}

.della-insta__item img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	transition: transform calc(var(--della-dur-slow) * 1.4) var(--della-ease-out);
}

.della-insta__item a:hover img {
	transform: scale(1.06);
}

.della-insta__overlay {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(var(--della-text-rgb), 0.42);
	color: #fff;
	opacity: 0;
	transition: opacity var(--della-dur) var(--della-ease);
}

.della-insta__item a:hover .della-insta__overlay,
.della-insta__item a:focus-visible .della-insta__overlay {
	opacity: 1;
}

/* =========================================================================
   9. Newsletter band
   ========================================================================= */

.della-news {
	position: relative;
	overflow: hidden;
	background: var(--della-surface);
}

.della-news.is-dark {
	background: var(--della-footer-bg);
}

.della-news__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.della-news__img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.della-news__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, var(--overlay, 0.2));
}

.della-news .della-container {
	position: relative;
	z-index: 2;
}

.della-news__inner {
	max-inline-size: 620px;
	margin-inline: auto;
	text-align: center;
}

.della-news__inner .della-heading {
	margin-block-end: 26px;
}

.della-news.is-dark .della-heading__title {
	color: var(--della-bg);
}

.della-news.is-light,
.della-news.has-media.is-light {
	color: var(--della-bg);
}

.della-news.is-light .della-heading__title {
	color: var(--della-bg);
}

.della-news.is-light .della-heading__intro,
.della-news.is-light .della-heading__eyebrow {
	color: rgba(255, 255, 255, 0.8);
}

.della-news__form {
	display: grid;
	gap: 10px;
	grid-template-columns: 1fr;
	max-inline-size: 480px;
	margin-inline: auto;
}

@media (min-width: 560px) {
	.della-news__form {
		grid-template-columns: 1fr auto;
	}
}

.della-news__form input[type="email"] {
	background: var(--della-bg);
	border-color: var(--della-border);
}

.della-news__form .della-btn {
	white-space: nowrap;
}

.della-news.is-dark .della-news__form .della-btn,
.della-news.is-light .della-news__form .della-btn {
	background: var(--della-bg);
	border-color: var(--della-bg);
	color: var(--della-heading);
}

.della-news.is-dark .della-news__form .della-btn::before,
.della-news.is-light .della-news__form .della-btn::before {
	background: var(--della-accent-alt);
}

.della-news.is-dark .della-news__form .della-btn:hover,
.della-news.is-light .della-news__form .della-btn:hover {
	color: var(--della-accent-alt-contrast);
	border-color: var(--della-accent-alt);
}

.della-news__status {
	grid-column: 1 / -1;
	font-size: var(--della-fs-sm);
	min-block-size: 1.2em;
	margin-block-start: 4px;
}

.della-news__status:empty {
	min-block-size: 0;
}

.della-news__status.is-error {
	color: var(--della-sale);
}

.della-news__status.is-success {
	color: var(--della-new);
}

.della-news.is-dark .della-news__status,
.della-news.is-light .della-news__status {
	color: rgba(255, 255, 255, 0.85);
}

/* The plugin-supplied form path (Mailchimp / CF7 shortcode). */
.della-news__inner .mc4wp-form,
.della-news__inner .wpcf7 {
	max-inline-size: 480px;
	margin-inline: auto;
}

/* =========================================================================
   10. Rich text
   ========================================================================= */

.della-rich__inner.is-start  { text-align: start; }
.della-rich__inner.is-center { text-align: center; }
.della-rich__inner.is-end    { text-align: end; }

.della-rich__title {
	position: relative;
	font-size: clamp(var(--della-fs-lg), 3.4vw, var(--della-fs-xl));
	padding-block-end: 18px;
	margin-block-end: 20px;
}

.della-rich__title::after {
	content: "";
	position: absolute;
	inset-block-end: 0;
	inset-inline-start: 0;
	inline-size: 30px;
	block-size: 2px;
	background: var(--della-accent-alt);
}

.della-rich__inner.is-center .della-rich__title::after {
	inset-inline: 0;
	margin-inline: auto; /* Centres without translateX, so RTL needs no override. */
}

.della-rich__inner.is-end .della-rich__title::after {
	inset-inline-start: auto;
	inset-inline-end: 0;
}

.della-rich.is-dark .della-prose {
	color: var(--della-footer-muted);
}

.della-rich.is-dark .della-prose a {
	color: var(--della-bg);
}

/* A static front page's own editor content, rendered below the sections. */
.della-section--content .della-prose {
	max-inline-size: 780px;
	margin-inline: auto;
}

/* =========================================================================
   Lazy section placeholder

   Everything past the third homepage block is fetched on approach. The
   placeholder holds the exact height the real section will take
   (--lazy-height, written inline by inc/sections.php) so nothing below it
   jumps when the swap happens. It has to read as a section that has not
   arrived yet, not as a broken one — hence the section's own title in the
   same muted small caps the real headings use, and a single quiet ring.
   ========================================================================= */

.della-lazy {
	display: grid;
	place-items: center;
	min-block-size: var(--lazy-height, 400px);
	padding-inline: var(--della-gutter);
	background: var(--della-bg);
	/* Matches the reveal used by the real sections, so a loaded block and a
	   pending one never differ in weight. */
	contain: layout paint;
}

.della-lazy__inner {
	display: grid;
	justify-items: center;
	gap: 18px;
	text-align: center;
	opacity: 0.55;
}

.della-lazy__title {
	margin: 0;
	font-family: var(--della-font-body);
	font-size: var(--della-fs-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: var(--della-tracking-wide);
	color: var(--della-muted);
}

.della-lazy__spinner {
	inline-size: 22px;
	block-size: 22px;
	border-radius: 50%;
	border: 1px solid rgba(var(--della-border-rgb), 0.7);
	/* One darker quadrant is what turns a ring into a spinner. */
	border-block-start-color: var(--della-muted);
	animation: della-lazy-spin 0.9s linear infinite;
}

@keyframes della-lazy-spin {
	to {
		transform: rotate(360deg);
	}
}

/*
 * The global reduce-motion rule freezes animations mid-turn, which would leave
 * a lopsided ring sitting there. Make it a complete, still ring instead.
 */
@media (prefers-reduced-motion: reduce) {
	.della-lazy__spinner {
		border-color: rgba(var(--della-border-rgb), 0.7);
		animation: none;
	}
}

/*
 * A failed fetch keeps the placeholder in the document. Stop pretending it is
 * still loading and stop reserving a screenful of empty page for a section that
 * is not coming — collapse to the title alone, which reads as a quiet gap
 * rather than a hole.
 */
.della-lazy.is-failed {
	min-block-size: 0;
	padding-block: 28px;
}

.della-lazy.is-failed .della-lazy__spinner {
	display: none;
}

.della-lazy.is-failed .della-lazy__inner {
	opacity: 0.4;
}

/* Without JS the placeholder never loads, so the <noscript> route is the page. */
.della-lazy__fallback {
	text-align: center;
	padding-block: 24px;
}

/* =========================================================================
   Category tiles — centre a short final row
   =========================================================================
   CSS Grid cannot centre a partial row. With `repeat(4, ...)` and three
   categories, the fourth track still exists and still takes its share of the
   width, so the tiles sit hard left with a column of dead space on the right —
   and `justify-content: center` does nothing, because the four tracks already
   fill the container.

   Flex wrapping is the tool that actually solves it: items take a computed
   basis so a FULL row matches the grid exactly, and any short row — the last
   one, or the only one — is centred by `justify-content`.

   --cols is the owner's "tiles per row" setting, coming from the della-cols-N
   class the section template emits.
   ========================================================================= */

.della-cats__grid,
.della-insta__grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	--cols: 4;
	/*
	 * ONE source for the gap. It drives both the actual `gap` and the flex
	 * basis below — if the two ever disagree the row silently stops filling the
	 * container (the Instagram strip uses a tighter 8px gap than the category
	 * tiles, which is exactly how that bug appeared).
	 */
	gap: var(--tile-gap);
}

.della-cats__grid  { --tile-gap: var(--della-gap, 30px); }
.della-insta__grid { --tile-gap: 8px; }

.della-cats__grid > *,
.della-insta__grid > * {
	/*
	 * Subtract the gaps this item is responsible for, so N items across match a
	 * grid of N columns to the pixel.
	 */
	flex: 0 1 calc((100% - (var(--cols) - 1) * var(--tile-gap)) / var(--cols));
	max-inline-size: 100%;
}

.della-cats__grid.della-cols-2, .della-insta__grid.della-cols-2 { --cols: 2; }
.della-cats__grid.della-cols-3, .della-insta__grid.della-cols-3 { --cols: 3; }
.della-cats__grid.della-cols-4, .della-insta__grid.della-cols-4 { --cols: 4; }
.della-cats__grid.della-cols-5, .della-insta__grid.della-cols-5 { --cols: 5; }
.della-cats__grid.della-cols-6, .della-insta__grid.della-cols-6 { --cols: 6; }

@media (max-width: 991px) {
	.della-cats__grid,
	.della-cats__grid[class*="della-cols-"] {
		--cols: 3;
	}

	.della-insta__grid,
	.della-insta__grid[class*="della-cols-"] {
		--cols: 4;
	}
}

@media (max-width: 640px) {
	.della-cats__grid,
	.della-cats__grid[class*="della-cols-"],
	.della-insta__grid,
	.della-insta__grid[class*="della-cols-"] {
		--cols: 2;
	}
}

/* A single tile should stay tile-sized rather than stretching into a banner. */
.della-cats__grid > :only-child {
	flex-basis: clamp(240px, 32%, 380px);
}
