/* =========================================================
   CHERUBIN BASE — replaces petty parent theme foundation
   ========================================================= */

/* --- Reset & Box Model --- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	padding: 0;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.65;
	color: #3a2d27;
	background-color: #fbf5ef;
	-webkit-font-smoothing: antialiased;
}

img,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: #8a5d7a;
	text-decoration: none;
}

a:hover {
	color: #6e4562;
}

h1, h2, h3, h4, h5, h6 {
	margin-top: 0;
	margin-bottom: 0.5em;
	font-weight: 700;
	line-height: 1.15;
	color: #3a2d27;
}

p {
	margin-top: 0;
	margin-bottom: 1em;
}

ul, ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

figure {
	margin: 0;
}

input,
textarea,
select,
button {
	font-family: inherit;
	font-size: inherit;
}

/* --- Layout container --- */
.container,
.cherubin-container {
	width: 100%;
	max-width: 1280px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 24px;
	padding-right: 24px;
}

/* --- Site wrapper --- */
#cherubin-site {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

#cherubin-main {
	flex: 1;
	padding-top: 24px;
	padding-bottom: 64px;
}

/* --- Header --- */
#cherubin-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(251, 245, 239, 0.92);
	border-bottom: 1px solid rgba(35, 33, 33, 0.07);
}

/* Blur on pseudo-element so it doesn't create a CSS stacking context.
   backdrop-filter on the element itself traps position:fixed children
   (like the mobile nav overlay) inside its containing block on iOS Safari. */
#cherubin-header::before {
	content: '';
	position: absolute;
	inset: 0;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	z-index: -1;
	pointer-events: none;
}

.cherubin-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 64px;
}

.cherubin-logo {
	display: flex;
	align-items: center;
	font-size: 1.35rem;
	font-weight: 800;
	color: #3a2d27;
	letter-spacing: -0.01em;
	white-space: nowrap;
	flex-shrink: 0;
}

.cherubin-logo:hover {
	color: #8a5d7a;
}

.cherubin-logo__img {
	display: block;
	max-height: 40px;
	width: auto;
	object-fit: contain;
}

.cherubin-logo__name {
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: #3a2d27;
}

/* --- Primary Nav --- */
.cherubin-nav {
	flex: 1;
}

.cherubin-nav ul {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.cherubin-nav ul li a {
	display: inline-flex;
	align-items: center;
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 0.92rem;
	font-weight: 600;
	color: #3a2d27;
	transition: background 0.15s, color 0.15s;
}

.cherubin-nav ul li a:hover,
.cherubin-nav ul li.current-menu-item > a,
.cherubin-nav ul li.current-page-ancestor > a {
	background: rgba(138, 93, 122, 0.10);
	color: #8a5d7a;
}

/* --- Header actions (cart, mobile toggle) --- */
.cherubin-header__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.cherubin-cart-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: #3a2d27;
	color: #fff7ec !important;
	border-radius: 999px;
	font-size: 0.88rem;
	font-weight: 700;
	transition: background 0.15s;
}

.cherubin-cart-link:hover {
	background: #8a5d7a;
	color: #fff !important;
}

.cherubin-cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 4px;
	background: #ffbf00;
	color: #2f2622;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 800;
	line-height: 1;
}

/* --- Mobile menu toggle --- */
.cherubin-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	/* No background / border — just the icon */
	background: transparent;
	border: none;
	border-radius: 0;
	cursor: pointer;
	color: #3a2d27;
	flex-shrink: 0;
	padding: 0;
}

/* SVG icons: explicit stroke so no plugin can make them disappear */
.cherubin-menu-toggle svg {
	display: block;
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	stroke: #3a2d27;
	fill: none;
}

.cherubin-cart-link svg {
	display: block;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	stroke: currentColor;
	fill: none;
}

/* Close button inside mobile nav overlay */
.cherubin-nav__close {
	display: none;
}

/* --- Breadcrumb / Page title bar --- */
#cherubin-breadcrumb {
	padding: 10px 0 0;
}

.cherubin-breadcrumb__inner {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.86rem;
	color: #8a5d7a;
	padding: 12px 20px;
	background: rgba(255, 250, 246, 0.85);
	border: 1px solid rgba(35, 33, 33, 0.07);
	border-radius: 18px;
	margin-bottom: 0;
	overflow: hidden;
	min-width: 0;
}

.cherubin-breadcrumb__inner a {
	color: #8a5d7a;
	font-weight: 600;
}

.cherubin-breadcrumb__inner a:hover {
	color: #6e4562;
}

.cherubin-breadcrumb__sep {
	opacity: 0.4;
}

.cherubin-breadcrumb__current {
	color: #6e5a4d;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

/* --- Footer --- */
#cherubin-footer {
	background: #3a2d27;
	color: rgba(255, 247, 236, 0.78);
	padding: 48px 0 32px;
	overflow: hidden;
}

.cherubin-footer__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
	gap: 40px;
}

.cherubin-footer__brand {
	display: grid;
	gap: 12px;
}

.cherubin-footer__logo {
	font-size: 1.35rem;
	font-weight: 800;
	color: #fff7ec;
	letter-spacing: -0.01em;
}

.cherubin-footer__tagline {
	font-size: 0.92rem;
	line-height: 1.6;
	color: rgba(255, 247, 236, 0.65);
}

.cherubin-footer__col h4 {
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: rgba(255, 247, 236, 0.45);
	margin-bottom: 14px;
}

.cherubin-footer__col ul {
	display: grid;
	gap: 10px;
}

.cherubin-footer__col ul li a {
	font-size: 0.92rem;
	color: rgba(255, 247, 236, 0.72);
	transition: color 0.15s;
}

.cherubin-footer__col ul li a:hover {
	color: #fff7ec;
}

.cherubin-footer__bottom {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 247, 236, 0.1);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	font-size: 0.82rem;
	color: rgba(255, 247, 236, 0.38);
}

.cherubin-footer__bottom a {
	color: rgba(255, 247, 236, 0.5);
}

.cherubin-footer__bottom a:hover {
	color: rgba(255, 247, 236, 0.85);
}

/* --- Buttons (base layer — further styled in cherubin-web.css) --- */
.button,
button.button,
input[type="submit"],
a.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 10px 22px;
	background: #3a2d27;
	color: #fff7ec;
	border: 0;
	border-radius: 999px;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, transform 0.12s;
}

.button:hover,
a.button:hover {
	background: #6e4562;
	color: #fff;
	transform: translateY(-1px);
}

/* --- Screen-reader / skip link --- */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

.screen-reader-text:focus {
	clip: auto;
	display: block;
	height: auto;
	left: 8px;
	top: 8px;
	width: auto;
	z-index: 9999;
	padding: 12px 24px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* --- WP alignments --- */
.alignleft { float: left; margin-right: 1.5em; }
.alignright { float: right; margin-left: 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignfull { width: 100%; }

/* --- Blog loop (index / archive) --- */
.cherubin-posts {
	display: grid;
	gap: 24px;
}

.cherubin-post-card {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: 0;
	background: rgba(255, 255, 255, 0.88);
	border: 1px solid rgba(35, 33, 33, 0.08);
	border-radius: 24px;
	overflow: hidden;
	box-shadow: 0 12px 32px rgba(35, 33, 33, 0.06);
}

.cherubin-post-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cherubin-post-card__image-placeholder {
	background: linear-gradient(135deg, #f3e5d7, #fffaf6);
	min-height: 200px;
}

.cherubin-post-card__body {
	padding: 28px 32px;
	display: grid;
	gap: 12px;
	align-content: start;
}

.cherubin-post-card__meta {
	font-size: 0.82rem;
	color: #8a5d7a;
	font-weight: 600;
}

.cherubin-post-card__title {
	font-size: clamp(1.2rem, 2vw, 1.7rem);
	line-height: 1.2;
	margin: 0;
}

.cherubin-post-card__title a {
	color: #3a2d27;
}

.cherubin-post-card__title a:hover {
	color: #8a5d7a;
}

.cherubin-post-card__excerpt {
	font-size: 0.96rem;
	line-height: 1.65;
	color: #5a4a40;
	margin: 0;
}

.cherubin-post-card__link {
	font-size: 0.9rem;
	font-weight: 700;
	color: #8a5d7a;
}

.cherubin-post-card__link:hover {
	color: #6e4562;
}

/* --- Single post — full container width --- */
.cherubin-single {
	width: 100%;
}

.cherubin-single__header {
	margin-bottom: 32px;
}

.cherubin-single__meta {
	font-size: 0.85rem;
	color: #8a5d7a;
	font-weight: 600;
	margin-bottom: 12px;
}

.cherubin-single__title {
	font-size: clamp(1.9rem, 4vw, 3rem);
	line-height: 1.05;
	margin-bottom: 20px;
}

.cherubin-single__thumbnail {
	margin-bottom: 36px;
	border-radius: 24px;
	overflow: hidden;
}

.cherubin-single__thumbnail img {
	width: 100%;
	height: auto;
}

.cherubin-single__content {
	background: rgba(255, 255, 255, 0.88);
	border: 1px solid rgba(35, 33, 33, 0.08);
	border-radius: 24px;
	padding: 36px 40px;
	box-shadow: 0 12px 32px rgba(35, 33, 33, 0.06);
	overflow-x: hidden;
	overflow-wrap: break-word;
	word-break: break-word;
}

/* Prevent wide tables / pre / iframes in post content from overflowing */
.cherubin-single__content table {
	max-width: 100%;
	width: 100%;
}

.cherubin-single__content pre,
.cherubin-single__content iframe {
	max-width: 100%;
}

.cherubin-single__content h2 { font-size: 1.55rem; margin: 1.5em 0 0.5em; }
.cherubin-single__content h3 { font-size: 1.25rem; margin: 1.2em 0 0.4em; }
.cherubin-single__content p { line-height: 1.75; color: #4a3b33; }
.cherubin-single__content ul, .cherubin-single__content ol { list-style: disc; padding-left: 1.5em; margin-bottom: 1em; }
.cherubin-single__content img { border-radius: 14px; margin: 1em 0; }

/* --- 404 --- */
.cherubin-404 {
	text-align: center;
	padding: 80px 24px;
	max-width: 560px;
	margin: 0 auto;
}

.cherubin-404 h1 {
	font-size: clamp(3rem, 8vw, 6rem);
	color: rgba(35, 33, 33, 0.12);
	line-height: 1;
	margin-bottom: 8px;
}

.cherubin-404 h2 {
	font-size: 1.7rem;
	margin-bottom: 16px;
}

.cherubin-404 p {
	color: #6e5a4d;
	margin-bottom: 32px;
}

/* --- Pagination --- */
.cherubin-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 48px;
	flex-wrap: wrap;
}

.cherubin-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	background: rgba(255, 255, 255, 0.88);
	border: 1px solid rgba(35, 33, 33, 0.08);
	border-radius: 12px;
	font-size: 0.92rem;
	font-weight: 600;
	color: #3a2d27;
	transition: background 0.15s;
}

.cherubin-pagination .page-numbers:hover,
.cherubin-pagination .page-numbers.current {
	background: #3a2d27;
	color: #fff7ec;
	border-color: #3a2d27;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 767px) {
	/* ---- Footer collapse ---- */
	.cherubin-footer__inner {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.cherubin-footer__brand {
		padding-bottom: 20px;
		margin-bottom: 4px;
		border-bottom: 1px solid rgba(255, 247, 236, 0.1);
	}

	.cherubin-footer__col {
		border-bottom: 1px solid rgba(255, 247, 236, 0.1);
	}

	.cherubin-footer__col h4 {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 14px 0;
		margin-bottom: 0;
		cursor: pointer;
		user-select: none;
	}

	.cherubin-footer__col h4::after {
		content: '+';
		font-size: 1.1rem;
		font-weight: 400;
		opacity: 0.6;
		transition: transform 0.2s;
	}

	.cherubin-footer__col.is-open h4::after {
		transform: rotate(45deg);
	}

	.cherubin-footer__col ul {
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease, padding 0.3s ease;
		padding-bottom: 0;
	}

	.cherubin-footer__col.is-open ul {
		max-height: 400px;
		padding-bottom: 16px;
	}

	/* ---- Mobile nav overlay (slide-in from right) ---- */
	/* Never display:none — iOS can't reliably toggle it.
	   Instead slide off-screen via transform. */
	.cherubin-nav {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		height: 100% !important;
		background: #fbf5ef !important;
		z-index: 99999 !important;
		padding: 0 24px 48px !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		/* hidden off to the right — no display:none */
		display: flex !important;
		flex-direction: column !important;
		transform: translateX(100%);
		transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
		/* Ensure it paints on top of everything */
		-webkit-backface-visibility: hidden;
		backface-visibility: hidden;
	}

	.cherubin-nav.is-open {
		transform: translateX(0) !important;
	}

	.cherubin-nav__close {
		display: flex;
		align-self: flex-end;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: 16px 0 8px;
		background: rgba(58, 45, 39, 0.08);
		border: none;
		border-radius: 50%;
		cursor: pointer;
		color: #3a2d27 !important;
		font-size: 1.3rem;
		font-weight: 400;
		line-height: 1;
		flex-shrink: 0;
		-webkit-tap-highlight-color: transparent;
		/* Force text color against any WC/plugin button resets */
		-webkit-text-fill-color: #3a2d27;
	}

	.cherubin-nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
	}

	.cherubin-nav ul li a {
		font-size: 1.15rem;
		padding: 13px 16px;
		border-radius: 14px;
		display: block;
	}

	.cherubin-menu-toggle {
		display: inline-flex;
	}

	.cherubin-post-card {
		grid-template-columns: 1fr;
	}

	.cherubin-single__content {
		padding: 20px 16px;
	}
}

@media (min-width: 768px) {
	.cherubin-menu-toggle {
		display: none;
	}
}
