/* ==========================================================================
   Front page. Ported from prototype/index.html.
   This file is the STATIC layout (JS off / reduced motion). The motion layer
   (html.has-motion …) is added with motion.js in the next step.
   Breakpoints: desktop ≥861px, phone ≤860px (same as the motion spec).
   ========================================================================== */

.dp-main--front .wp-block-post-content > * { margin-block: 0; }
/* The front page's content area is a plain full-width container (no constrained layout, so
   no negative-margin tricks: pinned sections measure correctly). Full-width sections fill it;
   the others are centred at the content width with the site's side padding. */
.dp-main--front .wp-block-post-content > :not(.alignfull):not(.pin-spacer) {
	width: calc(100% - var(--wp--style--root--padding-left) - var(--wp--style--root--padding-right));
	max-width: var(--wp--style--global--content-size);
	margin-inline: auto;
}
.dp-main--front :where(.dp-hero, .dp-pen, .dp-facts, .dp-diaries, .dp-quote, .dp-story, .dp-cta-section) :where(*) { margin-block: 0; }

/* ---------- 1. Hero ---------- */
.dp-hero {
	position: relative;
	z-index: 3;
	overflow-x: clip;
	padding-block: 136px 110px;
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.dp-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: 40px;
	align-items: center;
	width: 100%;
}
.dp-hero__copy { display: flex; flex-direction: column; gap: 22px; max-width: 560px; position: relative; z-index: 2; }
.dp-hero .dp-hero__lead { color: var(--dp-on-navy); line-height: 1.6; }
.dp-hero__ctas { gap: 16px; align-items: center; }
.dp-hero__skip { font-size: 14px; }
.dp-hero__skip a { color: var(--dp-on-navy); min-height: 44px; display: inline-flex; align-items: center; }
.dp-hero__hint { display: none; }

/* The diary (decorative). Static: closed, centred, cover facing out. */
.dp-stage { container-type: inline-size; position: relative; z-index: 1; }
.dp-stage__inner {
	--bw: clamp(140px, min(46cqw, 46vh), 440px);
	position: relative;
	height: calc(var(--bw) * 1.3067 + 80px);
	perspective: 2400px;
}
.dp-book {
	position: absolute;
	left: 50%;
	top: 40px;
	width: var(--bw);
	height: calc(var(--bw) * 1.3067);
	transform-style: preserve-3d;
	transform: translateX(-50%);
}
.dp-book__rp, .dp-book__leaf { position: absolute; inset: 0; transform-style: preserve-3d; }
.dp-book__rp { background: #fff; border-radius: 0 6px 6px 0; box-shadow: 0 40px 80px rgba(0, 0, 0, .45); }
.dp-book__rp img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 6px 6px 0; }
.dp-book__leaf { transform-origin: left center; }
.dp-book__face {
	position: absolute;
	inset: 0;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	overflow: hidden;
	background: #fff;
	border-radius: 0 6px 6px 0;
}
.dp-book__face img { width: 100%; height: 100%; object-fit: cover; }
.dp-book__back { transform: rotateY(180deg); border-radius: 6px 0 0 6px; }
.dp-book__cover .dp-book__front { border-radius: 3px 10px 10px 3px; box-shadow: inset 10px 0 18px rgba(0, 0, 0, .35); }
.dp-book__cover .dp-book__back { background: #F1ECE1; display: flex; align-items: flex-end; padding: 24px; color: #5F5A4C; font-size: 12px; }

@media (max-width: 860px) {
	.dp-hero { padding-block: 112px 96px; min-height: 0; }
	.dp-hero__grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- 2. Pen section ---------- */
.dp-pen { position: relative; z-index: 1; }
.dp-pen__stage {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 64px;
	align-items: center;
	padding-block: var(--wp--preset--spacing--70);
}
.dp-pen__copy { display: flex; flex-direction: column; gap: 16px; }
.dp-steps { display: flex; flex-direction: column; gap: 20px; }
.dp-step { display: flex; flex-direction: column; gap: 12px; }
.dp-step p { font-size: 17px; line-height: 1.65; color: var(--wp--preset--color--muted); max-width: 440px; }
/* Static: the three steps read as one short list. */
.dp-step--2 .dp-step__title, .dp-step--3 .dp-step__title { font-size: var(--wp--preset--font-size--x-large); }
.dp-step-dots { display: none; }

.dp-sheet {
	position: relative;
	height: min(84vh, 780px);
	aspect-ratio: 900 / 1176;
	background: #fff;
	border-radius: 6px;
	box-shadow: var(--wp--preset--shadow--sheet);
}
.dp-sheet .dp-sheet__page { width: 100%; height: 100%; border-radius: 6px; display: block; }
.dp-ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.dp-ink text { font-family: var(--wp--preset--font-family--hand); font-weight: 600; fill: var(--wp--custom--pen); text-anchor: middle; }
.dp-pen-tool { display: none; }
.dp-tally {
	position: absolute;
	left: -48px;
	bottom: 48px;
	background: var(--dp-navy);
	color: #fff;
	border-radius: 16px;
	padding: 22px 26px;
	display: grid;
	grid-template-columns: repeat(3, auto);
	gap: 28px;
	box-shadow: 0 24px 48px rgba(20, 33, 61, .35);
}
.dp-tally .dp-tally__n { font-family: var(--wp--preset--font-family--serif); font-size: 34px; color: var(--dp-saffron); line-height: 1; }
.dp-tally .dp-tally__l { font-size: 12px; color: var(--dp-on-navy); margin-top: 6px; }

@media (max-width: 860px) {
	.dp-pen__stage { grid-template-columns: 1fr; gap: 32px; padding-block: 96px 72px; }
	.dp-sheet { height: auto; width: 100%; }
	.dp-tally { left: 12px; right: 12px; bottom: -40px; gap: 12px; padding: 16px; }
	.dp-tally .dp-tally__n { font-size: 24px; }
}

/* ---------- Facts strip ---------- */
.dp-facts {
	margin-top: 80px !important;
	background: #fff;
	border: 1px solid var(--dp-sand);
	border-radius: 16px;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
}
.dp-facts > * { padding: 28px 30px; border-right: 1px solid var(--dp-sand); }
.dp-facts > *:last-child { border-right: 0; }
.dp-facts .dp-facts__big { font-family: var(--wp--preset--font-family--serif); font-size: 32px; color: var(--dp-navy); line-height: 1.2; }
.dp-facts .dp-facts__small { margin-top: 6px; font-size: 14px; color: var(--wp--preset--color--muted); }
@media (max-width: 860px) {
	.dp-facts { margin-top: 96px !important; grid-template-columns: 1fr 1fr; }
	.dp-facts > *:nth-child(2) { border-right: 0; }
	.dp-facts > *:nth-child(-n+2) { border-bottom: 1px solid var(--dp-sand); }
	.dp-facts .dp-facts__big { font-size: 24px; }
	.dp-facts > * { padding: 20px; }
}

/* ---------- Diaries (Query Loop of product pages) ---------- */
.dp-diaries { padding-block: var(--wp--preset--spacing--70); }
.dp-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 48px !important; }
.dp-section-head > .wp-block-group { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.dp-section-head__link a { font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.dp-section-head__link a:hover { text-decoration: underline; }

.dp-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; list-style: none; padding: 0; }
.dp-cards > li { margin: 0; display: flex; }
.dp-cards > li:nth-child(2) { --i: 1; } .dp-cards > li:nth-child(3) { --i: 2; }
.dp-cards > li:nth-child(4) { --i: 3; } .dp-cards > li:nth-child(5) { --i: 4; }
.dp-card {
	position: relative;
	width: 100%;
	background: #fff;
	border: 1px solid var(--dp-sand);
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform .35s var(--dp-ease), box-shadow .35s var(--dp-ease);
}
.dp-card:hover { box-shadow: var(--wp--preset--shadow--card); }
.dp-card:focus-within { outline: 2px solid var(--dp-navy); outline-offset: 3px; }
.dp-card__shot {
	background: var(--wp--preset--color--sand-light);
	height: 230px;
	display: flex;
	align-items: center;
	justify-content: center;
	perspective: 800px;
	margin: 0;
}
/* Portrait covers end up 120px wide; the landscape Pocket Planner photo 180px wide. */
.dp-card__shot img {
	width: auto !important;
	height: auto !important;
	max-width: 180px;
	max-height: 155px;
	border-radius: 3px 8px 8px 3px;
	box-shadow: var(--wp--preset--shadow--cover);
	transition: transform .5s var(--dp-ease);
}
.dp-card__body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.dp-card .dp-card__kicker { font-size: 12px; color: var(--wp--preset--color--muted); text-transform: uppercase; letter-spacing: 1px; }
.dp-card .dp-card__title { font-size: 19px; line-height: 1.3; }
.dp-card__title a { color: var(--dp-navy); text-decoration: none; }
.dp-card__title a:focus-visible { outline: none; }
.dp-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.dp-card__excerpt p { font-size: 14px; line-height: 1.5; color: var(--wp--preset--color--muted); }
.dp-card__excerpt .wp-block-post-excerpt__more-text { display: none; }
.dp-card__price { margin-top: auto !important; padding-top: 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.dp-card .dp-card__price-value { font-weight: 600; color: var(--dp-navy); }
.dp-card .dp-card__price-note { font-size: 13px; color: var(--wp--preset--color--muted); }

@media (max-width: 1100px) { .dp-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
	.dp-cards { grid-template-columns: 1fr; }
	.dp-card { flex-direction: row; }
	.dp-card__shot { height: auto; width: 120px; flex-shrink: 0; padding: 14px; }
	.dp-card__shot img { max-width: 96px; max-height: 104px; }
}

/* ---------- 3. Testimonial ---------- */
.dp-quote { padding-block: 140px; text-align: center; }
.dp-quote__q.wp-block-quote {
	max-width: 900px;
	margin-inline: auto !important;
	padding: 0;
	border: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
}
.dp-quote__q::before {
	content: "";
	width: 40px;
	height: 32px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 32'%3E%3Cpath d='M2 30V18C2 8 8 3 16 2M24 30V18C24 8 30 3 38 2' stroke='%23F2B705' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.dp-quote .dp-quote__text { font-family: var(--wp--preset--font-family--serif); font-size: var(--wp--preset--font-size--quote); line-height: 1.35; color: #fff; }
.dp-quote__q cite { font-family: var(--wp--preset--font-family--sans); font-style: normal; font-size: 15px; color: var(--dp-on-navy); }

/* ---------- 4. Heritage timeline ---------- */
/* Static: a heading row, then the eras as a grid of cards with their years. */
.dp-story { padding-block: 100px; overflow: hidden; }
.dp-story__stage { max-width: 1304px; margin-inline: auto !important; }
.dp-story__left { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px !important; }
.dp-odo, .dp-story__bar, .dp-story .dp-story__label { display: none; }
.dp-story__track { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 48px 40px; }
.dp-era { display: flex; flex-direction: column; gap: 20px; }
.dp-era .dp-era__year { font-family: var(--wp--preset--font-family--serif); font-size: 56px; color: var(--dp-navy); line-height: 1; }
.dp-era .dp-era__label { display: none; }
.dp-era__pic {
	height: min(52vh, 460px);
	min-height: 280px;
	background: var(--wp--preset--color--sand-light);
	border-radius: 20px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
/* Images scale to fit their box (76% of its height), never overflow it. */
.dp-era__pic > .wp-block-image { margin: 0; height: 76%; max-width: 86%; display: flex; align-items: center; justify-content: center; }
.dp-era__pic img { max-height: 100%; max-width: 100%; width: auto !important; height: auto !important; border-radius: 4px 10px 10px 4px; box-shadow: 0 24px 48px rgba(20, 33, 61, .28); }
.dp-era__pair { display: flex; gap: 18px; align-items: center; justify-content: center; height: 76%; width: 86%; }
.dp-era__pair > .wp-block-image { margin: 0; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.dp-era__pair .is-wide img { border-radius: 8px; }
.dp-era__art { width: 72%; height: 72%; }

/* Early Pravasi Diaries: three covers fanned like a hand of cards (all 7:10), newest on top. Map: one tall photo. */
.dp-era__fan { position: relative; height: 84%; width: 84%; margin: 0; }
.dp-era__fan > .wp-block-image { position: absolute; top: 50%; margin: 0; width: 44%; aspect-ratio: 7 / 10; }
.dp-era__fan > .wp-block-image:nth-child(1) { left: 0; z-index: 1; transform: translateY(-50%) rotate(-7deg); }
.dp-era__fan > .wp-block-image:nth-child(2) { left: 28%; z-index: 2; transform: translateY(-50%) rotate(-1deg); }
.dp-era__fan > .wp-block-image:nth-child(3) { right: 0; z-index: 3; transform: translateY(-50%) rotate(6deg); }
.dp-era__fan img { display: block; width: 100% !important; height: 100% !important; max-height: none !important; max-width: none !important; object-fit: cover; border-radius: 3px 8px 8px 3px; box-shadow: 0 14px 30px rgba(20, 33, 61, .32); }
.dp-era__pic > .wp-block-image.is-tall { height: 90%; }
.dp-era__pic .is-tall img { border-radius: 4px; box-shadow: 0 18px 38px rgba(20, 33, 61, .3); }
.dp-era .dp-era__title { font-family: var(--wp--preset--font-family--serif); font-weight: 400; font-size: 28px; line-height: 1.2; }
.dp-era p:not([class]) { color: var(--wp--preset--color--muted); line-height: 1.6; }
.dp-era p:not([class]) a { color: var(--dp-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (max-width: 860px) {
	.dp-story { padding-block: 96px; }
	.dp-story__track { gap: 48px; }
	.dp-era__pic { height: 280px; min-height: 0; }
}

/* ---------- CTA ---------- */
.dp-cta-section { padding-block: var(--wp--preset--spacing--70); }
.dp-cta {
	border-radius: 24px;
	padding: clamp(32px, 5vw, 64px);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 28px;
}
.dp-cta h2 { font-size: clamp(28px, 3.4vw, 40px); }
.dp-cta__text p { margin-top: 12px !important; font-size: 17px; line-height: 1.6; max-width: 600px; }
.dp-cta__buttons { gap: 12px; }

/* ==========================================================================
   MOTION LAYER: only when html.has-motion (JS on, no reduced-motion preference).
   motion.js drives these states; without it the static layout above applies.
   ========================================================================== */
html.lenis, html.lenis body { height: auto; }

.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* Hero: cream fades in over the navy (preset colour classes are !important, so an overlay). */
html.has-motion .dp-hero { --dp-hero-fade: 0; }
html.has-motion .dp-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--dp-cream);
	opacity: var(--dp-hero-fade);
	pointer-events: none;
	z-index: 0;
}
html.has-motion .dp-hero > * { position: relative; z-index: 1; }
html.has-motion .dp-book { opacity: 0; } /* motion.js fades it in; avoids a flash of the static pose */

@media (min-width: 861px) {
	html.has-motion .dp-hero__hint {
		position: absolute;
		left: 50%;
		bottom: 24px;
		transform: translateX(-50%);
		color: var(--dp-on-navy);
		font-size: 13px;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 8px;
		z-index: 4;
	}
	html.has-motion .dp-hero__hint i { width: 22px; height: 34px; border: 1.5px solid var(--dp-on-navy); border-radius: 12px; position: relative; }
	html.has-motion .dp-hero__hint i::after {
		content: "";
		position: absolute;
		left: 50%;
		top: 7px;
		width: 3px;
		height: 7px;
		margin-left: -1.5px;
		border-radius: 2px;
		background: var(--dp-saffron);
		animation: dp-wheel 1.6s infinite;
	}

	/* Pen section: one full-screen stage, pinned by motion.js; steps swap in place. */
	html.has-motion .dp-pen__stage { min-height: 100vh; padding-block: 40px; }
	html.has-motion .dp-steps { position: relative; min-height: 260px; display: block; }
	html.has-motion .dp-step {
		position: absolute;
		inset: 0;
		opacity: 0;
		transform: translateY(16px);
		transition: opacity .5s var(--dp-ease), transform .5s var(--dp-ease);
	}
	html.has-motion .dp-step.is-on { opacity: 1; transform: none; }
	html.has-motion .dp-step .dp-step__title { font-size: var(--wp--preset--font-size--xx-large); }
	html.has-motion .dp-step-dots { display: flex; gap: 8px; margin-top: 24px; }
	html.has-motion .dp-step-dots b { width: 28px; height: 4px; border-radius: 2px; background: var(--dp-sand); transition: background .3s; }
	html.has-motion .dp-step-dots b.is-on { background: var(--dp-navy); }
}
@keyframes dp-wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

html.has-motion .dp-pen-tool {
	display: block;
	position: absolute;
	left: 0;
	top: 0;
	width: 34px;
	height: 110px;
	pointer-events: none;
	transform-origin: 50% 100%;
	opacity: 0;
	z-index: 5;
	filter: drop-shadow(4px 8px 6px rgba(0, 0, 0, .25));
}
html.has-motion .dp-tally { opacity: 0; transform: translateY(24px) scale(.96); }

/* Diary cards: the cover turns slightly on hover. */
html.has-motion .dp-card:hover { transform: translateY(-6px); }
html.has-motion .dp-card:hover .dp-card__shot img { transform: rotateY(-18deg) rotateZ(-2deg) scale(1.06); }

/* ---------- 3. Testimonial: words light up as the quote passes (motion.js wraps words). ---------- */
html.has-motion .dp-quote__text .dp-word { opacity: .14; }

/* ---------- 4. Heritage timeline: pinned horizontal journey (desktop, motion only). ---------- */
@media (min-width: 861px) {
	html.has-motion .dp-story { padding-block: 0; }
	html.has-motion .dp-story__stage {
		max-width: none; height: 100vh; display: grid; grid-template-columns: minmax(340px, 40%) minmax(0, 1fr); align-items: center;
	}
	html.has-motion .dp-story__left {
		container-type: inline-size; margin: 0 !important; padding-right: 32px;
		padding-left: max(clamp(20px, 5vw, 48px), calc((100vw - 1200px) / 2 + 48px));
		position: relative; z-index: 2;
	}
	html.has-motion .dp-odo {
		display: flex; font-family: var(--wp--preset--font-family--serif); font-size: clamp(64px, 34cqw, 190px); line-height: 1;
		color: var(--dp-navy); height: 1em; overflow: hidden; letter-spacing: -.02em;
		font-variant-numeric: lining-nums tabular-nums;
	}
	html.has-motion .dp-odo .d { height: 1em; overflow: hidden; display: block; }
	html.has-motion .dp-odo .roll { display: flex; flex-direction: column; transition: transform 1s cubic-bezier(.7, 0, .2, 1); }
	html.has-motion .dp-odo .roll span { height: 1em; display: block; text-align: center; }
	html.has-motion .dp-story .dp-story__label { display: block; font-size: 18px; color: var(--wp--preset--color--muted); min-height: 3em; max-width: 360px; line-height: 1.5; }
	html.has-motion .dp-story__bar { display: block; height: 3px; background: var(--dp-sand); width: 260px; border-radius: 2px; overflow: hidden; }
	html.has-motion .dp-story__bar i { display: block; height: 100%; width: 100%; background: var(--dp-navy); transform-origin: left; transform: scaleX(0); }
	html.has-motion .dp-story__view {
		overflow: hidden; height: 100%; display: flex; align-items: center;
		-webkit-mask-image: linear-gradient(to right, transparent 0, #000 80px); mask-image: linear-gradient(to right, transparent 0, #000 80px);
	}
	html.has-motion .dp-story__track { display: flex; gap: 72px; padding-left: 80px; padding-right: 20vw; will-change: transform; }
	html.has-motion .dp-era { flex: 0 0 min(460px, 40vw); }
	html.has-motion .dp-era .dp-era__year { display: none; }
	html.has-motion .dp-era__pic { height: min(52vh, 460px); min-height: 0; }
}
