/**
 * Public Styles for Healthcare Doctors Directory Plugin
 *
 * Provides responsive styling for directory master tables,
 * clinic doctor tables, and doctor specialty tables using BEM methodology.
 */

:root {
	--hdd-border-color: #4a9d7c;
	--hdd-header-bg: #d9edf7;
	--hdd-label-bg: #eef7f4;
	--hdd-zebra-bg: #f9fbf9;
	--hdd-text-color: #2c3338;
	--hdd-heading-color: #1d2327;
	--hdd-primary-accent: #2271b1;
	--hdd-card-bg: #ffffff;
	--hdd-toggle-color: #263382;
	--hdd-toggle-bg: #ffffff;
	--hdd-toggle-hover-bg: #56b093;
	--hdd-toggle-hover-color: #ffffff;
}

/* Container */
.hdd-container {
	margin: 1.5em 0;
	font-family: inherit;
	color: var(--hdd-text-color);
}

/* Responsive Table Wrapper */
.hdd-table-responsive {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 1em 0;
}

/* BEM Table */
.hdd-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--hdd-border-color);
	background-color: #ffffff;
	font-size: 0.95rem;
	line-height: 1.5;
	text-align: left;
}

.hdd-table__head {
	background-color: var(--hdd-header-bg);
}

.hdd-table__cell--head {
	font-weight: 700;
	color: var(--hdd-heading-color);
	padding: 12px 16px;
	border: 1px solid var(--hdd-border-color);
}

.hdd-table__cell {
	padding: 12px 16px;
	border: 1px solid var(--hdd-border-color);
	color: var(--hdd-text-color);
	vertical-align: top;
	overflow-wrap: break-word;
	word-break: break-word;
}

.hdd-table__cell a {
	color: inherit;
}

.hdd-table__cell a:hover {
	color: var(--hdd-primary-accent);
}

/* Zebra Striping */
.hdd-table__row:nth-child(even) {
	background-color: var(--hdd-zebra-bg);
}

.hdd-table__row:hover {
	background-color: #f0f7f4;
}

.hdd-table__cell--name {
	font-weight: 600;
}

.hdd-table__cell--label {
	background-color: #f6f7f7;
	font-weight: 600;
	color: var(--hdd-heading-color);
	width: 200px;
	text-align: left;
}

.hdd-table__cell--value {
	background-color: #ffffff;
}

/* Specialty Table: Property Grid Layout */
.hdd-table--specialty .hdd-table__row:nth-child(even) {
	background-color: transparent;
}

.hdd-table--specialty .hdd-table__row:hover {
	background-color: #f0f7f4;
}

.hdd-table--specialty tbody {
	border-bottom: 3px solid #8c8f94;
}

.hdd-table--specialty tbody tr:last-child td,
.hdd-table--specialty tbody tr:last-child th {
	border-bottom: 3px solid #8c8f94;
}

.hdd-table--specialty .hdd-table__cell--name {
	background-color: var(--hdd-zebra-bg);
	vertical-align: top;
	width: 240px;
}

/*
 * Zebra Striping for Specialty Property Grid
 *
 * Each doctor has its own <tbody> with 4 <tr> rows.
 * Odd rows (1, 3) get zebra background; even rows (2, 4) stay white.
 * Applied at the cell level to override the static --label/#fff backgrounds.
 */
.hdd-table--specialty tbody tr:nth-child(odd) > .hdd-table__cell--label,
.hdd-table--specialty tbody tr:nth-child(odd) > .hdd-table__cell--value {
	background-color: var(--hdd-zebra-bg);
}

.hdd-table--specialty tbody tr:nth-child(even) > .hdd-table__cell--label,
.hdd-table--specialty tbody tr:nth-child(even) > .hdd-table__cell--value {
	background-color: #ffffff;
}

.hdd-table__description {
	font-size: 0.85rem;
	color: #646970;
	margin-top: 4px;
	font-weight: normal;
}

/* Doctor List & Name/Bio Typography inside Specialty Table */
.hdd-doctor-list {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin: 1em 0;
}

.hdd-doctor-card__name {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--hdd-heading-color);
}

.hdd-doctor-card__bio {
	font-size: 0.9rem;
	color: #50575e;
	margin-top: 4px;
	font-weight: normal;
}

/* Directory Notices */
.hdd-notice {
	padding: 14px 18px;
	border-left: 4px solid var(--hdd-border-color);
	background-color: var(--hdd-label-bg);
	margin: 1.5em 0;
	border-radius: 2px;
	color: var(--hdd-text-color);
}

.hdd-notice p {
	margin: 0;
}

.hdd-notice--warning {
	border-left-color: #dba617;
	background-color: #fcf9e8;
}

.hdd-notice--info {
	border-left-color: var(--hdd-border-color);
	background-color: var(--hdd-label-bg);
}

/* Table Cell Content Resets */
.hdd-table ul,
.hdd-table ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Tabs Navigation & Panels */

/* Tabs Reset: override WordPress theme list styles */
.hdd-tabs .hdd-tabs__nav,
.hdd-tabs .hdd-tabs__nav.hdd-tabs__nav {
	list-style: none !important;
	list-style-type: none !important;
	margin: 0 0 -1px 0 !important;
	padding: 0 !important;
	background: transparent;
	border: none;
}

.hdd-tabs .hdd-tabs__nav .hdd-tabs__item,
.hdd-tabs .hdd-tabs__nav li {
	list-style: none !important;
	list-style-type: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Remove any ::before / ::marker pseudo-element injected by theme */
.hdd-tabs .hdd-tabs__nav .hdd-tabs__item::before,
.hdd-tabs .hdd-tabs__nav .hdd-tabs__item::marker,
.hdd-tabs .hdd-tabs__nav li::before,
.hdd-tabs .hdd-tabs__nav li::marker {
	content: none !important;
	display: none !important;
}

.hdd-tabs__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	margin: 0 0 -1px 0;
	padding: 0;
	position: relative;
	z-index: 2;
	border-bottom: none;
}

.hdd-tabs__item {
	margin: 0;
	padding: 0;
	list-style: none;
	display: inline-block;
}

/* Inactive Tab */
.hdd-tabs .hdd-tabs__header,
.hdd-tabs__header,
.hdd-tabs__header:not(.active) {
	background-color: #ffffff;
	border: 1px solid #dcdcde;
	border-radius: 2px 2px 0 0;
	color: #50575e;
	padding: 10px 20px;
	font-size: 100%;
	font-weight: 500;
	cursor: pointer;
	line-height: 1.4;
	display: inline-block;
	text-decoration: none;
	box-shadow: none;
	text-shadow: none;
	outline: none;
	position: relative;
	z-index: 1;
	vertical-align: bottom;
	transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.hdd-tabs .hdd-tabs__header:not(.active):hover,
.hdd-tabs__header:not(.active):hover {
	background-color: #f6f7f7;
	color: #1d2327;
}

.hdd-tabs .hdd-tabs__header:focus-visible,
.hdd-tabs__header:focus-visible {
	outline: 2px solid var(--hdd-primary-accent, #2271b1);
	outline-offset: -2px;
}

/* Active Tab */
.hdd-tabs .hdd-tabs__header.active,
.hdd-tabs__header.active,
.hdd-tabs__header--active,
.hdd-tabs__item.active > .hdd-tabs__header,
.hdd-tabs__item--active > .hdd-tabs__header {
	background-color: #ffffff;
	color: #1d2327;
	border-top: 1px solid #dcdcde;
	border-left: 1px solid #dcdcde;
	border-right: 1px solid #dcdcde;
	border-bottom: 1px solid #ffffff;
	border-radius: 2px 2px 0 0;
	position: relative;
	z-index: 3;
	cursor: default;
}

/* Main Content Box */
.hdd-tabs__pane {
	border: 1px solid #dcdcde;
	background-color: #ffffff;
	position: relative;
	z-index: 1;
	animation: hddFadeIn 0.2s ease-in-out;
}

.hdd-tabs__pane[hidden] {
	display: none;
}

.hdd-tabs__pane .hdd-table-responsive {
	margin: 0;
	padding: 20px 20px 0 20px;
}

/* Neutralize .hdd-doctor-list flex/gap/margin inside panes */
.hdd-tabs__pane .hdd-doctor-list {
	display: block;
	gap: 0;
	margin: 0;
}

.hdd-tabs__pane .hdd-table {
	border: none;
}

/* Standalone Specialty Table (Without Tabs) */
.hdd-tabs__content--standalone,
.hdd-tabs__pane--no-tabs {
	border: none;
	background-color: transparent;
}

.hdd-tabs__pane--no-tabs .hdd-table-responsive,
.hdd-tabs__content--standalone .hdd-table-responsive {
	padding: 0;
}

.hdd-tabs__pane--no-tabs .hdd-table,
.hdd-tabs__content--standalone .hdd-table {
	border: 1px solid var(--hdd-border-color);
}

@keyframes hddFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* Clinic Doctors Collapsible Rows & Expand/Collapse Toggle (Progressive Enhancement) */
.hdd-container--clinic-doctors.hdd-container--js-ready:not(.hdd-container--expanded) .hdd-table__row--collapsible {
	display: none;
}

.hdd-container--clinic-doctors.hdd-container--js-ready.hdd-container--expanded .hdd-table__row--collapsible {
	animation: hddFadeIn 0.2s ease-in-out;
}

.hdd-container--clinic-doctors:not(.hdd-container--js-ready) .hdd-table-toggle {
	display: none;
}

.hdd-table-toggle {
	display: flex;
	justify-content: center;
	margin-top: 0.75em;
}

.hdd-table-toggle__button {
	background-color: var(--hdd-toggle-bg);
	color: var(--hdd-toggle-color);
	border: 1px solid var(--hdd-toggle-color);
	border-radius: 4px;
	padding: 8px 24px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
	box-shadow: none;
	text-shadow: none;
	min-height: 0;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.hdd-table-toggle__button:hover {
	background-color: var(--hdd-toggle-hover-bg);
	border-color: var(--hdd-toggle-hover-bg);
	color: var(--hdd-toggle-hover-color);
}

.hdd-table-toggle__button:focus-visible {
	outline: 2px solid var(--hdd-primary-accent);
	outline-offset: 2px;
}

/* Responsive Breakpoints (declared last so overrides always win the cascade) */
@media screen and (max-width: 768px) {
	.hdd-table {
		font-size: 0.85rem;
	}

	.hdd-table__cell,
	.hdd-table__cell--head,
	.hdd-table .hdd-table__cell--name {
		padding: 8px 6px;
	}

	.hdd-table--specialty .hdd-table__cell--name {
		width: 170px;
	}

	.hdd-table--specialty .hdd-table__cell--label {
		width: 130px;
	}

	.hdd-table__description {
		font-size: 0.8rem;
	}
}

@media screen and (max-width: 480px) {
	.hdd-table__cell,
	.hdd-table__cell--head,
	.hdd-table .hdd-table__cell--name {
		padding: 6px 4px;
	}

	.hdd-table--specialty .hdd-table__cell--name {
		width: 125px;
	}

	.hdd-table--specialty .hdd-table__cell--label {
		width: 100px;
	}

	.hdd-tabs__nav {
		gap: 2px;
	}

	.hdd-tabs .hdd-tabs__header,
	.hdd-tabs__header,
	.hdd-tabs__header:not(.active) {
		padding: 8px 12px;
		font-size: 0.88rem;
	}

	.hdd-table-toggle__button {
		padding: 7px 18px;
	}
}
