/* Chamagnieu Plongée — compléments au theme.json */

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

/* ---------- En-tête ---------- */
.cp-header { z-index: 50; box-shadow: 0 1px 0 rgb(255 255 255 / 0.08); }
.cp-header .wp-block-site-title a { text-decoration: none; }
.cp-header .wp-block-navigation a { text-decoration: none; }
.cp-header .wp-block-navigation a:hover { color: var(--wp--preset--color--turquoise); }
.cp-header .wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--accent-3) !important;
	border: 0 !important;
	border-radius: 12px;
	padding: 0.5rem 0;
	box-shadow: 0 12px 30px rgb(0 0 0 / 0.25);
	min-width: 240px !important;
}
.cp-header .wp-block-navigation__submenu-container a { padding: 0.45rem 1.1rem !important; }
.cp-logo { display: block; flex-shrink: 0; }
.cp-brand .wp-block-site-title { white-space: nowrap; }
.admin-bar .cp-header { top: 32px !important; }
@media (max-width: 782px) { .admin-bar .cp-header { top: 0 !important; } }
@media (max-width: 600px) {
	.cp-header .wp-block-buttons.cp-header-cta { display: none; }
	.cp-brand .wp-block-site-title { font-size: 1.1rem !important; }
}

/* ---------- Bandeau titre des pages ---------- */
.cp-page-hero { position: relative; overflow: hidden; }
.cp-page-hero::after {
	content: "";
	position: absolute; inset: auto 0 -1px 0; height: 28px;
	background: var(--wp--preset--color--base);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28V14c100-12 200-12 300 0s200 12 300 0 200-12 300 0 200 12 300 0v14z'/%3E%3C/svg%3E") center / 100% 100%;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28V14c100-12 200-12 300 0s200 12 300 0 200-12 300 0 200 12 300 0v14z'/%3E%3C/svg%3E") center / 100% 100%;
}

/* ---------- Contenu ---------- */
.cp-content img:not(.wp-block-cover__image-background) { border-radius: 12px; height: auto; max-width: 100%; }
.cp-content h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.cp-content li h4 { margin: 0; font-size: inherit; font-weight: 600; }

/* Tableaux (tarifs, horaires) — hors calendrier de réservation (tables FullCalendar « fc-* ») */
.cp-content table:not([class*="fc-"]) {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	border: 1px solid #d5e4e6;
	border-radius: 12px;
	overflow: hidden;
}
.cp-content table:not([class*="fc-"]) :is(th, td) { padding: 0.65rem 0.9rem; border: 0; border-bottom: 1px solid #e3eef0; vertical-align: top; text-align: left; }
.cp-content table:not([class*="fc-"]) > thead :is(th, td) {
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--base);
	font-weight: 700;
}
.cp-content table:not([class*="fc-"]) > tbody > tr:nth-child(even) > td { background: var(--wp--preset--color--accent-5); }
.cp-content table:not([class*="fc-"]) > tbody > tr:last-child > td { border-bottom: 0; }
.cp-content table:not([class*="fc-"]) caption {
	caption-side: top;
	text-align: left;
	font-weight: 800;
	font-size: 1.15rem;
	color: var(--wp--preset--color--accent-3);
	padding: 0 0 0.6rem;
}
.cp-content .wp-block-table,
.cp-content figure:has(> table) { overflow-x: auto; margin-block: 1.5rem; }

/* ---------- Composants d'accueil ---------- */
.cp-hero { min-height: min(82vh, 780px) !important; }
/* Contenu des bannières pleine largeur aligné sur la grille de 1240px (prime sur la règle double-classe du cœur) */
.wp-block-cover.alignfull.has-custom-content-position.has-custom-content-position > .wp-block-cover__inner-container,
.wp-block-cover.alignfull > .wp-block-cover__inner-container { max-width: 1240px; width: 100%; margin-inline: auto; }
.cp-eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; }
.cp-stats .wp-block-column { border-left: 3px solid var(--wp--preset--color--turquoise); padding-left: 1rem; }
.cp-stat-value { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; line-height: 1; color: var(--wp--preset--color--accent-3); margin: 0; }

.cp-card {
	border-radius: 16px;
	overflow: hidden;
	height: 100%;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cp-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgb(10 39 56 / 0.12); }
.cp-card .wp-block-post-featured-image,
.cp-card .wp-block-image { margin: 0; }
.cp-card .wp-block-image img { border-radius: 0; aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.cp-card h3 a,
.cp-card h2 a { text-decoration: none; }
.cp-card h3 a::after { content: " →"; }

.cp-callout { border-radius: 20px; }
.cp-rounded img { border-radius: 20px; }

.cp-plain-list { list-style: none; padding-left: 0; }
.cp-plain-list li { margin-bottom: 0.45rem; }
.cp-footer a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.cp-card { transition: none; }
	.cp-card:hover { transform: none; }
}

/* ---------- Formulaire de réservation (Booking Activities) ---------- */
.cp-content .bookacti-form-field-label,
.cp-content .bookacti-form-field-content { display: block; width: 100%; float: none; }
.cp-content .bookacti-form-field-content input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.cp-content .bookacti-form-field-content select { max-width: 520px; }
/* Une seule option (réserver sans compte) : le sélecteur est inutile */
.cp-content .bookacti-login-types-hidden { display: none !important; }
.cp-content .bookacti-form-field-label { margin: 1rem 0 0.35rem; font-weight: 700; color: var(--wp--preset--color--accent-3); }
.cp-content .bookacti-form-field-login-field-container { display: block; }
.cp-content .bookacti-form-field-content input[type="text"],
.cp-content .bookacti-form-field-content input[type="email"],
.cp-content .bookacti-form-field-content input[type="tel"],
.cp-content .bookacti-form-field-content input[type="number"],
.cp-content .bookacti-form-field-content select {
	width: 100%;
	box-sizing: border-box;
	padding: 0.7rem 0.9rem;
	font: inherit;
	font-size: 1rem;
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--base);
	border: 1.5px solid #c3d6d9;
	border-radius: 10px;
}
.cp-content .bookacti-form-field-content input:focus,
.cp-content .bookacti-form-field-content select:focus {
	outline: 3px solid color-mix(in srgb, var(--wp--preset--color--accent-1) 35%, transparent);
	border-color: var(--wp--preset--color--accent-1);
}
.cp-content .bookacti-form-field-checkbox-field-container { margin-top: 1.5rem; display: flex; gap: 0.6rem; align-items: flex-start; }
.cp-content .bookacti-form-field-checkbox-field-container input[type="checkbox"] { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; accent-color: var(--wp--preset--color--accent-1); }
.cp-content input.bookacti-submit-form,
.cp-content input.bookacti-new-booking-button {
	margin-top: 1.5rem;
	padding: 0.85em 2em;
	font: inherit;
	font-weight: 700;
	color: var(--wp--preset--color--base);
	background: var(--wp--preset--color--accent-6);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}
.cp-content input.bookacti-submit-form:hover { background: var(--wp--preset--color--accent-3); }
.cp-content .fc { --fc-border-color: #d5e4e6; --fc-today-bg-color: var(--wp--preset--color--accent-5); }
.cp-content .fc .fc-button-primary { background: var(--wp--preset--color--accent-3); border-color: var(--wp--preset--color--accent-3); }
.cp-content .fc .fc-button-primary:not(:disabled).fc-button-active,
.cp-content .fc .fc-button-primary:hover { background: var(--wp--preset--color--accent-1); border-color: var(--wp--preset--color--accent-1); }
.cp-content .fc .fc-event { border-radius: 8px; }

/* ---------- Diaporama (galerie « cp-slideshow », voir assets/slideshow.js) ---------- */
.cp-slideshow-wrapper { position: relative; margin-block: 1.5rem; }
.wp-block-gallery.cp-slideshow.cp-slideshow {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: 0 !important;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	border-radius: 20px;
	background: var(--wp--preset--color--accent-3);
	padding: 0 !important;
	box-sizing: border-box;
	scroll-padding: 0;
}
.wp-block-gallery.cp-slideshow::-webkit-scrollbar { display: none; }
.wp-block-gallery.cp-slideshow:focus-visible { outline: 3px solid var(--wp--preset--color--turquoise); outline-offset: 3px; }
.wp-block-gallery.cp-slideshow.cp-slideshow > figure.wp-block-image {
	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	scroll-snap-align: start;
	position: relative;
	aspect-ratio: 16 / 9;
}
.wp-block-gallery.cp-slideshow > figure.wp-block-image img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	border-radius: 0 !important;
}
.wp-block-gallery.cp-slideshow > figure.wp-block-image figcaption {
	position: absolute; inset: auto 0 0 0;
	margin: 0; padding: 2.5rem 1.4rem 1rem;
	font-size: 1rem; font-weight: 600; text-align: left;
	color: #fff;
	background: linear-gradient(transparent, rgb(10 39 56 / 0.8));
}
.cp-slideshow-nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 48px; height: 48px; padding: 12px;
	border: 0; border-radius: 999px; cursor: pointer;
	color: var(--wp--preset--color--accent-3);
	background: rgb(255 255 255 / 0.9);
	box-shadow: 0 4px 14px rgb(0 0 0 / 0.25);
}
.cp-slideshow-nav:hover, .cp-slideshow-nav:focus-visible { background: #fff; outline: 3px solid var(--wp--preset--color--turquoise); }
.cp-slideshow-nav svg { width: 100%; height: 100%; display: block; }
.cp-prev { left: 14px; } .cp-next { right: 14px; }
.cp-slideshow-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 0.9rem; }
.cp-slideshow-dots button {
	width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
	background: #b9cfd3;
}
.cp-slideshow-dots button[aria-current="true"] { width: 26px; background: var(--wp--preset--color--accent-1); }
@media (max-width: 600px) {
	.wp-block-gallery.cp-slideshow.cp-slideshow > figure.wp-block-image { aspect-ratio: 4 / 3; }
	.cp-slideshow-nav { width: 40px; height: 40px; padding: 10px; }
}
