/* AcTournai Formations — public pages. Colours come from CSS variables so the theme can restyle them. */
.af-formation {
	--af-accent: #b5006a;
	--af-text: #2b2b2b;
	--af-muted: #666;
	--af-line: #e3e3e3;
	--af-soft: #f6f5f3;
	color: var(--af-text);
}
.af-hero-img { display: block; width: 100%; height: clamp(220px, 42vw, 520px); object-fit: cover; }
.af-hero { position: relative; overflow: hidden; }
/* Header video: same frame as the photo, fades in over it once it actually plays. */
.af-hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.af-hero.is-playing .af-hero-video, .af-hero.is-paused .af-hero-video { opacity: 1; }
.af-hero-toggle { position: absolute; right: 16px; bottom: 16px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; transition: background .15s; }
.af-hero-toggle:hover { background: rgba(0,0,0,.75); }
.af-hero-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px var(--af-accent); }
.af-hero-toggle .af-i-play, .af-hero.is-paused .af-hero-toggle .af-i-pause { display: none; }
.af-hero.is-paused .af-hero-toggle .af-i-play { display: block; }
.af-wrap { max-width: 1240px; margin: 0 auto; padding: 32px 20px 64px; }
/* Top of the page: title + intro (full width) with the contact teacher in a right-hand column */
.af-top.has-aside { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; align-items: start; }
.af-main .af-title { margin-bottom: 24px; }
.af-aside { position: sticky; top: calc(var(--af-sticky-top, 0px) + 80px); padding: 22px 24px; background: var(--af-soft); border-left: 3px solid var(--af-accent); margin-top: 10px; }
.af-title { font-size: clamp(30px, 4vw, 46px); line-height: 1.1; margin: 0; padding: 0; }
.af-contact { margin: 0; font-size: 16px; line-height: 1.4; }
.af-contact span { display: block; margin-bottom: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--af-muted); }
.af-contact a { color: var(--af-accent); font-weight: 600; }
.af-contact + .af-social { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--af-line); }
.af-social > span { display: block; margin-bottom: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--af-muted); }
.af-social ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.af-social ul { gap: 8px; }
.af-social a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--af-accent); border-radius: 50%; color: var(--af-accent); text-decoration: none; transition: background .15s, color .15s; }
.af-social a:hover, .af-social a:focus-visible { background: var(--af-accent); color: #fff; }
.af-social a:focus-visible { outline: 3px solid var(--af-accent); outline-offset: 2px; }
.af-icon { width: 18px; height: 18px; fill: currentColor; }
.af-from { margin-top: 28px; }
.af-from .af-from-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--af-muted); margin: 0 0 10px; padding: 0; font-weight: 600; }
.af-from ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.af-from a { display: inline-block; padding: 6px 14px; border: 1px solid var(--af-line); border-radius: 999px; color: var(--af-text); text-decoration: none; }
.af-from a:hover, .af-from a:focus-visible { border-color: var(--af-accent); color: var(--af-accent); }
.af-intro { font-size: 17px; line-height: 1.7; }
.af-intro h2 { font-size: 24px; margin: 1.6em 0 .5em; }
.af-intro h3 { font-size: 20px; margin: 1.4em 0 .4em; }
.af-programme, .af-gallery-section { margin-top: 56px; }
.af-programme > h2, .af-gallery-section > h2 { font-size: 28px; margin-bottom: 20px; }

.af-year-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 2px solid var(--af-line); margin-bottom: 24px; }
.af-year-tabs[hidden] { display: none; }
.af-year-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 10px 16px; font: inherit; font-weight: 600; color: var(--af-muted); cursor: pointer; }
.af-year-tabs button[aria-selected="true"] { color: var(--af-accent); border-bottom-color: var(--af-accent); }
.af-year-tabs button:focus-visible { outline: 2px solid var(--af-accent); outline-offset: 2px; }
.af-programme.has-tabs .af-year-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.af-year { margin-bottom: 32px; }
.af-year-title { font-size: 22px; }
.af-doc-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.af-doc-cols h4, .af-masters h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--af-muted); margin: 0 0 10px; }
.af-doc-list, .af-masters ul { list-style: none; margin: 0; padding: 0; }
.af-doc-list li { padding: 12px 14px; background: var(--af-soft); border-left: 3px solid var(--af-accent); margin-bottom: 8px; }
.af-doc-list a { font-weight: 600; color: var(--af-text); text-decoration: none; }
.af-doc-list a:hover, .af-doc-list a:focus-visible { color: var(--af-accent); text-decoration: underline; }
.af-doc-meta { display: block; font-size: 12px; color: var(--af-muted); margin-top: 2px; }
.af-note { font-style: italic; color: var(--af-muted); margin-top: 16px; }
.af-masters { margin-top: 24px; }
.af-masters ul { display: flex; flex-wrap: wrap; gap: 8px; }
.af-masters a { display: inline-block; padding: 6px 12px; border: 1px solid var(--af-line); border-radius: 999px; color: var(--af-text); text-decoration: none; }
.af-masters a:hover, .af-masters a:focus-visible { border-color: var(--af-accent); color: var(--af-accent); }

.af-grid { list-style: none; margin: 0; padding: 0; columns: 3 260px; column-gap: 16px; }
.af-grid li { break-inside: avoid; margin-bottom: 16px; }
.af-grid figure { margin: 0; }
.af-grid img { display: block; width: 100%; height: auto; transition: opacity .2s; }
.af-grid a:hover img, .af-grid a:focus-visible img { opacity: .85; }
.af-grid figcaption { font-size: 13px; color: var(--af-muted); padding-top: 6px; line-height: 1.4; }

.af-lb { position: fixed; inset: 0; z-index: 100000; background: rgba(15, 15, 15, .94); display: flex; align-items: center; justify-content: center; padding: 48px 56px; }
.af-lb[hidden] { display: none; }
.af-lb figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.af-lb img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.af-lb figcaption { color: #ddd; font-size: 14px; margin-top: 10px; }
.af-lb button { position: absolute; background: none; border: 0; color: #fff; font-size: 36px; line-height: 1; padding: 8px 14px; cursor: pointer; }
.af-lb button:focus-visible { outline: 2px solid #fff; }
.af-lb-close { top: 10px; right: 10px; font-size: 28px; }
.af-lb-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.af-lb-next { right: 6px; top: 50%; transform: translateY(-50%); }

.af-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.af-card a { display: block; text-decoration: none; color: inherit; }
.af-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.af-card-title { display: block; font-weight: 600; padding-top: 8px; }

@media (max-width: 600px) {
	.af-lb { padding: 48px 8px; }
}

.af-videos-section { margin-top: 56px; }
.af-videos-section > h2 { font-size: 28px; margin-bottom: 20px; }
.af-videos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.af-videos figure { margin: 0; }
.af-videos .as-yt { margin: 0; }
.af-videos figcaption { font-size: 14px; padding-top: 8px; }

/* Section menu (Présentation / Structures / Galerie), sticky under the site header */
.af-subnav { position: sticky; top: var(--af-sticky-top, 0px); z-index: 50; background: #fff; border-bottom: 1px solid var(--af-line); box-shadow: 0 6px 16px rgba(0,0,0,.04); }
.af-subnav ul { list-style: none; margin: 0 auto; padding: 0 20px; max-width: 1240px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.af-subnav li { flex-shrink: 0; padding: 0; }
.af-subnav a { display: block; padding: 14px 14px 12px; font-family: var(--act-head, inherit); font-weight: 600; font-size: 15px; color: var(--af-muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.af-subnav a:hover, .af-subnav a:focus-visible, .af-subnav a.is-active { color: var(--af-accent); border-bottom-color: var(--af-accent); }
.af-formation #presentation, .af-formation #structures, .af-formation #videos, .af-formation #galerie { scroll-margin-top: calc(var(--af-sticky-top, 0px) + 70px); }
/* Scrolling to sections is handled in front.js (Divi overrides native anchor scrolling). */

@media (max-width: 900px) {
	.af-top.has-aside { grid-template-columns: 1fr; gap: 0; }
	.af-aside { position: static; order: -1; margin: 0 0 24px; }
	.af-main .af-title { margin-bottom: 16px; }
	.af-top.has-aside .af-main { display: contents; }
	.af-top.has-aside .af-title { order: -2; }
}
