.sun-moon-phases {
	--celestial-text: rgba(255, 255, 255, 0.96);
	--celestial-muted: rgba(255, 255, 255, 0.58);
	--celestial-line: rgba(255, 255, 255, 0.22);
	--celestial-arc: rgba(255, 255, 255, 0.30);
	--celestial-sun: #ffd65a;
	--celestial-moon: rgba(255, 255, 255, 0.96);

	width: 100%;
	padding: 8px 0;
	color: var(--celestial-text);
	font-family:
		"Poppins",
		Arial,
		sans-serif;
}

.celestial-block {
	width: 100%;
}

.celestial-heading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin: 0 0 -22px;
	color: var(--celestial-text);
	font-size: 13px;
	font-weight: 500;
}

.celestial-heading-icon {
	color: var(--celestial-sun);
	font-size: 18px;
	line-height: 1;
}

.celestial-separator {
	height: 0;
	margin: 18px 8px;
	background: none;
	box-shadow: none;
}

.celestial-dial {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.celestial-ground-line {
	stroke: var(--celestial-line);
	stroke-width: 1.2;
}

.celestial-arc {
	fill: none;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-dasharray: 3 8;
}

.celestial-arc-background {
	stroke: var(--celestial-arc);
}

.celestial-arc-progress {
	stroke-dasharray: 0 999;
}

.celestial-sun-progress {
	stroke: rgba(255, 214, 90, 0.82);
}

.celestial-moon-progress {
	stroke: rgba(255, 255, 255, 0.72);
}

.celestial-horizon-point {
	fill: rgba(255, 255, 255, 0.62);
}

.celestial-marker {
	pointer-events: none;
}

.celestial-marker-glow {
	fill: rgba(255, 214, 90, 0.17);
}

.celestial-sun-marker .celestial-marker-body {
	fill: var(--celestial-sun);
	stroke: rgba(255, 255, 255, 0.82);
	stroke-width: 1.5;
	filter:
		drop-shadow(
			0 0 6px rgba(255, 214, 90, 0.50)
		);
}

.celestial-moon-marker-body {
	fill: var(--celestial-moon);
	filter:
		drop-shadow(
			0 0 5px rgba(255, 255, 255, 0.32)
		);
}

.celestial-status {
	fill: var(--celestial-text);
	font-family: "Poppins", Arial, sans-serif;
	font-size: 16px;
	font-weight: 500;
}

.celestial-status-secondary {
	fill: rgba(255, 255, 255, 0.70);
	font-size: 17px;
	font-weight: 300;
}

.celestial-time {
	fill: var(--celestial-text);
	font-family: "Poppins", Arial, sans-serif;
	font-size: 20px;
	font-weight: 600;
}

.celestial-caption {
	fill: var(--celestial-muted);
	font-family: "Poppins", Arial, sans-serif;
	font-size: 16px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.celestial-moon-symbol {
	position: relative;
	display: inline-block;
	width: 17px;
	height: 17px;
	overflow: hidden;
	border-radius: 50%;
	background: transparent;
}

.celestial-moon-symbol::before {
	position: absolute;
	inset: 0;
	content: "";
	border-radius: 50%;
	background: #fff;
}

.celestial-moon-symbol.phase-new::before {
	display: none;
}

.celestial-moon-symbol.phase-waxing-crescent::before {
	-webkit-mask:
		radial-gradient(
			circle at 78% 50%,
			#000 0 50%,
			transparent 51%
		);
	mask:
		radial-gradient(
			circle at 78% 50%,
			#000 0 50%,
			transparent 51%
		);
}

.celestial-moon-symbol.phase-first-quarter::before {
	-webkit-mask:
		linear-gradient(
			to right,
			transparent 0 50%,
			#000 50% 100%
		);
	mask:
		linear-gradient(
			to right,
			transparent 0 50%,
			#000 50% 100%
		);
}

.celestial-moon-symbol.phase-waxing-gibbous::before {
	-webkit-mask:
		radial-gradient(
			circle at 62% 50%,
			#000 0 50%,
			transparent 51%
		);
	mask:
		radial-gradient(
			circle at 62% 50%,
			#000 0 50%,
			transparent 51%
		);
}

.celestial-moon-symbol.phase-full::before {
	-webkit-mask: none;
	mask: none;
}

.celestial-moon-symbol.phase-waning-gibbous::before {
	-webkit-mask:
		radial-gradient(
			circle at 38% 50%,
			#000 0 50%,
			transparent 51%
		);
	mask:
		radial-gradient(
			circle at 38% 50%,
			#000 0 50%,
			transparent 51%
		);
}

.celestial-moon-symbol.phase-last-quarter::before {
	-webkit-mask:
		linear-gradient(
			to right,
			#000 0 50%,
			transparent 50% 100%
		);
	mask:
		linear-gradient(
			to right,
			#000 0 50%,
			transparent 50% 100%
		);
}

.celestial-moon-symbol.phase-waning-crescent::before {
	-webkit-mask:
		radial-gradient(
			circle at 22% 50%,
			#000 0 50%,
			transparent 51%
		);
	mask:
		radial-gradient(
			circle at 22% 50%,
			#000 0 50%,
			transparent 51%
		);
}

@media (max-width: 700px) {
	.sun-moon-phases {
		padding: 7px 6px;
	}

	.celestial-heading {
		font-size: 12px;
	}

	.celestial-status {
		font-size: 13px;
	}
}

/* Titre Éphémérides avec icône Soleil/Lune */
.sun-moon-title {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.sun-moon-title-icon {
	display: block;
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	object-fit: contain;
}


/* Titre du module Éphémérides */
#sun-moon-phases-module .sun-moon-title {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 9px;
	width: 100%;
	margin: 0 0 10px;
	padding: 0;
	color: #fff;
	font-family: "Poppins", Arial, sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 26px;
}

#sun-moon-phases-module .sun-moon-title-icon {
	display: block;
	width: 26px;
	height: 26px;
	flex: 0 0 26px;
	object-fit: contain;
}

/* Le titre utilise désormais le style global des modules */
#sun-moon-phases-module > .sun-moon-phases > h3 {
	margin: 0;
}

#sun-moon-phases-module > .sun-moon-phases > h3 .module-icon {
	object-fit: contain;
}

/* Nom de la phase lunaire en bas du module */
.celestial-moon-phase-footer {
	width: 100%;
	margin: 2px 0 0;
	color: var(--celestial-muted);
	font-family: "Poppins", Arial, sans-serif;
	font-size: 8px;
	font-weight: 300;
	line-height: 1.2;
	text-align: center;
}

/* Centrage horizontal réel du module et des cadrans */
.sun-moon-phases {
	box-sizing: border-box;
}

.celestial-block,
.celestial-dial {
	box-sizing: border-box;
	margin-left: auto;
	margin-right: auto;
}

/* Icône Soleil/Lune dans le titre du cadran Soleil */
.celestial-heading-image {
	display: block;
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
	object-fit: contain;
}

/* TEST EXPÉRIMENTAL : icône lunaire réaliste NASA */
.celestial-moon-symbol {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    overflow: hidden;
    border-radius: 50%;
    background-color: #001f3f;
    background-image:
        url("/api/moon_current.php");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.celestial-moon-symbol::before {
    display: none !important;
}

/* Texte de phase lunaire plus compact */
.celestial-moon-phase-footer {
    margin-top: 0;
    font-size: 10px;
    line-height: 1;
}

/* Libellé de phase lunaire plus discret */
.celestial-moon-phase-footer {
    margin-top: 0;
    font-size: 8px;
    line-height: 1;
}

/* Statut de visibilité de la Lune plus lisible */
.celestial-block-moon .celestial-status {
    font-size: 17px;
    font-weight: 300;
    line-height: 1.2;
}

/* Source de l’image des phases lunaires */
.celestial-moon-source {
    width: 100%;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.85);
    font-family: "Poppins", Arial, sans-serif;
    font-size: 8px;
    font-weight: 300;
    line-height: 1.2;
    text-align: left;
}

/* Source NASA collée au bas du bloc */
.celestial-moon-source {
    margin: 5px 0 0;
    padding: 0;
    line-height: 1;
}

/* Aucun espace sous la source NASA */
#sun-moon-phases-module .sun-moon-phases {
    padding-bottom: 0;
}

#sun-moon-phases-module .celestial-moon-source {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Source NASA encore plus discrète */
#sun-moon-phases-module .celestial-moon-source {
    font-size: 7px;
    line-height: 1;
}

/* Petite bulle autour du nom de phase lunaire */
.celestial-moon-phase-footer {
    width: 100%;
    margin-top: 0;
    text-align: center;
}

#moonPhaseName {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(120, 180, 255, 0.16);
    border: 1px solid rgba(120, 180, 255, 0.45);
    color: rgba(255, 255, 255, 0.70);
    font-family: "Poppins", Arial, sans-serif;
    font-size: 8px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}

/* Remonter légèrement la bulle de phase lunaire */
#moonPhaseName {
    transform: translateY(-5px);
}

/* Bulle de phase lunaire assortie au bandeau météo */
#moonPhaseName {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Opacité des messages selon la visibilité réelle des astres */
#sunPhaseStatus {
    fill: rgba(255, 255, 255, 1);
}

#sunPhaseStatus.celestial-status-secondary {
    fill: rgba(255, 255, 255, 0.70);
}

#moonVisibilityStatus {
    fill: rgba(255, 255, 255, 1);
}

#moonVisibilityStatus.celestial-status-invisible {
    fill: rgba(255, 255, 255, 0.70);
}

/* Opacité des messages selon la visibilité des astres */
#sunPhaseStatus {
    fill: rgba(255, 255, 255, 1);
}

#sunPhaseStatus.celestial-status-secondary {
    fill: rgba(255, 255, 255, 0.70);
}

#moonVisibilityStatus {
    fill: rgba(255, 255, 255, 1);
}

#moonVisibilityStatus.celestial-status-invisible {
    fill: rgba(255, 255, 255, 0.70);
}

/* Évolution de la déclinaison lunaire */
.celestial-moon-declination {
    width: 100%;
    margin: -2px 0 3px;
    color: rgba(255, 255, 255, 0.70);
    font-family: "Poppins", Arial, sans-serif;
    font-size: 8px;
    font-weight: 300;
    line-height: 1;
    text-align: center;
}

/* Évolution de la déclinaison dans la bulle lunaire */
#moonPhaseName .moon-declination-text {
    display: inline-block;
    margin-left: 5px;
    padding-left: 5px;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.60);
    font-size: 8px;
    font-weight: 300;
    line-height: 1;
}

/* Lune visible : allumer les deux lignes */
#moonVisibilityStatus,
#moonDirectionStatus {
    fill: rgba(255, 255, 255, 1);
}

/* Lune invisible : atténuer le message affiché */
#moonVisibilityStatus.celestial-status-invisible,
#moonDirectionStatus.celestial-status-invisible {
    fill: rgba(255, 255, 255, 0.70);
}

/* Informations lunaires simples, petites et alignées à gauche */
.celestial-moon-phase-footer {
    width: 100%;
    margin-top: -4px;
    padding: 0 12px;
    box-sizing: border-box;
    text-align: left;
}

#moonPhaseName {
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    transform: none;
    color: rgba(255, 255, 255, 0.70);
    font-family: "Poppins", Arial, sans-serif;
    font-size: 8px;
    font-weight: 300;
    line-height: 1.45;
    white-space: normal;
    text-align: left;
}

#moonPhaseName .moon-declination-text {
    display: block;
    margin: 1px 0 0;
    padding: 0;
    border: 0;
    color: rgba(255, 255, 255, 0.60);
    font-size: 8px;
    font-weight: 300;
    line-height: 1.45;
}

#moonPhaseName .moon-declination-arrow {
    display: none !important;
}

/* Informations astronomiques lunaires */
.celestial-moon-details {
    width: 100%;
    margin: -4px 0 3px;
    padding: 0 12px;
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.68);
    font-family: "Poppins", Arial, sans-serif;
    font-size: 8px;
    font-weight: 300;
    line-height: 1.5;
    text-align: left;
}

.celestial-moon-details > div {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

.celestial-moon-details .moon-detail-label {
    color: rgba(255, 255, 255, 0.84);
    font-weight: 400;
}

.celestial-moon-details #moonPhaseName {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    transform: none;
    color: inherit;
    font: inherit;
    white-space: normal;
}

/* Positionnement final du bloc d'informations lunaires */
.celestial-moon-details {
    margin-top: 8px;
    padding-left: 4px;
    padding-right: 12px;
}



.celestial-moon-details > .moon-location-note {
    display: flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    margin-top: 10px;
    margin-left: 8px;
    padding: 0;
    color: rgba(173, 216, 255, 0.90);
    font-size: 7px;
    letter-spacing: 0.025em;
    line-height: 1.35;
}

.moon-location-note-icon {
    color: rgba(173, 216, 255, 0.95);
    font-size: 0.48rem;
    line-height: 1;
    text-shadow: 0 0 5px rgba(173, 216, 255, 0.45);
}

.moon-location-source {
    margin-left: 4px;
    color: rgba(173, 216, 255, 0.90);
    font-style: normal;
}


#moonDirectionStatus {
    line-height: calc(1em - 1px);
}
