/* =========================================================
   Doctors Directory – Frontend Styles
   ========================================================= */

/* --- Container --- */
.doctors-directory {
	max-width: 1200px;
	margin: 0 auto;
	font-family: inherit;
}

/* --- Alphabet Index --- */
.doctors-alphabet {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 10px;
	margin-block-start: 0px !important;
}

.doctors-alpha-btn {
	display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    padding: 0 6px;
    font-size: 18px;
    font-weight: 400;
    color: var(--wp--preset--color--custom-dark-green) !important;
    background: var(--wp--preset--color--custom-light-green) !important;
    border: 1px solid var(--wp--preset--color--custom-light-green) !important;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
    font-family: inherit;
    white-space: nowrap;
}

.doctors-alpha-btn:hover {
	background: var(--wp--preset--color--custom-dark-green) !important;
	border-color: var(--wp--preset--color--custom-dark-green) !important;
	color: var(--wp--preset--color--custom-light-green) !important;
}

.doctors-alpha-btn.is-active {
	background: var(--wp--preset--color--custom-dark-green) !important;
	border-color: var(--wp--preset--color--custom-dark-green) !important;
	color: var(--wp--preset--color--custom-light-green) !important;
}

.doctors-alpha-count {
	margin-bottom: 16px;
}

/* --- Search Bar --- */
.doctors-search-wrap {
	position: relative;
	margin-bottom: 10px;
}

.doctors-search-input {
	width: 100%;
	padding: 14px 50px 14px 20px;
	font-size: 18px;
	border: 1px solid #dde1e7;
	border-radius: 10px;
	box-sizing: border-box;
	background: #fff;
	color: #063a06;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
	-webkit-appearance: none;
	appearance: none;
}

.doctors-search-input:focus {
	outline: none;
	border-color: #063a06;
	box-shadow: none;
}

.doctors-search-input::placeholder {
	color: #9ba3af;
}

/* Spinner */
.doctors-search-spinner {
	display: none;
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	width: 22px;
	height: 22px;
	border: 3px solid #e0e4ea;
	border-top-color: #0073aa;
	border-radius: 50%;
	animation: doctors-spin 0.65s linear infinite;
}

@keyframes doctors-spin {
	to {
		transform: translateY(-50%) rotate(360deg);
	}
}

@keyframes doctorCardIn {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes doctorShimmer {
	from { background-position: -200% 0; }
	to   { background-position:  200% 0; }
}

/* --- Results Count --- */
.doctors-search-count {
	margin: 0 0 18px;
	color: #555;
	font-size: 14px;
}

/* --- Grid --- */
.doctors-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 10px;
}

/* --- Card --- */
.doctor-card {
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	animation: doctorCardIn 0.4s ease both;
	animation-delay: calc( var(--card-i, 0) * 50ms );
}

/* Prevents animation replay when filter shows a card again */
.doctor-card.no-anim {
	animation: none;
}

/* Card image */
.doctor-card-image {
	width: 100%;
	height: auto;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	flex-shrink: 0;
	border-radius: 20px !important;
    background: #f4f4f4;
}

img.doctor-photo {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 20px !important;
	transition: opacity 0.3s ease;
}

/* Shimmer while image is loading */
img.doctor-photo:not(.img-loaded) {
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: doctorShimmer 1.4s infinite;
	min-height: 120px;
}

img.doctor-photo.img-loaded {
	background: none;
	animation: none;
}

.doctor-photo-placeholder-img {
	opacity: 0.6;
}

/* Card body */
.doctor-card-info {
	padding: 16px 16px 0 0;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.doctor-name {
	margin: 0;
	font-size: 18px;
	font-weight: 400;
	color: #063a06;
	line-height: 1.3;
	margin-bottom: 5px;
}

.doctor-name .doctor-title {
	display: block;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
}

.doctor-name .doctor-title-after {
	font-size: 1em;
	font-weight: 400;
	line-height: inherit;
	letter-spacing: inherit;
	opacity: 0.85;
}

.doctor-name a {
	display: block;
	color: inherit;
	text-decoration: none;
}

.doctor-name a:hover {
	text-decoration: underline;
}

a.doctor-card-image {
	display: block;
	text-decoration: none;
}

.doctor-specialization {
	font-size: 13px;
	font-weight: 600;
	color: #0073aa;
	margin: 0 0 14px;
	line-height: 1.4;
}

.doctor-narrow-spec {
	font-weight: 400;
	color: #4a90d9;
}

/* Meta rows */
.doctor-meta-row {
	display: flex;
	gap: 6px;
	font-size: 14px;
	font-weight: 400;
	color: #063a0682;
	line-height: 1.2;
	margin-top: 0px;
	margin-bottom: 5px;
}

.doctor-meta-label {
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
}

.doctor-meta-clinic {
	font-weight: 400;
	color: #063a06;
}

.doctor-meta-clinic a {
	color: inherit;
	text-decoration: none;
}

.doctor-meta-clinic a:hover {
	text-decoration: underline;
}


/* Contact block */
.doctor-contact {
	margin-top: auto;
	padding-top: 10px;
}

.doctor-phone,
.doctor-email {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	margin: 5px 0;
}

.doctor-contact-icon {
	font-size: 14px;
	flex-shrink: 0;
}

.doctor-phone a,
.doctor-email a {
	color: #0073aa;
	text-decoration: none;
	word-break: break-all;
}

.doctor-phone a:hover,
.doctor-email a:hover {
	text-decoration: underline;
	color: #005177;
}

/* --- Empty / No Results --- */
.doctors-no-results {
	text-align: center;
	color: #6b7280;
	padding: 48px 20px;
	font-size: 15px;
	background: #f9fafb;
	border-radius: 10px;
	border: 1px dashed #d1d5db;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
	.doctors-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 860px) {
	.doctors-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 600px) {
	.doctors-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}

	.doctors-search-input {
		font-size: 15px;
		padding: 12px 44px 12px 16px;
	}
}

@media (max-width: 380px) {
	.doctors-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Education table ─────────────────────────────────────────────────── */
.doctor-education-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 16px;
	margin: 0;
}

.doctor-education-table thead tr {
	background: #f4f6f8;
}

.doctor-education-table th {
	text-align: left;
	padding: 8px 12px;
	font-weight: 600;
	color: #444;
	border-bottom: 2px solid #dde1e7;
	white-space: nowrap;
}

.doctor-education-table td {
	padding: 8px 12px;
	border-bottom: 1px solid #eaecef;
	vertical-align: top;
	color: #333;
	word-break: normal;
	overflow-wrap: break-word;
	hyphens: none;
}

.doctor-education-table tbody tr:last-child td {
	border-bottom: none;
}

.doctor-education-table tbody tr:hover td {
	background: #f9fafb;
}

/* --- Repeater paragraph format --- */
.doctor-repeater-list {
	margin: 0;
	padding: 0;
}

.doctor-repeater-list-item {
	margin: 0;
	padding: 0;
}

/* --- Block field labels --- */
.doctor-block-label {
	display: block;
	font-weight: 600;
}

span.doctor-block-label,
strong.doctor-block-label {
	display: inline;
	margin-right: 4px;
}

/* --- Profile section top (expertise + teaching) --- */
.doctor-profile-section__top .doctor-block-label {
	font-weight: 400;
	margin-bottom: 0;
}

.doctor-profile-section__top .doctor-block-label + * {
	margin-top: 0;
}

.doctor-profile-section .wp-block-accordion {
	margin-top: 32px;
}

/* --- Details section (clinic, department, odsek, specialization) --- */
.doctor-details-row {
	margin-bottom: 12px;
}

.doctor-details-row .doctor-block-label {
	margin-bottom: 0;
}

.doctor-details-row:first-child .doctor-block-label {
	margin: 0;
}

.doctor-block-clinic a {
	color: var(--wp--preset--color--custom-dark-green) !important;
}

.doctor-details-row .doctor-block-field {
	margin-top: 0;
}

/* Placeholder image inside Featured Image block (Query Loop) */
.wp-block-post-featured-image img.doctor-photo-placeholder-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

.wp-block-post-featured-image:has(img.doctor-photo-placeholder-img) {
	overflow: hidden;
}

/* Utility */
.no-underline,
.no-underline:hover,
.no-underline:focus,
.no-underline a,
.no-underline a:hover,
.no-underline a:focus {
	text-decoration: none;
}

/*
 * Long strings (e.g. email addresses) — same approach as WordPress core blocks.
 * @see https://github.com/WordPress/gutenberg/pull/75044
 */
.break-word,
.break-word a {
	overflow-wrap: break-word;
	word-break: break-word;
	min-width: 0;
}

/* ------------------------------------------------------------------ *
 * Employee cards block (doctors/employee-cards)
 * ------------------------------------------------------------------ */
.doctor-employee-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: flex-end;
}
.doctor-employee-cards .doctor-ec-column {
	min-width: 0;
}
.doctor-employee-cards .doctor-ec-column-empty {
	flex-grow: 1;
}
.doctor-employee-cards .doctor-ec-list {
	display: flex;
	flex-flow: row wrap;
	gap: 16px 14px;
	align-items: flex-start;
}
.doctor-employee-cards .doctor-ec-item {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 10px;
	align-items: flex-start;
	flex: 1 1 150px;
	max-width: 260px;
	min-width: 0;
}
.doctor-employee-cards .doctor-ec-link {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}
.doctor-employee-cards .doctor-ec-link:hover .doctor-ec-name {
	text-decoration: underline;
}
.doctor-employee-cards .doctor-ec-photo {
	margin: 0;
	flex: 0 0 auto;
	width: 76px;
}
.doctor-employee-cards .doctor-ec-photo img,
.doctor-employee-cards .doctor-ec-img {
	display: block;
	width: 76px !important;
	height: 76px !important;
	max-width: 76px;
	border-radius: 5px;
	aspect-ratio: 1;
	object-fit: cover;
}
.doctor-employee-cards .doctor-ec-text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	min-width: 0;
}
.doctor-employee-cards .doctor-ec-text p {
	margin: 0;
	line-height: 1.35;
	text-align: left;
}

@media (max-width: 600px) {
	.doctor-employee-cards .doctor-ec-column {
		flex-basis: 100% !important;
	}
	.doctor-employee-cards .doctor-ec-column-empty {
		display: none;
	}
}
