/*
Theme Name: Leaf Dental Child
Theme URI: https://leaf-dental-redesign.local/
Description: UI refinements for Leaf Dental based on the DigiPress Fresco parent theme.
Author: Leaf Dental
Template: dp-fresco
Version: 1.0.0
Text Domain: leaf-dental-child
*/

:root {
	--leaf-primary: #202f54;
	--leaf-primary-hover: #15213d;
	--leaf-primary-soft: rgba(32, 47, 84, 0.08);
	--leaf-border: #cfdad8;
	--leaf-surface: #f2f6f5;
	--leaf-text: #30383a;
}

/* --------------------------------------------------------------------------
 * Global navigation
 * -------------------------------------------------------------------------- */

.global_menu_ul:not(.mq-mode) > .menu-item > .menu-link,
.global_menu_ul:not(.mq-mode) > .menu-item > .menu-link .menu-title,
.global_menu_ul:not(.mq-mode) > .menu-item > .menu-link .menu-caption {
	transform: none !important;
}

.global_menu_nav .nav_chaser {
	top: auto !important;
	bottom: 0 !important;
	height: 3px !important;
	transform: none !important;
	border-radius: 3px 3px 0 0;
	background-color: var(--leaf-primary) !important;
	box-shadow: none !important;
}

.global_menu_ul:not(.mq-mode) > .menu-item:hover > .menu-link {
	color: var(--leaf-primary) !important;
	background-color: var(--leaf-primary-soft) !important;
}

.global_menu_ul:not(.mq-mode) > .menu-item > .menu-link:focus-visible {
	color: var(--leaf-primary) !important;
	background-color: var(--leaf-primary-soft) !important;
	outline: 2px solid var(--leaf-primary);
	outline-offset: -3px;
}

.global_menu_ul:not(.mq-mode) > .menu-item > .menu-link .menu-title {
	font-size: 14px !important;
	line-height: 74px;
}

/* Match desktop dropdown items to the top-level navigation text size. */
.global_menu_ul:not(.mq-mode)
	> .menu-item
	> .sub-menu
	.menu-link {
	font-size: 14px !important;
	line-height: 1.5;
}

/* Keep the whole header height hoverable.
 * The parent theme positions first-level submenus at top: 74px. */
.global_menu_ul:not(.mq-mode) > .menu-item,
.global_menu_ul:not(.mq-mode) > .menu-item > .menu-link {
	height: 74px;
}

/* Do not style .current-menu-item while PJAX is enabled.
 * DigiPress does not reliably refresh that class after PJAX navigation. */

/* Compact the information mega menu without reducing the post count. */
#global_menu_ul:not(.mq-mode)
	#menu-item-34
	> .loop-section.as-mega-menu,
#global_menu_ul:not(.mq-mode)
	#menu-item-34
	> .loop-section.as-mega-menu
	.loop-div {
	height: 340px !important;
}

#global_menu_ul:not(.mq-mode)
	#menu-item-34
	> .loop-section.as-mega-menu
	.loop-article {
	height: 170px !important;
}

#global_menu_ul:not(.mq-mode)
	#menu-item-34
	> .loop-section.as-mega-menu
	.loop-post-thumb {
	height: 95px !important;
	background-color: #fff;
}

#global_menu_ul:not(.mq-mode)
	#menu-item-34
	> .loop-section.as-mega-menu
	.loop-figure {
	background-color: #fff;
	background-repeat: no-repeat !important;
	background-position: center !important;
	background-size: contain !important;
	transform: none !important;
}

#global_menu_ul:not(.mq-mode)
	#menu-item-34
	> .loop-section.as-mega-menu
	.loop-article-content {
	height: 75px !important;
	padding: 0 8px;
}

#global_menu_ul:not(.mq-mode)
	#menu-item-34
	> .loop-section.as-mega-menu
	.loop-title {
	font-size: 14px !important;
	line-height: 1.45;
}

#global_menu_ul:not(.mq-mode)
	#menu-item-34
	> .loop-section.as-mega-menu
	.loop-media-icon {
	display: none;
}

/* --------------------------------------------------------------------------
 * Homepage phone and web reservation buttons
 * -------------------------------------------------------------------------- */

body.home #page-7 .btn.btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	padding: 12px 22px;
	color: #fff !important;
	background-color: var(--leaf-primary) !important;
	border-color: var(--leaf-primary) !important;
	border-radius: 5px;
	line-height: 1.4;
	text-decoration: none !important;
	box-shadow: none;
}

body.home #page-7 .btn.btn-primary:hover {
	color: #fff !important;
	background-color: var(--leaf-primary-hover) !important;
	border-color: var(--leaf-primary-hover) !important;
}

body.home #page-7 .btn.btn-primary:focus-visible {
	outline: 3px solid #0a5100;
	outline-offset: 3px;
}

/* Keep the two homepage contact actions compact on phones. */
@media screen and (max-width: 767px) {
	body.home #page-7 .entry > h2.wp-block-heading {
		font-size: clamp(24px, 6.1vw, 26px) !important;
		line-height: 1.45;
	}

	body.home
		#page-7
		.entry
		> .dp_sc_fl_box.fresco:first-of-type {
		display: grid;
		grid-template-columns: 1fr;
		gap: 12px;
		margin: 16px 0 20px;
	}

	body.home
		#page-7
		.entry
		> .dp_sc_fl_box.fresco:first-of-type
		> .dp_sc_fl_item {
		box-sizing: border-box;
		width: 100%;
		min-width: 0;
		margin: 0 !important;
		padding: 0;
	}

	body.home
		#page-7
		.entry
		> .dp_sc_fl_box.fresco:first-of-type
		.btn.btn-primary {
		box-sizing: border-box;
		width: 100%;
		margin: 0;
		padding-right: 12px;
		padding-left: 12px;
		white-space: nowrap;
	}
}

@media screen and (min-width: 390px) and (max-width: 767px) {
	body.home
		#page-7
		.entry
		> .dp_sc_fl_box.fresco:first-of-type {
		grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
	}
}

/* Keep sidebar news links readable without enlarging other widget text. */
#sidebar .widget_recent_entries li a {
	font-size: 17px;
	line-height: 1.7;
	transition: color 0.2s ease;
}

#sidebar .widget_recent_entries li a:hover,
#sidebar .widget_recent_entries li a:focus-visible {
	color: #a34732 !important;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

#sidebar .widget_recent_entries li a:focus-visible {
	outline: 2px solid #a34732;
	outline-offset: 3px;
	border-radius: 2px;
}

/* Match native block widgets to the former sidebar text sizing. */
#sidebar .widget_block > .wp-widget-group__inner-blocks {
	font-size: 17px;
	line-height: 1.6;
}

#sidebar .widget_block .wp-block-latest-posts__post-title,
#sidebar
	.widget_block
	> .wp-widget-group__inner-blocks
	> a:not(.btn):not(.icon-phone) {
	font-size: 17px;
	line-height: 1.7;
}

#sidebar .widget_block .wp-block-latest-posts__post-title {
	transition: color 0.2s ease;
}

#sidebar .widget_block .wp-block-latest-posts__post-title:hover,
#sidebar .widget_block .wp-block-latest-posts__post-title:focus-visible {
	color: #a34732 !important;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

#sidebar .widget_block .wp-block-latest-posts__post-title:focus-visible {
	outline: 2px solid #a34732;
	outline-offset: 3px;
	border-radius: 2px;
}

/* Keep the embedded XO calendar at its original compact scale. */
#sidebar .widget_block .xo-event-calendar {
	font-size: 12px;
	line-height: 1.8;
}

/* Match custom HTML widget headings to the standard sidebar heading style. */
#sidebar .widget_custom_html > .widgettitle {
	position: relative;
	margin: 0 0 16px;
	padding: 0 0 20px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
}

#sidebar .widget_custom_html > .widgettitle::before,
#sidebar .widget_custom_html > .widgettitle::after {
	content: "";
	position: absolute;
	display: block !important;
	bottom: -2px;
	left: 50%;
	width: 60px;
	height: 4px;
	border: 0;
	background-color: var(--leaf-primary);
	box-shadow: none;
	opacity: 0.8;
	transform: translateX(-75%) skewX(-35deg) !important;
	transition: width 0.4s;
}

#sidebar .widget_custom_html > .widgettitle::after {
	background-color: #aacebd;
	transform: translateX(-25%) skewX(-35deg) !important;
}

#sidebar .widget_custom_html > .widgettitle:hover::before,
#sidebar .widget_custom_html > .widgettitle:hover::after {
	width: 80px;
}

@media screen and (max-width: 1024px) {
	#sidebar .widget_custom_html > .widgettitle {
		font-size: 24px;
	}

	#sidebar .widget_custom_html > .widgettitle::before,
	#sidebar .widget_custom_html > .widgettitle::after {
		height: 6px;
	}
}

/* Distinguish the external facility-information link from reservation CTAs. */
#sidebar
	.widget_custom_html
	a.btn.btn-primary[title="施設基準など"],
#sidebar
	.widget_block
	> .wp-widget-group__inner-blocks
	a.btn.btn-primary[title="施設基準など"] {
	box-sizing: border-box;
	display: block;
	width: 100%;
	margin: 12px 0 14px;
	padding: 12px 16px;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 700;
	line-height: 1.5;
	text-align: center;
	background-color: #2c737a !important;
	border: 2px solid #2c737a !important;
	border-radius: 5px;
	box-shadow: none;
}

#sidebar
	.widget_custom_html
	a.btn.btn-primary[title="施設基準など"]:hover,
#sidebar
	.widget_block
	> .wp-widget-group__inner-blocks
	a.btn.btn-primary[title="施設基準など"]:hover {
	color: #fff !important;
	background-color: #235f66 !important;
	border-color: #235f66 !important;
}

#sidebar
	.widget_custom_html
	a.btn.btn-primary[title="施設基準など"]:focus-visible,
#sidebar
	.widget_block
	> .wp-widget-group__inner-blocks
	a.btn.btn-primary[title="施設基準など"]:focus-visible {
	color: #fff !important;
	outline: 3px solid var(--leaf-primary);
	outline-offset: 3px;
}

/* Reduce excess spacing within the sidebar consultation calendar group. */
#sidebar #custom_html-4,
#sidebar #block-3 {
	margin-bottom: 24px;
}

#sidebar #block-3 > .wp-block-columns {
	margin-bottom: 0;
}

#sidebar #custom_html-4 .wd-title {
	margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
 * Features page: paired equipment-photo cards and captions
 * Page ID: 10
 * -------------------------------------------------------------------------- */

body.page-id-10 .entry .wp-block-columns > .wp-block-column {
	display: flex;
}

body.page-id-10 .entry .wp-block-columns .wp-block-cover.media__image {
	display: grid;
	grid-template-rows: 270px minmax(76px, auto);
	align-items: stretch;
	width: 100%;
	min-height: 0 !important;
	height: auto;
	padding: 0 !important;
	aspect-ratio: auto !important;
	overflow: hidden;
	background-color: var(--leaf-surface);
	border: 1px solid var(--leaf-border);
	border-radius: 6px;
}

body.page-id-10
	.entry
	.wp-block-columns
	.wp-block-cover.media__image
	img.wp-block-cover__image-background {
	position: relative !important;
	inset: auto !important;
	grid-row: 1;
	width: 100%;
	height: 270px;
	object-fit: contain !important;
	object-position: center;
}

body.page-id-10
	.entry
	.wp-block-columns
	.wp-block-cover.media__image
	.wp-block-cover__background {
	display: none;
}

body.page-id-10
	.entry
	.wp-block-columns
	.wp-block-cover.media__image
	.wp-block-cover__inner-container {
	position: relative;
	grid-row: 2;
	display: flex;
	align-self: stretch;
	width: 100%;
	color: var(--leaf-text) !important;
}

body.page-id-10
	.entry
	.wp-block-columns
	.wp-block-cover.media__image
	.wp-block-cover__inner-container
	p {
	box-sizing: border-box;
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 76px;
	margin: 0;
	padding: 14px 16px !important;
	color: var(--leaf-text) !important;
	font-size: 15px !important;
	font-weight: 600;
	line-height: 1.55 !important;
	background: #eaf3f1 !important;
	border-top: 1px solid var(--leaf-border);
	text-shadow: none;
}

@media screen and (max-width: 781px) {
	body.page-id-10 .entry .wp-block-columns .wp-block-cover.media__image {
		grid-template-rows: 240px minmax(72px, auto);
	}

	body.page-id-10
		.entry
		.wp-block-columns
		.wp-block-cover.media__image
		img.wp-block-cover__image-background {
		height: 240px;
	}
}

/* --------------------------------------------------------------------------
 * Caries page: before/after case-photo galleries
 * Page ID: 213
 * -------------------------------------------------------------------------- */

body.page-id-213 .entry :is(
		.wp-block-gallery-1,
		.wp-block-gallery-2,
		.wp-block-gallery-3,
		.wp-block-gallery-4,
		.wp-block-gallery-5,
		.wp-block-gallery-7
	) {
	max-width: 760px;
	margin-right: auto;
	margin-left: auto;
	gap: 16px;
}

body.page-id-213 .entry .wp-block-gallery-7 {
	max-width: 560px;
}

body.page-id-213 .entry :is(
		.wp-block-gallery-1,
		.wp-block-gallery-2,
		.wp-block-gallery-3,
		.wp-block-gallery-4,
		.wp-block-gallery-5,
		.wp-block-gallery-7
	)
	> figure.wp-block-image {
	display: flex;
	flex: 0 0 calc((100% - 16px) / 2) !important;
	flex-direction: column;
	width: calc((100% - 16px) / 2) !important;
}

body.page-id-213 .entry :is(
		.wp-block-gallery-1,
		.wp-block-gallery-2,
		.wp-block-gallery-3,
		.wp-block-gallery-4,
		.wp-block-gallery-5,
		.wp-block-gallery-7
	)
	img {
	width: auto !important;
	max-width: 100%;
	height: auto !important;
	margin-right: auto;
	margin-left: auto;
	object-fit: contain !important;
}

body.page-id-213 .entry .wp-block-gallery figcaption.wp-element-caption {
	position: static !important;
	margin-top: 7px;
	padding: 0;
	color: var(--leaf-text) !important;
	font-size: 14px;
	line-height: 1.5;
	background: none !important;
	text-align: center;
	text-shadow: none;
}

/* --------------------------------------------------------------------------
 * Periodontal page: five explanatory diagrams
 * Page ID: 232
 * -------------------------------------------------------------------------- */

body.page-id-232 .entry > .wp-block-gallery-1 {
	display: grid !important;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 16px;
	max-width: 760px;
	margin-right: auto;
	margin-left: auto;
}

body.page-id-232
	.entry
	> .wp-block-gallery-1
	> figure.wp-block-image {
	grid-column: span 2;
	width: auto !important;
	margin: 0 !important;
}

body.page-id-232
	.entry
	> .wp-block-gallery-1
	> figure.wp-block-image:nth-child(4) {
	grid-column: 2 / span 2;
}

body.page-id-232 .entry > .wp-block-gallery-1 img {
	display: block;
	width: 100%;
	height: auto !important;
	object-fit: contain !important;
}

/* --------------------------------------------------------------------------
 * Clinic overview page: consultation-hours table
 * Page ID: 1511
 * -------------------------------------------------------------------------- */

body.page-id-1511 .entry .deb-block-1bfc620 {
	box-sizing: border-box;
	max-width: 100%;
	margin-right: auto;
	margin-left: auto;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

body.page-id-1511 .entry .deb-block-1bfc620 table {
	width: 640px !important;
	min-width: 560px;
	margin-right: auto;
	margin-left: auto;
	color: var(--leaf-text);
	font-size: 15px;
	line-height: 1.4;
	table-layout: fixed;
	border-collapse: collapse;
}

body.page-id-1511 .entry .deb-block-1bfc620 td {
	box-sizing: border-box;
	height: 48px;
	padding: 8px 6px !important;
	vertical-align: middle;
	text-align: center;
	border: 1px solid var(--leaf-border);
}

body.page-id-1511 .entry .deb-block-1bfc620 td:first-child {
	width: 132px;
	white-space: normal;
}

body.page-id-1511 .entry .deb-block-1bfc620 tr:first-child td {
	color: #fff;
	font-weight: 700;
	background-color: var(--leaf-primary);
}

body.page-id-1511
	.entry
	.deb-block-1bfc620
	tr:not(:first-child)
	td:first-child {
	font-weight: 600;
	background-color: var(--leaf-surface);
}

body.page-id-1511
	.entry
	.deb-block-1bfc620
	td
	span[style*="font-size"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.4em;
	font-size: 1em !important;
	line-height: 1;
}

/* --------------------------------------------------------------------------
 * Information category archive
 * -------------------------------------------------------------------------- */

/* Match the title underline used on standard singular pages. */
body.category-information #ct-whole .hd-title span {
	padding: 0 0 2.4vw;
	margin-bottom: 0.92vw;
}

body.category-information #ct-whole .hd-title span::before,
body.category-information #ct-whole .hd-title span::after {
	content: "";
	position: absolute;
	top: auto;
	right: auto;
	bottom: -8px;
	left: 50%;
	width: 6vw;
	height: 7px;
	border: 0;
	background-color: #fff;
	box-shadow: none;
	opacity: 0.5;
	transform: translateX(calc(-50% - 1.5vw)) skewX(-35deg);
	transition: width 0.4s;
}

body.category-information #ct-whole .hd-title span::after {
	transform: translateX(calc(-50% + 1.5vw)) skewX(-35deg);
}

body.category-information #ct-whole .hd-title span:hover::before,
body.category-information #ct-whole .hd-title span:hover::after {
	width: 7vw;
}

body.category-information #ct-whole .hd-meta.title-desc {
	display: none !important;
}

/* Use a compact thumbnail and give the message the visual priority. */
body.category-information #content .loop-article {
	display: grid !important;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
	width: 100% !important;
	margin: 0 0 32px !important;
	padding: 0 0 32px !important;
	border-bottom: 1px solid var(--leaf-border);
}

body.category-information #content .loop-col.one,
body.category-information #content .loop-col.two {
	display: block;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
}

body.category-information #content .loop-post-thumb:not(.video) {
	height: auto !important;
	aspect-ratio: 4 / 3;
}

body.category-information #content .loop-post-thumb .thumb-link {
	display: block;
	width: 100%;
	height: 100%;
}

body.category-information #content .loop-post-thumb .loop-figure {
	width: 100% !important;
	height: 100% !important;
	background-color: #fff;
	background-repeat: no-repeat !important;
	background-position: center !important;
	background-size: contain !important;
	transform: none !important;
}

body.category-information #content .loop-title {
	margin-bottom: 14px;
	font-size: 20px;
	line-height: 1.5;
}

body.category-information #content .loop-excerpt {
	margin-bottom: 14px;
	font-size: 16px;
	line-height: 1.8;
}

body.category-information #content .loop-meta {
	margin-bottom: 0;
}

body.category-information #content .more-link {
	display: none !important;
}

/* --------------------------------------------------------------------------
 * Mobile adjustments
 * -------------------------------------------------------------------------- */

body.mb-theme #tgl_mq_menu {
	min-width: 44px;
	min-height: 44px;
}

body.mb-theme .global_menu_ul.mq-mode .menu-link {
	display: flex;
	align-items: center;
	min-height: 44px;
}

@media (max-width: 767px) {
	body.page-id-10 .entry .wp-block-columns .wp-block-cover.media__image {
		height: auto;
	}

	body.page-id-232 .entry > .wp-block-gallery-1 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	body.page-id-232
		.entry
		> .wp-block-gallery-1
		> figure.wp-block-image {
		grid-column: auto;
	}

	body.page-id-232
		.entry
		> .wp-block-gallery-1
		> figure.wp-block-image:last-child {
		grid-column: 1 / -1;
		justify-self: center;
		width: calc((100% - 12px) / 2) !important;
	}

	body.page-id-1511 .entry .deb-block-1bfc620 table {
		margin: 0;
		font-size: 14px;
	}

	body.category-information #content .loop-article {
		grid-template-columns: 200px minmax(0, 1fr);
		gap: 24px;
	}
}

@media (max-width: 480px) {
	body.category-information #content .loop-article {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	body.category-information #content .loop-col.one {
		width: min(100%, 260px) !important;
		margin-right: auto !important;
		margin-left: auto !important;
	}

	body.category-information #content .loop-title {
		font-size: 18px;
	}

	body.page-id-213 .entry :is(
			.wp-block-gallery-1,
			.wp-block-gallery-2,
			.wp-block-gallery-3,
			.wp-block-gallery-4,
			.wp-block-gallery-5,
			.wp-block-gallery-7
		) {
		gap: 8px;
	}

	body.page-id-213 .entry :is(
			.wp-block-gallery-1,
			.wp-block-gallery-2,
			.wp-block-gallery-3,
			.wp-block-gallery-4,
			.wp-block-gallery-5,
			.wp-block-gallery-7
		)
		> figure.wp-block-image {
		flex-basis: calc((100% - 8px) / 2) !important;
		width: calc((100% - 8px) / 2) !important;
	}

	body.page-id-213 .entry .wp-block-gallery figcaption.wp-element-caption {
		font-size: 12px;
	}
}
