/*
 * Site-wide refinements (loaded by inc/apsh-fiche.php).
 * Values copied from the existing pages: hero #e7e8eb, titles #304495, buttons #007ab8 / 10px radius,
 * side gutter 40px desktop, 24px tablet, 16px mobile.
 */

/* Directory filter [apsh_filtre_etablissements]: same box as the Actualités filter, wider keyword field. */
.apsh-dir-filter { margin: 0; }
.apsh-dir-filter .actu-field-col { flex: 1 1 200px !important; }
.apsh-dir-filter .actu-field-col.apsh-dir-filter__search { flex: 1.6 1 260px !important; }
.apsh-dir-filter .actu-field-col input::placeholder { color: #64748b; }
.apsh-dir-filter .actu-btn-search { background-color: #007ab8; border-radius: 10px; }
.apsh-dir-filter .actu-btn-search:hover, .apsh-dir-filter .actu-btn-search:focus-visible { background-color: #304495; }
.apsh-dir-filter .actu-btn-search:focus-visible,
.apsh-dir-filter .actu-field-col input:focus-visible,
.apsh-dir-filter .actu-field-col select:focus-visible { outline: 3px solid #f5b400; outline-offset: 2px; }
.apsh-dir-filter__reset { display: inline-block; margin-top: 16px; color: #304495; font-size: 14px; font-weight: 600; text-decoration: underline; }

/* Loop grid pagination (directory, family pages): buttons instead of bare numbers. */
.elementor-widget-loop-grid .elementor-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.elementor-widget-loop-grid .elementor-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; margin: 0 !important;
	border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #304495; font-weight: 600; text-decoration: none;
}
.elementor-widget-loop-grid .elementor-pagination a.page-numbers:hover { border-color: #007ab8; color: #007ab8; }
.elementor-widget-loop-grid .elementor-pagination .page-numbers.current { background: #007ab8; border-color: #007ab8; color: #fff; }
.elementor-widget-loop-grid .elementor-pagination .page-numbers.dots { border: 0; background: none; }

/* Content pages built on the "Protection des données" layout: space under the hero and side gutter. */
.page-id-1368 .elementor > .e-atomic-element,
.page-id-2196 .elementor > .e-atomic-element,
.page-id-2197 .elementor > .e-atomic-element,
.page-id-2198 .elementor > .e-atomic-element { padding-inline: 30px; }
.page-id-2196 .elementor > .e-con-full:first-child + .e-atomic-element,
.page-id-2197 .elementor > .e-con-full:first-child + .e-atomic-element,
.page-id-2198 .elementor > .e-con-full:first-child + .e-atomic-element { margin-top: 60px; }

/* Links inside rich text of these pages use the brand blue, not the browser default. */
.page-id-1368 .elementor-widget-text-editor a,
.page-id-2196 .elementor-widget-text-editor a,
.page-id-2197 .elementor-widget-text-editor a,
.page-id-2198 .elementor-widget-text-editor a { color: #007ab8; }

/* Search results and 404 (search.php, 404.php): same hero band and gutter as the Elementor pages. */
.apsh-page { padding: 0 0 96px; }
.apsh-page__hero { background: #e7e8eb; padding: 80px 40px; margin-bottom: 48px; }
.apsh-page__hero .apsh-page__title { font-size: 47px; line-height: 54px; }
.apsh-page__lead { margin: 16px 0 0; font-size: 24px; line-height: 1.4; color: #5c6066; max-width: 760px; }
.apsh-page__inner { max-width: 1441px; margin: 0; padding: 0 40px; box-sizing: border-box; }
.apsh-page .search-form input[type="submit"] { background: #007ab8; border-radius: 10px; }
.apsh-results { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.apsh-results__item { background: #f9fafb; border-radius: 16px; align-content: start; }
.apsh-results__title { font-size: 24px; line-height: 32px; }
.apsh-results__title a { text-decoration: none; }
.apsh-results__title a:hover { text-decoration: underline; }

@media (max-width: 1024px) {
	.page-id-1368 .elementor > .e-atomic-element,
	.page-id-2196 .elementor > .e-atomic-element,
	.page-id-2197 .elementor > .e-atomic-element,
	.page-id-2198 .elementor > .e-atomic-element { padding-inline: 14px; }
	.apsh-page__hero { padding: 56px 24px; }
	.apsh-page__inner { padding: 0 24px; }
}

@media (max-width: 767px) {
	.page-id-1368 .elementor > .e-atomic-element,
	.page-id-2196 .elementor > .e-atomic-element,
	.page-id-2197 .elementor > .e-atomic-element,
	.page-id-2198 .elementor > .e-atomic-element { padding-inline: 6px; }
	.page-id-2196 .elementor > .e-con-full:first-child + .e-atomic-element,
	.page-id-2197 .elementor > .e-con-full:first-child + .e-atomic-element,
	.page-id-2198 .elementor > .e-con-full:first-child + .e-atomic-element { margin-top: 32px; }
	.apsh-page__hero { padding: 40px 16px; margin-bottom: 32px; }
	.apsh-page__hero .apsh-page__title { font-size: 32px; line-height: 38px; }
	.apsh-page__lead { font-size: 18px; }
	.apsh-page__inner { padding: 0 16px; }
	.apsh-results { grid-template-columns: 1fr; }
	.apsh-dir-filter { padding: 24px 20px !important; }
	.apsh-dir-filter .actu-filter-title { font-size: 24px; }
}

/* Loop cards: tags (prestation, territoire) wrap as whole pills instead of breaking inside. */
.e-loop-item .e-con:has(> .elementor-widget-post-info) { flex-wrap: wrap; }
.e-loop-item .elementor-widget-post-info li { white-space: nowrap; }

/* The Actualités filter stacks its fields in a column under 900px: a flex-basis would become a height there. */
@media (max-width: 900px) {
	.apsh-dir-filter .actu-field-col, .apsh-dir-filter .actu-field-col.apsh-dir-filter__search { flex: none !important; }
}

/* Directory: message when the search finds nothing. */
.e-loop-nothing-found-message__text { margin: 0; padding: 40px 24px; border-radius: 16px; background: #f9fafb; text-align: center; font-size: 18px; color: #5c6066; }

/* Article detail (template "Modele Article Unique" #612): body text imported as plain HTML, styled like the mockup. */
.single-post .elementor-widget-theme-post-content { font-family: Inter, sans-serif; color: #5c6066; }
.single-post .elementor-widget-theme-post-content p,
.single-post .elementor-widget-theme-post-content li { font-size: 20px; line-height: 26px; color: #5c6066; }
.single-post .elementor-widget-theme-post-content p { margin: 0; }
.single-post .elementor-widget-theme-post-content h2 { margin: 32px 0 17px; font-size: 32px; line-height: 40px; font-weight: 700; color: #9d1b64; }
.single-post .elementor-widget-theme-post-content h2:first-child { margin-top: 0; }
.single-post .elementor-widget-theme-post-content ul,
.single-post .elementor-widget-theme-post-content ol { margin: 0 0 16px; padding-left: 1.3em; display: grid; gap: 6px; }
.single-post .elementor-widget-theme-post-content blockquote { margin: 24px 0; padding: 24px; border: 0; border-radius: 12px; background: #f5f5ec; }
.single-post .elementor-widget-theme-post-content blockquote p { font-style: italic; }
.single-post .elementor-widget-theme-post-content a { color: #007ab8; text-decoration: underline; }
@media (max-width: 767px) {
	.single-post .elementor-widget-theme-post-content h2 { font-size: 22px; }
	.single-post .elementor-widget-theme-post-content p,
	.single-post .elementor-widget-theme-post-content li { font-size: 16px; }
}

/* Fiche template #1214 hero pills [apsh_fiche_tags] (same look as the loop cards). */
.apsh-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.apsh-tags__item { padding: 5px 12px; border-radius: 29px; background: #bdcfe5; color: #2c4466; font: 500 14px/1.3 Inter, sans-serif; }
.single-post .apsh-news-cover, .single-post .apsh-news-figure { margin: 0 0 32px; }
.single-post .apsh-news-figure { margin-top: 24px; }
.single-post .apsh-news-cover img, .single-post .apsh-news-figure img { display: block; width: 100%; height: auto; border-radius: 16px; }
.single-post .apsh-news-figure img { width: auto; max-width: 100%; }

/* "Antenne" pill (loop items #940/#890, fiche templates #1300/#1214, map): dark blue to stand out. */
.elementor-element.elementor-element-apshant { background-color: #304495 !important; }
.elementor-element-apshant .elementor-icon-list-text, .elementor-element-apshant a { color: #fff !important; }
.apsh-tags__item--antenne { background: #304495; color: #fff; }

/* Touch targets >= 44px on touch screens: glossary A-Z letters and search/404 pagination. */
@media (max-width: 1024px) {
	.apsh-alphabet-bar .letter-btn { width: 44px; height: 44px; font-size: 15px; }
	.apsh-alphabet-bar .btn-all-terms { height: 44px; font-size: 14px; }
}
.apsh-page .nav-links .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }

/* Article #612: event date and place, "À retenir" box. Portrait #1852: quote, video loaded on click. */
.apsh-event { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 0 0 32px; padding: 20px 24px; border-radius: 16px; background: #eef3f9; color: #2c4466; font: 16px/1.5 Inter, sans-serif; }
.apsh-event dt { font-weight: 700; }
.apsh-event dd { margin: 0; }
.apsh-event dd::first-letter { text-transform: uppercase; }
.apsh-retenir { margin: 0; padding: 24px; border-left: 4px solid #304495; border-radius: 0 16px 16px 0; background: #eef3f9; color: #2c4466; }
.apsh-retenir__titre { margin: 0 0 8px; font: 700 20px/1.3 Inter, sans-serif; }
.apsh-retenir > :last-child { margin-bottom: 0; }
.apsh-quote { margin: 0 0 32px; padding: 24px 28px; border-radius: 16px; background: #eef3f9; color: #2c4466; }
.apsh-quote blockquote { margin: 0; font: italic 500 22px/1.45 Inter, sans-serif; }
.apsh-quote blockquote p { margin: 0; }
.apsh-quote figcaption { margin-top: 12px; font: 700 16px/1.4 Inter, sans-serif; }
.apsh-video { position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #2c4466; }
.apsh-video iframe { display: block; width: 100%; height: 100%; border: 0; }
.apsh-video__play { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 100%; padding: 24px; border: 0; background: none; color: #fff; font: 700 20px/1.3 Inter, sans-serif; cursor: pointer; }
.apsh-video__play:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.apsh-video__icon { width: 72px; height: 72px; border-radius: 50%; background: #fff; position: relative; }
.apsh-video__icon::after { content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%); border-style: solid; border-width: 14px 0 14px 22px; border-color: transparent transparent transparent #304495; }
.apsh-video__note { max-width: 420px; font-weight: 400; font-size: 14px; }
@media (max-width: 767px) {
	.apsh-quote blockquote { font-size: 18px; }
	.apsh-video__icon { width: 56px; height: 56px; }
}
/* PDF links of the Avis du comité éthique page (#1557) and the Protection des données page (#1368). */
.apsh-doc-links { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 8px 0 0; padding: 0; list-style: none; }
:is(.apsh-doc-links, .elementor-element-065ceee) a { color: #007ab8; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
/* Post info lists (date, author): Elementor's -8px right margin overflowed the screen on phones when the line was full. */
@media (max-width: 767px) { .elementor-widget-post-info .elementor-inline-items { margin-right: 0; } }
/* Loop grids: equal columns (a long card no longer widens its column past the screen) and term
   pills that wrap ("Montpellier Métropole, Siège / transverse" on the transverse services). */
.elementor-widget-loop-grid .elementor-loop-container { grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr)); }
.elementor-inline-item:has(> .elementor-post-info__item--type-terms), .elementor-post-info__item--type-terms, .elementor-post-info__terms-list { white-space: normal; }
