/* A paper December calendar. Layout follows spacing.css; ink and stickers are optical details. */
#calendar-dialog{
 --calendar-rule:#c4b5a1;--calendar-cell-height:72px;
 width:min(960px,calc(100vw - var(--space-32)));max-width:none;
 max-height:calc(100svh - var(--space-32));padding:var(--space-24);
 border:1px solid #d3c2a7;border-radius:var(--radius-small);
 background:#faf5eb url('assets/calendar-paper.svg');color:#302d26;
 box-shadow:0 24px 96px #06171066;
}
#calendar-dialog .close{top:var(--space-8);right:var(--space-8);background:transparent}
.calendar-masthead{padding-right:0}
#calendar-dialog .calendar-masthead>.eyebrow{margin:0;font:500 8px/16px var(--font-ui);letter-spacing:1.8px}
.calendar-titleline{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-16);margin-bottom:var(--space-16)}
#calendar-dialog #calendar-title{margin:0;font:400 64px/64px 'Monsieur La Doulaise',cursive;color:var(--wine);letter-spacing:0}
.calendar-year{font:400 24px/32px var(--font-display);color:var(--wine)}
.calendar-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--space-8) var(--space-24);margin-bottom:var(--space-16)}
#calendar-dialog .tabs{display:flex;gap:var(--space-24);margin:0;border:0}
#calendar-dialog .tabs button{min-height:32px;min-width:48px;padding:var(--space-8) 0;font:500 11px/16px var(--font-ui);color:#81705e}
#calendar-dialog .tabs button.active{color:var(--wine)}
#calendar-summary{max-width:none;white-space:nowrap;margin:0;font:400 10px/16px var(--font-ui);color:#7c6b59;text-align:right}
.calendar-weekdays{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));text-align:center;font:500 10px/24px var(--font-ui);letter-spacing:1px;text-transform:uppercase;color:var(--wine)}
#calendar-dialog #film-list{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));max-height:none;overflow:visible;border-top:1px solid var(--calendar-rule);border-left:1px solid var(--calendar-rule)}
.calendar-day,.calendar-quiet{position:relative;min-width:0;min-height:var(--calendar-cell-height);border:0;border-right:1px solid var(--calendar-rule);border-bottom:1px solid var(--calendar-rule);border-radius:0;padding:var(--space-8);background:transparent;text-align:left;color:#4d4237}
.calendar-day{display:flex;flex-direction:column;align-items:flex-start;transition:background .18s,opacity .18s}
.calendar-day:enabled:hover{background:#eddfcb66}
.calendar-day:focus-visible{z-index:2;outline:none}
.calendar-number{position:relative;display:block;font:400 22px/24px var(--font-display);color:var(--wine)}
.calendar-film{position:absolute;left:var(--space-8);right:var(--space-8);bottom:var(--space-8);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-height:32px;font:400 10px/16px var(--font-ui);color:#5f5346}
.calendar-day.has-sticker .calendar-film{max-width:calc(100% - var(--space-48))}
.calendar-sticker{position:absolute;right:0;bottom:var(--space-4);width:var(--space-56);height:var(--space-56);object-fit:contain;pointer-events:none;transform:rotate(var(--sticker-turn));filter:drop-shadow(0 2px 2px #49301b22)}
.calendar-marker{display:flex;align-items:center;gap:var(--space-4);z-index:1;position:absolute;top:var(--space-8);right:var(--space-8);color:var(--wine)}
.calendar-marker .button-icon{width:12px;height:12px}
.calendar-marker .icon-heart{color:var(--wine)}
.calendar-marker .icon-watched{color:#31573e}
.calendar-day.is-watched .calendar-film{color:#486147}
.calendar-day.is-muted{opacity:1;cursor:default}
.calendar-day.is-muted>*{opacity:.22}
.calendar-day.is-muted .calendar-sticker{filter:grayscale(1);opacity:.11}
.calendar-quiet .calendar-number{opacity:.5}
.calendar-quiet.is-outside .calendar-number{opacity:.2}
.calendar-christmas{position:absolute;left:var(--space-8);right:var(--space-8);bottom:var(--space-8);font:400 28px/32px 'Monsieur La Doulaise',cursive;color:var(--wine);text-align:center}
.calendar-footer{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:var(--space-8) var(--space-24);margin-top:var(--space-16)}
.calendar-legend{display:flex;gap:var(--space-16);font:400 9px/16px var(--font-ui);color:#7c6b59}
.calendar-legend>span{display:inline-flex;align-items:center;gap:var(--space-4)}
.calendar-legend .button-icon{width:12px;height:12px;color:var(--wine)}
.calendar-legend>span:last-child .button-icon{color:#31573e}
@media(max-height:760px) and (min-width:601px){
 #calendar-dialog{--calendar-cell-height:64px;padding:var(--space-16)}
 #calendar-dialog #calendar-title{font-size:56px;line-height:48px}
 .calendar-film{-webkit-line-clamp:1;max-height:16px}
 .calendar-sticker{width:var(--space-40);height:var(--space-40)}
}
@media(max-width:600px){
 #calendar-dialog{--calendar-cell-height:64px;width:calc(100vw - var(--space-16));max-height:calc(100svh - var(--space-16));padding:var(--space-16)}
 .calendar-masthead{padding-right:0}
 #calendar-dialog #calendar-title{font-size:56px;line-height:56px}
 .calendar-year{font-size:20px;line-height:24px}
 .calendar-toolbar{flex-direction:column;align-items:flex-start;gap:var(--space-8)}
 #calendar-dialog .tabs{gap:var(--space-16)}
 #calendar-summary{width:100%;max-width:none;font-size:9px;text-align:left}
 .calendar-weekdays{font-size:8px;letter-spacing:0}
 .calendar-day,.calendar-quiet{padding:var(--space-4)}
 .calendar-number{font-size:16px;line-height:24px}
 .calendar-film{display:none}
 .calendar-sticker{width:var(--space-32);height:var(--space-32);right:var(--space-4)}
 .calendar-marker{top:var(--space-4);right:var(--space-4)}
 .calendar-marker .button-icon{width:8px;height:8px}
 .calendar-christmas{display:none}
}
@media(prefers-reduced-motion:reduce){.calendar-day{transition:none}}

.calendar-gift{position:absolute;right:var(--space-12);bottom:var(--space-12);width:24px;height:24px;color:#9b4745;pointer-events:none;transition:transform .2s,color .2s}
.calendar-day:enabled:hover .calendar-gift,.calendar-day:focus-visible .calendar-gift{transform:translateY(-2px) rotate(-6deg);color:var(--wine)}
@media(max-width:600px){.calendar-gift{width:20px;height:20px;right:var(--space-8);bottom:var(--space-8)}}
@media(prefers-reduced-motion:reduce){.calendar-gift{transition:none}.calendar-day:enabled:hover .calendar-gift,.calendar-day:focus-visible .calendar-gift{transform:none}}

@media(min-width:601px){.calendar-day.is-saved.is-watched .calendar-sticker{width:48px;height:48px}}
@media(max-height:760px) and (min-width:601px){.calendar-day.is-saved.is-watched .calendar-sticker{width:40px;height:40px}}

/* A double pen circle marks the actual date, independently of film progress. */
.calendar-number{width:max-content}
.is-today .calendar-number::after,.is-today .calendar-number::before{content:'';position:absolute;pointer-events:none;border:solid var(--wine);border-radius:49% 55% 46% 52%;transform:rotate(-11deg)}
.is-today .calendar-number::after{inset:-4px -8px;border-width:1.5px 1px 2px 1.5px}
.is-today .calendar-number::before{inset:-2px -7px -5px -9px;border-width:1px;border-right-color:transparent;border-top-color:transparent;opacity:.6;transform:rotate(7deg)}
.calendar-today-symbol{display:inline-block;width:12px;height:12px;border:1px solid var(--wine);border-bottom-width:1.5px;border-radius:49% 55% 46% 52%;transform:rotate(-11deg)}
@media(max-width:600px){.is-today .calendar-number::after{inset:-2px -5px}.is-today .calendar-number::before{inset:0 -4px -3px -6px}}
/* Feedback 2026-11-10: the legend now lives in the filter tabs, the summary appears only for empty filters, and the year sits with the month. */
#calendar-dialog .tabs button{display:inline-flex;align-items:center;gap:6px}
#calendar-dialog .tabs button .button-icon{width:14px;height:14px;flex:none}
#calendar-dialog .tabs button[data-filter="saved"] .button-icon{color:var(--wine)}
#calendar-dialog .tabs button[data-filter="watched"] .button-icon{color:#31573e}
#calendar-summary[hidden]{display:none}
#calendar-summary{font-size:12px;line-height:20px}
.calendar-titleline{justify-content:flex-start;gap:var(--space-16)}
#calendar-dialog .tabs button{font-size:13px;line-height:24px}
/* Roomier cells on larger screens (feedback 12 Nov): two lines of title next to the ornament,
   and the dialog grows with the screen so nothing is squeezed. */
@media(min-width:601px){
 #calendar-dialog{width:min(1120px,calc(100vw - var(--space-32)));--calendar-cell-height:clamp(104px,calc((100svh - 300px)/6),132px)}
 .calendar-day{padding:var(--space-12)}
 .calendar-film{left:var(--space-12);right:var(--space-12);bottom:var(--space-12);-webkit-line-clamp:3;max-height:none;font-size:14px!important;line-height:18px!important}
 .calendar-day.has-sticker .calendar-film{max-width:calc(100% - 68px)}
 .calendar-sticker{width:64px;height:64px;right:var(--space-4);bottom:var(--space-8)}
}
/* Larger ornaments and Christmas note, tidier titles (12 Nov). */
@media(min-width:601px){
 .calendar-sticker{width:72px;height:72px;right:2px;bottom:var(--space-4)}
 .calendar-day.has-sticker .calendar-film{max-width:calc(100% - 66px)}
 .calendar-film{text-wrap:pretty;hyphens:manual}
 .calendar-christmas{font-size:40px;line-height:44px;bottom:var(--space-12);left:0;right:0;white-space:nowrap}
}
/* December has five calendar rows: give them the height, and keep titles clear of the ornament (12 Nov). */
@media(min-width:601px){
 #calendar-dialog{--calendar-cell-height:clamp(112px,calc((100svh - 300px)/6),132px)}
 .calendar-sticker{width:64px;height:64px;right:-2px;bottom:6px}
 .calendar-day.has-sticker .calendar-film{right:48px;max-width:none}
 .calendar-marker{top:var(--space-8);right:var(--space-8);gap:6px}
 .calendar-marker .button-icon{width:16px;height:16px}
 .calendar-christmas{font-size:clamp(30px,2.6vw,38px);line-height:1.15}
}
/* Tablets: cells are narrow, so the ornament sits up top and the title gets the full width below. */
@media(min-width:601px) and (max-width:1099px){
 #calendar-dialog{--calendar-cell-height:clamp(120px,calc((100svh - 300px)/5),140px)}
 .calendar-day{padding:var(--space-8)}
 .calendar-sticker{width:58px;height:58px;top:18px;right:4px;bottom:auto}
 #calendar-dialog .calendar-day.calendar-day .calendar-film{left:var(--space-8);right:var(--space-8);bottom:var(--space-8);font-size:12px!important;line-height:15px!important}
 .calendar-christmas{font-size:clamp(20px,2.9vw,30px)}
}
@media(min-width:601px) and (max-width:1099px){.calendar-marker .button-icon{width:14px;height:14px}}
@media(min-width:1100px){#calendar-dialog .calendar-day.calendar-day .calendar-film{font-size:13px!important;line-height:17px!important}}
/* Phones: every opened day shows its film ornament (no titles fit here anyway). */
@media(max-width:600px){
 .calendar-day .calendar-sticker{width:40px;height:40px;right:50%;bottom:var(--space-8);transform:translateX(50%) rotate(var(--sticker-turn,0deg))}
}
