/**
 * Pharmelia — Horaires & gardes, front-end styles.
 */

.ph-horaires-page .ph-page__article .ph-entry {
	max-width: none;
}

.ph-horaires {
	--ph-h-primary: var(--ph-primary, #05482f);
	--ph-h-primary-rgb: var(--ph-primary-rgb, 5, 72, 47);
	--ph-h-primary-dark: var(--ph-primary-dark, #033a26);
	--ph-h-accent: var(--ph-accent, #b08828);
	--ph-h-accent-soft: var(--ph-accent-soft, rgba(176, 136, 40, 0.12));
	--ph-h-ink: var(--ph-ink, #0c2418);
	--ph-h-body: var(--ph-body, #50635a);
	--ph-h-muted: var(--ph-muted, #7a8b82);
	--ph-h-border: var(--ph-border, #e1e6da);
	--ph-h-border-strong: var(--ph-border-strong, #ccd6c6);
	--ph-h-surface: var(--ph-surface, #fff);
	--ph-h-soft: var(--ph-soft, #f1f4ea);
	--ph-h-shadow: var(--ph-shadow-sm, 0 6px 18px rgba(12, 36, 24, 0.06));
	--ph-h-radius: 22px;
	--ph-h-radius-sm: 14px;
	--ph-h-font: var(--ph-font-body, system-ui, -apple-system, "Segoe UI", sans-serif);
	--ph-h-font-heading: var(--ph-font-heading, var(--ph-h-font));

	color: var(--ph-h-body);
	font-family: var(--ph-h-font);
	font-size: 15.5px;
	line-height: 1.65;
}

.ph-horaires *,
.ph-horaires *::before,
.ph-horaires *::after {
	box-sizing: border-box;
}

.ph-horaires [hidden] {
	display: none !important;
}

div.ph-horaires :is(h2, h3) {
	margin: 0;
	color: var(--ph-h-ink);
	font-family: var(--ph-h-font-heading);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.ph-horaires :where(p, ul, ol, li) {
	margin: 0;
}

.ph-horaires ul,
.ph-horaires ol {
	list-style: none;
	padding: 0;
}

.ph-horaires a {
	color: var(--ph-h-primary);
	text-decoration: none;
}

.ph-horaires a:hover {
	color: var(--ph-h-primary-dark);
}

.ph-horaires :where(a, button, [tabindex]):focus-visible {
	outline: 2px solid var(--ph-h-accent);
	outline-offset: 3px;
}

.ph-horaires-icon {
	flex: 0 0 auto;
}

.ph-horaires-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Layout ------------------------------------------------------------------ */

.ph-horaires__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 24px;
	align-items: start;
}

.ph-horaires__main {
	min-width: 0;
}

.ph-horaires__aside {
	display: flex;
	flex-direction: column;
	gap: 18px;
	position: sticky;
	top: 24px;
}

/* Summary ----------------------------------------------------------------- */

.ph-horaires-summary {
	display: grid;
	grid-template-columns: minmax(0, auto) minmax(0, 1fr);
	gap: 18px 30px;
	align-items: center;
	padding: 24px 26px;
	border: 1px solid var(--ph-h-border);
	border-radius: var(--ph-h-radius);
	background:
		radial-gradient(circle at 100% 0%, rgba(var(--ph-h-primary-rgb), 0.09), transparent 55%),
		linear-gradient(180deg, #fbfcf7 0%, #fff 100%);
	box-shadow: var(--ph-h-shadow);
}

.ph-horaires-summary__status {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ph-horaires__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--ph-h-muted);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	line-height: 1.4;
}

.ph-horaires__eyebrow .ph-horaires-icon {
	color: var(--ph-h-accent);
}

.ph-horaires-status {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	padding: 10px 16px;
	border-radius: 999px;
	width: fit-content;
	max-width: 100%;
	font-size: 14px;
	line-height: 1.4;
}

.ph-horaires-status strong {
	font-weight: 700;
}

.ph-horaires-status__detail {
	font-weight: 500;
	opacity: 0.9;
}

.ph-horaires-status__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
}

.ph-horaires-status--open {
	background: #e8f4ec;
	color: #086141;
}

.ph-horaires-status--garde {
	background: #fbf1d8;
	color: #775611;
}

.ph-horaires-status--closed {
	background: #f1f3ee;
	color: #53655b;
}

.ph-horaires-summary__garde {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: #775611;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
}

.ph-horaires-summary__garde .ph-horaires-icon {
	margin-top: 2px;
}

.ph-horaires-summary__intro {
	color: var(--ph-h-body);
	font-size: 14.5px;
	line-height: 1.7;
	max-width: 56ch;
}

/* Planning ---------------------------------------------------------------- */

.ph-horaires-planning {
	margin-top: 24px;
	padding: 24px;
	border: 1px solid var(--ph-h-border);
	border-radius: calc(var(--ph-h-radius) + 2px);
	background: var(--ph-h-surface);
	box-shadow: var(--ph-h-shadow);
}

.ph-horaires-planning__header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--ph-h-border);
}

.ph-horaires-planning__heading {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ph-horaires .ph-horaires-planning__title {
	font-size: clamp(24px, 2.6vw, 32px);
	letter-spacing: -0.02em;
}

.ph-horaires-planning__empty {
	padding: 36px 0;
	color: var(--ph-h-muted);
	text-align: center;
}

.ph-horaires-months {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.ph-horaires-months__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--ph-h-border-strong);
	border-radius: 50%;
	background: #fff;
	color: var(--ph-h-primary);
	transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ph-horaires-months__btn:hover {
	border-color: var(--ph-h-primary);
	background: var(--ph-h-primary);
	color: #fff;
}

.ph-horaires-months__btn--text {
	width: auto;
	padding: 0 16px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.ph-horaires-months__btn[aria-current="date"] {
	border-color: transparent;
	background: var(--ph-h-soft);
	color: var(--ph-h-primary);
}

/* Carousel ---------------------------------------------------------------- */

.ph-horaires-carousel {
	margin-top: 20px;
}

.ph-horaires-carousel__viewport {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	border-radius: var(--ph-h-radius-sm);
	-webkit-overflow-scrolling: touch;
}

.ph-horaires-carousel__viewport::-webkit-scrollbar {
	display: none;
}

.ph-horaires-carousel__viewport:focus-visible {
	outline-offset: 5px;
}

.ph-horaires-week {
	flex: 0 0 100%;
	min-width: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	padding: 3px;
}

.ph-horaires-week__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 12px;
	padding: 0 4px 10px;
}

.ph-horaires-week__label {
	color: var(--ph-h-muted);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.ph-horaires-week__label strong {
	margin-left: 4px;
	color: var(--ph-h-ink);
	font-weight: 700;
	letter-spacing: 0.02em;
}

.ph-horaires-week__badge {
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(var(--ph-h-primary-rgb), 0.09);
	color: var(--ph-h-primary);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ph-horaires-week__count {
	color: var(--ph-h-muted);
	font-size: 11.5px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.05em;
}

.ph-horaires-week__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 8px;
}

/* Day cards --------------------------------------------------------------- */

.ph-horaires-day {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 156px;
	padding: 12px 9px 11px;
	border: 1px solid var(--ph-h-border);
	border-radius: var(--ph-h-radius-sm);
	background: #fbfcf8;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ph-horaires-day--out {
	border-style: dashed;
	background: #fff;
	opacity: 0.48;
}

.ph-horaires-day--today {
	border-color: var(--ph-h-primary);
	background: #fff;
	box-shadow: 0 0 0 2px rgba(var(--ph-h-primary-rgb), 0.1);
}

.ph-horaires-day--garde {
	border-color: rgba(176, 136, 40, 0.55);
	background: linear-gradient(180deg, #fffdf6 0%, #fbf3de 100%);
}

.ph-horaires-day--garde.ph-horaires-day--today {
	border-color: var(--ph-h-accent);
	box-shadow: 0 0 0 2px rgba(176, 136, 40, 0.16);
}

.ph-horaires-day__head {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 24px;
}

.ph-horaires-day__dow {
	color: var(--ph-h-muted);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ph-horaires-day__today {
	padding: 2px 6px;
	border-radius: 999px;
	background: rgba(var(--ph-h-primary-rgb), 0.1);
	color: var(--ph-h-primary);
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.ph-horaires-day__num {
	margin-left: auto;
	color: var(--ph-h-ink);
	font-family: var(--ph-h-font-heading);
	font-size: 21px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.ph-horaires-day--garde .ph-horaires-day__num {
	color: #6e510f;
}

.ph-horaires-day__hours {
	display: flex;
	flex-direction: column;
	gap: 2px;
	color: var(--ph-h-body);
	font-size: 11.5px;
	line-height: 1.45;
	letter-spacing: -0.01em;
	font-variant-numeric: tabular-nums;
}

.ph-horaires-day__closed {
	color: var(--ph-h-muted);
	font-style: normal;
}

.ph-horaires-day__badge {
	align-self: flex-start;
	margin-top: auto;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	line-height: 1.5;
}

.ph-horaires-day__badge--open {
	background: #e8f4ec;
	color: #086141;
}

.ph-horaires-day__badge--closed {
	background: #f1f3ee;
	color: #6a7a70;
}

.ph-horaires-day__badge--garde {
	background: #f6e8bf;
	color: #6e510f;
}

.ph-horaires-day__gardes {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-top: 8px;
	border-top: 1px dashed rgba(176, 136, 40, 0.45);
}

.ph-horaires-day__garde {
	display: flex;
	flex-direction: column;
	gap: 1px;
	color: #6e510f;
	font-size: 11px;
	line-height: 1.45;
	font-variant-numeric: tabular-nums;
}

.ph-horaires-day__garde strong {
	font-size: 11.5px;
	font-weight: 700;
}

/* Controls ---------------------------------------------------------------- */

.ph-horaires-carousel__controls {
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) 38px;
	grid-template-areas:
		"prev dots next"
		"prev counter next";
	align-items: center;
	gap: 2px 14px;
	padding-top: 16px;
}

.ph-horaires-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--ph-h-border-strong);
	border-radius: 50%;
	background: #fff;
	color: var(--ph-h-primary);
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.ph-horaires-arrow[data-ph-prev] {
	grid-area: prev;
}

.ph-horaires-arrow[data-ph-next] {
	grid-area: next;
}

.ph-horaires-arrow:hover:not(:disabled) {
	border-color: var(--ph-h-primary);
	background: var(--ph-h-primary);
	color: #fff;
}

.ph-horaires-arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.ph-horaires-dots {
	grid-area: dots;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 7px;
	align-self: end;
}

.ph-horaires-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #cfd8c9;
	cursor: pointer;
	transition: width 0.2s ease, border-radius 0.2s ease, background-color 0.2s ease;
}

.ph-horaires-dot:hover {
	background: var(--ph-h-border-strong);
}

.ph-horaires-dot.is-active {
	width: 24px;
	border-radius: 999px;
	background: var(--ph-h-primary);
}

.ph-horaires-counter {
	grid-area: counter;
	justify-self: center;
	color: var(--ph-h-muted);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.05em;
	font-variant-numeric: tabular-nums;
	align-self: start;
}

.ph-horaires-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--ph-h-border);
	color: var(--ph-h-muted);
	font-size: 12px;
}

.ph-horaires-legend li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.ph-horaires-legend__dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
}

.ph-horaires-legend__dot--open {
	background: #0d7a4d;
}

.ph-horaires-legend__dot--closed {
	background: #b9c3b7;
}

.ph-horaires-legend__dot--garde {
	background: var(--ph-h-accent);
}

/* Aside cards ------------------------------------------------------------- */

.ph-horaires-card {
	padding: 22px;
	border: 1px solid var(--ph-h-border);
	border-radius: var(--ph-h-radius);
	background: var(--ph-h-surface);
	box-shadow: var(--ph-h-shadow);
}

.ph-horaires .ph-horaires-card__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
	font-size: 16.5px;
}

.ph-horaires-card__title .ph-horaires-icon {
	color: var(--ph-h-accent);
}

.ph-horaires-hours {
	display: flex;
	flex-direction: column;
}

.ph-horaires-hours li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(225, 230, 218, 0.8);
	font-size: 13px;
	line-height: 1.45;
}

.ph-horaires-hours li:last-child {
	border-bottom: 0;
}

.ph-horaires-hours li.is-today {
	color: var(--ph-h-primary);
	font-weight: 600;
}

.ph-horaires-hours__day {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

.ph-horaires-hours__marker {
	padding: 1px 6px;
	border-radius: 999px;
	background: rgba(var(--ph-h-primary-rgb), 0.1);
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.ph-horaires-hours__times {
	color: var(--ph-h-body);
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.ph-horaires-hours li.is-today .ph-horaires-hours__times {
	color: var(--ph-h-primary);
}

.ph-horaires-card__note {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px dashed var(--ph-h-border);
	color: var(--ph-h-muted);
	font-size: 11.5px;
	line-height: 1.6;
}

.ph-horaires-card__empty {
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--ph-h-soft);
	color: var(--ph-h-muted);
	font-size: 12.5px;
	line-height: 1.6;
}

.ph-horaires-gardes {
	display: flex;
	flex-direction: column;
}

.ph-horaires-garde {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 11px 0;
	border-bottom: 1px dashed var(--ph-h-border);
}

.ph-horaires-garde:last-child {
	border-bottom: 0;
}

.ph-horaires-garde__badge {
	display: flex;
	flex: 0 0 46px;
	flex-direction: column;
	align-items: center;
	padding: 6px 4px;
	border-radius: 11px;
	background: #fbf1d8;
	color: #6e510f;
	line-height: 1.1;
}

.ph-horaires-garde__num {
	font-family: var(--ph-h-font-heading);
	font-size: 18px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.ph-horaires-garde__month {
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.ph-horaires-garde__body {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.ph-horaires-garde__body strong {
	color: var(--ph-h-ink);
	font-size: 13px;
	font-weight: 700;
}

.ph-horaires-garde__when {
	color: var(--ph-h-muted);
	font-size: 11px;
	line-height: 1.5;
}

.ph-horaires-garde__time {
	color: #6e510f;
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.ph-horaires-card--contact .ph-horaires-btn {
	width: 100%;
	justify-content: center;
	margin-top: 16px;
}

.ph-horaires-phone {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--ph-h-primary);
	font-family: var(--ph-h-font-heading);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.ph-horaires-phone .ph-horaires-icon {
	color: var(--ph-h-accent);
}

.ph-horaires-address {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-top: 10px;
	color: var(--ph-h-body);
	font-size: 12.5px;
	line-height: 1.6;
}

.ph-horaires-address .ph-horaires-icon {
	margin-top: 2px;
	color: var(--ph-h-muted);
}

.ph-horaires a.ph-horaires-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 18px;
	border-radius: 999px;
	background: var(--ph-h-primary);
	color: #fff;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

.ph-horaires a.ph-horaires-btn:hover {
	background: var(--ph-h-primary-dark);
	color: #fff;
	text-decoration: none;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1100px) {
	.ph-horaires__layout {
		grid-template-columns: minmax(0, 1fr) 290px;
		gap: 22px;
	}

	.ph-horaires-planning {
		padding: 22px;
	}

	.ph-horaires-day {
		min-height: 148px;
		padding: 11px 9px 10px;
	}

	.ph-horaires-day__hours {
		font-size: 11.5px;
	}
}

@media (max-width: 1180px) {
	.ph-horaires__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.ph-horaires__aside {
		position: static;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: start;
	}

	.ph-horaires-card--contact {
		grid-column: 1 / -1;
	}
}

@media (max-width: 760px) {
	.ph-horaires-summary {
		grid-template-columns: minmax(0, 1fr);
		padding: 20px;
	}

	.ph-horaires-planning {
		padding: 18px;
	}

	.ph-horaires-planning__header {
		align-items: flex-start;
	}

	.ph-horaires-week__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 6px;
	}

	.ph-horaires-day {
		flex-flow: row wrap;
		align-items: center;
		gap: 6px 12px;
		min-height: 0;
		padding: 10px 12px;
	}

	.ph-horaires-day__head {
		flex: 0 0 82px;
		min-height: 0;
	}

	.ph-horaires-day__num {
		font-size: 18px;
	}

	.ph-horaires-day__hours {
		flex: 1 1 110px;
		flex-direction: row;
		flex-wrap: wrap;
		column-gap: 10px;
		font-size: 12px;
	}

	.ph-horaires-day__badge {
		margin-top: 0;
	}

	.ph-horaires-day__gardes {
		flex: 1 0 100%;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 4px 14px;
		padding-top: 6px;
	}

	.ph-horaires-day__garde {
		flex-direction: row;
		gap: 5px;
	}

	.ph-horaires-card {
		padding: 18px;
	}
}

@media (max-width: 620px) {
	.ph-horaires__aside {
		grid-template-columns: minmax(0, 1fr);
	}

	.ph-horaires-carousel__controls {
		grid-template-columns: 36px minmax(0, 1fr) 36px;
		gap: 2px 8px;
	}

	.ph-horaires-arrow {
		width: 36px;
		height: 36px;
	}

	.ph-horaires-months {
		width: 100%;
		justify-content: flex-end;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ph-horaires *,
	.ph-horaires *::before,
	.ph-horaires *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}

	.ph-horaires-carousel__viewport {
		scroll-behavior: auto;
	}
}

@media print {
	.ph-horaires__aside,
	.ph-horaires-carousel__controls,
	.ph-horaires-legend,
	.ph-horaires-months {
		display: none !important;
	}

	.ph-horaires__layout {
		display: block;
	}

	.ph-horaires-carousel__viewport {
		display: block;
		overflow: visible;
	}

	.ph-horaires-week {
		padding: 0 0 18px;
		break-inside: avoid;
	}

	.ph-horaires-planning {
		border: 0;
		box-shadow: none;
		padding: 0;
	}
}
