/*
Theme Name: Jordanne FM
Description: Thème du site d'information et de radio Jordanne FM (prototype).
Version: 0.4.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: jordannefm
*/

/* Les réglages principaux (couleurs, polices, espacements) sont dans theme.json. */

.jfm-header { position: sticky; top: 0; z-index: 50; }
.jfm-header .wp-block-navigation a { text-decoration: none; }
.jfm-header .wp-block-navigation a:hover { color: var(--wp--preset--color--vert); }
.jfm-logo img { height: 52px; width: auto; display: block; }

.jfm-cat a, .jfm-cat {
	text-transform: uppercase; letter-spacing: .04em; font-weight: 700; font-size: .75rem;
	color: var(--wp--preset--color--bleu); text-decoration: none;
}
.jfm-card .wp-block-post-featured-image img { border-radius: 10px; aspect-ratio: 16/9; object-fit: cover; }
.jfm-card .wp-block-post-title a { text-decoration: none; color: inherit; }
.jfm-card .wp-block-post-title a:hover { color: var(--wp--preset--color--bleu); }
.jfm-une .wp-block-post-featured-image img { border-radius: 14px; aspect-ratio: 16/9; object-fit: cover; }
.jfm-section-title { border-left: 6px solid var(--wp--preset--color--vert); padding-left: .6rem; }

/* Légendes sous les photos */
.wp-block-image figcaption, .wp-element-caption, .wp-block-post-featured-image figcaption {
	font-style: italic; font-size: .85rem; color: #5b6475; margin-top: .4rem; text-align: left;
}
.entry-content blockquote, .wp-block-quote {
	border-left: 5px solid var(--wp--preset--color--vert); margin-left: 0; padding: .4rem 0 .4rem 1rem;
	font-style: italic; color: var(--wp--preset--color--marine);
}
.entry-content iframe { max-width: 100%; }
.wp-block-embed__wrapper iframe { width: 100%; }

/* Lecteur radio persistant */
body { padding-bottom: 76px; }
.jfm-player {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; height: 68px;
	display: flex; align-items: center; gap: 14px; padding: 0 16px;
	background: var(--wp--preset--color--marine); color: #fff; box-shadow: 0 -4px 18px rgba(0,0,0,.25);
	font-family: var(--wp--preset--font-family--quicksand);
}
.jfm-player button.jfm-play {
	flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--wp--preset--color--vert); color: var(--wp--preset--color--marine);
	display: grid; place-items: center;
}
.jfm-player button.jfm-play svg { width: 22px; height: 22px; }
.jfm-player .jfm-now { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.jfm-player .jfm-now small { display: block; opacity: .75; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.jfm-player .jfm-now strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jfm-player select {
	flex: 0 0 auto; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4);
	border-radius: 20px; padding: 6px 10px; font: inherit;
}
.jfm-player select option { color: #111; }
.jfm-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff4d4f; margin-right: 6px; vertical-align: middle; }
.jfm-player.is-playing .jfm-live-dot { animation: jfm-pulse 1.4s infinite; }
@keyframes jfm-pulse { 50% { opacity: .25; } }
@media (max-width: 600px) { .jfm-player select { max-width: 120px; } }

/* Transition de page discrète */
.transition-fade { transition: opacity .2s; }
html.is-animating .transition-fade { opacity: 0; }

/* Ajustements après premier rendu */
.jfm-section-title a { color: var(--wp--preset--color--marine); text-decoration: none; }
.jfm-section-title a:hover { color: var(--wp--preset--color--bleu); }
.jfm-une .wp-block-post-title { font-size: clamp(1.5rem, 2.4vw, 2.1rem) !important; }
.jfm-une .wp-block-post-title a { color: var(--wp--preset--color--marine); text-decoration: none; }
.jfm-card .wp-block-post-title { margin: .6rem 0 .3rem; line-height: 1.3; }
.wp-block-post-terms.jfm-cat { margin-bottom: .2rem; }

.jfm-player .i-pause, .jfm-player.is-playing .i-play { display: none; }
.jfm-player.is-playing .i-pause { display: block; }
@media (max-width: 600px) {
	.jfm-player { gap: 10px; padding: 0 10px; }
	.jfm-player .jfm-now small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.jfm-player select { max-width: 104px; font-size: .8rem; padding: 5px 6px; }
}

/* Podcasts */
.jfm-episodes { list-style: none; margin: 0; padding: 0; }
.jfm-episodes li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #e3e7ef; }
.jfm-episodes li div { min-width: 0; line-height: 1.3; }
.jfm-episodes strong { display: block; font-size: .95rem; }
.jfm-episodes small { color: #5b6475; font-size: .8rem; }
.jfm-episode {
	flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--wp--preset--color--bleu); color: #fff; display: grid; place-items: center;
}
.jfm-episode svg { width: 18px; height: 18px; }
.jfm-episode.is-current { background: var(--wp--preset--color--vert); color: var(--wp--preset--color--marine); }

/* Vidéos YouTube (vignettes, sans cookie) */
.jfm-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.jfm-video { text-decoration: none; color: inherit; font-weight: 600; font-size: .9rem; line-height: 1.3; }
.jfm-video img { width: 100%; height: auto; border-radius: 10px; display: block; margin-bottom: 6px; }

/* Boutons du direct */
.jfm-live-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.jfm-live-buttons button {
	display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-radius: 14px; cursor: pointer;
	background: var(--wp--preset--color--bleu); color: #fff; text-align: left; font: inherit;
}
.jfm-live-buttons button:hover { background: var(--wp--preset--color--marine); }
.jfm-live-buttons svg { flex: 0 0 34px; width: 34px; height: 34px; color: var(--wp--preset--color--vert); }
.jfm-live-buttons strong { display: block; color: var(--wp--preset--color--vert); }
.jfm-live-buttons small { font-size: .82rem; }

/* Cartes (équipe, émissions, pages de la radio) */
.jfm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.jfm-grid figure { margin: 0; }
.jfm-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; }
.jfm-grid h3 { margin: .5rem 0 .2rem; font-size: 1.1rem; }
.jfm-grid p { margin: 0; font-size: .9rem; }
.jfm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.jfm-tiles a {
	display: block; padding: 22px 18px; border-radius: 14px; text-decoration: none;
	background: var(--wp--preset--color--fond); color: var(--wp--preset--color--marine); font-weight: 700;
	border-left: 6px solid var(--wp--preset--color--vert);
}
.jfm-tiles a small { display: block; font-weight: 400; color: #5b6475; margin-top: 4px; }
.jfm-tiles a:hover { background: #e8eef8; }
.jfm-player.is-podcast .jfm-play { background: #fff; }
table.jfm-freq { width: 100%; border-collapse: collapse; }
table.jfm-freq td, table.jfm-freq th { padding: 10px 8px; border-bottom: 1px solid #e3e7ef; text-align: left; }

/* ===== v0.3 : inspirations « sites radio » ===== */
.jfm-header-row { gap: 18px; }
.jfm-header .jfm-nav { flex: 1 1 auto; }
.jfm-header .wp-block-navigation__submenu-container { background: var(--wp--preset--color--marine) !important; border: 0 !important; border-radius: 10px; padding: 8px 0; }
.jfm-header .wp-block-navigation__submenu-container a { padding: 8px 18px !important; }
.jfm-header-tools { gap: 12px; }
.jfm-search .wp-block-search__button { background: transparent; color: #fff; border: 0; padding: 6px; }
.jfm-search .wp-block-search__button svg { fill: #fff; width: 26px; height: 26px; }
.jfm-search .wp-block-search__input { border-radius: 20px; border: 0; padding: 6px 12px; }

/* Bouton « En direct » */
.jfm-pill {
	display: flex; align-items: center; gap: 10px; border: 0; cursor: pointer; text-align: left;
	background: var(--wp--preset--color--marine); color: #fff; border-radius: 40px; padding: 5px 8px 5px 5px; max-width: 290px;
	font: inherit;
}
.jfm-pill img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 40px; background: #fff; }
.jfm-pill > span { min-width: 0; line-height: 1.15; }
.jfm-pill small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--wp--preset--color--vert); font-weight: 700; }
.jfm-pill strong { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jfm-pill em { display: block; font-style: normal; font-size: .75rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jfm-pill svg { flex: 0 0 34px; width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--wp--preset--color--vert); color: var(--wp--preset--color--marine); }
.jfm-pill:hover { background: #0a1a36; }
@media (max-width: 781px) {
	.jfm-pill > span { display: none; }
	.jfm-pill { padding: 4px; }
	.jfm-logo img { height: 42px; }
}

/* Carrousel */
.jfm-carousel { position: relative; }
.jfm-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 16px; }
.jfm-track::-webkit-scrollbar { display: none; }
.jfm-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; color: #fff; text-decoration: none; aspect-ratio: 16 / 9; overflow: hidden; }
.jfm-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jfm-slide-txt {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 26px 22px;
	background: linear-gradient(transparent, rgba(15, 35, 71, .92));
}
.jfm-slide-txt .jfm-cat { color: var(--wp--preset--color--vert); }
.jfm-slide-txt strong { display: block; font-family: var(--wp--preset--font-family--poppins); font-size: clamp(1.15rem, 2.2vw, 1.75rem); line-height: 1.2; margin: 4px 0; }
.jfm-slide-txt small { opacity: .85; }
.jfm-carousel button {
	position: absolute; top: 42%; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
	background: rgba(255, 255, 255, .92); color: var(--wp--preset--color--marine); font-size: 1.6rem; line-height: 1;
}
.jfm-car-prev { left: 12px; } .jfm-car-next { right: 12px; }

/* Titres diffusés */
.jfm-titres { list-style: none; margin: 0; padding: 0; }
.jfm-titres-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.jfm-titres li { position: relative; line-height: 1.2; min-width: 0; }
.jfm-titres img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--wp--preset--color--fond); }
.jfm-t-time {
	position: absolute; top: 6px; left: 6px; background: var(--wp--preset--color--marine); color: #fff;
	font-size: .7rem; font-weight: 700; padding: 2px 6px; border-radius: 6px;
}
.jfm-titres strong { display: block; font-size: .8rem; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jfm-titres small { display: block; font-size: .72rem; color: #5b6475; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jfm-titres-list li { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; column-gap: 14px; padding: 8px 0; border-bottom: 1px solid #e3e7ef; align-items: center; }
.jfm-titres-list img { grid-row: 1 / 3; width: 64px; }
.jfm-titres-list .jfm-t-time { position: static; justify-self: start; grid-column: 2; margin-bottom: 2px; }
.jfm-titres-list strong { font-size: .95rem; margin: 0; }
.jfm-titres-stations a { display: inline-block; margin: 0 6px 8px 0; padding: 6px 14px; border-radius: 20px; background: var(--wp--preset--color--fond); text-decoration: none; font-weight: 600; }
.jfm-titres-stations a[aria-current] { background: var(--wp--preset--color--bleu); color: #fff; }
.jfm-more { text-align: right; font-size: .85rem; font-weight: 700; margin-top: 10px; }
.jfm-more a { text-decoration: none; }

/* À l'antenne */
.jfm-antenne { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.jfm-antenne a { position: relative; display: block; border-radius: 14px; overflow: hidden; color: #fff; text-decoration: none; aspect-ratio: 4 / 3; }
.jfm-antenne img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jfm-antenne-txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 12px; background: linear-gradient(transparent, rgba(15, 35, 71, .9)); }
.jfm-antenne-txt strong { display: block; font-family: var(--wp--preset--font-family--poppins); font-size: 1.1rem; }
.jfm-antenne-txt small { font-size: .8rem; opacity: .9; }
.jfm-antenne-txt em { display: inline-block; font-style: normal; font-size: .7rem; font-weight: 700; text-transform: uppercase; background: var(--wp--preset--color--vert); color: var(--wp--preset--color--marine); padding: 2px 8px; border-radius: 10px; margin-bottom: 4px; }
.jfm-antenne a.is-now { outline: 4px solid var(--wp--preset--color--vert); outline-offset: -4px; }
@media (max-width: 781px) { .jfm-titres-grid { grid-template-columns: repeat(3, 1fr); } }

/* Ajustements mobile v0.3.1 */
@media (max-width: 781px) {
	.jfm-header-row { gap: 8px; }
	.jfm-header-tools { gap: 4px; }
	.jfm-pill img { display: none; }
	.jfm-pill { padding: 0; background: transparent; }
	.jfm-pill svg { flex-basis: 38px; width: 38px; height: 38px; }
	.jfm-slide { aspect-ratio: 4 / 3; }
	.jfm-slide-txt { padding: 40px 16px 14px; }
	.jfm-carousel button { top: 10px; width: 34px; height: 34px; font-size: 1.3rem; }
	.jfm-car-prev { left: auto; right: 52px; }
	.jfm-car-next { right: 10px; }
	.jfm-antenne { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; }
	.jfm-antenne a { flex: 0 0 72%; scroll-snap-align: start; }
}

/* Formulaire de contact */
.jfm-contact label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 14px; }
.jfm-contact label span { color: var(--wp--preset--color--rouge); }
.jfm-contact input, .jfm-contact select, .jfm-contact textarea {
	display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: inherit; font-weight: 400;
	border: 1px solid #c9d1df; border-radius: 10px; background: #fff;
}
.jfm-contact input:focus, .jfm-contact select:focus, .jfm-contact textarea:focus { outline: 2px solid var(--wp--preset--color--bleu); border-color: transparent; }
.jfm-f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .jfm-f-row { grid-template-columns: 1fr; } }
.jfm-hp { position: absolute !important; left: -9999px; }
.jfm-f-rgpd { font-size: .8rem; color: #5b6475; }
.jfm-f-status.is-ok { color: #11724b; font-weight: 700; }
.jfm-f-status.is-error { color: #b32d2e; font-weight: 700; }

/* Contenus extérieurs bloqués avant consentement */
.jfm-embed { position: relative; }
.jfm-embed.is-blocked iframe { visibility: hidden; min-height: 220px; }
.jfm-embed-ph { display: none; }
.jfm-embed.is-blocked .jfm-embed-ph {
	display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 6px;
	position: absolute; inset: 0; padding: 20px; border-radius: 12px; background: var(--wp--preset--color--fond); border: 1px dashed #c9d1df;
}
.jfm-embed-ph p { margin: 0; font-size: .9rem; }

/* Bandeau cookies */
.jfm-consent { position: fixed; left: 16px; right: 16px; bottom: 84px; z-index: 200; display: flex; justify-content: center; }
.jfm-consent[hidden] { display: none; }
.jfm-consent-box {
	max-width: 760px; background: #fff; color: var(--wp--preset--color--texte); border-radius: 16px; padding: 20px 22px;
	box-shadow: 0 10px 40px rgba(15, 35, 71, .35); border-top: 6px solid var(--wp--preset--color--vert); font-size: .9rem;
}
.jfm-consent-title { font-family: var(--wp--preset--font-family--poppins); font-weight: 700; font-size: 1.1rem; margin: 0 0 6px; color: var(--wp--preset--color--marine); }
.jfm-consent-details label { display: block; margin: 8px 0; }
.jfm-consent-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.jfm-consent-actions button {
	flex: 1 1 140px; padding: 11px 14px; border-radius: 30px; font: inherit; font-weight: 700; cursor: pointer;
	border: 2px solid var(--wp--preset--color--bleu); background: #fff; color: var(--wp--preset--color--bleu);
}
.jfm-consent-actions button[data-jfm-consent=accept], .jfm-consent-actions button[data-jfm-consent=refuse] {
	background: var(--wp--preset--color--bleu); color: #fff;
}
