/*
Theme Name:        Craftroq
Theme URI:         https://www.designslabz.com/
Description:       Craftroq child theme of DesignsLabz. Put site-specific customisations here so parent theme updates never overwrite them.
Author:            DesignsLabz
Author URI:        https://www.designslabz.com/
Template:          designslabz
Version:           1.0.0
Requires at least: 6.6
Requires PHP:      8.2
License:           GPL v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       craftroq
*/

/*
 * Child theme overrides. Loaded after the parent's compiled stylesheet
 * (handle: designslabz-style), so rules here win the cascade.
 */

/* ---------- Brand colours -------------------------------------------- *
 * Neutral roles (background, surface, border, text) come from the       *
 * theme.json palette. The parent's brand tokens are not presets, so     *
 * they are set here. Theme Options → Colours still overrides primary,   *
 * secondary and accent (inline <style> printed after this sheet).       */
:root {
	--dl-color-primary:   #c0266d; /* Raspberry — 5.6:1 on white */
	--dl-color-secondary: #351322; /* Deep Burgundy */
	--dl-color-accent:    #e85a98; /* Bright Raspberry */

	/* Raspberry already passes 4.5:1, so use it as-is for brand text and
	 * filled buttons instead of the parent's darkened color-mix(). */
	--dl-color-brand-strong: #c0266d;
	--dl-color-brand-soft:   #fceef5; /* Soft Pink */
	--dl-color-link-hover:   #a51f5b; /* Dark Raspberry */

	/* The logo is a square mark; the parent's 160px default would make it
	 * 160px tall. Theme Options → Header → Logo max-width still overrides. */
	--dl-header-logo-width: 44px;
}

/* ---------- Header ---------------------------------------------------- */
.site-header__account {
	margin-inline-start: var(--dl-space-2, 0.5rem);
	color: var(--dl-color-contrast);
	font-size: var(--dl-text-sm, 0.875rem);
	font-weight: var(--dl-weight-semibold, 600);
	text-decoration: none;
	white-space: nowrap;
}

.site-header__account:hover {
	color: var(--dl-color-brand-strong);
}

@media (width < 480px) {
	.site-header__account {
		display: none;
	}
}

/* Product mega menu (inc/navigation.php). */
.menu-item-has-children.cr-mega .sub-menu a.cr-mega__card {
	display: flex;
	align-items: flex-start;
	gap: 0.875rem;
	padding: 0.75rem;
	border-radius: var(--dl-radius-md, 0.75rem);
	white-space: normal;
}

.menu-item-has-children.cr-mega .sub-menu a.cr-mega__card:hover,
.menu-item-has-children.cr-mega .sub-menu a.cr-mega__card:focus-visible {
	background: var(--dl-color-brand-soft);
}

.cr-mega__icon {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	object-fit: cover;
}

.cr-mega__text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.cr-mega__name {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	color: var(--dl-color-contrast);
	font-size: 0.9375rem;
	font-weight: 700;
}

.cr-mega__pill {
	padding: 0.15rem 0.45rem;
	border-radius: var(--dl-radius-pill, 999px);
	background: var(--dl-color-brand-soft);
	color: var(--dl-color-brand-strong);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.cr-mega__pill--pro {
	background: var(--wp--preset--color--brand-dark, #351322);
	color: #fff;
}

.cr-mega__pill--coming-soon {
	background: var(--wp--preset--color--accent, #e85a98);
	color: var(--wp--preset--color--brand-dark, #351322);
}

.cr-mega__desc {
	color: var(--dl-color-text-muted);
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.45;
}

.menu-item-has-children.cr-mega .sub-menu .cr-mega__footer a {
	color: var(--dl-color-brand-strong);
	font-weight: 600;
}

.menu-item-has-children.cr-mega .sub-menu .cr-mega__footer a::after {
	content: " →";
}

@media (width >= 768px) {
	.menu-item-has-children.cr-mega > .sub-menu {
		flex-flow: row wrap;
		gap: 0.25rem;
		width: min(680px, 90vw);
		padding: 0.75rem;
		inset-inline-start: 50%;
		transform: translateX(-50%);
		border-radius: var(--dl-radius-lg, 1rem);
		box-shadow: 0 24px 60px -24px rgb(53 19 34 / 35%);
	}

	.cr-mega > .sub-menu > .cr-mega__item {
		flex: 1 1 calc(50% - 0.25rem);
	}

	.cr-mega > .sub-menu > .cr-mega__footer {
		flex: 1 1 100%;
		margin-top: 0.25rem;
		padding-top: 0.5rem;
		border-top: 1px solid var(--dl-color-border);
	}

	.menu-item-has-children.cr-mega .sub-menu .cr-mega__footer a {
		padding: 0.5rem 0.75rem;
		border-radius: var(--dl-radius-md, 0.75rem);
	}
}

/* ---------- Footer ---------------------------------------------------- */
.site-footer.cr-footer {
	margin-block-start: 0;
	padding-block: clamp(3rem, 7vw, 4.5rem) 0;
	border: 0;
	background: var(--wp--preset--color--brand-dark, #351322);
	color: rgb(252 238 245 / 72%);
}

.cr-footer__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) repeat(5, minmax(0, 1fr));
	gap: clamp(2rem, 5vw, 3.5rem);
	padding-block-end: clamp(2.5rem, 6vw, 3.5rem);
}

.cr-footer .custom-logo-link img {
	width: auto;
	max-width: none;
	height: 44px;
	filter: brightness(0) invert(1);
}

.cr-footer__about {
	max-width: 34ch;
	margin: 1.25rem 0 0;
	font-size: 0.9375rem;
	line-height: 1.6;
}

.cr-footer__heading {
	margin: 0 0 1rem;
	color: var(--wp--preset--color--accent, #e85a98);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cr-footer ul {
	display: grid;
	gap: 0.7rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cr-footer a {
	color: rgb(252 238 245 / 85%);
	font-size: 0.9375rem;
	text-decoration: none;
}

.cr-footer a:hover {
	color: #fff;
}

.cr-footer__products a {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
}

.cr-footer__icon {
	width: 24px;
	height: 24px;
	border-radius: 6px;
	box-shadow: 0 0 0 1px rgb(255 255 255 / 25%);
}

.cr-footer__bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	padding-block: 1.5rem;
	border-top: 1px solid rgb(255 255 255 / 10%);
	font-size: 0.8125rem;
}

.cr-footer__bar p {
	margin: 0;
}

.cr-footer__bar a {
	font-size: inherit;
}

@media (width < 1100px) {
	.cr-footer__inner {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.cr-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (width < 900px) {
	.cr-footer__inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cr-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (width < 560px) {
	.cr-footer__inner {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- Breadcrumb (parent markup, used on blog pages) ----------- */
.breadcrumb__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 var(--dl-space-4, 1rem);
	padding: 0;
	color: var(--dl-color-text-muted);
	font-size: var(--dl-text-sm, 0.875rem);
	list-style: none;
}

.breadcrumb__list a {
	color: inherit;
	text-decoration: none;
}

.breadcrumb__list a:hover {
	color: var(--dl-color-brand-strong);
}

.breadcrumb__sep {
	margin-inline-start: 0.5rem;
	opacity: 0.5;
}

/* ---------- Blocks ---------------------------------------------------- */

/* Paragraphs are capped at 70ch, so a centred one needs centring as a box too. */
p.has-text-align-center {
	margin-inline: auto;
}

/* Bento grid: brand burgundy instead of the parent's black and purple. */
:root {
	--dl-bento-bg: #351322;
}

/* .bento-card adds specificity: block styles print after this sheet. */
.dl-block-bento-grid .bento-card .bento-card__glow {
	background: radial-gradient(circle at var(--dl-bento-x, 50%) var(--dl-bento-y, 50%), rgb(232 90 152 / 18%), transparent 60%);
}

.dl-block-bento-grid .bento-card .bento-card__badge {
	background: rgb(232 90 152 / 20%);
	color: #fceef5;
}

/* Re-declared because the :root block above would otherwise beat the
 * parent's [data-theme='dark'] rule (same specificity, later sheet). */
[data-theme='dark'] {
	--dl-color-brand-strong: #e85a98; /* 6:1 on the dark base */
	--dl-color-brand-soft:   #351322;
	--dl-color-link-hover:   #e85a98;
}

/* --------------------------------------------------------------------------
   404 page (templates/404.php)
   -------------------------------------------------------------------------- */
.error-404__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.craftroq-404-search { display: flex; gap: .5rem; max-width: 32rem; margin-inline: auto; }
.craftroq-404-search input[type="search"] { flex: 1 1 auto; min-width: 0; }
@media (max-width: 480px) { .craftroq-404-search { flex-direction: column; } }

/* --------------------------------------------------------------------------
   Text pages (legal, docs, support): content wrapped in a constrained
   .cr-page group, since page.php prints blocks straight into <main>.
   -------------------------------------------------------------------------- */
.cr-page {
	padding-inline: var(--dl-container-gutter, 1.25rem);
	padding-block: 0 clamp(3rem, 7vw, 5rem);
	line-height: 1.7;
}

.cr-page > * + * {
	margin-block-start: 1rem;
}

.cr-page > h2 {
	margin-block-start: 2.5rem;
	font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

.cr-page > h3 {
	margin-block-start: 1.75rem;
	font-size: 1.0625rem;
}

.cr-page ul,
.cr-page ol {
	padding-inline-start: 1.25rem;
}

.cr-page li + li {
	margin-block-start: 0.4rem;
}

.cr-page a:not(.wp-element-button) {
	color: var(--wp--preset--color--primary, #c0266d);
	text-underline-offset: 2px;
}

.cr-page .wp-block-table {
	overflow-x: auto;
}

.cr-page .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.cr-page .wp-block-table th,
.cr-page .wp-block-table td {
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--wp--preset--color--border, #ecdde5);
	text-align: start;
	vertical-align: top;
}

.cr-page .wp-block-table thead th {
	background: var(--wp--preset--color--surface, #fbf3f7);
	font-weight: 600;
}

.cr-page .wp-block-details {
	padding: 0.9rem 1.1rem;
	border: 1px solid var(--wp--preset--color--border, #ecdde5);
	border-radius: 10px;
}

.cr-page .wp-block-details + .wp-block-details {
	margin-block-start: 0.6rem;
}

.cr-page .wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
}

.cr-page .wp-block-details p {
	margin-block: 0.6rem 0;
}

.cr-page .wp-block-buttons {
	margin-block-start: 1.25rem;
}
