/* Photothèque CET-ASNI — charte : bleu marine #092242, bleu #255BA3, jaune #FFE800 */
.cetasni-pt {
	--pt-navy: #092242;
	--pt-blue: #255ba3;
	--pt-yellow: #ffe800;
	--pt-text: #5c6470;
	--pt-muted: #7a7a7a;
	--pt-line: #e3e8ef;
	--pt-soft: #f4f6fa;
	--pt-radius: 10px;
	color: var(--pt-text);
}
body.cetasni-pt-page:not([class*=elementor-page-]) .site-main {
	max-width: 1180px; padding-inline: 20px; box-sizing: border-box;
}
body.cetasni-pt-page .page-content > .cetasni-pt:first-child { margin-top: 26px; }
html body .cetasni-pt a,
html body .cetasni-pt a:hover,
html body .cetasni-pt a span { text-decoration: none; }
html body .cetasni-pt .cpt-crumbs a:hover { text-decoration: underline; }
.cetasni-pt img { max-width: 100%; height: auto; }

/* ---------- Boutons ---------- */
.cetasni-pt .cpt-btn,
.cetasni-pt .cpt-btn:visited {
	display: inline-flex; align-items: center; gap: .4em;
	padding: .8em 1.4em; border: 2px solid var(--pt-navy); border-radius: 3px;
	background: var(--pt-navy); color: #fff; font-weight: 600; line-height: 1.2;
	transition: background-color .2s, color .2s, border-color .2s;
}
.cetasni-pt .cpt-btn:hover,
.cetasni-pt .cpt-btn:focus-visible { background: var(--pt-yellow); border-color: var(--pt-yellow); color: var(--pt-navy); }
.cetasni-pt .cpt-btn span { font-weight: 400; opacity: .85; }
.cetasni-pt .cpt-btn--ghost,
.cetasni-pt .cpt-btn--ghost:visited { background: transparent; color: var(--pt-navy); }

/* ---------- Index des albums ---------- */
.cpt-index { padding: 8px 0 40px; }
.cpt-intro { max-width: 760px; margin: 0 0 8px; font-size: 1.05rem; line-height: 1.6; }
.cpt-stats { margin: 0 0 22px; color: var(--pt-muted); font-size: .95rem; }
.cpt-stats strong { color: var(--pt-navy); }

.cpt-toolbar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
	padding-bottom: 22px; margin-bottom: 28px; border-bottom: 1px solid var(--pt-line);
}
.cpt-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.cetasni-pt .cpt-filter,
.cetasni-pt .cpt-filter:hover,
.cetasni-pt .cpt-filter:focus {
	padding: .55em 1.1em; border: 1.5px solid var(--pt-line); border-radius: 999px;
	background: #fff; color: var(--pt-navy); font: inherit; font-size: .92rem; font-weight: 500;
	cursor: pointer; transition: border-color .2s, background-color .2s, color .2s;
}
.cetasni-pt .cpt-filter:hover { border-color: var(--pt-navy); }
.cetasni-pt .cpt-filter:focus-visible { outline: 3px solid var(--pt-yellow); outline-offset: 2px; }
.cetasni-pt .cpt-filter.is-active,
.cetasni-pt .cpt-filter.is-active:hover { background: var(--pt-navy); border-color: var(--pt-navy); color: #fff; }
.cpt-year select {
	padding: .55em 2.2em .55em 1em; border: 1.5px solid var(--pt-line); border-radius: 999px;
	background: #fff; color: var(--pt-navy); font: inherit; font-size: .92rem; cursor: pointer;
}

.cpt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 28px; }
.cpt-card[hidden] { display: none; }
.cpt-card__link {
	display: flex; flex-direction: column; height: 100%;
	background: #fff; border-radius: var(--pt-radius); overflow: hidden;
	box-shadow: 0 1px 2px rgba(9, 34, 66, .06), 0 8px 24px rgba(9, 34, 66, .08);
	border-bottom: 4px solid transparent;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.cpt-card__link:hover,
.cpt-card__link:focus-visible {
	transform: translateY(-4px); border-bottom-color: var(--pt-yellow);
	box-shadow: 0 2px 4px rgba(9, 34, 66, .08), 0 16px 36px rgba(9, 34, 66, .16);
}
.cpt-card__link:focus-visible { outline: 3px solid var(--pt-yellow); outline-offset: 3px; }
.cpt-card__media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--pt-soft); }
.cpt-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.cpt-card__link:hover .cpt-card__media img { transform: scale(1.05); }
.cpt-card__count {
	position: absolute; left: 12px; bottom: 12px; padding: .35em .75em; border-radius: 999px;
	background: rgba(9, 34, 66, .85); color: #fff; font-size: .8rem; font-weight: 600; letter-spacing: .02em;
	backdrop-filter: blur(4px);
}
.cpt-card__count::before {
	content: ""; display: inline-block; width: 1em; height: .8em; margin-right: .45em; vertical-align: -.05em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M8 0 6.2 2.5H2A2 2 0 0 0 0 4.5V18a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V4.5a2 2 0 0 0-2-2h-4.2L16 0H8Zm4 5.5a5.5 5.5 0 1 1 0 11 5.5 5.5 0 0 1 0-11Zm0 2.5a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%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 24 20'%3E%3Cpath d='M8 0 6.2 2.5H2A2 2 0 0 0 0 4.5V18a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V4.5a2 2 0 0 0-2-2h-4.2L16 0H8Zm4 5.5a5.5 5.5 0 1 1 0 11 5.5 5.5 0 0 1 0-11Zm0 2.5a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cpt-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.cpt-card__tag { color: var(--pt-blue); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cpt-card__title { color: var(--pt-navy); font-size: 1.12rem; font-weight: 700; line-height: 1.3; }
.cpt-card__date { color: var(--pt-muted); font-size: .88rem; }
.cpt-empty { padding: 40px 0; text-align: center; color: var(--pt-muted); }

/* ---------- Page d'un album ---------- */
.cpt-album { padding-top: 26px; padding-bottom: 60px; }
.cpt-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: .88rem; color: var(--pt-muted); }
.cetasni-pt .cpt-crumbs a { color: var(--pt-blue); }
.cetasni-pt .cpt-crumbs a:hover { color: var(--pt-navy); text-decoration: underline; }
.cpt-album__head { margin-bottom: 28px; }
.cpt-album__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 16px; color: var(--pt-navy); font-weight: 600; }
.cpt-album__meta > * + *::before { content: "•"; margin-right: 18px; color: var(--pt-yellow); text-shadow: 0 0 1px var(--pt-navy); }
.cetasni-pt .cpt-album__meta a { color: var(--pt-blue); }
.cpt-album__desc { max-width: 780px; font-size: 1.05rem; line-height: 1.65; }
.cpt-album__desc p:last-child { margin-bottom: 0; }
.cpt-album__foot { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--pt-line); display: grid; gap: 24px; }
.cpt-adjs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cetasni-pt .cpt-adj {
	display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--pt-line);
	border-radius: var(--pt-radius); color: var(--pt-navy); font-weight: 600; line-height: 1.3;
	transition: border-color .2s, background-color .2s;
}
.cetasni-pt .cpt-adj:hover { border-color: var(--pt-navy); background: var(--pt-soft); }
.cpt-adj--next { grid-column: 2; flex-direction: row-reverse; text-align: right; }
.cpt-adj img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.cpt-adj small { display: block; color: var(--pt-muted); font-weight: 400; font-size: .8rem; margin-bottom: 2px; }

/* ---------- Galerie « justifiée » (rangées de hauteur égale, ordre conservé) ---------- */
.cpt-gallery { --row: 250px; display: flex; flex-wrap: wrap; gap: 8px; }
.cpt-gallery::after { content: ""; flex-grow: 1000000; }
.cpt-gallery--compact { --row: 190px; }
.cpt-gallery__item {
	position: relative; display: block; overflow: hidden; border-radius: 6px; background: var(--pt-soft);
	flex-grow: calc(var(--r) * 100); flex-basis: calc(var(--r) * var(--row)); aspect-ratio: var(--r);
	cursor: zoom-in;
}
.cpt-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease, filter .3s; }
.cpt-gallery__item::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 0 var(--pt-yellow); transition: box-shadow .2s; }
.cpt-gallery__item:hover img { transform: scale(1.04); filter: brightness(1.05); }
.cpt-gallery__item:focus-visible { outline: none; }
.cpt-gallery__item:focus-visible::after { box-shadow: inset 0 0 0 4px var(--pt-yellow); }
@media (max-width: 767px) {
	.cpt-gallery { --row: 150px; gap: 5px; }
	.cpt-gallery--compact { --row: 120px; }
	.cpt-grid { gap: 20px; }
	.cpt-adjs { grid-template-columns: 1fr; }
	.cpt-adj--next { grid-column: auto; }
}

/* ---------- Extrait d'album dans un article ---------- */
.cpt-extrait { margin: 28px 0; }
.cpt-extrait__cta { margin: 18px 0 0; text-align: center; }

/* ---------- Visionneuse ---------- */
.cpt-lb {
	position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
	background: rgba(5, 14, 28, .96); color: #fff; opacity: 0; transition: opacity .2s ease;
	font-family: inherit; -webkit-user-select: none; user-select: none; touch-action: pan-y;
}
.cpt-lb[hidden] { display: none; }
.cpt-lb.is-open { opacity: 1; }
.cpt-lb__stage { position: absolute; inset: 56px 72px 64px; display: flex; align-items: center; justify-content: center; }
.cpt-lb__img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); transition: opacity .2s; }
.cpt-lb.is-loading .cpt-lb__img { opacity: .35; }
.cpt-lb.is-loading .cpt-lb__stage::after {
	content: ""; position: absolute; width: 38px; height: 38px; border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .25); border-top-color: #ffe800; animation: cpt-spin .8s linear infinite;
}
@keyframes cpt-spin { to { transform: rotate(360deg); } }
.cpt-lb button,
.cpt-lb button:hover,
.cpt-lb button:focus {
	position: absolute; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0;
	width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff;
	font: 400 30px/1 system-ui, sans-serif; cursor: pointer; transition: background-color .2s, color .2s;
}
.cpt-lb button:hover { background: #ffe800; color: #092242; }
.cpt-lb button:focus-visible { outline: 3px solid #ffe800; outline-offset: 2px; }
.cpt-lb .cpt-lb__close { top: 12px; right: 12px; font-size: 28px; }
.cpt-lb .cpt-lb__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.cpt-lb .cpt-lb__next { right: 14px; top: 50%; transform: translateY(-50%); }
.cpt-lb__bar {
	position: absolute; left: 0; right: 0; bottom: 0; min-height: 56px; padding: 12px 20px;
	display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: .92rem;
}
.cpt-lb__caption { opacity: .9; }
.cpt-lb__count { margin-left: auto; opacity: .75; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 767px) {
	.cpt-lb__stage { inset: 56px 0 64px; }
	.cpt-lb .cpt-lb__prev, .cpt-lb .cpt-lb__next { top: auto; bottom: 6px; transform: none; width: 44px; height: 44px; }
	.cpt-lb .cpt-lb__prev { left: 8px; }
	.cpt-lb .cpt-lb__next { right: 8px; }
	.cpt-lb__bar { padding: 12px 64px; justify-content: center; }
	.cpt-lb__caption { display: none; }
	.cpt-lb__count { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.cetasni-pt *, .cpt-lb, .cpt-lb * { transition: none !important; animation: none !important; }
}
