/* =========================================================
   Polaris GSheet Events — styles front-end
   Variables : --pgs-cal-* pour le calendrier
               --pgs-actu-* pour le bloc actualités
   ========================================================= */

/* Les custom properties --pgs-* sont injectées par inject_css_vars() dans <head>.
   Ce fichier ne redéfinit pas de :root pour éviter de les écraser
   (ce CSS est chargé dans le footer via shortcode). */
:root {
	--pgs-cal-height       : 650px;
	--pgs-cal-border       : #e5e7eb;
	--pgs-cal-radius       : 8px;
	--pgs-actu-card-shadow : 0 4px 12px rgba(0,0,0,.18);
	--pgs-actu-card-radius : 8px;
	--pgs-actu-gap         : 1.5rem;
	--pgs-modal-backdrop   : rgba(0,0,0,.55);
	--pgs-modal-radius     : 12px;
	--pgs-modal-max-width  : 560px;
}

/* ----- Calendrier wrapper ----- */
.pgs-calendar-wrap {
	width: 100%;
}

.pgs-calendar-wrap #pgs-calendar {
	min-height: var(--pgs-cal-height);
}

/* Boutons FullCalendar */
.pgs-calendar-wrap .fc-button-primary {
	background-color: var(--pgs-cal-primary) !important;
	border-color    : var(--pgs-cal-primary) !important;
	color           : var(--pgs-cal-btn-text) !important;
}
.pgs-calendar-wrap .fc-button-primary:hover,
.pgs-calendar-wrap .fc-button-primary:not(:disabled):active,
.pgs-calendar-wrap .fc-button-primary:not(:disabled).fc-button-active {
	background-color: var(--pgs-cal-primary-hover) !important;
	border-color    : var(--pgs-cal-primary-hover) !important;
	color           : var(--pgs-cal-btn-text-hover) !important;
}

/* Événements */
.pgs-calendar-wrap .fc-event {
	background-color: var(--pgs-cal-event-bg);
	border-color    : var(--pgs-cal-event-bg);
	color           : var(--pgs-cal-event-text);
	border-radius   : 4px;
	padding         : 1px 4px;
	cursor          : pointer;
}

/* Aujourd'hui */
.pgs-calendar-wrap .fc-day-today {
	background-color: var(--pgs-cal-today-bg) !important;
}

/* Texte général (numéros des jours) */
.pgs-calendar-wrap .fc-daygrid-day-number,
.pgs-calendar-wrap .fc-timegrid-slot-label {
	color: var(--pgs-cal-text);
	text-decoration: none;
}

/* Vue agenda — fond coloré + texte blanc + pas de hover */
.pgs-calendar-wrap .fc-list-event td {
	background-color: var(--pgs-cal-event-bg);
}
.pgs-calendar-wrap .fc-list-event:hover td {
	background-color: var(--pgs-cal-event-bg) !important;
}
.pgs-calendar-wrap .fc-list-event-title a,
.pgs-calendar-wrap .fc-list-event-time {
	color          : var(--pgs-cal-event-text) !important;
	text-decoration: none;
}
.pgs-calendar-wrap .fc-list-event-dot {
	border-color: var(--pgs-cal-event-text) !important;
}

/* Titre mois / année */
.pgs-calendar-wrap .fc-toolbar-title {
	font-size: 40px;
}

/* En-têtes (nom du mois dans le titre, noms des jours de la semaine) */
.pgs-calendar-wrap .fc-toolbar-title,
.pgs-calendar-wrap .fc-col-header-cell-cushion,
.pgs-calendar-wrap .fc-list-day-text,
.pgs-calendar-wrap .fc-list-day-side-text {
	color: var(--pgs-cal-header-text);
	text-decoration: none;
}

/* ----- Modale ----- */
.pgs-modal {
	position: fixed;
	inset   : 0;
	z-index : 99999;
	display : flex;
	align-items    : center;
	justify-content: center;
}
.pgs-modal[hidden] {
	display: none;
}

.pgs-modal__backdrop {
	position        : absolute;
	inset           : 0;
	background      : var(--pgs-modal-backdrop);
}

.pgs-modal__box {
	position        : relative;
	background      : #fff;
	border-radius   : var(--pgs-modal-radius);
	max-width       : var(--pgs-modal-max-width);
	width           : calc(100% - 2rem);
	max-height      : 90vh;
	overflow-y      : auto;
	box-shadow      : 0 20px 60px rgba(0,0,0,.3);
	z-index         : 1;
}

.pgs-modal__image img {
	width        : 100%;
	max-height   : 220px;
	object-fit   : cover;
	border-radius: var(--pgs-modal-radius) var(--pgs-modal-radius) 0 0;
	display      : block;
}

.pgs-modal__body {
	padding: 1.5rem;
}

.pgs-modal__close {
	position        : absolute;
	top             : .75rem;
	right           : .75rem;
	background      : rgba(0,0,0,.15);
	border          : none;
	border-radius   : 50%;
	width           : 2rem;
	height          : 2rem;
	cursor          : pointer;
	font-size       : 1rem;
	z-index         : 2;
	color           : #fff;
	display         : flex;
	align-items     : center;
	justify-content : center;
	line-height     : 1;
	padding         : 0;
}
.pgs-modal__close:hover {
	background: rgba(0,0,0,.35);
}

.pgs-modal__title {
	margin   : 0 0 .25rem;
	font-size: 1.25rem;
}

.pgs-modal__date {
	color     : var(--pgs-actu-muted);
	font-size : .9rem;
	margin    : 0 0 1rem;
}

.pgs-modal__meta {
	display              : grid;
	grid-template-columns: max-content 1fr;
	gap                  : .25rem .75rem;
	margin               : 0 0 1rem;
	font-size            : .9rem;
}
.pgs-modal__meta dt {
	font-weight: 600;
	color      : #374151;
}
.pgs-modal__meta dd {
	margin: 0;
	color : #111827;
}

.pgs-modal__description {
	font-size  : .9rem;
	color      : #374151;
	margin     : 0 0 1.25rem;
	white-space: pre-line;
}

.pgs-modal__actions {
	display : flex;
	gap     : .75rem;
	flex-wrap: wrap;
}

body.pgs-modal-open {
	overflow: hidden;
}

/* ----- Boutons actions modale ----- */
.pgs-btn {
	display        : inline-block;
	padding        : .5rem 1.25rem;
	border-radius  : 6px;
	font-size      : .9rem;
	text-decoration: none;
	font-weight    : 600;
	transition     : opacity .15s;
}
.pgs-btn:hover { opacity: .85; }

.pgs-btn--primary {
	background: var(--pgs-btn-primary-bg);
	color     : var(--pgs-btn-primary-text);
}
.pgs-btn--secondary {
	background: var(--pgs-btn-secondary-bg);
	color     : var(--pgs-btn-secondary-text);
	border    : 1px solid #d1d5db;
}

/* ----- Single événement ----- */
.pgs-single-event__inner {
	max-width : 800px;
	margin    : 2rem auto;
	padding   : 0 1rem;
}

.pgs-single-event__image img {
	width        : 100%;
	max-height   : 360px;
	object-fit   : cover;
	border-radius: var(--pgs-cal-radius);
	margin-bottom: 1.5rem;
	display      : block;
}

.pgs-single-event__cat {
	display       : inline-block;
	background    : var(--pgs-cal-primary);
	color         : #fff;
	font-size     : .75rem;
	font-weight   : 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	padding       : .2em .6em;
	border-radius : 4px;
	margin-bottom : .5rem;
}

.pgs-single-event__title {
	font-size    : 1.75rem;
	margin       : .25rem 0 .4rem;
}

.pgs-single-event__datetime {
	color      : var(--pgs-actu-muted);
	font-size  : .95rem;
	margin     : 0 0 1.5rem;
}

.pgs-single-event__desc {
	font-size    : 1rem;
	line-height  : 1.7;
	margin-bottom: 1.5rem;
	color        : #374151;
}

.pgs-single-event__meta {
	display              : grid;
	grid-template-columns: max-content 1fr;
	gap                  : .4rem .75rem;
	margin-bottom        : 1.5rem;
	font-size            : .95rem;
}
.pgs-single-event__meta dt {
	font-weight: 600;
	color      : #374151;
}
.pgs-single-event__meta dd {
	margin: 0;
	color : #111827;
}

.pgs-link-maps {
	display    : inline-block;
	margin-left: .5em;
	font-size  : .85em;
	color      : var(--pgs-cal-primary);
}

.pgs-single-event__grid {
	display              : grid;
	grid-template-columns: 1fr 1fr;
	gap                  : 2rem;
	align-items          : start;
	margin-bottom        : 1.5rem;
}

@media (max-width: 640px) {
	.pgs-single-event__grid { grid-template-columns: 1fr; }
}

.pgs-single-event__col-map iframe {
	width        : 100%;
	min-height   : 320px;
	height       : 100%;
	border       : 0;
	border-radius: var(--pgs-cal-radius);
	display      : block;
}

.pgs-single-event__actions {
	display  : flex;
	gap      : .75rem;
	flex-wrap: wrap;
	margin-top: 1.25rem;
}

/* ----- Bloc actualités ----- */
.pgs-actu-grid {
	display              : grid;
	grid-template-columns: repeat(var(--pgs-actu-columns), 1fr);
	gap                  : var(--pgs-actu-gap);
}

@media (max-width: 768px) {
	.pgs-actu-grid { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
	.pgs-actu-grid { grid-template-columns: repeat(2, 1fr); }
}

.pgs-actu-card {
	background   : var(--pgs-actu-card-bg);
	border-radius: var(--pgs-actu-card-radius);
	box-shadow   : var(--pgs-actu-card-shadow);
	display      : flex;
	flex-direction: column;
}

.pgs-actu-card__body {
	padding: 1.5rem;
	flex   : 1;
	display: flex;
	flex-direction: column;
}

.pgs-actu-card__title {
	font-size  : 1.4rem;
	font-weight: 700;
	line-height: 1.25;
	margin     : 0 0 .75rem;
}

.pgs-actu-card__title a {
	color          : var(--pgs-actu-text);
	text-decoration: underline;
}

.pgs-actu-card__title a:hover {
	color: var(--pgs-actu-muted);
}

.pgs-actu-card__meta {
	display    : flex;
	align-items: center;
	gap        : .35rem;
	font-size  : .82rem;
	color      : var(--pgs-actu-muted);
	margin     : 0 0 .75rem;
}

.pgs-actu-card__meta-icon {
	flex-shrink: 0;
	opacity    : .65;
}

.pgs-actu-card__desc {
	font-size : 1rem;
	color     : var(--pgs-actu-muted);
	flex      : 1;
	margin    : 0 0 1.25rem;
	overflow  : hidden;
	display   : -webkit-box;
	-webkit-line-clamp : 3;
	-webkit-box-orient : vertical;
}

.pgs-actu-card__footer {
	margin-top: auto;
	display   : flex;
	gap       : .5rem;
}

.pgs-actu-card__prix {
	font-size  : .9rem;
	font-weight: 600;
	color      : var(--pgs-actu-muted);
}
