/* ==========================================================================
   Deepa Publications: shared components (all pages, and the editor).
   Tokens come from theme.json (--wp--preset--*, --wp--custom--*).
   Base styles are the static layout. Anything animated is scoped under
   html.has-motion (see inc/motion-flag.php).
   ========================================================================== */

:root {
	--dp-navy: var(--wp--preset--color--navy);
	--dp-saffron: var(--wp--preset--color--saffron);
	--dp-cream: var(--wp--preset--color--cream);
	--dp-sand: var(--wp--preset--color--sand);
	--dp-on-navy: var(--wp--preset--color--on-navy);
	--dp-ease: var(--wp--custom--ease);
	--dp-header-h: 84px;
	--dp-qbar-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.screen-reader-text { border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }
img { max-width: 100%; height: auto; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
:focus-visible { outline: 2px solid var(--dp-navy); outline-offset: 3px; }
.has-navy-background-color :focus-visible,
.dp-header :focus-visible { outline-color: var(--dp-saffron); }

/* Text on navy surfaces */
.has-navy-background-color :is(h1, h2, h3, h4):not(.has-text-color) { color: #fff; }
.has-navy-background-color .is-style-eyebrow:not(.has-text-color) { color: var(--dp-saffron); }
.has-navy-background-color a:not(.wp-element-button) { color: inherit; }

/* ---------- Buttons ---------- */
.wp-block-button__link {
	min-height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: transform .2s var(--dp-ease), background-color .2s, color .2s;
}
html.has-motion .wp-block-button__link:hover { transform: translateY(-2px); }
.dp-btn-sm .wp-block-button__link { min-height: 44px; padding: 10px 18px; }

/* ---------- Header ---------- */
.dp-site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	transition: transform .4s var(--dp-ease);
}
.dp-header { background: var(--dp-navy); transition: background-color .3s, box-shadow .3s; }
.dp-header__bar { min-height: var(--dp-header-h); gap: 16px; }
.dp-header__right { gap: 28px; }
.dp-logo { margin: 0; flex-shrink: 0; }
.dp-logo img { height: 52px; width: auto !important; }

/* Front page: transparent over the navy hero. Without JS it simply scrolls away. */
.home .dp-site-header { position: absolute; inset: 0 0 auto 0; top: var(--wp-admin--admin-bar--height, 0px); }
.home .dp-header { background: transparent; }
html.js .home .dp-site-header { position: fixed; }
.dp-site-header.is-solid .dp-header { background: rgba(20, 33, 61, .96); box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.dp-site-header.is-hidden { transform: translateY(-100%); }

/* Navigation */
.dp-nav .wp-block-navigation-item__content {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}
.dp-nav .wp-block-navigation-item__content:hover { text-decoration: underline; text-underline-offset: 6px; }
.dp-nav.wp-block-navigation { --navigation-layout-justification-setting: flex-end; gap: 28px; }
.dp-nav .wp-block-navigation__container { gap: 28px; }
.dp-nav .wp-block-navigation__responsive-container-open,
.dp-nav .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.dp-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 24px clamp(20px, 5vw, 48px); }
.dp-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 8px; font-size: 22px; font-family: var(--wp--preset--font-family--serif); }

@media (max-width: 860px) {
	:root { --dp-header-h: 72px; }
	.dp-logo img { height: 40px; }
	.dp-header .dp-header__cta.wp-block-buttons { display: none; }
	/* Core collapses the menu below 600px; collapse up to 860px to match the design. */
	.dp-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: inline-flex; }
	.dp-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}

/* ---------- Page shell ---------- */
/* Full-bleed sections sit flush against each other. */
:where(.wp-block-post-content) > .alignfull + .alignfull { margin-block-start: 0; }
.dp-main:not(.dp-main--front):not(.dp-main--flush) { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--70); }
.dp-main--flush .wp-block-post-content > * { margin-block: 0; }

/* Plain page sections (product pages and later templates): full-width bands with a centred wrap. */
.dp-wrap { width: calc(100% - var(--wp--style--root--padding-left) - var(--wp--style--root--padding-right)); max-width: 1200px; margin-inline: auto; }
.dp-section { padding-block: var(--wp--preset--spacing--70); }
.dp-section--flush-top { padding-top: 0; }
.dp-page-title { margin-bottom: var(--wp--preset--spacing--50); }

/* ---------- Footer ---------- */
.dp-footer { font-size: 14px; padding-top: 64px; padding-bottom: 40px; }
.dp-footer p { margin: 0 0 8px; line-height: 1.6; }
.dp-footer a { color: var(--dp-on-navy); }
.dp-footer a:hover { color: #fff; }
.dp-footer__cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.dp-footer__cols > * { margin: 0 !important; }
.dp-footer__logo { margin: 0 0 12px; }
.dp-footer__logo img { height: 56px; width: auto !important; }
.dp-footer .dp-footer__title { font-family: var(--wp--preset--font-family--sans); font-size: 14px; font-weight: 600; line-height: 1.6; color: #fff; margin: 0 0 8px; }
.dp-footer .dp-footer__copy { margin-top: 40px; padding-top: 24px; border-top: 1px solid #2E3B5A; color: #A9B0BF; font-size: 13px; }
.dp-footer .dp-footer__copy a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) {
	.dp-footer__cols { grid-template-columns: 1fr 1fr; }
	.dp-footer { padding-bottom: calc(40px + var(--dp-qbar-h)); }
}
@media (max-width: 420px) { .dp-footer__cols { grid-template-columns: 1fr; } }

/* ---------- Phone quote bar ---------- */
.dp-qbar { display: none; }
@media (max-width: 860px) {
	.dp-qbar {
		display: block;
		position: fixed;
		inset: auto 0 0 0;
		z-index: 60;
		background: #fff;
		border-top: 1px solid var(--dp-sand);
		padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
	}
	html.js .dp-qbar { transform: translateY(110%); }
	html.js .dp-qbar.is-shown { transform: none; }
	html.has-motion .dp-qbar { transition: transform .35s var(--dp-ease); }
	.dp-qbar__buttons { flex-wrap: nowrap; gap: 10px; }
	.dp-qbar__quote { flex: 1; }
	.dp-qbar__quote .wp-block-button__link, .dp-qbar__call .wp-block-button__link { width: 100%; }
	.dp-qbar__call .wp-block-button__link::before {
		content: "";
		width: 20px;
		height: 20px;
		background: currentColor;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2' stroke='black' stroke-width='2' fill='none' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2' stroke='black' stroke-width='2' fill='none' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	}
}

/* ---------- Reveals (any page) ---------- */
html.has-motion .dp-reveal {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity .8s var(--dp-ease), transform .8s var(--dp-ease);
	transition-delay: calc(var(--i, 0) * 90ms);
}
html.has-motion .dp-reveal.is-in { opacity: 1; transform: none; }
.dp-reveal--1 { --i: 1; } .dp-reveal--2 { --i: 2; } .dp-reveal--3 { --i: 3; } .dp-reveal--4 { --i: 4; }

/* Editor: never hide or move anything. */
.editor-styles-wrapper .dp-reveal { opacity: 1 !important; transform: none !important; }
.editor-styles-wrapper .dp-qbar { position: static; transform: none; display: block; }

/* ---------- Shared content pieces ---------- */
/* Price tables (Pocket Planner tiers, logo printing) */
.dp-price-table { margin: 0; }
.dp-price-table table { border-collapse: collapse; width: 100%; font-size: 16px; }
.dp-price-table td { border: 0; border-top: 1px solid var(--dp-sand); padding: 16px 0; }
.dp-price-table tr:last-child td { border-bottom: 1px solid var(--dp-sand); }
.dp-price-table td:last-child { text-align: right; font-weight: 600; color: var(--dp-navy); white-space: nowrap; padding-left: 16px; }
.dp-price-table figcaption { text-align: left; margin-top: 8px; }
.dp-price-table--tiers td { padding-block: 10px; }


/* ---------- CTA band ---------- */
.dp-band { border-radius: 24px; padding: clamp(32px, 4vw, 48px) clamp(28px, 4.5vw, 56px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.dp-band .dp-band__title { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; max-width: 560px; }


.dp-main--landing > .wp-block-post-content > :last-child { padding-bottom: 112px; }

/* ---------- Style guide (local only page) ---------- */
.dp-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.dp-swatches > * { margin: 0 !important; min-height: 110px; border-radius: 12px; padding: 16px; border: 1px solid var(--dp-sand); display: flex; flex-direction: column; justify-content: flex-end; }
.dp-swatches p { margin: 0; font-size: 13px; }

/* Mobile menu overlay: left-aligned, large serif links. */
.dp-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.dp-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: flex-start; }

/* Footer links: comfortable touch targets (WCAG 2.5.8). */
.dp-footer p a { display: inline-block; padding-block: 5px; }
.dp-footer p { line-height: 1.5; }
