/*
 * Mise en forme commune (clair et sombre). Les couleurs viennent des jetons --lh-*
 * définis dans lh.css (clair) ou lh-night.css (sombre).
 * Les noms de classes et d'identifiants utilisés par les fichiers de contenu
 * (rouge, verset, antienne, liturgie, espace, ref, cantique ...) sont conservés.
 *
 * Police de lecture : --lh-reading (à empattements par défaut, plus étroite : elle
 * respecte mieux les retours à la ligne des vers des psaumes).
 */

@font-face {
	font-family: "Liturgie";
	src: url('liturgy.ttf');
}

:root {
	--lh-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--lh-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
	--lh-reading: var(--lh-serif); /* mettre var(--lh-sans) pour une lecture sans empattements */
	--lh-radius: 20px;
	--lh-touch: 48px; /* taille minimale d'une cible tactile */
}

*:not(input):not(textarea):not(select) {
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
}

#detect-area {
	background-color: #FF0000!important;
}

/* ---------- Structure générale ---------- */

body {
	margin: 0;
	padding: 0;
	width: auto;
	font-family: var(--lh-sans);
	color: var(--lh-text);
	-webkit-text-size-adjust: 100%;
}

div.page__background {
	background: var(--lh-page-background)!important;
	top: 0!important;
	padding-top: 0!important;
}

div.page__content {
	font-family: var(--lh-sans);
	color: var(--lh-text);
}

/* Focus clavier / lecteur d'écran bien visible */
:focus-visible {
	outline: 3px solid var(--lh-accent);
	outline-offset: 2px;
	border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
	* { animation-duration: .001ms!important; transition-duration: .001ms!important; }
}

/* ---------- Barre du haut (claire, comme le reste de l'interface) ---------- */

ons-toolbar.toolbar {
	background-color: var(--lh-surface);
	background-image: none;
	border-bottom: 0;
	box-shadow: 0 1px 0 var(--lh-border), 0 4px 14px rgba(0, 0, 0, .05);
	color: var(--lh-text);
}

ons-toolbar .toolbar__left,
ons-toolbar .toolbar__center,
ons-toolbar .toolbar__right {
	color: var(--lh-text);
}

ons-toolbar .toolbar__center {
	font-weight: 700;
	letter-spacing: .005em;
}

ons-toolbar ons-icon,
ons-toolbar ons-toolbar-button {
	color: var(--lh-text);
}

/* Cibles tactiles confortables dans la barre */
ons-toolbar ons-toolbar-button.toolbar-button {
	min-width: var(--lh-touch);
	min-height: var(--lh-touch);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
}

.bouton_menu_g {
	font-size: 1em;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	min-height: var(--lh-touch);
	padding-right: .5em;
}

/* Le sélecteur de date ressemble à une puce cliquable */
.bouton_date {
	font-size: .9em;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .45em;
	width: max-content;
	max-width: 100%;
	margin: 0 auto;
	line-height: 1.2;
	height: 38px;
	padding: 0 1em;
	border-radius: 999px;
	background: var(--lh-surface-2);
	color: var(--lh-text);
	cursor: pointer;
	position: relative;
	top: 50%;
	transform: translateY(-50%);
}
.bouton_date::before {
	content: "\f32e"; /* calendrier (Material Design Iconic Font) */
	font-family: "Material-Design-Iconic-Font";
	font-weight: normal;
	font-size: 1.25em;
	color: var(--lh-accent);
}
.bouton_date:active { background: var(--lh-accent-soft); }

.barre-menu .select-input {
	color: var(--lh-text)!important;
}

/* ---------- Carte de lecture ---------- */

ons-card.cadre,
.cadre {
	background: var(--lh-surface);
	color: var(--lh-text);
	width: calc(100% - 24px);
	max-width: 44rem;
	margin: 12px auto;
	padding: 1.2em 1.3em 4.5em;
	box-sizing: border-box;
	border-radius: var(--lh-radius);
	box-shadow: var(--lh-shadow);
	font-family: var(--lh-reading);
	font-size: 1.05em;
	line-height: 1.65;
}

/* Les contrôles restent en police d'interface, lisibles et sobres */
.cadre select,
.cadre input,
.cadre ons-button,
.cadre ons-list,
.cadre ons-switch,
.cadre .switch-latin {
	font-family: var(--lh-sans);
}

/* ---------- Titres ---------- */

h1, h2, h3 {
	font-family: var(--lh-sans)!important;
}

h1 {
	font-size: 1.1em!important;
}

.page__content h2 {
	color: var(--lh-text);
	text-transform: uppercase;
	letter-spacing: .07em;
	font-size: .92em!important;
	font-weight: 700!important;
	line-height: 1.3;
	margin: 2.2em 0 .9em!important;
	padding: .15em 0 .15em .75em;
	border: 0;
	border-left: 4px solid var(--lh-accent);
}

.page__content h2.cantique {
	text-transform: none;
	letter-spacing: 0;
	font-size: 1.05em!important;
	font-weight: normal!important;
	margin: 1.6em 0 .8em!important;
	padding: 0;
	border-left: 0;
}
.page__content h2.cantique .rouge { font-weight: 700; }

h3 {
	font-size: 1em!important;
	font-weight: normal;
}

/* Titres d'en-tête de chaque office (date, temps liturgique, saint du jour) */
[id$="_titre_principal"] {
	font-size: 1.35em;
	font-weight: 700;
	line-height: 1.3;
	margin-top: .2em;
}
[id$="_titre_sanctoral"],
[id$="_titre_secondaire"] {
	color: var(--lh-muted);
	font-size: .92em;
	line-height: 1.45;
	margin-top: .3em;
}

/* ---------- Texte liturgique ---------- */

p {
	text-align: left; /* le texte justifié est plus fatigant à lire */
	margin: .7em 0;
}

.antienne {
	font-size: .95em;
}

p.ref {
	font-size: .9em;
	color: var(--lh-rubric);
	text-align: right;
	margin-top: 0;
}

span.verset, .rouge {
	color: var(--lh-rubric);
}

span.verset {
	font-size: .65em;
	vertical-align: text-top;
	font-family: var(--lh-sans);
	font-weight: 600;
	margin-right: .15em;
}

/* syllabes accentuées du chant : discrètes mais présentes */
u {
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
	text-decoration-color: var(--lh-muted);
}

.espace {
	margin-left: 2em;
}

.center, .center p {
	text-align: center;
}

.center p.antienne {
	text-align: left;
}

.droite {
	text-align: right;
}

.espace-dessous {
	margin-bottom: .5em;
}

span.petit {
	font-size: .6em;
}

span.liturgie {
	font-family: Liturgie;
	font-weight: bold;
	margin-right: .3em;
}

span.liturgie2 {
	font-family: Liturgie;
	font-size: .9em;
}

.switch-latin {
	text-align: right;
	font-size: .85em!important;
	font-style: italic!important;
	color: var(--lh-muted);
	margin-right: .5em;
}

/* ---------- Champs de sélection et saisie ---------- */

.select-input,
select.select-input {
	font-family: var(--lh-sans);
	font-size: 1em;
	font-weight: 600;
	color: var(--lh-text);
	background-color: var(--lh-surface-2);
	border: 0;
	border-radius: 14px;
	min-height: var(--lh-touch);
	padding: .4em 2.4em .4em 1em;
	max-width: 100%;
	box-sizing: border-box;
}
.select-input option {
	color: #1B1B1F;
	background: #FFFFFF;
}

.barre-menu .select-input {
	background-color: var(--lh-surface-2);
}

input.nombre,
.nombre {
	width: 4.5em;
	min-height: var(--lh-touch);
	font-family: var(--lh-sans);
	font-size: 1em;
	font-weight: 600;
	text-align: center;
	color: var(--lh-text);
	background: var(--lh-surface-2);
	border: 0;
	border-radius: 14px;
	box-sizing: border-box;
}

.slider {
	width: 92%;
	margin: 0 auto;
	padding: 0;
}

/* ---------- Boutons ---------- */

ons-button .button,
ons-button.button {
	min-height: var(--lh-touch);
	border-radius: 999px;
	background-color: var(--lh-accent);
	color: var(--lh-on-accent);
	font-weight: 700;
}

ons-fab.fab {
	background-color: var(--lh-accent);
	color: var(--lh-on-accent);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
ons-fab.fab:active {
	filter: brightness(.92);
}
ons-fab.fab--mini {
	width: 48px;
	height: 48px;
	line-height: 48px;
}
ons-fab.fab--mini .fab__icon {
	line-height: 48px;
	color: var(--lh-on-accent);
}

/* ---------- Interrupteurs ---------- */

ons-switch .switch__toggle {
	background-color: var(--lh-switch-off-track);
	border-color: transparent;
}
ons-switch .switch__handle {
	background-color: var(--lh-switch-thumb);
	border-color: transparent;
}
ons-switch .switch__input:checked + .switch__toggle {
	background-color: var(--lh-switch-on-track);
	border-color: transparent;
}
ons-switch .switch__input:checked + .switch__toggle .switch__handle {
	background-color: var(--lh-switch-on);
	border-color: transparent;
}

/* ---------- Onglets (affichage « onglets » des offices) : puces arrondies ---------- */

ons-tabbar .tabbar {
	background-color: var(--lh-surface);
	border-bottom: 0;
	box-shadow: 0 1px 0 var(--lh-border);
	height: 56px;
	box-sizing: border-box;
	padding: 8px 8px;
	gap: 6px;
}
ons-tab.tabbar__item {
	padding: 0;
}
ons-tab .tabbar__button {
	height: 40px;
	border-radius: 999px;
	background: var(--lh-surface-2);
	overflow: hidden;
}
ons-tab .tabbar__label {
	height: 40px;
	line-height: 40px!important;
	font-size: .74em!important;
	font-weight: 600;
	text-transform: none!important;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 2px;
}
ons-tab .tabbar__button,
ons-tab .tabbar__label {
	color: var(--lh-muted)!important;
}
ons-tab.active .tabbar__button {
	background: var(--lh-accent-soft);
	box-shadow: inset 0 0 0 1.5px var(--lh-accent);
}
ons-tab.active .tabbar__button,
ons-tab.active .tabbar__label {
	color: var(--lh-link)!important;
}
ons-tabbar .tabbar__border {
	display: none;
}
.tabbar__content {
	top: 56px;
}

/* ---------- Listes (paramètres, prières, rituels ...) ---------- */

.cadre .list {
	background: transparent;
	border: 0;
}
.cadre .list-header {
	background: transparent;
	color: var(--lh-muted);
	font-family: var(--lh-sans);
	font-size: .78em;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	padding: 1.2em 0 .5em;
	border: 0;
}
.cadre .list-item {
	min-height: 56px;
	padding-left: 0;
	background: transparent;
	color: var(--lh-text);
	font-family: var(--lh-sans);
}
.cadre .list-item .list-item__center,
.cadre .list-item .list-item__left,
.cadre .list-item .list-item__right {
	border-color: var(--lh-border);
	text-align: left;
}
.cadre .list-item--tappable:active {
	background: var(--lh-surface-2);
}

/* Chevron : indique qu'une ligne ouvre une page */
.cadre ons-list-item[tappable] .list-item__center {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.cadre ons-list-item[tappable] .list-item__center::after {
	content: "\f2fb";
	font-family: "Material-Design-Iconic-Font";
	font-size: 1.5em;
	color: var(--lh-muted);
	margin-left: .5em;
}

/* ---------- Curseur (psaumes et cantiques) ---------- */

.noUi-target {
	background: var(--lh-surface-2);
	border: 0;
	border-radius: 999px;
	box-shadow: none;
}
.noUi-horizontal { height: 10px; }
.noUi-connect { background: var(--lh-accent); }
.noUi-handle {
	background: var(--lh-accent);
	border: 3px solid var(--lh-surface);
	border-radius: 50%;
	box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
}
.noUi-handle::before,
.noUi-handle::after { display: none; }
.noUi-horizontal .noUi-handle {
	width: 30px;
	height: 30px;
	right: -15px;
	top: -11px;
}

/* ---------- Menus latéraux ---------- */

ons-splitter-side ons-page .page__background {
	background: var(--lh-surface)!important;
}
ons-splitter-side .list {
	background: transparent;
	border: 0;
}
ons-splitter-side .list-item {
	min-height: 52px;
	background: transparent;
	color: var(--lh-text);
	font-family: var(--lh-sans);
}
ons-splitter-side .list-item__center,
ons-splitter-side .list-item__left {
	border-color: var(--lh-border);
}
ons-splitter-side .list-header {
	background: transparent;
	border-color: var(--lh-border);
	color: var(--lh-muted);
	font-size: .78em;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
}
ons-splitter-side .list-item--tappable:active {
	background: var(--lh-surface-2);
}
ons-splitter-side .list-item__icon,
ons-splitter-side ons-icon {
	color: var(--lh-accent);
}

/* pour centrer le calendrier */
div.picker__holder {
	margin: auto;
}

/* ================================================================
 *  PAGE D'ACCUEIL
 * ================================================================ */

.accueil {
	max-width: 44rem;
	margin: 0 auto;
	padding: 22px 16px 32px;
	box-sizing: border-box;
	font-family: var(--lh-sans);
}
.accueil button { font-family: var(--lh-sans); }

.accueil-entete { margin: 4px 4px 22px; }
.accueil-appnom {
	margin: 0 0 .15em;
	font-size: .8em;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--lh-muted);
	text-align: left;
}
.accueil .accueil-date {
	font-family: var(--lh-sans)!important;
	font-size: 1.6em!important;
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
	text-align: left;
	color: var(--lh-text);
}
.accueil-date::first-letter { text-transform: uppercase; }

.accueil-section {
	margin: 26px 6px 10px;
	font-size: .8em;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--lh-muted);
	text-align: left;
}

/* Pastille d'icône (cercle ambre clair) */
.pastille {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--lh-accent-soft);
	color: var(--lh-accent);
	font-size: 1.35em;
}
.pastille ons-icon { color: inherit; font-size: 1em; }

/* Tuiles : un bouton par office / par ressource */
.tuiles {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}
.tuile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	min-height: 138px;
	padding: 16px;
	border: 0;
	border-radius: var(--lh-radius);
	background: var(--lh-surface);
	color: var(--lh-text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	box-shadow: var(--lh-shadow);
	-webkit-tap-highlight-color: transparent;
}
.tuile:active { transform: scale(.985); filter: brightness(.97); }
.tuile-nom { font-size: 1.15em; font-weight: 700; line-height: 1.2; }
.tuile-sous {
	display: block;
	margin-top: 3px;
	font-size: .8em;
	font-weight: 500;
	line-height: 1.3;
	color: var(--lh-muted);
}

/* Tuile large (Complies) : icône à gauche */
.tuile--large {
	grid-column: span 2;
	min-height: 84px;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 14px;
}

/* L'office du moment est mis en valeur */
.tuile--now {
	background: var(--lh-accent);
	color: var(--lh-on-accent);
}
.tuile--now .pastille { background: rgba(255, 255, 255, .45); color: var(--lh-on-accent); }
.tuile--now .tuile-sous { color: rgba(27, 27, 31, .75); }
.tuile-badge {
	position: absolute;
	top: 14px;
	right: 14px;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .5);
	color: var(--lh-on-accent);
	font-size: .7em;
	font-weight: 700;
}

/* Carte de lignes (Paramètres, Nouveautés, À propos) */
.carte-lignes {
	background: var(--lh-surface);
	border-radius: var(--lh-radius);
	box-shadow: var(--lh-shadow);
	overflow: hidden;
}
.ligne {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 64px;
	padding: 10px 16px;
	border: 0;
	border-top: 1px solid var(--lh-border);
	background: transparent;
	color: var(--lh-text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.ligne:first-child { border-top: 0; }
.ligne:active { background: var(--lh-surface-2); }
.ligne .pastille { width: 38px; height: 38px; font-size: 1.15em; }
.ligne-nom { flex: 1; font-size: 1.02em; font-weight: 600; }
.ligne-fleche { font-family: "Material-Design-Iconic-Font"; font-size: 1.5em; color: var(--lh-muted); }

@media (max-width: 340px) {
	.tuile { min-height: 120px; padding: 14px; }
}
