/**
 * Tema calendario "hoferhof" per MotoPress Hotel Booking.
 *
 * Attivo quando il campo Customizer "hoferhof_calendar_skin_enabled" è spuntato
 * (functions.php enqueue con dipendenza da hoferhof-style → stampa dopo style.css).
 *
 * Il rendering "Default" del plugin resta quello di Albatross in style.css
 * (sezione .datepick ripristinata upstream): questo skin la sovrascrive solo
 * quando è attivo.
 *
 * SCOPI: ogni calendario MPHB vive sotto una di queste radici —
 *   .mphb-calendar           calendario disponibilità inline
 *   .mphb-check-in-datepick  popup del campo check-in (search/booking form)
 *   .mphb-check-out-datepick popup del campo check-out
 *   .mphb-datepick-popup     radice generica dei popup (kbwood pickerClass)
 * La macro :is(…) qui sotto copre tutti i casi; nelle regole critiche
 * (!important) è aggiunta anche la variante composta ad alta specificità
 * .mphb-datepick-popup.mphb-check-in-datepick / …-out per battere le regole
 * upstream a parità di ordine di caricamento.
 *
 * Palette Hoferhof: link #3a7423 (hover/focus #7f223d), accent #7f223d,
 * heading #395337, testo #282828, neutri #e5e5e5/#f7f7f7.
 */

:root {
	--hf-cal-accent: #7f223d;
	--hf-cal-accent-light: #9d4361;
}

/* ------------------------------------------------------------------
   Root / cornice
   ------------------------------------------------------------------ */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup).datepick {
	border-color: #e5e5e5;
	background-color: #fff;
}

/* ------------------------------------------------------------------
   Navigazione (frecce prev/next): link del tema verde → burgundy
   ------------------------------------------------------------------ */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-nav {
	background-color: #fff;
}

:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-nav a {
	color: #3a7423;
}

:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-nav a:hover {
	background-color: transparent;
	color: #7f223d;
}

:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-nav a.datepick-disabled {
	color: rgba(40, 40, 40, 0.35);
}

:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-cmd-next,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-cmd-prev {
	background: #f7f7f7;
	color: #3a7423;
	transition: .3s;
}

/* Hover: cerchio pieno accent + freccia bianca. Il :not(.datepick-disabled)
   serve a battere la regola upstream (#fc9285) di style.css */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-cmd-next:hover:not(.datepick-disabled),
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-cmd-prev:hover:not(.datepick-disabled) {
	color: #fff;
	background-color: #7f223d;
}

/* ------------------------------------------------------------------
   Comando "Today"
   ------------------------------------------------------------------ */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-ctrl .datepick-cmd-today {
	color: #7f223d;
	font-weight: 700;
}

:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-ctrl .datepick-cmd-today:hover {
	background-color: rgba(127, 34, 61, 0.08);
	color: #7f223d;
	text-decoration: none;
}

/* ------------------------------------------------------------------
   Comandi testuali Clear / Close: colori dei link del tema
   (base verde, hover burgundy sottolineato) — contro il rosa upstream
   ------------------------------------------------------------------ */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-cmd-clear,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-cmd-close {
	color: #3a7423;
}

/* Hover/focus decisivi: elemento <a> + variante composta + !important,
   per spegnere qualunque rosa ereditato (es. .datepick a:hover upstream) */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) a.datepick-cmd-clear:hover,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) a.datepick-cmd-clear:focus,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) a.datepick-cmd-close:hover,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) a.datepick-cmd-close:focus,
.mphb-datepick-popup.mphb-check-in-datepick a.datepick-cmd-clear:hover,
.mphb-datepick-popup.mphb-check-in-datepick a.datepick-cmd-clear:focus,
.mphb-datepick-popup.mphb-check-in-datepick a.datepick-cmd-close:hover,
.mphb-datepick-popup.mphb-check-in-datepick a.datepick-cmd-close:focus,
.mphb-datepick-popup.mphb-check-out-datepick a.datepick-cmd-clear:hover,
.mphb-datepick-popup.mphb-check-out-datepick a.datepick-cmd-clear:focus,
.mphb-datepick-popup.mphb-check-out-datepick a.datepick-cmd-close:hover,
.mphb-datepick-popup.mphb-check-out-datepick a.datepick-cmd-close:focus {
	color: #7f223d !important;
	text-decoration: underline !important;
	background-color: transparent !important;
}

/* ------------------------------------------------------------------
   Header mese: Cabin, testo heading
   ------------------------------------------------------------------ */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month-header,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month-header select {
	font-family: "Cabin", sans-serif;
	color: #395337;
}

/* ------------------------------------------------------------------
   Griglia mesi/giorni
   ------------------------------------------------------------------ */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month {
	border-color: #e5e5e5;
}

:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month th,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month th a {
	background-color: #f7f7f7;
	color: #395337;
}

:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month td,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month td .datepick-other-month,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month td .datepick-weekend {
	background-color: #fff;
	color: #282828;
}

/* Giorno corrente */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month td .datepick-today {
	background-color: #fff;
	color: #7f223d;
	font-weight: 700;
}

/* ------------------------------------------------------------------
   Stati non prenotabili: grigi neutri
   ------------------------------------------------------------------ */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-past-date,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-booked-date:not(.mphb-selectable-date) {
	color: rgba(40, 40, 40, 0.35);
}

:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-out-of-season-date--check-in,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-out-of-season-date--check-out,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-out-of-season-date,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-mark-as-unavailable--check-in,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-mark-as-unavailable--check-out,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-mark-as-unavailable {
	background: linear-gradient(135deg, #ececec 6.25%, #ffffff 6.25%, #ffffff 50%, #ececec 50%, #ececec 56.25%, #ffffff 56.25%, #ffffff 100%);
	background-size: 11.31px 11.31px;
	color: rgba(40, 40, 40, 0.4);
}

/* Date non selezionabili: !important + variante composta per battere
   l'upstream a parità di ordine */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-unselectable-date--check-in,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-unselectable-date--check-out,
.mphb-datepick-popup.mphb-check-in-datepick .datepick-month table td .mphb-unselectable-date--check-in,
.mphb-datepick-popup.mphb-check-out-datepick .datepick-month table td .mphb-unselectable-date--check-out {
	color: rgba(40, 40, 40, 0.25) !important;
}

/* ------------------------------------------------------------------
   Highlight (cella in hover): tinta chiara dell'accent, uguale al range
   ------------------------------------------------------------------ */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .datepick-highlight,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td a.datepick-highlight,
.mphb-datepick-popup.mphb-check-in-datepick .datepick-month table td .datepick-highlight,
.mphb-datepick-popup.mphb-check-out-datepick .datepick-month table td .datepick-highlight {
	background-color: var(--hf-cal-accent-light) !important;
	color: #fff !important;
}

/* ------------------------------------------------------------------
   Percorso del range: start + intermedie in accent chiaro
   (!important + variante composta per battere l'upstream)
   ------------------------------------------------------------------ */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-check-in-date,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-selected-date,
.mphb-datepick-popup.mphb-check-in-datepick .datepick-month table td .mphb-check-in-date,
.mphb-datepick-popup.mphb-check-in-datepick .datepick-month table td .mphb-selected-date,
.mphb-datepick-popup.mphb-check-out-datepick .datepick-month table td .mphb-check-in-date,
.mphb-datepick-popup.mphb-check-out-datepick .datepick-month table td .mphb-selected-date {
	background-color: var(--hf-cal-accent-light) !important;
	color: #fff !important;
}

/* La data confermata dal popup aperto (e il check-out scelto) restano
   in accent pieno */
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .datepick-selected,
:is(.mphb-calendar,
	.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) .datepick-month table td .mphb-check-out-date,
.mphb-datepick-popup.mphb-check-in-datepick .datepick-month table td .datepick-selected,
.mphb-datepick-popup.mphb-check-out-datepick .datepick-month table td .datepick-selected,
.mphb-datepick-popup.mphb-check-in-datepick .datepick-month table td .mphb-check-out-date,
.mphb-datepick-popup.mphb-check-out-datepick .datepick-month table td .mphb-check-out-date {
	background-color: var(--hf-cal-accent) !important;
	color: #fff !important;
}

/* Range marcato dal JS del tema (initCalendarRangePreview): intermedie */
.datepick-month td a.hoferhof-in-range,
.datepick-month td span.hoferhof-in-range {
	background-color: var(--hf-cal-accent-light) !important;
	color: #fff !important;
}

/* ------------------------------------------------------------------
   Variabili consumate dal calendario disponibilità gruppi del plugin
   ------------------------------------------------------------------ */
.mphb-calendar.mphb-datepick {
	--mphb-available-date-bg: #ffffff;
	--mphb-available-date-color: #282828;
	--mphb-not-available-date-bg: #ececec;
	--mphb-not-available-date-color: rgba(40, 40, 40, 0.4);
	--mphb-booked-date-bg: #f0f0f0;
	--mphb-booked-date-color: rgba(40, 40, 40, 0.35);
	--mphb-out-of-season-date-bg: #ffffff;
	--mphb-out-of-season-date-color: rgba(40, 40, 40, 0.4);
	--mphb-selected-date-bg: #7f223d;
	--mphb-selected-date-color: #fff;
	--mphb-unselectable-date-color: rgba(40, 40, 40, 0.25);
}

/* Riepilogo date selezionate sotto il calendario */
.mphb-calendar .mphb-calendar__selected-dates {
	color: #282828;
}

/* ------------------------------------------------------------------
   Popup (search form): margini come nei temi plugin
   ------------------------------------------------------------------ */
:is(.mphb-check-in-datepick,
	.mphb-check-out-datepick,
	.mphb-datepick-popup) {
	max-width: 100%;
	padding: 0 1em;
}

@media screen and (min-width: 48em) {
	:is(.mphb-check-in-datepick,
		.mphb-check-out-datepick,
		.mphb-datepick-popup) {
		padding: 0;
	}
}
