/*
 * Shared Kadence header/footer alignment for the Doctor Ally shell.
 * Owned by dba-doctor-ally-core so the rules survive Kadence updates.
 */

:root {
	--dba-chrome-muted: #A3ABB8;
}

/* Header */
.site-header-item .header-account-wrap .header-account-button,
.site-header-item .header-mobile-account-wrap .header-account-button {
	border-radius: 20px;
	background-color: var(--dba-blue-deep);
}

.site-header-item .header-account-wrap .header-account-button:hover,
.site-header-item .header-mobile-account-wrap .header-account-button:hover {
	background-color: #0B3E69;
}

.site-header-item .header-cart-wrap {
	margin-left: 12px;
	padding-left: 12px;
	border-left: 1px solid var(--dba-chrome-muted);
}

.main-navigation .primary-menu-container > ul > li.menu-item.current-menu-item > a,
.main-navigation .primary-menu-container > ul > li.menu-item.current-menu-ancestor > a,
.main-navigation .primary-menu-container > ul > li.menu-item.current_page_item > a,
.main-navigation .primary-menu-container > ul > li.menu-item.current_page_ancestor > a {
	color: var(--dba-orange);
}

/* Article archive pagination: keep the native Kadence markup, but use the
 * shared 1200px rail and Doctor Ally brand treatment. */
body.blog .navigation.pagination {
	max-width: var(--dba-container);
	margin: 48px auto 0;
}

body.blog .navigation.pagination .nav-links {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
}

body.blog .navigation.pagination .page-numbers {
	margin-right: 0;
	border: 2px solid var(--dba-orange);
	border-radius: var(--dba-cta-radius);
	color: var(--dba-orange);
}

body.blog .navigation.pagination a.page-numbers:hover,
body.blog .navigation.pagination a.page-numbers:focus-visible,
body.blog .navigation.pagination .page-numbers.current {
	border-color: var(--dba-orange);
	background: var(--dba-orange);
	color: #FFFFFF;
}

body.blog .navigation.pagination .page-numbers.dots {
	border: 0;
	color: var(--dba-body);
}

/* Footer layout */
#colophon.site-footer {
	background: var(--dba-footer);
	color: var(--dba-chrome-muted);
}

#colophon .site-container {
	width: calc(100% - 2rem);
	max-width: var(--dba-container);
}

#colophon .site-middle-footer-inner-wrap {
	/* Match the legacy desktop rails: x≈156 / 495 / 725 / 970 at 1440px. */
	grid-template-columns: 345px 200px 215px 350px;
}

#colophon .footer-widget1 {
	padding-left: 36px;
}

#colophon .site-middle-footer-wrap,
#colophon .site-bottom-footer-wrap {
	background: transparent;
}

#colophon .site-bottom-footer-wrap {
	border-top: 0;
}

#colophon .site-bottom-footer-inner-wrap {
	padding-top: 0;
}

#colophon .footer-widget-area ul,
#colophon .footer-widget-area ol {
	margin-left: 0;
	padding-left: 0;
	list-style: none;
}

#colophon .footer-widget-area li {
	list-style: none;
}

#colophon .footer-widget-area a {
	color: var(--dba-chrome-muted);
}

#colophon .footer-widget-area a:hover,
#colophon .footer-widget-area a:focus-visible {
	color: var(--dba-orange);
}

/* The previous glyph fallbacks rendered as broken fragments. Keep these rows
 * text-only until a verified, self-contained SVG asset is available. */
#colophon .dba-footer-brand > p:last-of-type a {
	display: inline;
}

#colophon .dba-footer-brand > p:last-of-type a::before {
	content: none;
	display: none;
}

/* Remove the unreliable pseudo-icon badges; the link labels remain intact. */
#colophon .footer-widget4 li a::before {
	content: none;
	display: none;
}

#colophon .footer-widget3 li a[href*="med-wiki-index"]::after {
	content: "用藥查詢";
	display: inline-block;
	margin-left: 7px;
	padding: 1px 5px;
	border-radius: 4px;
	background: var(--dba-orange);
	color: #FFFFFF;
	font-size: 13px;
	line-height: 1.25;
}

/* Footer legal row: same navy surface, left disclaimer and two-edge metadata. */
#colophon .footer-html-inner {
	padding-top: 22px;
	border-top: 1px solid rgba(163, 171, 184, .55);
	text-align: left;
}

#colophon .footer-html-inner > p:first-child {
	margin-top: 0;
	margin-bottom: 18px;
}

#colophon .footer-html-inner > p:last-child {
	display: block;
	justify-content: normal;
	text-align: left;
	margin-bottom: 0;
}

@media (max-width: 1024px) {
	#colophon .site-middle-footer-inner-wrap {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	#colophon .footer-widget1 {
		padding-left: 0;
	}

	#colophon .footer-html-inner > p:last-child {
		display: block;
	}
}

@media (max-width: 767px) {
	#colophon .site-middle-footer-inner-wrap {
		grid-template-columns: 1fr;
	}

	#colophon .site-container {
		width: calc(100% - 2rem);
	}
}

/* Doctor Ally migrated course/lesson copy: scoped content typography. */
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) {
  color: #415674;
  font-size: 16px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  word-break: normal;
  min-width: 0;
}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) :is(h1,h2,h3,h4,h5,h6) {
  color: #173d60;
  line-height: 1.5;
  white-space: normal;
  word-break: normal;
  margin: 1.6em 0 .7em;
}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) h2 {font-size: clamp(22px, 2.2vw, 28px);}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) h3 {font-size: clamp(20px, 1.9vw, 24px);}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) h4 {font-size: 19px;}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) p {margin: 0 0 1.1em; line-height: inherit;}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) :is(ul,ol) {padding-inline-start: 1.5em; margin: .7em 0 1.4em;}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) li {margin: .4em 0;}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) :is(img,video,iframe) {max-width: 100%;}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) img {height: auto;}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) figure {margin: 1.5em 0; max-width:100%;}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) table {display:block; overflow-x:auto; max-width:100%; border-collapse:collapse;}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) :is(td,th) {padding:.65em; border:1px solid #dce5ee;}
:is(.dba-migrated-course-copy, .dba-migrated-lesson-copy) blockquote {margin:1.5em 0; padding:1em 1.25em; border-inline-start:3px solid #0f4d81; background:#f4f7fa;}
.dba-course-content-nav {display:flex; flex-wrap:wrap; gap:10px 20px; padding:0 0 18px; margin-bottom:24px; border-bottom:1px solid #dce5ee;}
.dba-course-content-nav a {color:#0f4d81; text-decoration:underline; text-underline-offset:4px;}
.dba-migrated-course-copy [id] {scroll-margin-top:110px;}
.dba-migrated-lesson-copy > a {display:inline-block; margin:.75em 0;}

/* Compact mobile account control preserves the logo rail and accessible name. */
@media (max-width: 767px) {
 #mobile-header .site-container { padding-inline: 15px; }
 #mobile-header .site-header-main-section-left { flex: 1 1 auto; min-width: 0; }
 #mobile-header .site-header-main-section-right { flex: 0 0 auto; }
 #mobile-header .site-header-item { margin-inline: 0 10px; }
 #mobile-header .site-header-main-section-right .site-header-item:last-child { margin-right: 0; }
 #mobile-header .custom-logo { width: 190px; max-width: 100%; height: auto; }
 #mobile-header .menu-toggle-open { padding: 8px 0; }
 #mobile-header .header-mobile-account-in-wrap .header-account-button { padding: 8px; background: transparent; }
 #mobile-header .header-account-username { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
 #mobile-header .header-account-button .kadence-svg-iconset { margin: 0; }
}

/* Mobile navigation follows the original left-hand brand drawer. */
#mobile-drawer .drawer-inner { width: min(360px, calc(100vw - 32px)); max-width: 100%; background: #1e2845; color: #fff; }
#mobile-drawer .drawer-header { padding: 20px 20px 0; }
#mobile-drawer .drawer-header .menu-toggle-close.drawer-toggle { box-sizing: border-box; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; max-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; }
#mobile-drawer .drawer-content { padding: 12px 30px 30px; }
#mobile-drawer .site-header-item-mobile-navigation { display: flex; flex-direction: column; align-items: stretch; width: 100%; margin: 0; }
#mobile-drawer .dba-mobile-menu-title { display: block; margin: 0 0 30px; color: #fff; font-size: 22px; font-weight: 600; line-height: 1.4; text-decoration: none; }
#mobile-drawer .mobile-navigation { width: 100%; margin: 0; }
#mobile-drawer .mobile-navigation ul li a { padding: 9px 0; border: 0; color: #fff; font-size: 15px; line-height: 26px; }
#mobile-drawer .mobile-navigation ul li { border: 0; }
#mobile-drawer .mobile-navigation .drawer-nav-drop-wrap { border: 0; }
#mobile-drawer .mobile-navigation .drawer-sub-toggle { box-sizing: border-box; display: flex; flex: 0 0 40px; align-self: center; align-items: center; justify-content: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; }
#mobile-drawer .mobile-navigation .sub-menu { margin: 4px 0 10px 10px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.18); }
#mobile-drawer .mobile-navigation .sub-menu a { font-size: 14px; color: #dfe4ea; }
#mobile-drawer .mobile-navigation a:hover, #mobile-drawer .mobile-navigation a:focus-visible { color: #f2a31e; }
#mobile-drawer .site-header-item[data-section="kadence_customizer_header_search"] { display: none; }
#mobile-drawer .dba-mobile-menu-extras { width: 100%; margin-top: 24px; }
#mobile-drawer .dba-mobile-menu-extras .search-form { position: relative; width: 100%; margin: 0; }
#mobile-drawer .dba-mobile-menu-extras .search-field { width: 100%; height: 50px; padding: 10px 48px 10px 16px; border: 1px solid #dfe4ea; border-radius: 4px; background: #fff; color: #1e2845; font-size: 14px; }
#mobile-drawer .dba-mobile-menu-extras .search-submit { color: transparent; background: transparent; }
#mobile-drawer .dba-mobile-menu-extras .kadence-search-icon-wrap { color: #1e2845; pointer-events: none; }
#mobile-drawer .dba-mobile-menu-brands { display: grid; gap: 12px; margin-top: 22px; text-align: center; }
#mobile-drawer .dba-mobile-menu-brands a { color: #c3c9d4; font-size: 12px; line-height: 1.8; text-decoration: none; }

#mobile-drawer .drawer-header .menu-toggle-close:hover,
#mobile-drawer .mobile-navigation .drawer-sub-toggle:hover { background: rgba(255,255,255,.08); }
#mobile-drawer .drawer-header .menu-toggle-close:focus-visible,
#mobile-drawer .mobile-navigation .drawer-sub-toggle:focus-visible { outline: 2px solid #f2a31e; outline-offset: 2px; }
/* Keep page titles and navigation distinct, including wrapped article titles. */
.entry-hero .entry-header > .kadence-breadcrumbs {
	margin: 18px 0 0;
	line-height: 1.7;
}

.dba-brand-hero--page-header .dba-brand-hero__breadcrumb {
	margin-top: 18px;
}

@media (max-width: 767px) {
	.entry-hero .entry-header > .kadence-breadcrumbs,
	.dba-brand-hero--page-header .dba-brand-hero__breadcrumb {
		margin-top: 16px;
		font-size: 14px;
		line-height: 1.7;
	}
}
