/* ============================================================
   Style commun des formulaires Firebase (cartes claires).
   Generalise depuis 2_add_program_fb : chaque section = une carte
   blanche avec titre. AUCUN champ/attribut fonctionnel n'est touche,
   uniquement la presentation.

   Pour appliquer ce style a un formulaire :
   - ajouter la classe .form-bg sur le .page-content
   - ajouter la classe .form-host sur le <form class="list ...">
   - envelopper le contenu dans <div class="prog-form">
   - regrouper les <li> dans <section class="prog-card"> + <ul class="prog-list">
   - bouton submit dans <div class="block prog-submit-block">
   ============================================================ */

/* ---- Fond clair de la page, pour faire respirer les cartes ---- */
.page-content.form-bg {
	background-color: rgb(238, 237, 247);
}

/* ---- Le <form> (.list) ne fait plus carte lui-meme ---- */
.form-host.list {
	font-size: 17px;
	background: transparent;
	margin: 0;
}
.form-host.list::before,
.form-host.list::after {
	display: none;
}

/* ---- Conteneur general : padding lateral + espace bas pour le submit ---- */
.prog-form {
	padding: 12px 12px calc(24px + env(safe-area-inset-bottom));
}

/* ---- Carte de section ---- */
.prog-card {
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 2px 10px rgba(31, 27, 70, 0.07);
	margin: 0 0 16px;
	overflow: hidden;
}

/* ---- Titre de section ---- */
.prog-card-title {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 16px 10px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #6b6796;
}
.prog-card-title i.f7-icons {
	font-size: 18px;
	color: #b6a200; /* rappel du jaune festival, version sobre */
}

/* ---- Petite note explicative sous un titre de carte ---- */
.prog-card-note {
	padding: 0 16px 12px;
	margin: 0;
	font-size: 12px;
	color: #6b6796;
}

/* ---- Liste interne : neutralise le chrome Framework7 (hairlines, fond) ---- */
.prog-card .prog-list {
	margin: 0;
	background: transparent;
	list-style: none;
	padding: 0;
}
.prog-card .prog-list::before,
.prog-card .prog-list::after {
	display: none;
}
/* Le framework force padding-left/right:16px !important sur .item-inner, ce qui
   doublait l'inset et rognait la largeur des champs. On neutralise tout le
   padding lateral pour que chaque input occupe la pleine largeur de la carte. */
.prog-card .prog-list .item-content {
	padding-left: 0 !important;
	padding-right: 0 !important;
}
.prog-card .prog-list .item-inner,
.prog-card .prog-list .item-inner-switch {
	padding-left: 0 !important;
	padding-right: 0 !important;
	padding-top: 8px;
	padding-bottom: 8px;
}
/* Hairline fine entre deux lignes d'une meme carte, pas sur la derniere. */
.prog-card .prog-list .item-content:not(:last-child) .item-inner::after,
.prog-card .prog-list .item-content:not(:last-child) .item-inner-switch::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: rgba(31, 27, 70, 0.07);
}

/* Ligne sans separateur : pour rattacher visuellement deux champs lies
   (ex. le jour et son heure dans le formulaire workshop). */
.prog-card .prog-list .prog-no-divider .item-inner::after,
.prog-card .prog-list .prog-no-divider .item-inner-switch::after {
	display: none !important;
}

/* Separateur NET : ligne horizontale bien visible pour detacher un bloc du
   suivant (ex. apres l'heure, avant le jour suivant dans le formulaire workshop).
   Plus marquee que la hairline par defaut. */
.prog-card .prog-list .prog-day-divider .item-inner::after,
.prog-card .prog-list .prog-day-divider .item-inner-switch::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: rgba(31, 27, 70, 0.22);
	display: block !important;
}

/* Suppression explicite de toute ligne sous les lignes "jour" (Thursday /
   Friday / Saturday) du formulaire workshop. Cible les IDs builder pour etre
   certain de gagner sur n'importe quelle regle de hairline. */
#form-29154-li-10 .item-inner::after,
#form-29154-li-10 .item-inner-switch::after,
#form-29154-li-13 .item-inner::after,
#form-29154-li-13 .item-inner-switch::after,
#form-29154-li-16 .item-inner::after,
#form-29154-li-16 .item-inner-switch::after {
	display: none !important;
}

/* ---- Libelles de champ ---- */
.prog-card .item-title.item-label,
.prog-card .item-title.item-label-switch {
	color: #1f1b46;
	font-weight: 600;
	font-size: 14px;
}

/* ---- Champs texte / date / select / textarea : look "input rempli" ---- */
.prog-card .item-input-wrap input,
.prog-card .item-input-wrap select,
.prog-card .item-input-wrap textarea {
	margin-top: 6px;
	background: #f4f3fb;
	border-radius: 10px;
	padding: 11px 12px;
	font-size: 16px;
	color: #1f1b46;
	width: 100%;
	box-sizing: border-box;
	border: 1px solid transparent;
	transition: border-color .15s, background .15s;
}
/* ---- Reliable dropdown (replaces the buggy data-api-mode="2" <select>) ----
   The native select rendered its chosen value unreliably on macOS and, because
   its options load asynchronously, edit-preload and submit could end up empty.
   custom.js hides the real <select> (kept for FormData) and shows this button,
   opening a Framework7 Action Sheet to pick. */
.dbx-picker { position: relative; }
.dbx-picker-native {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px; border: 0;
	clip: rect(0 0 0 0); clip-path: inset(50%);
	overflow: hidden; opacity: 0; pointer-events: none;
}
.dbx-picker-display {
	display: block;
	width: 100%;
	margin-top: 6px;
	text-align: left;
	background: #f4f3fb;
	border: 1px solid transparent;
	border-radius: 10px;
	padding: 11px 34px 11px 12px;
	font-size: 16px;
	color: #1f1b46;
	box-sizing: border-box;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b6796' d='M1.4 0L6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}
.dbx-picker-display.is-empty { color: #a09cc0; }
.dbx-picker-display:active { background: #ffffff; border-color: #d9c400; }
/* Scrollable, searchable picker popup for collection-backed selects
   (location/guest have 40+ options). Replaces the F7 Action Sheet, whose
   buttons selected on touch-release so any drag to scroll picked a row. A
   normal overflow container lets the browser tell scrolling from a tap. */
.popup.dbx-picker-popup { display: flex; flex-direction: column; }
.dbx-picker-header {
	flex: 0 0 auto;
	position: relative;
	padding: calc(env(safe-area-inset-top) + 10px) 12px 8px;
	background: #ffffff;
	border-bottom: 1px solid #ececf4;
}
.dbx-picker-title {
	font-size: 17px; font-weight: 600; color: #1f1b46;
	line-height: 28px; padding-right: 64px;
}
.dbx-picker-close {
	position: absolute; right: 12px;
	top: calc(env(safe-area-inset-top) + 10px);
	line-height: 28px; color: #b9a800;
}
.dbx-picker-search {
	display: block; width: 100%; margin-top: 8px; box-sizing: border-box;
	padding: 9px 12px; font-size: 16px; color: #1f1b46;
	background: #f4f3fb; border: 1px solid #e2e0ef; border-radius: 10px;
}
.dbx-picker-scroll {
	flex: 1 1 auto; min-height: 0;
	overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.dbx-picker-list { list-style: none; margin: 0; padding: 0; }
.dbx-picker-list li { border-bottom: 1px solid #f0eff7; }
.dbx-picker-list .dbx-opt {
	display: block; padding: 14px 16px;
	font-size: 16px; color: #1f1b46; text-decoration: none;
}
.dbx-picker-list .dbx-opt:active { background: #f4f3fb; }
.dbx-picker-list .dbx-opt-active { font-weight: 600; }
.dbx-picker-list .dbx-opt-active::after { content: "✓"; float: right; color: #b9a800; }
.prog-card .item-input-wrap textarea {
	resize: vertical;
	min-height: 80px;
}
.prog-card .item-input-wrap input:focus,
.prog-card .item-input-wrap select:focus,
.prog-card .item-input-wrap textarea:focus {
	background: #ffffff;
	border-color: #d9c400;
	outline: none;
}
.prog-card .item-input-wrap input::placeholder,
.prog-card .item-input-wrap textarea::placeholder {
	color: #a09cc0;
}
.prog-card .input-dropdown-wrap::after {
	color: #6b6796;
}

/* ---- Editeur de texte riche (Content) ---- */
.prog-card .text-editor {
	margin-top: 6px;
	background: #f4f3fb;
	border-radius: 10px;
}
.prog-card .text-editor .text-editor-content {
	min-height: 110px;
	padding: 12px;
	font-size: 16px;
	color: #1f1b46;
}

/* ---- Lignes a toggle ---- */
.prog-card .item-inner-switch {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.prog-card .item-inner-switch .item-input {
	margin-top: 0;
}
/* Libelle + courte explication a gauche, toggle a droite */
.prog-card .prog-switch-label {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.prog-card .prog-switch-hint {
	font-size: 12px;
	font-weight: 400;
	color: #6b6796;
}

/* ---- Bouton d'action attache a une carte ("Add a new ...") ---- */
.prog-card-action {
	padding: 4px 16px 16px;
}
.prog-add-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 42px;
	border-radius: 10px;
	border: 1.5px dashed #c9b400;
	background: #fffceb;
	color: #6b5e00;
	font-weight: 600;
	font-size: 15px;
	text-transform: none;
}
.prog-add-btn i.f7-icons {
	font-size: 19px;
	color: #c9a700;
}
.prog-add-btn:active {
	background: #fdf6c9;
}

/* ---- Bloc image (Poster / photo) ---- */
.prog-card .item-image-large .item-input-info {
	color: #6b6796;
	font-size: 13px;
	margin-bottom: 10px;
}
.prog-card .firebase_document_preview {
	border-radius: 12px;
}

/* ---- Champs techniques caches ---- */
.prog-hidden-fields {
	margin: 0;
	padding: 0;
	list-style: none;
}
.prog-hidden-fields::before,
.prog-hidden-fields::after {
	display: none;
}

/* ---- Bouton Submit : pleine largeur, bien visible ---- */
.prog-submit-block {
	margin: 8px 0 0;
	padding: 0;
}
.prog-submit-block .button {
	height: 50px;
	border-radius: 12px;
	font-size: 17px;
	font-weight: 700;
	box-shadow: 0 4px 12px rgba(217, 196, 0, 0.35);
}

/* ============================================================
   Repeaters dbExpress (listes de contenu) — structure plate
   media-list (cf. pages/.../repeater_userlist.html de reference).
   Remplace les anciennes lignes a base de card/row/col/block
   dont les marges/paddings empiles donnaient des "marges trop
   grandes". Style partage = rendu identique sur toutes les pages
   (sponsors, guests, workshops, editions, exhibitions, kids
   village, village, program).
   ============================================================ */

/* La liste elle-meme : pas de marge verticale parasite Framework7 */
.dbexpress-virtual-list-content.media-list {
	margin: 0;
}

/* Vignette carree compacte, taille constante sur toutes les pages */
.dbexpress-virtual-list-content.media-list .item-media {
	align-self: center;
	min-width: 52px;
}
.dbexpress-virtual-list-content.media-list .virtual-list-media {
	width: 52px;
	height: 52px;
	min-width: 52px;
	border-radius: 8px;
	overflow: hidden;
	background-color: #ececf2;
}
.dbexpress-virtual-list-content.media-list .virtual-list-media .dbexpress-image-content {
	width: 100%;
	height: 100%;
}

/* Titre / sous-titres : compacts, ellipsis sur une ligne */
.dbexpress-virtual-list-content.media-list .item-title {
	font-weight: 600;
}
.dbexpress-virtual-list-content.media-list .item-title,
.dbexpress-virtual-list-content.media-list .item-subtitle,
.dbexpress-virtual-list-content.media-list .item-text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dbexpress-virtual-list-content.media-list .item-subtitle {
	font-size: 13px;
}
.dbexpress-virtual-list-content.media-list .item-text {
	font-size: 12px;
	line-height: 1.35;
}

/* Plusieurs lignes d'info (ex. horaires workshop) : on autorise le retour
   a la ligne et on retire le clamp hauteur par defaut de Framework7. */
.dbexpress-virtual-list-content.media-list .item-text.dbx-multiline {
	white-space: normal;
	max-height: none;
}

/* Champ dbexpress inline : pas de marge de <p>/bloc parasite */
.dbexpress-virtual-list-content .dbexpress-field,
.dbexpress-virtual-list-content .dbexpress-field p {
	margin: 0;
}

/* Bloc droite du titre (indicateur + bouton supprimer) */
.dbexpress-virtual-list-content .item-title-row .item-after {
	display: flex;
	align-items: center;
	gap: 4px;
}

/* Bouton supprimer inline : discret, a droite du titre */
.dbexpress-virtual-list-content .dbexpress-action-button {
	min-width: 0;
	width: auto;
	height: auto;
	margin: 0;
	padding: 2px 6px;
	line-height: 1;
}
.dbexpress-virtual-list-content .dbexpress-action-button i.f7-icons {
	font-size: 20px;
}
