/*
 * [mrsync_directory] default styles.
 * Every rule is scoped to .mrsync-dir. Override the custom properties below
 * for quick theming, or disable this file with css="0" on the shortcode.
 * Class reference: .docs/directory-css.html
 */

.mrsync-dir {
	--mrsync-accent:        #e0193a;
	--mrsync-accent-hover:  #b8102c;
	--mrsync-accent-text:   #ffffff;
	--mrsync-text:          #1a1a1a;
	--mrsync-muted:         #555b66;
	--mrsync-border:        #E7E5E4;
	--mrsync-bg:            #ffffff;
	--mrsync-input-focus-border: #9aa3b2;
	--mrsync-panel-bg:      #ffffff;
	--mrsync-panel-shadow:  0 8px 24px rgba(16, 24, 40, 0.08);
	--mrsync-card-bg:       #ffffff;
	--mrsync-card-spacing:  10px;  /* title > names > description */
	--mrsync-card-row-spacing: 4px; /* between name rows */
	--mrsync-card-lift:     -4px;
	--mrsync-card-shadow-hover: 0 10px 24px rgba(16, 24, 40, 0.10);
	--mrsync-radius:        24px;
	--mrsync-radius-small:  4px;
	--mrsync-columns:       2;
	--mrsync-gap:           16px;

	color: var(--mrsync-text);
}

.mrsync-dir *,
.mrsync-dir *::before,
.mrsync-dir *::after {
	box-sizing: border-box;
}

/* ── Search panel ─────────────────────────────────────────────────────────── */

.mrsync-dir__panel {
	max-width: 1125px;
	margin: 0 auto 64px;
	padding: 35px 24px;
	background: var(--mrsync-panel-bg);
	border: 1px solid var(--mrsync-border);
	border-radius: var(--mrsync-radius);
	box-shadow: var(--mrsync-panel-shadow);
}

.mrsync-dir__form {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 0 0 20px;
}

/* Visually hidden, still read by screen readers. */
.mrsync-dir__label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.mrsync-dir__input {
	flex: 0 1 320px;
	min-width: 0;
	height: 46px;
	padding: 0 18px;
	font: inherit;
	color: var(--mrsync-text);
	background: var(--mrsync-bg);
	border: 1px solid var(--mrsync-border);
	border-radius: 999px;
}

/* No coloured ring on focus (also overrides theme/Elementor kit focus styles).
   A slightly darker neutral border still shows the field is active. */
.mrsync-dir .mrsync-dir__input:focus,
.mrsync-dir .mrsync-dir__input:focus-visible {
	outline: none;
	box-shadow: none;
	border-color: var(--mrsync-input-focus-border);
}

.mrsync-dir__button {
	height: 46px;
	padding: 0 20px;
	font: inherit;
	color: var(--mrsync-accent-text);
	background: var(--mrsync-accent);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

.mrsync-dir__button:hover,
.mrsync-dir__button:focus-visible {
	background: var(--mrsync-accent-hover);
}

.mrsync-dir__letter-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mrsync-dir__letter-item {
	margin: 0;
}

.mrsync-dir__letter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 6px;
	font-size: 14px;
	line-height: 1;
	color: var(--mrsync-text);
	text-decoration: none;
	background: var(--mrsync-bg);
	border: 1px solid var(--mrsync-border);
	border-radius: var(--mrsync-radius-small);
}

a.mrsync-dir__letter:hover,
a.mrsync-dir__letter:focus-visible {
	color: var(--mrsync-accent);
	border-color: var(--mrsync-accent);
}

.mrsync-dir__letter--active,
a.mrsync-dir__letter--active:hover {
	color: var(--mrsync-accent-text);
	background: var(--mrsync-accent);
	border-color: var(--mrsync-accent);
}

.mrsync-dir__letter--disabled {
	opacity: 0.4;
	cursor: default;
}

/* ── Results ──────────────────────────────────────────────────────────────── */

/* While an AJAX search, letter or page request is running. */
.mrsync-dir--loading .mrsync-dir__results {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.mrsync-dir__status {
	margin: 0 0 16px;
	font-size: 14px;
	color: var(--mrsync-muted);
}

.mrsync-dir__clear {
	margin-left: 6px;
	color: var(--mrsync-accent);
}

.mrsync-dir__grid {
	display: grid;
	grid-template-columns: repeat(var(--mrsync-columns), minmax(0, 1fr));
	gap: var(--mrsync-gap);
}

.mrsync-dir__card {
	position: relative;
	padding: 20px;
	background: var(--mrsync-card-bg);
	border: 1px solid var(--mrsync-border);
	border-radius: var(--mrsync-radius);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Lift on hover, desktop only (real pointer + hover, wide screens). */
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
	.mrsync-dir__card:hover,
	.mrsync-dir__card:focus-within {
		transform: translateY(var(--mrsync-card-lift));
		box-shadow: var(--mrsync-card-shadow-hover);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mrsync-dir__card {
		transition: none;
	}
	.mrsync-dir__card:hover,
	.mrsync-dir__card:focus-within {
		transform: none;
	}
}

/* Scoped under .mrsync-dir so theme / Elementor kit margins on h3, dl, dt,
   dd and p (e.g. ".elementor-kit-123 h3") don't add extra space. */
.mrsync-dir .mrsync-dir__card-title {
	margin: 0 0 var(--mrsync-card-spacing);
	padding: 0;
	font-size: 18px;
	line-height: 1.3;
}

.mrsync-dir__card-link {
	color: inherit;
	text-decoration: none;
}

/* Makes the whole card clickable. */
.mrsync-dir__card-link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.mrsync-dir .mrsync-dir__card-names {
	margin: 0 0 var(--mrsync-card-spacing);
	padding: 0;
	font-size: 14px;
	line-height: 1.45;
}

.mrsync-dir .mrsync-dir__card-name {
	margin: 0 0 var(--mrsync-card-row-spacing);
}

.mrsync-dir .mrsync-dir__card-name:last-child {
	margin-bottom: 0;
}

.mrsync-dir .mrsync-dir__card-label {
	display: inline;
	margin: 0;
	padding: 0;
	font-weight: 600;
}

.mrsync-dir .mrsync-dir__card-value {
	display: inline;
	margin: 0;
	padding: 0;
	color: var(--mrsync-muted);
}

.mrsync-dir .mrsync-dir__card-excerpt {
	margin: 0;
	padding: 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--mrsync-muted);
}

@media (min-width: 1025px) {
	.mrsync-dir .mrsync-dir__card-names,
	.mrsync-dir .mrsync-dir__card-excerpt {
		font-size: 15px;
	}
}

.mrsync-dir__error {
	margin: 0 0 16px;
	padding: 12px 16px;
	font-size: 14px;
	color: var(--mrsync-accent);
	border: 1px solid var(--mrsync-accent);
	border-radius: var(--mrsync-radius-small);
}

.mrsync-dir__empty {
	padding: 32px 0;
	text-align: center;
	color: var(--mrsync-muted);
}

/* ── Pagination ───────────────────────────────────────────────────────────── */

.mrsync-dir__pagination {
	margin-top: 32px;
}

.mrsync-dir__pages {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mrsync-dir__page {
	margin: 0;
}

.mrsync-dir__page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	font-size: 14px;
	color: var(--mrsync-text);
	text-decoration: none;
	border: 1px solid var(--mrsync-border);
	border-radius: var(--mrsync-radius-small);
}

a.mrsync-dir__page-link:hover,
a.mrsync-dir__page-link:focus-visible {
	color: var(--mrsync-accent);
	border-color: var(--mrsync-accent);
}

.mrsync-dir__page--current .mrsync-dir__page-link {
	color: var(--mrsync-accent-text);
	background: var(--mrsync-accent);
	border-color: var(--mrsync-accent);
}

.mrsync-dir__page--dots .mrsync-dir__page-link {
	border-color: transparent;
}

/* ── Elementor editor preview ─────────────────────────────────────────────── */

.mrsync-dir__editor-notice {
	margin: 0 0 16px;
	padding: 10px 14px;
	font-size: 13px;
	line-height: 1.4;
	color: #1e3a5f;
	background: #eef4fb;
	border: 1px dashed #93b4d8;
	border-radius: var(--mrsync-radius-small);
}

/* Links and controls are inert in the editor so clicks select the widget
   instead of navigating the preview. Hover styles still show on cards. */
.mrsync-dir--editor a,
.mrsync-dir--editor input,
.mrsync-dir--editor button {
	pointer-events: none;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
	.mrsync-dir {
		--mrsync-columns: 1;
	}

	.mrsync-dir__panel {
		margin-bottom: 32px;
		padding: 16px;
	}

	.mrsync-dir__input {
		flex: 1 1 auto;
	}
}
