/* Galerie CTEA — crème, encre, terracotta ; General Sans. */
@font-face { font-family: "CTEA General Sans"; src: url(polices/GeneralSans-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "CTEA General Sans"; src: url(polices/GeneralSans-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "CTEA General Sans"; src: url(polices/GeneralSans-Semibold.woff2) format("woff2"); font-weight: 600; font-display: swap; }

.ctea-gal {
	--encre: #0F0F0F;
	--creme: #F4F1EA;
	--terre: #B33F19;
	--doux: #5F5A52;
	--filet: rgba(15, 15, 15, .14);
	--rayon: 20px;
	--ecart: 12px;
	font-family: "CTEA General Sans", "General Sans", system-ui, sans-serif;
	color: var(--encre);
	width: 100%;
}
.ctea-gal *, .ctea-gal *::before, .ctea-gal *::after { box-sizing: border-box; }
.ctea-gal p { margin: 0; }
.ctea-gal button { font: inherit; }
.ctea-gal .ctea-ico { width: 18px; height: 18px; flex: none; }

/* Boutons des albums : mêmes pilules que les filtres du journal. */
.ctea-gal__barre { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.ctea-gal__puce {
	display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 8px 0 18px; border-radius: 999px; cursor: pointer;
	border: 1.5px solid var(--terre); background: transparent; color: var(--terre); font-size: 15px; font-weight: 500; line-height: 1.2;
	transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.ctea-gal__puce:hover { background: rgba(179, 63, 25, .08); }
.ctea-gal__puce[aria-pressed=true] { background: var(--encre); border-color: var(--encre); color: var(--creme); }
.ctea-gal__n {
	display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
	background: rgba(179, 63, 25, .12); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.ctea-gal__puce[aria-pressed=true] .ctea-gal__n { background: rgba(244, 241, 234, .16); }
.ctea-gal__puce:focus-visible, .ctea-gal__diapo:focus-visible, .ctea-gal__plus:focus-visible, .ctea-gal__item a:focus-visible { outline: 2px solid var(--terre); outline-offset: 3px; }

/* Nom de l'album, date, lieu */
.ctea-gal__tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--filet); }
.ctea-gal__info[hidden] { display: none; }
.ctea-gal__titre { font-size: clamp(22px, 2.1vw, 30px); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.ctea-gal__meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px !important; color: var(--doux); font-size: 15px; }
.ctea-gal__meta span { display: inline-flex; align-items: center; gap: 7px; }
.ctea-gal__meta .ctea-ico { color: var(--terre); width: 17px; height: 17px; }
.ctea-gal__diapo {
	display: inline-flex; align-items: center; gap: 9px; flex: none; min-height: 44px; padding: 0 20px 0 16px; border-radius: 999px; cursor: pointer;
	border: 0; background: var(--encre); color: var(--creme); font-size: 15px; font-weight: 500; transition: background-color .25s ease;
}
.ctea-gal__diapo:hover { background: var(--terre); }
.ctea-gal__diapo .ctea-ico { width: 15px; height: 15px; fill: currentColor; }

/* Mosaïque : paysages, portraits sur deux rangées, une grande photo sur sept. */
.ctea-gal__mur {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 15.5vw, 250px); grid-auto-flow: dense;
	gap: var(--ecart); margin: 0; padding: 0; list-style: none;
}
.ctea-gal__item { margin: 0; padding: 0; min-width: 0; }
.ctea-gal__item.est-haute { grid-row: span 2; }
.ctea-gal__item.est-grande { grid-column: span 2; grid-row: span 2; }
.ctea-gal__item.est-cache { display: none; }
.ctea-gal__item a { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: var(--rayon); background: #E7E1D6; }
.ctea-gal__item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2, .7, .2, 1), opacity .5s ease; }
.ctea-gal__item a:hover img { transform: scale(1.04); }
.ctea-gal__loupe {
	position: absolute; right: 12px; bottom: 12px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
	background: var(--creme); color: var(--encre); opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .3s ease;
}
.ctea-gal__loupe .ctea-ico { width: 16px; height: 16px; }
.ctea-gal__item a:hover .ctea-gal__loupe, .ctea-gal__item a:focus-visible .ctea-gal__loupe { opacity: 1; transform: none; }
.ctea-gal.est-pret .ctea-gal__item.est-nouveau img { animation: ctea-gal-entree .6s ease backwards; }
@keyframes ctea-gal-entree { from { opacity: 0; } }

/* Afficher plus : pilule terracotta, flèche du site. */
.ctea-gal__suite { display: flex; justify-content: center; margin-top: 36px !important; }
.ctea-gal__suite[hidden] { display: none; }
.ctea-gal__plus {
	display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px 0 24px; border-radius: 999px; cursor: pointer;
	border: 1.5px solid var(--terre); background: transparent; color: var(--terre); font-size: 15px; font-weight: 500; transition: background-color .25s ease, color .25s ease;
}
.ctea-gal__plus::after {
	content: ""; width: 14px; height: 14px; background: currentColor; transition: transform .3s ease;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 7h10M7.5 2.5L12 7l-4.5 4.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 7h10M7.5 2.5L12 7l-4.5 4.5'/%3E%3C/svg%3E") center / contain no-repeat;
	transform: rotate(90deg);
}
.ctea-gal__plus:hover { background: var(--terre); color: #fff; }
.ctea-gal__plus:hover::after { transform: rotate(90deg) translateX(4px); }
.ctea-gal__plus .ctea-gal__n { background: rgba(179, 63, 25, .12); }
.ctea-gal__plus:hover .ctea-gal__n { background: rgba(255, 255, 255, .2); }

.ctea-gal-vide { padding: 24px; border: 1px dashed var(--filet, #ccc); border-radius: 20px; }

@media (max-width: 1024px) {
	.ctea-gal__mur { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: clamp(140px, 22vw, 230px); }
}
@media (max-width: 767px) {
	.ctea-gal { --ecart: 8px; --rayon: 14px; }
	.ctea-gal__barre { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px 22px; padding: 0 20px 4px; scrollbar-width: none; }
	.ctea-gal__barre::-webkit-scrollbar { display: none; }
	.ctea-gal__puce { flex: none; font-size: 14px; }
	.ctea-gal__tete { flex-direction: column; align-items: stretch; gap: 16px; }
	.ctea-gal__diapo { justify-content: center; }
	.ctea-gal__meta { font-size: 14px; }
	.ctea-gal__mur { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 43vw; }
	.ctea-gal__item.est-grande { grid-row: span 1; aspect-ratio: auto; }
	.ctea-gal__loupe { display: none; }
}

/* ---------- Visionneuse ---------- */
.ctea-visio {
	position: fixed; inset: 0; z-index: 99999; display: grid; grid-template-rows: auto minmax(0, 1fr) 2px auto;
	background: #0F0F0F; color: #F4F1EA; font-family: "CTEA General Sans", "General Sans", system-ui, sans-serif;
	animation: ctea-visio-entree .3s ease;
}
.ctea-visio[hidden] { display: none; }
@keyframes ctea-visio-entree { from { opacity: 0; } }
.ctea-visio button {
	display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
	background: rgba(244, 241, 234, .08); color: #F4F1EA; transition: background-color .2s ease;
}
.ctea-visio button:hover { background: #B33F19; }
.ctea-visio button:focus-visible { outline: 2px solid #F4F1EA; outline-offset: 2px; }
.ctea-visio__tete { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 14px 20px; }
.ctea-visio__compte { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; margin: 0; }
.ctea-visio__nom { margin: 0; font-size: 15px; color: rgba(244, 241, 234, .7); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctea-visio__outils { display: flex; justify-content: flex-end; gap: 8px; }
.ctea-visio__pause, .ctea-visio [aria-pressed=true] .ctea-visio__lecture { display: none; }
.ctea-visio [aria-pressed=true] .ctea-visio__pause { display: block; }
.ctea-visio__lecture { fill: currentColor; width: 16px; height: 16px; }
.ctea-visio__scene { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 20px; min-height: 0; touch-action: pan-y; }
.ctea-visio__cadre { margin: 0; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center; }
.ctea-visio__cadre img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 12px; transition: opacity .25s ease; user-select: none; -webkit-user-drag: none; }
.ctea-visio__cadre img.est-change { opacity: 0; }
.ctea-visio__legende { margin: 12px 0 0; font-size: 15px; color: rgba(244, 241, 234, .8); text-align: center; }
.ctea-visio__legende[hidden] { display: none; }
.ctea-visio__nav { width: 52px !important; height: 52px !important; }
.ctea-visio__progres { background: rgba(244, 241, 234, .1); }
.ctea-visio__progres span { display: block; height: 100%; width: 0; background: #B33F19; }
.ctea-visio__bande { display: flex; gap: 8px; padding: 14px 20px 18px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.ctea-visio__bande::-webkit-scrollbar { display: none; }
.ctea-visio__bande button { flex: none; width: 64px; height: 48px; border-radius: 8px; overflow: hidden; background: rgba(244, 241, 234, .06); opacity: .45; transition: opacity .2s ease; }
.ctea-visio__bande button:hover { background: none; opacity: .85; }
.ctea-visio__bande button[aria-current=true] { opacity: 1; outline: 2px solid #B33F19; outline-offset: 2px; }
.ctea-visio__bande img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctea-visio__avis { position: absolute; left: 50%; bottom: 96px; margin: 0; padding: 10px 18px; border-radius: 999px; background: #F4F1EA; color: #0F0F0F; font-size: 14px; font-weight: 500; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.ctea-visio__avis.est-visible { opacity: 1; }
html.ctea-visio-ouverte, html.ctea-visio-ouverte body { overflow: hidden; }

@media (max-width: 767px) {
	.ctea-visio__tete { grid-template-columns: auto 1fr; padding: 10px 12px; }
	.ctea-visio__nom { display: none; }
	.ctea-visio__outils { gap: 6px; }
	.ctea-visio__scene { grid-template-columns: minmax(0, 1fr); padding: 0 8px; }
	.ctea-visio__nav { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); width: 44px !important; height: 44px !important; background: rgba(15, 15, 15, .55) !important; }
	.ctea-visio__nav--prec { left: 12px; }
	.ctea-visio__nav--suiv { right: 12px; }
	.ctea-visio__bande { padding: 12px 12px 16px; }
	.ctea-visio__bande button { width: 52px; height: 40px; }
	.ctea-visio [data-lien] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.ctea-gal *, .ctea-visio, .ctea-visio * { animation: none !important; transition: none !important; }
}

/* Le thème (Hello Elementor) colore en rose les boutons au survol et au focus : on garde nos couleurs dans tous les états. */
.ctea-gal .ctea-gal__puce:focus, .ctea-gal .ctea-gal__plus:focus { background: transparent; color: var(--terre); border-color: var(--terre); }
.ctea-gal .ctea-gal__puce:hover { background: rgba(179, 63, 25, .08); color: var(--terre); }
.ctea-gal .ctea-gal__puce[aria-pressed=true], .ctea-gal .ctea-gal__puce[aria-pressed=true]:hover, .ctea-gal .ctea-gal__puce[aria-pressed=true]:focus { background: var(--encre); border-color: var(--encre); color: var(--creme); }
.ctea-gal .ctea-gal__plus:hover { background: var(--terre); color: #fff; border-color: var(--terre); }
.ctea-gal .ctea-gal__diapo:focus { background: var(--encre); color: var(--creme); }
.ctea-gal .ctea-gal__diapo:hover { background: var(--terre); color: var(--creme); }
.ctea-visio button:focus { background: rgba(244, 241, 234, .08); color: #F4F1EA; }
.ctea-visio button:hover, .ctea-visio .ctea-visio__fermer:hover { background: #B33F19; color: #F4F1EA; }
.ctea-visio .ctea-visio__bande button:focus { background: rgba(244, 241, 234, .06); }
.ctea-visio__scene { padding-bottom: 16px; }
@media (max-width: 767px) { .ctea-visio .ctea-visio__nav:focus { background: rgba(15, 15, 15, .55); } }
