/* DoodleMerry child theme styles */

:root {
	--dm-navy: #1d2457;
	--dm-text: #2b2f4a;
	--dm-pink: #e8437a;
	--dm-pink-soft: #fde8ef;
	--dm-purple: #7b4fd0;
	--dm-yellow: #ffc72c;
	--dm-line: #ebe6f3;
	--dm-radius: 18px;
	--dm-shadow: 0 6px 18px rgba(48, 40, 110, .07);
	--dm-head: "Fredoka", "Nunito", system-ui, sans-serif;
	--dm-body: "Nunito", system-ui, sans-serif;
}

/* Re-colour Kadence's global palette so inner pages (blog, categories, shop) match. */
:root {
	--global-palette1: #e8437a;
	--global-palette2: #c42b5e;
	--global-palette3: #1d2457;
	--global-palette4: #2b2f4a;
	--global-palette5: #4a4f6e;
	--global-palette6: #7a7f99;
	--global-palette7: #f3effb;
	--global-palette8: #f8f5fd;
	--global-palette9: #ffffff;
	--global-heading-font-family: "Fredoka", "Nunito", system-ui, sans-serif;
	--global-body-font-family: "Nunito", system-ui, sans-serif;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--global-heading-font-family); }

.entry-hero .entry-header,
.entry-hero-container-inner {
	background: linear-gradient(135deg, #e6f3fd, #f3ecfd 55%, #fde9f1);
}

.content-bg,
body.content-style-unboxed .site { background: #fff; }

.loop-entry {
	border: 2px solid #f1eef6;
	border-radius: 18px;
	box-shadow: 0 6px 18px rgba(48, 40, 110, .07);
	overflow: hidden;
}
.post-thumbnail-inner img[src$=".svg"],
.loop-entry .post-thumbnail-inner img[src$=".svg"],
.category-christmas .post-thumbnail-inner img,
.dm-printable-post .post-thumbnail-inner img {
	object-fit: contain;
	padding: 18px;
	background: #fff;
}

body {
	background: #fff;
	color: var(--dm-text);
	font-family: var(--dm-body);
}

.dm-container {
	width: 100%;
	max-width: 1500px;
	margin: 0 auto;
	padding: 0 32px;
}

/* ---------- Buttons ---------- */
.dm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	border: 0;
	border-radius: 999px;
	padding: .7em 1.5em;
	font-family: var(--dm-head);
	font-weight: 600;
	font-size: 1.05rem;
	line-height: 1.1;
	text-decoration: none;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.dm-btn:hover { transform: translateY(-2px); }
.dm-btn--pink { background: var(--dm-pink); color: #fff; box-shadow: 0 6px 14px rgba(232, 67, 122, .3); }
.dm-btn--pink:hover { background: #d63269; color: #fff; }
.dm-btn--purple { background: var(--dm-purple); color: #fff; box-shadow: 0 6px 14px rgba(123, 79, 208, .3); }
.dm-btn--purple:hover { background: #6a3fc0; color: #fff; }
.dm-btn--soft { background: var(--dm-pink-soft); color: var(--dm-pink); font-size: 1rem; padding: .6em 1.2em; }
.dm-btn--soft:hover { background: var(--dm-pink); color: #fff; }
.dm-btn--lg { font-size: 1.35rem; padding: .7em 1.5em; }

/* ---------- Header ---------- */
.dm-header {
	background: #fff;
	position: relative;
	z-index: 50;
}
.dm-header__inner {
	display: flex;
	align-items: center;
	gap: 28px;
	min-height: 86px;
}
.dm-logo { flex: 0 0 auto; line-height: 0; }
.dm-logo img { width: 250px; height: auto; }

.dm-nav {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 24px;
}
.dm-menu {
	display: flex;
	align-items: center;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.dm-menu li { position: relative; margin: 0; }
.dm-menu > li > a {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	border-radius: 999px;
	color: var(--dm-navy);
	font-family: var(--dm-head);
	font-weight: 600;
	font-size: 1.1rem;
	text-decoration: none;
	white-space: nowrap;
}
.dm-menu > li > a:hover { color: var(--dm-pink); }
.dm-menu > .current-menu-item > a,
.dm-menu > .current-menu-item > a:hover {
	background: var(--dm-pink);
	color: #fff;
}
.dm-menu > .menu-item-has-children > a::after {
	content: "";
	width: 7px;
	height: 7px;
	border-right: 2.5px solid currentColor;
	border-bottom: 2.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	margin-left: 2px;
}
.dm-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 210px;
	list-style: none;
	margin: 6px 0 0;
	padding: 8px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 14px 34px rgba(29, 36, 87, .14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.dm-menu .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.dm-menu li:hover > .sub-menu,
.dm-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.dm-menu .sub-menu a {
	display: block;
	padding: 8px 14px;
	border-radius: 10px;
	color: var(--dm-navy);
	font-weight: 700;
	text-decoration: none;
}
.dm-menu .sub-menu a:hover { background: var(--dm-pink-soft); color: var(--dm-pink); }

.dm-search {
	margin-left: auto;
	display: flex;
	align-items: center;
	width: 270px;
	border: 2px solid var(--dm-line);
	border-radius: 999px;
	background: #fff;
	box-shadow: var(--dm-shadow);
	padding: 4px 6px 4px 18px;
}
.dm-search input[type="search"] {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	padding: 8px 0;
	font-family: var(--dm-body);
	font-size: 1rem;
	color: var(--dm-text);
	outline: none;
}
.dm-search button {
	border: 0;
	background: transparent;
	color: var(--dm-navy);
	padding: 6px 10px;
	line-height: 0;
	cursor: pointer;
	box-shadow: none;
}
.dm-search button:hover { color: var(--dm-pink); background: transparent; }
.dm-search:focus-within { border-color: var(--dm-pink); }

.dm-nav-toggle {
	display: none;
	margin-left: auto;
	border: 0;
	background: var(--dm-pink-soft);
	color: var(--dm-pink);
	border-radius: 12px;
	padding: 8px;
	line-height: 0;
	cursor: pointer;
}
.dm-nav-toggle:hover,
.dm-nav-toggle:focus { background: var(--dm-pink); color: #fff; }

/* ---------- Hero ---------- */
.dm-home { overflow: hidden; }
.dm-hero {
	background-size: cover;
	background-position: center bottom;
	background-color: #cfeafb;
}
.dm-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
	align-items: end;
	min-height: 360px;
}
.dm-hero__text {
	position: relative;
	align-self: center;
	padding: 32px 0 40px 36px;
}
.dm-hero h1 {
	margin: 0 0 14px;
	color: var(--dm-navy);
	font-family: var(--dm-head);
	font-weight: 700;
	font-size: clamp(2.2rem, 3.6vw, 3.6rem);
	line-height: 1.05;
	letter-spacing: -.01em;
	max-width: 14.5ch;
}
.dm-hero p {
	margin: 0 0 22px;
	max-width: 24ch;
	color: var(--dm-navy);
	font-weight: 700;
	font-size: clamp(1.1rem, 1.5vw, 1.45rem);
	line-height: 1.3;
}
.dm-hero__heart {
	position: absolute;
	width: 52px;
	left: 380px;
	top: 52%;
}
.dm-hero__art { align-self: end; line-height: 0; }
.dm-hero__art img {
	display: block;
	width: 100%;
	max-width: 760px;
	height: auto;
}

/* Little yellow "spark" doodles */
.dm-spark {
	position: absolute;
	width: 40px;
	height: 40px;
	pointer-events: none;
	background:
		linear-gradient(var(--dm-yellow), var(--dm-yellow)) 6px 4px / 7px 24px no-repeat,
		linear-gradient(var(--dm-yellow), var(--dm-yellow)) 20px 10px / 7px 24px no-repeat;
	border-radius: 4px;
}
.dm-spark--a { left: 420px; top: 28px; transform: rotate(25deg); }
.dm-spark--b { left: -6px; top: 58%; transform: rotate(-60deg); }
.dm-spark--c { position: relative; display: inline-block; width: 34px; height: 34px; vertical-align: top; transform: rotate(20deg); }

/* ---------- Category tiles ---------- */
.dm-cats {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	gap: 14px;
	margin-top: 24px;
	margin-bottom: 30px;
}
.dm-cat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px 8px 18px;
	border-radius: var(--dm-radius);
	color: var(--dm-navy);
	font-family: var(--dm-head);
	font-weight: 600;
	font-size: 1.1rem;
	text-align: center;
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease;
}
.dm-cat img { width: 78px; height: 78px; object-fit: contain; }
.dm-cat:hover { transform: translateY(-4px); box-shadow: var(--dm-shadow); color: var(--dm-navy); }
.dm-cat--coloring-pages   { background: #fdeaf0; }
.dm-cat--mazes            { background: #fdf3dc; }
.dm-cat--puzzles          { background: #e2f1fb; }
.dm-cat--dot-to-dot       { background: #e3f6ec; }
.dm-cat--word-search      { background: #ece8fb; }
.dm-cat--activity-sheets  { background: #fdefdf; }
.dm-cat--craft-printables { background: #fde7ee; }
.dm-cat--activity-books   { background: #e5eefb; }

/* ---------- Main area ---------- */
.dm-main {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: 32px;
	align-items: start;
	margin-bottom: 56px;
}
.dm-card {
	border-radius: 22px;
	position: relative;
}
.dm-latest {
	background: #fff;
	border: 2px solid #f1eef6;
	box-shadow: var(--dm-shadow);
	padding: 26px 26px 28px;
}
.dm-latest__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}
.dm-home h2 {
	margin: 0;
	color: var(--dm-navy);
	font-family: var(--dm-head);
	font-weight: 700;
	line-height: 1.1;
}
.dm-latest h2 { font-size: clamp(1.6rem, 2.2vw, 2.1rem); }
.dm-link-arrow {
	color: var(--dm-pink);
	font-family: var(--dm-head);
	font-weight: 600;
	font-size: 1.15rem;
	text-decoration: none;
	white-space: nowrap;
}
.dm-link-arrow:hover { color: #c42b5e; }

.dm-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
}
.dm-printable {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 10px;
	padding: 12px 12px 18px;
	border: 2px solid #f1eef6;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 4px 12px rgba(48, 40, 110, .06);
	transition: transform .15s ease, box-shadow .15s ease;
}
.dm-printable:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(48, 40, 110, .1); }
.dm-printable__thumb { display: block; width: 100%; aspect-ratio: 1 / .85; line-height: 0; }
.dm-printable__thumb img { width: 100%; height: 100%; object-fit: contain; }
.dm-printable h3 {
	margin: 0;
	flex: 1;
	font-family: var(--dm-body);
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.25;
}
.dm-printable h3 a { color: var(--dm-navy); text-decoration: none; }
.dm-printable h3 a:hover { color: var(--dm-pink); }
.dm-empty { margin: 0; font-weight: 700; }

/* Christmas section: festive frame, portrait page thumbnails, 6 across. */
.dm-xmas {
	margin-bottom: 32px;
	border-color: #f6d3d8;
	background:
		radial-gradient(circle at 12px 12px, rgba(255, 255, 255, .9) 2px, transparent 2.5px) 0 0 / 34px 34px,
		linear-gradient(135deg, #fdecee, #fff 40%, #fff 60%, #e6f5ec);
}
.dm-xmas h2 { color: #c62f45; }
.dm-xmas .dm-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dm-xmas .dm-printable__thumb { aspect-ratio: 8.5 / 11; }
.dm-single-download { margin-top: 1.5em; }
.dm-single-download .dm-btn,
.dm-single-download .dm-btn:hover { color: #fff; text-decoration: none; }

/* ---------- Sidebar cards ---------- */
.dm-side { display: grid; gap: 24px; }
.dm-side h2 { font-size: clamp(1.5rem, 1.9vw, 1.85rem); margin-bottom: 10px; }
.dm-side p { margin: 0 0 16px; color: var(--dm-navy); font-weight: 600; line-height: 1.4; }
.dm-side__text { position: relative; max-width: 72%; }

.dm-news {
	background: linear-gradient(135deg, #efe9fd, #e6e4fb 60%, #ece2fb);
	padding: 24px 24px 26px;
}
.dm-news__art, .dm-book__art {
	position: absolute;
	right: 18px;
	top: 18px;
	width: 120px;
	height: auto;
}
.dm-news__form { display: flex; gap: 8px; }
.dm-news__form input[type="email"] {
	flex: 1;
	min-width: 0;
	border: 2px solid #fff;
	border-radius: 999px;
	padding: 11px 18px;
	background: #fff;
	font-family: var(--dm-body);
	font-size: 1rem;
	box-shadow: var(--dm-shadow);
}
.dm-news__form input[type="email"]:focus { border-color: var(--dm-pink); outline: none; }
.dm-news__msg { font-weight: 800 !important; color: #178a52 !important; }
.dm-news__msg--err { color: #c42b5e !important; }

.dm-book {
	background: linear-gradient(135deg, #fff6d9, #fdf0cf);
	padding: 24px 24px 26px;
	min-height: 190px;
}
.dm-book__art { width: 150px; top: auto; bottom: 18px; }

/* ---------- Header cart ---------- */
.dm-cart {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--dm-pink-soft);
	color: var(--dm-pink);
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}
.dm-cart:hover { background: var(--dm-pink); color: #fff; }
.dm-cart__count {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 99px;
	background: var(--dm-purple);
	color: #fff;
	font: 800 12px/22px var(--dm-body);
	text-align: center;
}
.dm-cart__count.is-empty { display: none; }

/* ---------- Shop (WooCommerce) ---------- */
.dm-shop-hero {
	background-size: cover;
	background-position: center bottom;
	margin-bottom: 36px;
}
.dm-shop-hero .dm-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 220px;
}
.dm-shop-hero h1 {
	margin: 0 0 10px;
	color: var(--dm-navy);
	font-family: var(--dm-head);
	font-weight: 700;
	font-size: clamp(2rem, 3.2vw, 3.2rem);
	line-height: 1.05;
}
.dm-shop-hero p { margin: 0; max-width: 46ch; color: var(--dm-navy); font-weight: 700; font-size: 1.15rem; line-height: 1.4; }
.dm-shop-hero img { width: 380px; max-width: 42%; height: auto; align-self: flex-end; }
@media (max-width: 860px) { .dm-shop-hero img { display: none; } .dm-shop-hero .dm-container { min-height: 170px; } }

.woocommerce .button,
.woocommerce button.button,
.woocommerce a.button,
.wc-block-components-button,
.wp-element-button { border-radius: 999px !important; font-family: var(--dm-head); font-weight: 600; }

.woocommerce ul.products li.product {
	background: #fff;
	border: 2px solid #f1eef6;
	border-radius: 20px;
	box-shadow: var(--dm-shadow);
	overflow: hidden;
	transition: transform .15s ease, box-shadow .15s ease;
}
.woocommerce ul.products li.product:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(48, 40, 110, .12); }
.woocommerce ul.products li.product .product-details { padding: 6px 18px 20px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--dm-head);
	font-weight: 700;
	font-size: clamp(1rem, 1.6vw, 1.3rem);
	color: var(--dm-navy);
}
.woocommerce ul.products li.product .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price { color: var(--dm-pink); font-family: var(--dm-head); font-weight: 700; }
.woocommerce ul.products li.product .price { font-size: 1.2rem; }
.woocommerce div.product .product_title { font-family: var(--dm-head); font-weight: 700; color: var(--dm-navy); }
.woocommerce div.product div.images img { border-radius: 24px; }
.woocommerce div.product p.price { font-size: 1.8rem; }
.woocommerce-products-header__title,
.woocommerce .page-title { font-family: var(--dm-head); }

/* ---------- Footer ---------- */
.dm-footer {
	background: #f8f5fd;
	border-top: 2px solid #efe9f8;
	color: var(--dm-navy);
}
.dm-footer__inner {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1fr;
	gap: 32px;
	padding-top: 44px;
	padding-bottom: 36px;
}
.dm-footer__brand img { width: 210px; height: auto; }
.dm-footer__brand p { max-width: 36ch; margin: 10px 0 0; font-weight: 600; line-height: 1.5; }
.dm-footer h3 {
	margin: 0 0 12px;
	color: var(--dm-navy);
	font-family: var(--dm-head);
	font-weight: 700;
	font-size: 1.2rem;
}
.dm-footer ul { list-style: none; margin: 0; padding: 0; }
.dm-footer li { margin: 0 0 8px; }
.dm-footer a { color: var(--dm-navy); font-weight: 700; text-decoration: none; }
.dm-footer a:hover { color: var(--dm-pink); }
.dm-footer__bottom {
	border-top: 2px solid #efe9f8;
	padding: 16px 0;
	font-weight: 700;
	font-size: .95rem;
	text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1640px) {
	.dm-logo img { width: 220px; }
	.dm-menu { gap: 2px; }
	.dm-menu > li > a { padding: 8px 13px; font-size: 1.05rem; }
	.dm-search { width: 230px; }
	.dm-header__inner { gap: 18px; }
	.dm-nav { gap: 14px; }
}

@media (max-width: 1400px) {
	.dm-logo img { width: 190px; }
	.dm-menu > li > a { padding: 8px 10px; font-size: .98rem; }
	.dm-search { width: 190px; }
	.dm-container { padding: 0 24px; }
}

@media (max-width: 1240px) {
	.dm-nav-toggle { display: inline-flex; }
	.dm-cart { width: 42px; height: 42px; }
	.dm-nav {
		display: none;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 12px 32px 22px;
		background: #fff;
		box-shadow: 0 16px 30px rgba(29, 36, 87, .12);
	}
	.dm-nav.is-open { display: flex; }
	.dm-menu { flex-direction: column; align-items: stretch; }
	.dm-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		margin: 0 0 4px 18px;
		padding: 0;
	}
	.dm-search { width: 100%; margin-left: 0; }

	.dm-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.dm-main { grid-template-columns: 1fr; }
	.dm-xmas .dm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.dm-side { grid-template-columns: 1fr 1fr; }
	.dm-spark--a { left: auto; right: 0; }
	.dm-hero__heart { display: none; }
}

@media (max-width: 860px) {
	.dm-container { padding: 0 16px; }
	.dm-nav { padding-left: 16px; padding-right: 16px; }
	.dm-hero__inner { grid-template-columns: 1fr; min-height: 0; }
	.dm-hero__text { padding: 30px 8px 10px; }
	.dm-hero__text .dm-spark { display: none; }
	.dm-hero h1 { max-width: none; }
	.dm-hero__art img { margin: 0 auto; }
	.dm-grid,
	.dm-xmas .dm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dm-side { grid-template-columns: 1fr; }
	.dm-footer__inner { grid-template-columns: 1fr 1fr; }
	.dm-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
	.dm-logo img { width: 170px; }
	.dm-header__inner { min-height: 70px; }
	.dm-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.dm-latest { padding: 18px 14px; }
	.dm-latest__head { flex-wrap: wrap; }
	.dm-grid { gap: 12px; }
	.dm-side__text { max-width: none; }
	.dm-news__art, .dm-book__art { display: none; }
	.dm-news__form { flex-direction: column; }
	.dm-btn--lg { font-size: 1.15rem; }
}

/* Most Loved Books (DoodleMerry Downloads plugin) */
.dm-popular-books .dmb-pop-title{margin-top:0}
.dm-popular-books__more{text-align:right;margin:18px 0 0}

/* Gift Guides page: guide posts as cards */
.wp-block-latest-posts.is-grid { gap: 18px; padding: 0; }
.wp-block-latest-posts.is-grid li {
	margin: 0; padding: 20px; background: #fff; border: 2px solid var(--dm-line);
	border-radius: var(--dm-radius); box-shadow: var(--dm-shadow);
}
.wp-block-latest-posts.is-grid li::before { content: "🎁"; display: block; font-size: 34px; margin-bottom: 8px; }
.wp-block-latest-posts.is-grid li:has(.wp-block-latest-posts__featured-image)::before { content: none; }
.wp-block-latest-posts__featured-image img { border-radius: 12px; }
.wp-block-latest-posts__post-title {
	font-family: var(--dm-head); font-weight: 700; font-size: 1.2rem; line-height: 1.3;
	color: var(--dm-navy); text-decoration: none;
}
.wp-block-latest-posts__post-title:hover { color: var(--dm-pink); }
.wp-block-latest-posts__post-excerpt { margin: 8px 0 0; font-size: .95rem; }
@media (max-width: 781px) { .wp-block-latest-posts.is-grid li { width: 100%; } }
