/* ==========================================================================
   Product pages (template: page-product). Follows design-reference/Product.dc.html.
   Static layout first; the flip viewer (product.js) only runs with html.has-motion.
   ========================================================================== */

.dp-main--product :where(.dp-product-hero, .dp-figures, .dp-flip, .dp-logo-print, .dp-related) :where(*) { margin-block: 0; }

/* Breadcrumbs */
.dp-crumbs { padding-top: 32px; font-size: 14px; color: var(--wp--preset--color--muted); }
.dp-crumbs a { color: var(--wp--preset--color--muted); }
.dp-crumbs a:hover { color: var(--dp-navy); }

/* ---------- Hero ---------- */
.dp-product-hero { padding-block: 32px 96px; }
.dp-product-hero__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 64px; align-items: start; }

.dp-product-media { display: flex; flex-direction: column; gap: 16px; }
.dp-product-media__main {
	background: var(--wp--preset--color--sand-light);
	border-radius: 20px;
	height: 520px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 40px;
}
.dp-product-media__main img {
	max-height: 100%;
	max-width: 100%;
	width: auto !important;
	height: auto !important;
	border-radius: 5px 14px 14px 5px;
	box-shadow: 0 30px 60px rgba(20, 33, 61, .28);
}
.dp-product-media__thumbs.wp-block-gallery { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px !important; margin: 0; }
.dp-product-media__thumbs .wp-block-image { width: 100% !important; margin: 0 !important; }
.dp-product-media__thumbs .wp-block-image a { display: block; height: 88px; border-radius: 10px; overflow: hidden; background: #fff; border: 2px solid transparent; transition: border-color .2s; }
.dp-product-media__thumbs .wp-block-image a[aria-current="true"] { border-color: var(--dp-navy); }
.dp-product-media__thumbs .wp-block-image img { width: 100%; height: 100% !important; object-fit: cover; object-position: top; }

.dp-product-info { display: flex; flex-direction: column; gap: 24px; padding-top: 16px; }
.dp-product-info .dp-product__kicker {
	font-size: 14px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--wp--preset--color--eyebrow);
}
.dp-product-info .dp-product__title { font-size: clamp(40px, 5vw, 56px); line-height: 1.08; }
.dp-product-info .dp-product__lead { font-size: 19px; line-height: 1.6; color: var(--wp--preset--color--charcoal); }
.dp-product__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; padding-block: 20px; border-block: 1px solid var(--dp-sand); }
.dp-product__price .dp-product__price-value { font-family: var(--wp--preset--font-family--serif); font-size: 40px; color: var(--dp-navy); line-height: 1; }
.dp-product__price .dp-product__price-note { font-size: 15px; color: var(--wp--preset--color--muted); }

.dp-periods { display: flex; flex-direction: column; gap: 12px; }
.dp-periods .dp-periods__label { font-size: 14px; font-weight: 600; color: var(--dp-navy); }
.dp-pills { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dp-pills li { font-size: 15px; padding: 10px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--dp-sand); color: var(--dp-navy); }

.dp-product__ctas { gap: 12px; }
.dp-product__preview a { font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.dp-product__preview a:hover { text-decoration: underline; }

.dp-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dp-spec { background: #fff; border-radius: 12px; padding: 16px; border: 1px solid var(--dp-sand); }
.dp-spec .dp-spec__label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--wp--preset--color--muted); }
.dp-spec .dp-spec__value { margin-top: 6px; font-weight: 600; color: var(--dp-navy); line-height: 1.35; }

@media (max-width: 860px) {
	.dp-product-hero { padding-bottom: 72px; }
	.dp-product-hero__grid { gap: 32px; }
	.dp-product-media__main { height: 400px; padding: 32px; }
	.dp-product-media__thumbs .wp-block-image a { height: 72px; }
}
@media (max-width: 480px) {
	.dp-specs { grid-template-columns: 1fr; }
	.dp-product-media__main { height: 340px; }
}

/* ---------- Key figures ---------- */
.dp-figures { padding-block: 88px; }
.dp-figures__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; }
.dp-figure { display: flex; flex-direction: column; gap: 8px; }
.dp-figures .dp-figure__n { font-family: var(--wp--preset--font-family--serif); font-size: 48px; line-height: 1.05; color: var(--dp-saffron); }
.dp-figures .dp-figure__l { font-size: 15px; line-height: 1.5; color: var(--dp-on-navy); }

/* ---------- Flip through the formats ---------- */
.dp-flip { padding-block: 112px; }
.dp-flip__head { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin-bottom: 48px !important; }
.dp-flip__head h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.15; }
.dp-flip__grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; align-items: start; }
@media (max-width: 1000px) { .dp-flip__grid { grid-template-columns: 1fr; } }
.dp-flip__book { background: var(--wp--preset--color--sand-light); border-radius: 20px; padding: 40px 28px; display: flex; flex-direction: column; gap: 16px; }
.dp-flip__book .dp-flip__note { font-size: 14px; color: var(--wp--preset--color--muted); text-align: center; }

/* Static gallery of the pages (JS off / reduced motion), scrolls inside its box. */
.dp-flipbook.wp-block-gallery { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px !important; margin: 0; max-height: 560px; overflow-y: auto; padding: 4px; }
.dp-flipbook.wp-block-gallery[hidden] { display: none !important; }
.dp-flipbook .wp-block-image { width: 100% !important; margin: 0 !important; }
.dp-flipbook .wp-block-image a { display: block; aspect-ratio: 3 / 4; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 4px 10px rgba(20, 33, 61, .12); }
.dp-flipbook .wp-block-image img { width: 100%; height: 100% !important; object-fit: cover; object-position: top; }

.dp-formats { display: flex; flex-direction: column; gap: 16px; }
.dp-format { background: #fff; border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--dp-sand); }
.dp-format h3 { font-size: 18px; }
.dp-format p { font-size: 15px; line-height: 1.6; color: var(--wp--preset--color--muted); }
.dp-format { position: relative; transition: border-color .25s, box-shadow .25s; }
.dp-format .dp-format__link a { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--dp-navy); }
.dp-format .dp-format__link a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.dp-format:hover { border-color: var(--dp-navy); }
.dp-format:focus-within { outline: 2px solid var(--dp-navy); outline-offset: 3px; }
.dp-format .dp-format__link a:focus-visible { outline: none; }
.dp-format.is-current { border-color: var(--dp-saffron); box-shadow: inset 4px 0 0 var(--dp-saffron); }

/* Desktop: the book stays in view while you read the format cards beside it. */
/* Only on screens tall enough to show the whole book with its controls; sits below the header. */
@media (min-width: 1001px) and (min-height: 760px) {
	.dp-flip__book { position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--dp-header-h) + 16px); }
}

/* Flip viewer (built by product.js) */
.dp-fb { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.dp-fb__book { width: 100%; max-width: 760px; margin-inline: auto; }
.dp-fb__page { background: #fff; overflow: hidden; }
.dp-fb__page img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dp-fb__bar { display: flex; align-items: center; gap: 12px; }
.dp-fb__bar button {
	width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--dp-navy); background: transparent; color: var(--dp-navy);
	display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px;
}
.dp-fb__bar button:disabled { opacity: .35; cursor: default; }
.dp-fb__bar button:not(:disabled):hover { background: var(--dp-navy); color: #fff; }
.dp-fb__status { min-width: 9em; text-align: center; font-size: 14px; color: var(--wp--preset--color--muted); }

/* ---------- Logo on the cover ---------- */
.dp-logo-print { padding-block: 96px; }
.dp-logo-print__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 56px; align-items: center; }
.dp-logo-print__text { display: flex; flex-direction: column; gap: 16px; }
.dp-logo-print__text h2 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.15; }
.dp-logo-print__text p:not(.is-style-eyebrow) { font-size: 17px; line-height: 1.65; color: var(--wp--preset--color--muted); }

/* ---------- Other diaries ---------- */
.dp-related { padding-block: 112px 40px; }
.dp-related__title { font-size: 36px; margin-bottom: 40px !important; }
.dp-related__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; list-style: none; padding: 0; }
.dp-related__list > li { margin: 0; display: flex; }
.dp-mini-card {
	position: relative; width: 100%; background: #fff; border-radius: 16px; padding: 20px; display: flex; gap: 16px; align-items: center;
	border: 1px solid var(--dp-sand); transition: box-shadow .3s var(--dp-ease), transform .3s var(--dp-ease);
}
.dp-mini-card:hover { box-shadow: var(--wp--preset--shadow--card); }
html.has-motion .dp-mini-card:hover { transform: translateY(-3px); }
.dp-mini-card:focus-within { outline: 2px solid var(--dp-navy); outline-offset: 3px; }
.dp-mini-card__img { margin: 0; flex: 0 0 auto; width: 72px; display: flex; justify-content: center; }
.dp-mini-card__img img { max-width: 72px; max-height: 76px; width: auto !important; height: auto !important; border-radius: 2px 6px 6px 2px; box-shadow: 0 6px 14px rgba(20, 33, 61, .2); }
.dp-mini-card__body { display: flex; flex-direction: column; gap: 4px; }
.dp-mini-card .dp-mini-card__title { font-size: 17px; }
.dp-mini-card__title a { color: var(--dp-navy); text-decoration: none; }
.dp-mini-card__title a::after { content: ""; position: absolute; inset: 0; }
.dp-mini-card__title a:focus-visible { outline: none; }
.dp-mini-card__meta { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--wp--preset--color--muted); }
.dp-mini-card__meta p + p { font-weight: 600; color: var(--dp-navy); }


.dp-main--product > .wp-block-group:last-child { padding-bottom: 112px; }
