/* ============================================================
   VIDRIO (glass) · CALENDAR (2.8.79): idea D of the redesign mockups (mockups/redesign-calendar/)
   ============================================================
   On top of glass.css. The glass is Daily's (--vd-caja). On the iPhone, each view in a box: the month with the
   selected day's list below, the week with its seven days separated by lines, the day with its schedule. On
   desktop, two columns: the month on the left and the selected day on the right; the week in seven columns, one box
   per day; the schedule with the all-day items to its right.
   The boxes are set by calendar.js: .cal-monthbox (the month grid), .cal-daylist (the selected day), .cal-week (the
   week), .cal-day (the day: .cal-band + .cal-timetable) and .cal-footer (the legend and the Google line).
   It overrides the minimum that glass.css gives the Calendar (“Until its section redesigns it”): the rules go with
   html.glass #view-cal.view, which has the same specificity as its rules (html.glass .view:not(#view-hoy)), and this
   stylesheet comes after. With the dark theme or at night, the same :is(…) key as the base. Day · Week · Month, as in
   the mockup's D (the selected one in white with olive text), not like the base's segmented control.
   Careful: where the base groups something of two classes in :is(…) (.blk-head .h), the rule weighs one class more;
   here ours gets an ancestor (.cal-head, .cal-daylist, .cal-monthbox, .cal-footer) to match it. */

/* ---------- the colour that detaches the “+N” from its icon (the outline takes the cell's colour) ---------- */
html.glass #view-cal.view{--vd-agenda-celda:rgba(240,243,240,.95)}
:is(:root[data-theme="dark"].glass,html.glass.gl-night) #view-cal.view{--vd-agenda-celda:rgba(30,35,33,.95)}

/* ---------- the glass, Daily's ---------- */
html.glass #view-cal.view :is(.cal-nav,.cal-monthbox,.cal-daylist,.cal-day,.cal-legend span,.gc-footer),
html.glass #view-cal.view .cal-week{   /* separate: on desktop it's removed, and inside the :is it would weigh more than that rule */
  background:linear-gradient(180deg,rgba(255,255,255,.09),rgba(255,255,255,0) 42%),var(--vd-caja);
  -webkit-backdrop-filter:var(--vd-blur);backdrop-filter:var(--vd-blur);
  box-shadow:inset 0 0 0 1px var(--vd-borde),inset 0 1px 0 var(--vd-brillo)}
/* what the base put in glass and now sits inside a box: no background of its own */
html.glass #view-cal.view :is(.cal-grid,.cal-allday,.cal-tl,.cal-arrow,.cal-daylist .cal-today-ic){
  background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none}

/* ---------- the header: ‹ date › in a capsule, like Daily's date, with the usual fixed 148 px slot,
   and «+ Evento» (+ Event) in an olive capsule. Nothing moves from one day to the next or between views ---------- */
html.glass #view-cal.view .cal-head{margin-bottom:12px;flex-wrap:nowrap}
html.glass #view-cal.view .cal-nav{flex:0 0 auto;gap:0;padding:3px;border-radius:999px}   /* flex:0 0 auto: WebKit shrank the box and the “›” ended up outside the capsule */
html.glass #view-cal.view .cal-arrow{border:0;border-radius:50%;width:34px;height:34px;color:var(--muted);font-size:19px}
html.glass #view-cal.view .cal-head .cal-label{width:148px;color:var(--text);text-shadow:none}
html.glass #view-cal.view .cal-head .cal-new{height:40px;padding:0 17px;border-radius:999px;font-size:13.5px;box-shadow:0 1px 2px rgba(0,0,0,.12),0 4px 14px rgba(0,0,0,.14)}
/* Day · Week · Month: the one from the mockup's D. The base's glass capsule, lower, and the selected one in white */
html.glass #view-cal.view .cal-seg{padding:3px;gap:0;margin-bottom:14px}
html.glass #view-cal.view .cal-seg button{padding:7px 0;font-family:inherit;font-weight:600;font-size:13px;color:var(--muted)}
html.glass #view-cal.view .cal-seg button.on{background:rgba(255,255,255,.92);color:var(--olive);box-shadow:0 1px 2px rgba(0,0,0,.1),0 2px 8px rgba(0,0,0,.08);text-shadow:none}   /* 2.8.90: without the text shadow of the olive buttons: this one is white */
:is(:root[data-theme="dark"].glass,html.glass.gl-night) #view-cal.view .cal-seg button.on{background:rgba(255,255,255,.18);color:#fff}

/* back to today: a round button; outside the boxes, with the base's glass; inside, translucent grey */
html.glass #view-cal.view .cal-today-ic{width:34px;height:34px}
html.glass #view-cal.view .cal-daylist .cal-today-ic{background:var(--surface-2);color:var(--muted)}
html.glass #view-cal.view :is(.cal-today-row,.cal-wtoday){justify-content:flex-end;margin-bottom:10px}

/* ---------- the month, in its box, with thin lines between weeks ---------- */
html.glass #view-cal.view .cal-monthbox{border-radius:26px;padding:14px 12px 8px}
html.glass #view-cal.view .cal-grid{gap:0;padding:0;border-radius:0}
html.glass #view-cal.view .cal-monthbox .cal-wd span{font-size:11.5px;color:var(--faint);text-shadow:none}
html.glass #view-cal.view :is(.cal-cell,.cal-cell.out,.cal-cell.today){--cbg:var(--vd-agenda-celda);background:none;border:0;border-top:1px solid var(--border-soft);border-radius:0;padding-top:7px}
:is(:root[data-theme="dark"].glass,html.glass.gl-night) #view-cal.view :is(.cal-cell,.cal-cell.out,.cal-cell.today){--cbg:var(--vd-agenda-celda)}
html.glass #view-cal.view .cal-cell .cn{font-size:12.5px}
html.glass #view-cal.view .cal-cell:hover{border-color:var(--border-soft);background:var(--surface-2)}
/* today: the number in an olive circle */
html.glass #view-cal.view .cal-cell.today .cn{display:grid;place-items:center;width:22px;height:22px;margin-top:-4px;border-radius:50%;background:var(--olive-fill);color:var(--on-olive);text-shadow:var(--on-olive-sombra)}
:is(:root[data-theme="dark"].glass,html.glass.gl-night) #view-cal.view .cal-cell.today .cn{color:#17191A}
html.glass #view-cal.view .cal-cell.sel{background:var(--surface-2);border-radius:12px;border-top-color:transparent}
html.glass #view-cal.view .cal-cell.arr{background:rgba(138,169,120,.22);border-radius:0;border-top-color:transparent}
html.glass #view-cal.view .cal-monthbox .cal-hint{margin:6px 0 2px;font-size:12.5px;color:var(--muted);text-shadow:none}

/* ---------- the selected day, in its box, with the title like Daily's (17 px, normal case) ---------- */
html.glass #view-cal.view .cal-daylist{margin-top:14px;padding:14px 18px 12px;border-radius:26px}
html.glass #view-cal.view .cal-daylist .cal-dhd{font-size:17px;line-height:1.25;letter-spacing:-.01em;color:var(--text);text-shadow:none}
html.glass #view-cal.view .cal-dhd-row{min-height:34px}

/* ---------- the rows, like those of Daily's schedule: their project's line on the left, no card ---------- */
html.glass #view-cal.view :is(.cal-ev,.cal-wday .cal-ev){background:none;border:0;border-left:3px solid;border-radius:2px;padding:7px 4px 7px 11px;margin:0 0 6px;gap:10px}
:is(:root[data-theme="dark"].glass,html.glass.gl-night) #view-cal.view .cal-wday .cal-ev{background:none}
html.glass #view-cal.view .cal-ev:last-child{margin-bottom:0}
html.glass #view-cal.view .cal-tt{font-size:14.5px}
html.glass #view-cal.view .cal-hr{font-size:12.5px;color:var(--muted);font-variant-numeric:tabular-nums}
html.glass #view-cal.view .cal-rep{color:var(--muted)}
html.glass #view-cal.view .cal-all{background:rgba(138,169,120,.2)}
:is(:root[data-theme="dark"].glass,html.glass.gl-night) #view-cal.view .cal-all{background:rgba(157,190,134,.18)}
/* Google, not responded to: dotted border and light background, as always */
html.glass #view-cal.view :is(.cal-ev.gpend,.cal-wday .cal-ev.gpend){border:1.5px dashed var(--gc);border-radius:12px;background:var(--gcbg);padding:7px 10px}
:is(:root[data-theme="dark"].glass,html.glass.gl-night) #view-cal.view .cal-wday .cal-ev.gpend{background:var(--gcbg)}

/* ---------- the week: on the iPhone, one box with the seven days separated by lines ---------- */
html.glass #view-cal.view .cal-week{gap:0;border-radius:26px;padding:4px 18px}
html.glass #view-cal.view :is(.cal-wday,.cal-wday.today){background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;
  border:0;border-radius:0;padding:13px 0 12px;border-bottom:1px solid var(--border-soft)}
html.glass #view-cal.view .cal-wday:last-child{border-bottom:0}
html.glass #view-cal.view .cal-wdh{font-size:15px;text-transform:none;color:var(--text)}   /* no capitalize: the text already comes with its capital letter */
html.glass #view-cal.view .cal-wday.today .cal-wdh{color:var(--olive)}
html.glass #view-cal.view .cal-wempty{color:var(--muted);font-size:13px}

/* ---------- the day: one box with the all-day items on top and the schedule below ---------- */
html.glass #view-cal.view .cal-day{border-radius:26px;padding:12px 16px 16px 10px}
html.glass #view-cal.view .cal-band{padding:4px 0 12px 8px;margin-bottom:14px;border-bottom:1px solid var(--border)}
html.glass #view-cal.view .cal-allday{border:0;border-radius:0;padding:0;margin:0}
html.glass #view-cal.view .cal-ad{font-size:13.5px;border-left-width:3px;padding:2px 0 2px 9px}
html.glass #view-cal.view .cal-ad.gpend{border:1.5px dashed var(--gc);border-radius:10px;background:var(--gcbg);padding:4px 9px}
html.glass #view-cal.view .cal-tl{padding:0;border-radius:0;margin-top:2px}
html.glass #view-cal.view .cal-hl{color:var(--muted);font-size:10.5px;font-variant-numeric:tabular-nums}
html.glass #view-cal.view .cal-block{border-radius:9px;box-shadow:0 1px 2px rgba(0,0,0,.14)}
html.glass #view-cal.view .cal-block.gpend{background:linear-gradient(var(--gcbg),var(--gcbg)),rgba(255,255,255,.82)!important}
:is(:root[data-theme="dark"].glass,html.glass.gl-night) #view-cal.view .cal-block.gpend{background:linear-gradient(var(--gcbg),var(--gcbg)),rgba(20,24,22,.85)!important}

/* ---------- at the bottom: the legend in capsules (a long name ends in “…” and doesn't widen the page) and Google's */
html.glass #view-cal.view .cal-footer{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:16px}
html.glass #view-cal.view .cal-legend{justify-content:center;gap:6px;margin:0;padding:0;border:0;max-width:100%}
html.glass #view-cal.view .cal-footer .cal-legend span{display:inline-block;max-width:100%;min-width:0;padding:5px 11px 5px 9px;border-radius:999px;
  font-size:12px;color:var(--text);text-shadow:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
html.glass #view-cal.view .cal-legend i{display:inline-block;margin-right:6px;vertical-align:0}
html.glass #view-cal.view .gc-footer{margin:0;padding:6px 13px;border-radius:999px;color:var(--muted);max-width:100%}
html.glass #view-cal.view .gc-footer span{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}

/* ---------- on desktop: two columns ---------- */
@media(min-width:860px){
  /* the month on the left; the selected day on the right, staying put when scrolling */
  html.glass #view-cal.view .cal-v-month{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;align-items:start}
  html.glass #view-cal.view .cal-cell{height:92px}
  html.glass #view-cal.view .cal-q-ic .glyph{width:22px;height:22px}
  html.glass #view-cal.view .cal-daylist{margin-top:0;position:sticky;top:84px}
  html.glass #view-cal.view .cal-daylist .cal-ev{flex-wrap:wrap;row-gap:2px}
  /* the week in seven columns, one box per day, with the time above each item */
  html.glass #view-cal.view .cal-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;padding:0;border-radius:0;
    background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none}
  html.glass #view-cal.view :is(.cal-wday,.cal-wday.today){border-radius:20px;padding:12px 10px 10px;border:0;min-height:260px;
    background:linear-gradient(180deg,rgba(255,255,255,.09),rgba(255,255,255,0) 42%),var(--vd-caja);
    -webkit-backdrop-filter:var(--vd-blur);backdrop-filter:var(--vd-blur);box-shadow:inset 0 0 0 1px var(--vd-borde),inset 0 1px 0 var(--vd-brillo)}
  html.glass #view-cal.view .cal-wday.today{box-shadow:inset 0 0 0 1.5px var(--olive-soft),inset 0 1px 0 var(--vd-brillo)}
  html.glass #view-cal.view .cal-wday .cal-wdh{font-size:14px;margin-bottom:10px}
  html.glass #view-cal.view .cal-wday .cal-ev{display:grid;grid-template-columns:auto minmax(0,1fr);gap:3px 6px;align-items:start;padding:3px 0 3px 8px;margin-bottom:9px}
  html.glass #view-cal.view .cal-wday .cal-ev :is(.cal-hr,.cal-all){grid-column:1/-1;grid-row:1;justify-self:start;max-width:100%;overflow:hidden;text-overflow:ellipsis}
  html.glass #view-cal.view .cal-wday .cal-ev .cal-ic{grid-column:1;grid-row:2;margin-top:1px}
  html.glass #view-cal.view .cal-wday .cal-ev .cal-ic .glyph{width:15px;height:15px}
  html.glass #view-cal.view .cal-wday .cal-tt{grid-column:2;grid-row:2;font-size:13px;line-height:1.3}
  html.glass #view-cal.view .cal-wday .cal-ev.gpend{padding:5px 7px}
  /* the day: the schedule on the left and the all-day items on the right */
  html.glass #view-cal.view .cal-day{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:0 18px;align-items:start}
  html.glass #view-cal.view .cal-band{grid-column:2;grid-row:1;margin:0;padding:6px 0 6px 18px;border:0;border-left:1px solid var(--border);position:sticky;top:84px}
  html.glass #view-cal.view .cal-timetable{grid-column:1;grid-row:1}
}
