/* =========================================================
   ЛисаПарк — календарь афиши по неделям
   Подключать ПОСЛЕ style.css. Использует переменные style.css.
   ========================================================= */
:root {
	--color-calendar-1: rgb(20,20,20);
	--color-calendar-2: #F28021;
	--color-calendar-3: rgb(255,255,255);
	--color-calendar-4: rgb(120 120 120);
	--color-calendar-5: #D67626;
	--color-calendar-6: #e9b386;
	--color-calendar-7: #fcfaf2;
	--color-calendar-8: #f4f4f4;
	--color-calendar-9: #ffefd9;
} 
   
/* Старая лента дат остаётся в коде (на неё завязан script.js), но скрыта */
.lp-cal-on .aff-date-box { display: none; }

.lp-cal { max-width: 900px; margin: 10px auto 26px; }

/* Шапка: месяц и стрелки */
.lp-cal__head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.lp-cal__month {
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 34px; font-weight: 700; line-height: 1;
    color: var(--color-calendar-1); text-transform: uppercase;
}
.lp-cal__nav {
    width: 40px; height: 40px; border-radius: 50%;
    border: 2px solid var(--color-calendar-2); background: var(--color-calendar-3);
    color: var(--color-calendar-2); font-size: 30px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s;
}
.lp-cal__nav:hover:not(:disabled) { background: var(--color-calendar-2); color: var(--color-calendar-3); }
.lp-cal__nav:disabled { opacity: .3; cursor: default; }
.lp-cal__nav:focus-visible, .lp-cal__day:focus-visible { outline: 2px solid var(--color-calendar-2); outline-offset: 2px; }
.lp-cal__day * {
	font-family: sans-serif;
}

/* Дни недели */
.lp-cal__weekdays, .lp-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.lp-cal__weekdays div {
    text-align: center; font-size: 14px !important; font-weight: bold;
    color: var(--color-calendar-4); text-transform: uppercase; padding: 0 0 10px;
}
.lp-cal__weekdays div:nth-child(n+6) { color: var(--color-calendar-5); }

/* Сетка */
.lp-cal__grid {
    border: 1px solid var(--color-calendar-6); border-radius: 20px; overflow: hidden;
    background: var(--color-calendar-3);
	gap: 1px;
    background-color: var(--color-calendar-6);
}



.lp-cal__day, .lp-cal__empty {
    min-height: 88px;
	min-width: 88px;
    /*border-right: 1px solid var(--color-calendar-6); border-bottom: 1px solid var(--color-calendar-6);*/
}
.lp-cal__grid > :nth-child(7n) { border-right: 0; }
.lp-cal__empty { background: var(--color-calendar-7); background: var(--color-calendar-8);}

.lp-cal__day {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    background: var(--color-calendar-3); padding: 6px 2px; cursor: pointer;
    font: inherit; color: var(--color-calendar-1); width: 100%;
    border-top: 0; border-left: 0;
    transition: background .15s;
}
.lp-cal__day.is-weekend { background: var(--color-calendar-7); }
.lp-cal__num { font-size: 22px; font-weight: bold; line-height: 1; }
.lp-cal__count, .lp-cal__count * { font-size: 12px; color: var(--color-calendar-5); font-weight: bold; white-space: nowrap;}
.lp-cal__num { color: inherit; }
.lp-cal__day:hover:not(:disabled) { background: var(--color-calendar-9); }

/* Сегодня */
.lp-cal__day.is-today .lp-cal__num { color: var(--color-calendar-2); }
.lp-cal__day.is-today .lp-cal__num::after {
    content: ''; display: block; width: 18px; height: 3px; border-radius: 2px;
    background: var(--color-calendar-2); margin: 4px auto 0;
}

/* Выбранный день */
.lp-cal__day.is-selected {
    background: var(--color-calendar-9);
    box-shadow: inset 0 0 0 2px var(--color-calendar-2);
}
.lp-cal__grid>*:first-child{
	border-radius: 20px 0px 0px 0px;
}
.lp-cal__grid>*:nth-child(7){
	border-radius: 0px 20px 0px 0px;
}
.lp-cal__grid>*:last-child{
	border-radius: 0px 0px 20px 0px;
}
.lp-cal__grid>*:nth-child(7n + 1):nth-last-child(-n + 7){
	border-radius: 0px 0px 0px 20px;
}

/* Дни без спектаклей и прошедшие */
.lp-cal__day:disabled { cursor: default; background: var(--color-calendar-3); }
.lp-cal__day.is-weekend:disabled { background: var(--color-calendar-7); }
.lp-cal__day:disabled .lp-cal__num { color: #cfcfcf; font-weight: normal; }

/* Подпись под календарём */
.lp-cal__legend {
    display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center;
    margin-top: 12px; font-size: 14px; color: var(--color-calendar-4);
}
.lp-cal__legend span::before {
    content: ''; display: inline-block; width: 14px; height: 14px; border-radius: 4px;
    vertical-align: -2px; margin-right: 6px; border: 1px solid var(--color-calendar-6);
}
.lp-cal__legend .lg-weekend::before { background: var(--color-calendar-7); }
.lp-cal__legend .lg-selected::before { background: var(--color-calendar-9); border: 2px solid var(--color-calendar-2); }
.lp-cal__legend .lg-spect {display: none;}
.lp-cal__legend .lg-spect::before {
	background: url(../images/theatermasks3.png);
	background-position: center center !important;
	background-repeat: no-repeat !important;
	background-size: contain !important;
	border: none;
}

/* Заголовок выбранного дня над списком спектаклей */
.lp-cal__selected-title {
    font-family: 'Montserrat Alternates', sans-serif; font-size: 24px; font-weight: 700;
    text-align: center; margin: 4px 0 14px;
}

@media (max-width: 640px) {
    .lp-cal__month { font-size: 24px; }
    .lp-cal__nav { width: 34px; height: 34px; font-size: 17px; }
    .lp-cal__day, .lp-cal__empty { min-height: 56px; min-width: initial; min-width: 40px;}
    .lp-cal__num { font-size: 17px; }
    .lp-cal__count .lp-cal__word { display: none; }   /* на телефоне только число */
	.lp-cal__count, .lp-cal__count * {margin-left: -14px; font-size: 12px;}
	/*.lp-cal__count:after {content: none;}*/
	.lp-cal__legend .lg-spect {display: inline-block;}
	.lp-cal__count:after {
		content: '';
		background: url(../images/theatermasks3.png);
		background-position: center center !important;
		background-repeat: no-repeat !important;
		background-size: contain !important;
		position: absolute;
		width: 12px;
        height: 12px;
        top: 2px;
        right: -16px;
	}
    .lp-cal__weekdays div { font-size: 12px; }
    .lp-cal__grid { border-radius: 14px; }
	.lp-cal__grid>*:first-child{border-radius: 14px 0px 0px 0px;}
	.lp-cal__grid>*:nth-child(7){border-radius: 0px 14px 0px 0px;}
	.lp-cal__grid>*:last-child{border-radius: 0px 0px 14px 0px;}
	.lp-cal__grid>*:nth-child(7n + 1):nth-last-child(-n + 7){border-radius: 0px 0px 0px 14px;}
}
@media (prefers-reduced-motion: reduce) { .lp-cal__day, .lp-cal__nav { transition: none; } }
