/* Hadiths — mobile first, navigation type HadeethEnc */

.hd-widget {
	--hd-accent: #f56a6a;
	--hd-accent-soft: #fef0f0;
	--hd-text: #3d4449;
	--hd-muted: #7f888f;
	--hd-border: rgba(210, 215, 217, 0.85);
	--hd-radius: 0.5em;
	--hd-touch: 2.75rem;
	font-family: "Open Sans", sans-serif;
	color: var(--hd-text);
	max-width: 100%;
}

.hd-widget * {
	box-sizing: border-box;
}

.hd-page-head h2 {
	margin-bottom: 0.35em;
	line-height: 1.25;
}

.hd-intro {
	font-size: 0.9em;
	line-height: 1.55;
	color: var(--hd-muted);
	margin: 0 0 1.25em;
}

.hd-intro a {
	color: var(--hd-accent);
}

/* Hadith du jour */
.hd-day {
	margin-bottom: 1.25em;
	border-radius: var(--hd-radius);
	border: 1px solid var(--hd-border);
	border-left: 4px solid var(--hd-accent);
	background: var(--hd-accent-soft);
	overflow: hidden;
}

.hd-day__label {
	display: block;
	padding: 0.5em 1em 0;
	font-size: 0.7em;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--hd-muted);
}

.hd-day__link {
	display: block;
	padding: 0.35em 1em 1em;
	color: inherit;
	text-decoration: none;
}

.hd-day__link strong {
	display: block;
	font-size: 1em;
	line-height: 1.35;
	margin-bottom: 0.35em;
}

.hd-day__excerpt {
	display: block;
	font-size: 0.88em;
	line-height: 1.5;
	color: var(--hd-muted);
	font-weight: 400;
}

/* Recherche */
.hd-search {
	display: flex;
	gap: 0.5em;
	margin-bottom: 1em;
	width: 100%;
}

.hd-search input[type="search"] {
	flex: 1;
	min-width: 0;
	min-height: var(--hd-touch);
	padding: 0 0.85em;
	border: 1px solid var(--hd-border);
	border-radius: var(--hd-radius);
	font: inherit;
	font-size: 1rem;
	-webkit-appearance: none;
}

.hd-search .button.fit {
	flex: 0 0 auto;
	min-height: var(--hd-touch);
	margin: 0;
	padding-left: 1.1em;
	padding-right: 1.1em;
}

/* Fil d'Ariane */
.hd-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25em 0.35em;
	font-size: 0.82em;
	line-height: 1.4;
	margin-bottom: 1.25em;
	color: var(--hd-muted);
}

.hd-breadcrumb a {
	color: var(--hd-accent);
	text-decoration: none;
}

.hd-breadcrumb__sep {
	opacity: 0.55;
}

.hd-breadcrumb__current {
	color: var(--hd-text);
	font-weight: 600;
}

/* Grille catégories (7 racines + sous-cats) */
.hd-cat-section__title {
	font-size: 1rem;
	margin: 0 0 0.75em;
	color: var(--hd-text);
}

.hd-cat-grid {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.65em;
}

@media (min-width: 480px) {
	.hd-cat-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	.hd-cat-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.75em;
	}
}

.hd-cat-card {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 4.5rem;
	padding: 0.85em 1em;
	border: 1px solid var(--hd-border);
	border-radius: var(--hd-radius);
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.hd-cat-card:hover,
.hd-cat-card:focus {
	border-color: var(--hd-accent);
	box-shadow: 0 2px 12px rgba(245, 106, 106, 0.15);
}

.hd-cat-card__title {
	font-weight: 600;
	font-size: 0.95em;
	line-height: 1.35;
	margin-bottom: 0.35em;
}

.hd-cat-card__count {
	font-size: 0.8em;
	color: var(--hd-muted);
}

.hd-cat-section__actions {
	margin-top: 1.25em;
}

.hd-cat-section__actions .button {
	width: 100%;
	text-align: center;
	min-height: var(--hd-touch);
	line-height: 1.3;
	padding-top: 0.65em;
	padding-bottom: 0.65em;
}

@media (min-width: 600px) {
	.hd-cat-section__actions .button {
		width: auto;
	}
}

/* Liste hadiths */
.hd-list-section__back {
	margin: 0 0 0.75em;
	font-size: 0.9em;
}

.hd-list-section__back a {
	color: var(--hd-accent);
	text-decoration: none;
}

.hd-list__meta {
	font-size: 0.85em;
	color: var(--hd-muted);
	margin: 0 0 0.5em;
}

.hd-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.hd-list__item {
	border-bottom: 1px solid var(--hd-border);
}

.hd-list__link {
	display: block;
	padding: 0.9em 0;
	color: inherit;
	text-decoration: none;
	min-height: var(--hd-touch);
}

.hd-list__title {
	display: block;
	font-weight: 600;
	font-size: 0.98em;
	line-height: 1.4;
	margin-bottom: 0.2em;
}

.hd-list__link:active .hd-list__title,
.hd-list__link:hover .hd-list__title {
	color: var(--hd-accent);
}

.hd-list__item .hd-list__meta {
	display: block;
	font-size: 0.78em;
}

.hd-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.65em;
	margin-top: 1.5em;
}

.hd-pagination .button.small {
	min-height: var(--hd-touch);
	min-width: 6.5rem;
	text-align: center;
	margin: 0;
}

.hd-pagination__label {
	font-size: 0.9em;
	color: var(--hd-muted);
}

/* Fiche hadith */
.hd-detail .hd-page-head {
	margin-bottom: 0.5em;
}

.hd-detail__path {
	font-size: 0.82em;
	line-height: 1.5;
	color: var(--hd-muted);
	margin: 0 0 1em;
}

.hd-detail__path a {
	color: var(--hd-accent);
	text-decoration: none;
}

.hd-detail__text {
	font-size: 1.05em;
	line-height: 1.7;
	margin: 0 0 1.25em;
	padding: 0;
	border: 0;
	font-style: normal;
}

.hd-detail__meta {
	font-size: 0.9em;
	color: var(--hd-muted);
	margin-bottom: 1.25em;
	line-height: 1.55;
}

.hd-detail__meta p {
	margin: 0.35em 0;
}

.hd-detail__meta a {
	color: var(--hd-accent);
}

.hd-image-box {
	margin-top: 1.5em;
	padding: 1em;
	border: 1px solid var(--hd-border);
	border-radius: var(--hd-radius);
	background: #f8f9fa;
}

.hd-image-box h3 {
	font-size: 1em;
	margin: 0 0 0.85em;
}

/* Sélecteur de thème — pastilles colorées */
.hd-theme-picker {
	margin-bottom: 1.5em;
	text-align: center;
}

.hd-theme-picker__label {
	display: block;
	font-size: 0.75em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--hd-muted);
	margin-bottom: 0.65em;
	font-weight: 600;
	text-align: center;
}

.hd-themes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1.1rem;
	justify-content: center;
	align-items: flex-end;
	width: 100%;
	margin-bottom: 0.25em;
}

/* Boutons thème — priorité sur le CSS Editorial (label / input radio) */
.hd-widget .hd-theme-swatch {
	display: inline-flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: flex-end !important;
	gap: 0.3em !important;
	min-width: 3rem;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	cursor: pointer;
	font-family: inherit;
	line-height: 1.2;
	-webkit-appearance: none;
	appearance: none;
}

.hd-widget .hd-theme-swatch:hover,
.hd-widget .hd-theme-swatch:focus {
	background: transparent !important;
}

.hd-widget .hd-theme-swatch__chip {
	display: block !important;
	width: 1.85rem !important;
	height: 1.85rem !important;
	min-width: 1.85rem !important;
	min-height: 1.85rem !important;
	border-radius: 50% !important;
	border: 2px solid #fff !important;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.15) !important;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	flex-shrink: 0;
}

.hd-widget .hd-theme-swatch--sable .hd-theme-swatch__chip {
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

.hd-widget .hd-theme-swatch.is-selected .hd-theme-swatch__chip {
	box-shadow: 0 0 0 2px var(--hd-accent), 0 0 0 4px var(--hd-accent-soft), 0 2px 8px rgba(245, 106, 106, 0.35) !important;
	transform: scale(1.08);
}

.hd-widget .hd-theme-swatch__name {
	display: block !important;
	font-size: 0.72em !important;
	color: var(--hd-muted) !important;
	text-align: center;
	font-weight: 400 !important;
	letter-spacing: 0;
	text-transform: none;
	line-height: 1.2;
	white-space: nowrap;
}

.hd-widget .hd-theme-swatch.is-selected .hd-theme-swatch__name {
	color: var(--hd-accent) !important;
	font-weight: 600 !important;
}

/* Aperçu cliquable (div, pas <button> — évite le cadre rouge Editorial) */
.hd-widget .hd-preview-zoom {
	display: block;
	width: 100%;
	max-width: min(100%, 400px);
	margin: 0.5em auto 1.25em;
	clear: both;
	padding: 0;
	border: none !important;
	outline: none;
	background: transparent !important;
	box-shadow: none !important;
	cursor: zoom-in;
	position: relative;
	border-radius: var(--hd-radius);
}

.hd-widget .hd-preview-zoom .hd-preview {
	display: block;
	width: 100%;
	max-width: 400px;
	height: auto;
	margin: 0 auto;
	object-fit: contain;
	border-radius: var(--hd-radius);
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
	background: #1a1a2e;
	vertical-align: middle;
}

.hd-preview-zoom:hover .hd-preview,
.hd-preview-zoom:focus .hd-preview {
	box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
}

.hd-preview.is-loading {
	opacity: 0.4;
}

.hd-widget .hd-preview-zoom__hint {
	display: block;
	margin-top: 0.45em;
	font-size: 0.78em;
	color: var(--hd-muted) !important;
	text-align: center;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
}

/* Lightbox */
.hd-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.hd-lightbox[hidden] {
	display: none !important;
}

.hd-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
}

.hd-lightbox__dialog {
	position: relative;
	z-index: 1;
	max-width: min(96vw, 1080px);
	max-height: 96vh;
}

.hd-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: 96vh;
	width: auto;
	height: auto;
	border-radius: var(--hd-radius);
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.hd-lightbox__close {
	position: fixed;
	top: 0.75rem;
	right: 0.85rem;
	z-index: 10002;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0.35rem;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: #fff !important;
	font-size: 2.75rem;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
	-webkit-appearance: none;
	appearance: none;
}

.hd-lightbox__close:hover,
.hd-lightbox__close:focus {
	background: transparent !important;
	color: #fff !important;
	opacity: 0.85;
}

body.hd-lightbox-open {
	overflow: hidden;
}

.hd-download-actions {
	margin: 0;
	text-align: center;
}

.hd-download-actions .button {
	margin: 0;
	min-height: var(--hd-touch);
	width: 100%;
	max-width: 20rem;
}

@media (min-width: 500px) {
	.hd-download-actions .button {
		width: auto;
	}
}
