/* =========================================================================
   Bemypet Magazine Grid
   Brand tokens are injected inline from admin settings (see css_vars()).
   Fallbacks below keep things sane if the inline block is missing.
   ========================================================================= */
.bmp-magazine,
.bmp-cats,
.bmp-article {
	--bmp-primary: #111111;
	--bmp-accent: #ff5a3c;
	--bmp-text: #1a1a1a;
	--bmp-muted: #8a8a8a;
	--bmp-surface: #ffffff;
	--bmp-border: #ececec;
	--bmp-radius: 16px;
	--bmp-gap: 28px;
	--bmp-measure: 720px;
}

.bmp-magazine *,
.bmp-cats * {
	box-sizing: border-box;
}

/* Kill theme underline/box-shadow on card + category links */
.bmp-magazine a,
.bmp-cats a {
	text-decoration: none;
	box-shadow: none;
}
.bmp-magazine a:hover,
.bmp-cats a:hover {
	text-decoration: none;
}

/* ---------- Filter pills ---------- */
.bmp-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 calc(var(--bmp-gap) * 0.9);
}
.bmp-filter__pill {
	appearance: none;
	border: 1px solid var(--bmp-border);
	background: var(--bmp-surface);
	color: var(--bmp-text);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	padding: 11px 18px;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.bmp-filter__pill:hover {
	border-color: var(--bmp-primary);
	transform: translateY(-1px);
}
.bmp-filter__pill.is-active {
	background: var(--bmp-primary);
	border-color: var(--bmp-primary);
	color: #fff;
}

/* ---------- Grid ---------- */
.bmp-grid {
	display: grid;
	grid-template-columns: repeat(var(--bmp-cols, 3), minmax(0, 1fr));
	gap: var(--bmp-gap);
	transition: opacity 0.2s ease;
}
.bmp-magazine.is-loading .bmp-grid {
	opacity: 0.45;
	pointer-events: none;
}

/* ---------- Card ---------- */
.bmp-card {
	background: var(--bmp-surface);
	border: 1px solid var(--bmp-border);
	border-radius: var(--bmp-radius);
	overflow: hidden;
	transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.bmp-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.32);
}
.bmp-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}
.bmp-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: linear-gradient(135deg, #f3f3f3, #e7e7e7);
}
.bmp-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}
.bmp-card:hover .bmp-card__img {
	transform: scale(1.05);
}
.bmp-card__placeholder {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--bmp-accent) 18%, transparent), transparent 60%),
		linear-gradient(135deg, #f3f3f3, #e7e7e7);
}
.bmp-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: color-mix(in srgb, var(--bmp-primary) 92%, transparent);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 6px 12px;
	border-radius: 999px;
	backdrop-filter: blur(3px);
}
.bmp-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 20px 20px 22px;
	flex: 1 1 auto;
}
.bmp-card__title {
	margin: 0;
	font-size: 1.12rem;
	line-height: 1.4;
	font-weight: 700;
	color: var(--bmp-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.bmp-card:hover .bmp-card__title {
	color: var(--bmp-accent);
}
.bmp-card__excerpt {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.6;
	color: var(--bmp-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.bmp-card__meta {
	margin-top: auto;
	font-size: 0.8rem;
	color: var(--bmp-muted);
}

/* ---------- Load more ---------- */
.bmp-loadmore-wrap {
	display: flex;
	justify-content: center;
	margin-top: calc(var(--bmp-gap) * 1.4);
}
.bmp-loadmore {
	appearance: none;
	border: 1px solid var(--bmp-primary);
	background: transparent;
	color: var(--bmp-primary);
	font: inherit;
	font-weight: 700;
	padding: 13px 34px;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease;
}
.bmp-loadmore:hover {
	background: var(--bmp-primary);
	color: #fff;
}
.bmp-loadmore[hidden] {
	display: none;
}

.bmp-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--bmp-muted);
	padding: 48px 0;
}

/* ---------- Category cards ---------- */
.bmp-cats {
	display: grid;
	grid-template-columns: repeat(var(--bmp-cols, 4), minmax(0, 1fr));
	gap: var(--bmp-gap);
}
.bmp-cat {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 150px;
	padding: 18px;
	border-radius: var(--bmp-radius);
	overflow: hidden;
	text-decoration: none;
	color: #fff;
	background: var(--bmp-primary);
	transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.bmp-cat:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.4);
}
.bmp-cat__media {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	z-index: 0;
}
.bmp-cat::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.62));
	z-index: 1;
}
.bmp-cat__name,
.bmp-cat__count {
	position: relative;
	z-index: 2;
}
.bmp-cat__name {
	font-size: 1.05rem;
	font-weight: 700;
}
.bmp-cat__count {
	font-size: 0.8rem;
	opacity: 0.85;
	margin-top: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.bmp-grid { grid-template-columns: repeat(min(var(--bmp-cols, 3), 2), minmax(0, 1fr)); }
	.bmp-cats { grid-template-columns: repeat(min(var(--bmp-cols, 4), 3), minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.bmp-grid { grid-template-columns: 1fr; }
	.bmp-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bmp-filter { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
	.bmp-filter::-webkit-scrollbar { display: none; }
	.bmp-filter__pill { flex: 0 0 auto; }
}

/* =========================================================================
   Magazine single-post typography  (body.bmp-article)
   Scoped to the common content wrappers so it works across themes without
   fighting the theme's own layout width.
   ========================================================================= */
body.bmp-article .entry-content,
body.bmp-article .post-content,
body.bmp-article .single-content,
body.bmp-article article .content {
	max-width: var(--bmp-measure, 720px);
	margin-left: auto;
	margin-right: auto;
	color: var(--bmp-text, #1a1a1a);
	font-size: 1.075rem;
	line-height: 1.85;
	letter-spacing: -0.003em;
	word-break: keep-all;
}
body.bmp-article .entry-content > *,
body.bmp-article .post-content > * {
	margin-top: 0;
	margin-bottom: 1.5em;
}
body.bmp-article .entry-content h2,
body.bmp-article .post-content h2 {
	font-size: 1.7rem;
	line-height: 1.35;
	font-weight: 800;
	margin-top: 2.4em;
	margin-bottom: 0.7em;
	letter-spacing: -0.01em;
}
body.bmp-article .entry-content h3,
body.bmp-article .post-content h3 {
	font-size: 1.32rem;
	line-height: 1.4;
	font-weight: 700;
	margin-top: 2em;
	margin-bottom: 0.6em;
}
body.bmp-article .entry-content h4,
body.bmp-article .post-content h4 {
	font-size: 1.1rem;
	font-weight: 700;
	margin-top: 1.7em;
	margin-bottom: 0.5em;
}
body.bmp-article .entry-content h2 + p,
body.bmp-article .entry-content h3 + p,
body.bmp-article .post-content h2 + p,
body.bmp-article .post-content h3 + p {
	margin-top: 0;
}
body.bmp-article .entry-content a,
body.bmp-article .post-content a {
	color: var(--bmp-accent, #ff5a3c);
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}
body.bmp-article .entry-content img,
body.bmp-article .post-content img {
	border-radius: calc(var(--bmp-radius, 16px) * 0.75);
}
body.bmp-article .entry-content figure,
body.bmp-article .post-content figure {
	margin: 2.4em 0;
}
body.bmp-article .entry-content figcaption,
body.bmp-article .post-content figcaption {
	margin-top: 0.7em;
	font-size: 0.85rem;
	color: var(--bmp-muted, #8a8a8a);
	text-align: center;
}
body.bmp-article .entry-content blockquote,
body.bmp-article .post-content blockquote {
	margin: 2.2em 0;
	padding: 4px 0 4px 24px;
	border-left: 3px solid var(--bmp-primary, #111);
	font-size: 1.2rem;
	line-height: 1.6;
	font-weight: 600;
	color: var(--bmp-text, #1a1a1a);
}
body.bmp-article .entry-content ul,
body.bmp-article .entry-content ol,
body.bmp-article .post-content ul,
body.bmp-article .post-content ol {
	padding-left: 1.3em;
}
body.bmp-article .entry-content li,
body.bmp-article .post-content li {
	margin-bottom: 0.6em;
}
body.bmp-article .entry-content hr,
body.bmp-article .post-content hr {
	margin: 3em auto;
	border: 0;
	width: 60px;
	border-top: 2px solid var(--bmp-border, #ececec);
}

/* -------------------------------------------------------------------------
   Elementor Theme Builder single template (it-service child theme).
   the_content lives in .elementor-widget-theme-post-content, NOT .entry-content,
   so the rules above don't reach it. Re-scope the magazine measure + typography
   here, and — the reason images render huge — cap images to the content column.
   ------------------------------------------------------------------------- */
body.bmp-article .elementor-widget-theme-post-content > .elementor-widget-container {
	max-width: var(--bmp-measure, 720px);
	margin-inline: auto;
	color: var(--bmp-text, #1a1a1a);
	font-size: 1.075rem;
	line-height: 1.85;
	letter-spacing: -0.003em;
	word-break: keep-all;
}
body.bmp-article .elementor-widget-theme-post-content > .elementor-widget-container > * {
	margin-top: 0;
	margin-bottom: 1.5em;
}
/* The fix for "images too big": constrain to the column, never upscale full-size uploads */
body.bmp-article .elementor-widget-theme-post-content img {
	max-width: 100%;
	height: auto;
	border-radius: calc(var(--bmp-radius, 16px) * 0.75);
}
body.bmp-article .elementor-widget-theme-post-content figure {
	margin: 2.2em 0;
	text-align: center;
}
body.bmp-article .elementor-widget-theme-post-content figure img {
	display: inline-block;
}
body.bmp-article .elementor-widget-theme-post-content figcaption {
	margin-top: 0.7em;
	font-size: 0.85rem;
	color: var(--bmp-muted, #8a8a8a);
	text-align: center;
}
body.bmp-article .elementor-widget-theme-post-content h2 {
	font-size: 1.7rem;
	line-height: 1.35;
	font-weight: 800;
	margin: 2.4em 0 0.7em;
	letter-spacing: -0.01em;
}
body.bmp-article .elementor-widget-theme-post-content h3 {
	font-size: 1.32rem;
	line-height: 1.4;
	font-weight: 700;
	margin: 2em 0 0.6em;
}
body.bmp-article .elementor-widget-theme-post-content h4 {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 1.7em 0 0.5em;
}
body.bmp-article .elementor-widget-theme-post-content p {
	margin: 0 0 1.5em;
}
body.bmp-article .elementor-widget-theme-post-content h2 + p,
body.bmp-article .elementor-widget-theme-post-content h3 + p {
	margin-top: 0;
}
body.bmp-article .elementor-widget-theme-post-content ul,
body.bmp-article .elementor-widget-theme-post-content ol {
	padding-left: 1.3em;
}
body.bmp-article .elementor-widget-theme-post-content li {
	margin-bottom: 0.6em;
}
body.bmp-article .elementor-widget-theme-post-content blockquote {
	margin: 2.2em 0;
	padding: 4px 0 4px 24px;
	border-left: 3px solid var(--bmp-primary, #111);
	font-size: 1.2rem;
	line-height: 1.6;
	font-weight: 600;
	color: var(--bmp-text, #1a1a1a);
}
body.bmp-article .elementor-widget-theme-post-content a {
	color: var(--bmp-accent, #ff5a3c);
	text-underline-offset: 3px;
}

/* -------------------------------------------------------------------------
   Gutenberg-block readability normalization (content pasted from the editor).
   The 진심 posts carry lots of spacer <div>s, centered headings and empty
   paragraphs that make the article read broken. Tame them here.
   ------------------------------------------------------------------------- */
/* Oversized spacer divs → tight, consistent rhythm */
body.bmp-article .elementor-widget-theme-post-content div[style*="height:50px"] { height: 16px !important; }
body.bmp-article .elementor-widget-theme-post-content div[style*="height:100px"] { height: 30px !important; }
/* Drop empty paragraphs (stray gaps) */
body.bmp-article .elementor-widget-theme-post-content p:empty { display: none; }
/* Long-form reads better left-aligned — kill stray center alignment on text */
body.bmp-article .elementor-widget-theme-post-content p,
body.bmp-article .elementor-widget-theme-post-content li,
body.bmp-article .elementor-widget-theme-post-content h1,
body.bmp-article .elementor-widget-theme-post-content h2,
body.bmp-article .elementor-widget-theme-post-content h3,
body.bmp-article .elementor-widget-theme-post-content h4 {
	text-align: left;
}
/* Consistent paragraph spacing regardless of source markup */
body.bmp-article .elementor-widget-theme-post-content p { margin: 0 0 1.3em; line-height: 1.85; }

/* Gutenberg images: clean centered figure */
body.bmp-article .elementor-widget-theme-post-content figure.wp-block-image {
	margin: 1.8em auto;
	text-align: center;
}
body.bmp-article .elementor-widget-theme-post-content figure.wp-block-image img {
	display: inline-block;
	height: auto;
}
body.bmp-article .elementor-widget-theme-post-content figure.wp-block-image.is-resized img {
	max-width: 100%;
}

/* Gallery → 2-up on desktop, stacked on mobile.
   Core's .is-layout-flex sets width:calc(50%…) on the nested figures; combined
   with any wrapper that shrinks again the images render tiny. Force the figures
   to a real 50% of the content column here (higher specificity than core). */
body.bmp-article .elementor-widget-theme-post-content .wp-block-gallery {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 14px;
	margin: 1.8em 0;
}
body.bmp-article .elementor-widget-theme-post-content .wp-block-gallery figure.wp-block-image {
	margin: 0;
	flex: 0 1 calc(50% - 7px);
	max-width: calc(50% - 7px);
	width: calc(50% - 7px);
}
body.bmp-article .elementor-widget-theme-post-content .wp-block-gallery figure.wp-block-image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 10px;
}
body.bmp-article .elementor-widget-theme-post-content .wp-block-gallery figcaption {
	margin-top: 6px;
	font-size: 0.85rem;
	color: var(--bmp-muted, #8a8a8a);
}
@media (max-width: 600px) {
	body.bmp-article .elementor-widget-theme-post-content .wp-block-gallery figure.wp-block-image {
		flex-basis: 100%;
		max-width: 100%;
		width: 100%;
	}
}

/* -------------------------------------------------------------------------
   Mobile fixes for the single-post view. The single-post Elementor header
   template (6568) differs from the site header (252): its logo (#logo-normal,
   681×200) has no mobile width cap, so it overflows the viewport. And the
   article widgets sit edge-to-edge with no side breathing room. Patch both
   here, scoped to body.bmp-article so only single posts are affected.
   ------------------------------------------------------------------------- */
@media (max-width: 767px) {
	/* Oversized single-post header logo (#logo-normal, 681px) → sensible mobile size. */
	body.bmp-article #logo-normal img {
		max-width: 150px;
		height: auto;
	}
	/* Single-post header (6568): the logo + nav are full-width (e-con-full)
	   e-child items inside .e-con-inner, so they stack (logo row + hamburger row).
	   Lay them on ONE row — logo left, hamburger right. Target .e-con-inner (the
	   real flex parent) + descendant e-child (not direct children). */
	body.bmp-article .elementor-location-header .e-parent .e-con-inner {
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: space-between !important;
	}
	body.bmp-article .elementor-location-header .e-parent .e-con.e-child {
		width: auto !important;
		max-width: none !important;
		flex: 0 0 auto !important;
		align-items: flex-start !important;
	}
	body.bmp-article .elementor-location-header .elementor-widget-image,
	body.bmp-article .elementor-location-header .elementor-widget-image .elementor-widget-container,
	body.bmp-article .elementor-location-header .elementor-widget-image a {
		width: auto !important;
		display: inline-block !important;
	}
	/* Hamburger icon is dark (#33373D) on the dark (#333) header → invisible.
	   Make it white for contrast. */
	body.bmp-article .elementor-location-header .elementor-menu-toggle,
	body.bmp-article .elementor-location-header .elementor-menu-toggle svg,
	body.bmp-article .elementor-location-header .elementor-menu-toggle i {
		color: #ffffff !important;
		fill: #ffffff !important;
	}
	/* Side breathing room for the article widgets */
	body.bmp-article .elementor-widget-theme-post-title > .elementor-widget-container,
	body.bmp-article .elementor-widget-post-info > .elementor-widget-container,
	body.bmp-article .elementor-widget-theme-post-content > .elementor-widget-container {
		padding-left: 16px;
		padding-right: 16px;
	}
}

/* Contact button pill (전화 예약안내) */
body.bmp-article .elementor-widget-theme-post-content .wp-block-buttons {
	display: flex;
	justify-content: center;
	margin: 1.8em 0;
}
body.bmp-article .elementor-widget-theme-post-content .wp-block-button__link {
	display: inline-block;
	border-radius: 999px;
	padding: 14px 32px;
	font-weight: 700;
	text-decoration: none;
	line-height: 1.2;
}

/* Instagram + KakaoTalk contact banners → one centered row.
   Primary mechanism: the two banner figures are wrapped in <div class="bmp-contact-row">
   in post content, so this works in every browser (no :has() dependency). */
body.bmp-article .elementor-widget-theme-post-content .bmp-contact-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 12px;
	margin: 1.6em 0;
}
body.bmp-article .elementor-widget-theme-post-content .bmp-contact-row figure.wp-block-image {
	margin: 0;
	max-width: 47%;
	flex: 0 1 250px;
}
body.bmp-article .elementor-widget-theme-post-content .bmp-contact-row figure.wp-block-image img {
	width: 100% !important;
	height: auto;
}

/* Fallback for un-wrapped content in browsers that support :has() */
body.bmp-article .elementor-widget-theme-post-content > .elementor-widget-container > figure.wp-block-image:has(a[href*="instagram.com"]),
body.bmp-article .elementor-widget-theme-post-content > .elementor-widget-container > figure.wp-block-image:has(a[href*="pf.kakao"]) {
	display: inline-block;
	width: auto;
	max-width: 46%;
	margin: 12px 4px 0;
	vertical-align: top;
}
