/* THE one AYF schedule design -- one responsive visual language shared by the
   public schedule widget (js/ays-schedule-widget.js, embedded cross-origin on
   astangaforeningen.dk) and the member app's own schedule (app/schedule.html).
   Do not fork this file per context; extend it here so both stay identical.
   Loaded as a real <link>, not duplicated inline -- the widget is loaded
   cross-origin, so every color falls back to a literal (matching astanga-
   v2.css's tokens) in case the host page hasn't defined the CSS variable. */

.ays-sw { font-family: var(--sans, inherit); color: var(--ink, #251f1d); }

/* container-type here (not a viewport media query further down) is what
   makes this ONE responsive design regardless of context -- the public
   site's wide page and the member app's narrower .container each give this
   panel a different actual width, and the grid needs to react to ITS OWN
   available space, not to the viewport, or the same 7-column grid that
   fits comfortably on the public site cramps into unreadably narrow
   columns inside the member app's narrower layout (exactly what happened
   before this was a container query). */
.ays-sw-panel { container-type: inline-size; container-name: ays-sw; position: relative; padding: clamp(1rem, 3vw, 2rem); overflow: hidden; border: 1px solid var(--line, rgba(37, 31, 29, .18)); border-radius: clamp(1.25rem, 3vw, 2rem); background: var(--white, #fff); box-shadow: 0 24px 70px rgba(62, 42, 33, .08); margin-bottom: 1.5rem; }

.ays-sw-nav { display: flex; align-items: center; justify-content: center; gap: 1.1rem; margin-bottom: clamp(1rem, 2.5vw, 1.75rem); }
.ays-sw-nav button { display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; background: none; border: 1px solid var(--line, rgba(37, 31, 29, .18)); border-radius: 999px; cursor: pointer; font: inherit; font-size: 1rem; line-height: 1; color: inherit; transition: border-color .15s ease, color .15s ease; }
.ays-sw-nav button:hover, .ays-sw-nav button:focus-visible { border-color: var(--wine, #5f1205); color: var(--wine, #5f1205); }
.ays-sw-nav-label { min-width: 11em; text-align: center; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .72; }

/* align-items: stretch (was start) so every day column, and with it the vertical divider on its left edge, runs the full height of the week table. With start a
   quiet day's divider stopped where its few classes ended, which looked ragged. The seven columns stay equal width; mobile (block layout below) is unaffected. */
.ays-sw-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: stretch; }
.ays-sw-day { padding: 0 .6rem; border-left: 1px solid var(--line, rgba(37, 31, 29, .1)); min-width: 0; }
.ays-sw-day:first-child { border-left: none; padding-left: 0; }
.ays-sw-day:last-child { padding-right: 0; }
.ays-sw-day-head { margin-bottom: .85rem; padding: .4rem .5rem; border-radius: .5rem; text-align: center; }
.ays-sw-day-head .ays-sw-weekday { display: block; font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.ays-sw-day-head .ays-sw-daynum { display: block; margin-top: .15rem; font-family: var(--display, Georgia, serif); font-size: 1.15rem; font-weight: 500; }
.ays-sw-day.is-today .ays-sw-day-head { background: rgba(95, 18, 5, .07); }
.ays-sw-day.is-today .ays-sw-day-head .ays-sw-weekday { color: var(--wine, #5f1205); opacity: .85; }
.ays-sw-day.is-today .ays-sw-day-head .ays-sw-daynum { color: var(--wine, #5f1205); }
.ays-sw-empty { padding: .5rem 0; font-size: .78rem; opacity: .55; }

/* One row shape everywhere: colour dot, time, class name, a restrained meta
   line (level/room/teacher), and -- only in the member app, where an item is
   a real <div data-open-session> not an anonymous <button> -- a status/action
   slot appended by JS (.ays-sw-status / .ays-sw-book). The public widget
   never renders that slot; it only ever opens the detail modal. */
.ays-sw-item { display: flex; align-items: flex-start; gap: .55rem; width: 100%; padding: .85rem 0; border: none; border-top: 1px solid var(--line, rgba(37, 31, 29, .14)); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; flex-wrap: wrap; }
.ays-sw-day .ays-sw-item:first-of-type { border-top: none; }
.ays-sw-item:hover .ays-sw-name, .ays-sw-item:focus-visible .ays-sw-name { color: var(--wine, #5f1205); }
.ays-sw-item:focus-visible { outline: 2px solid var(--wine, #5f1205); outline-offset: 2px; border-radius: 4px; }
.ays-sw-dot { flex: none; width: 8px; height: 8px; margin-top: .45rem; border-radius: 50%; }
.ays-sw-item-body { min-width: 0; flex: 1; }
.ays-sw-time { display: block; font-size: .72rem; letter-spacing: .03em; opacity: .62; font-variant-numeric: tabular-nums; }
.ays-sw-name { display: block; margin-top: .1rem; font-family: var(--display, Georgia, serif); font-size: 1rem; font-weight: 500; letter-spacing: -.01em; transition: color .15s ease; }
.ays-sw-meta { display: block; margin-top: .2rem; font-size: .72rem; line-height: 1.45; opacity: .6; }

/* Restrained status/action -- never a noisy "17 of 22 left" count, just the
   member's own relationship to the class. */
.ays-sw-status { display: block; margin-top: .3rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ays-sw-status--booked { color: var(--good, #2f6b3a); }
.ays-sw-status--waitlisted { color: #9a6a10; }
.ays-sw-status--full { color: var(--bad, #8a2a1a); }
.ays-sw-status--open { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-soft, #5f5752); }
/* 1-3 places left: a little stronger, in the same warm amber the waiting list uses (never the red of "Full"). */
.ays-sw-status--low { font-weight: 700; color: #9a6a10; }

/* A class this member has booked (or is waiting for) in the member's weekly schedule: a very light tint with a thin matching edge, so it is recognisable at a
   glance without becoming heavy. "Booked ✓" stays the status text. Only app/schedule.js adds these classes; the public widget never does.
   The card is widened by .5rem each side (inside the day's own padding) so its text stays aligned with the other classes in the column. */
.ays-sw-item--booked, .ays-sw-item--waitlisted { width: calc(100% + 1rem); margin: .15rem 0 .15rem -.5rem; padding-left: .5rem; padding-right: .5rem; border-radius: .6rem; border-top-color: transparent; }
.ays-sw-item--booked { background: rgba(47, 107, 58, .08); box-shadow: inset 0 0 0 1px rgba(47, 107, 58, .24); }
.ays-sw-item--waitlisted { background: rgba(154, 106, 16, .09); box-shadow: inset 0 0 0 1px rgba(154, 106, 16, .26); }
/* The booking/access instruction above the schedule ("You have 1 of 1 classes left to choose ..."): a soft wine-tinted information panel with a small "i" mark,
   the dynamic numbers in bold. Informative, not a warning. */
.notice--booking-info { position: relative; padding-left: 3.1rem; background: rgba(95, 18, 5, .06); color: var(--ink, #251f1d); line-height: 1.5; }
.notice--booking-info::before { content: "i"; position: absolute; left: 1.05rem; top: .95rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--wine, #5f1205); color: #fff; font: italic 600 .85rem/1.4rem var(--display, Georgia, serif); text-align: center; }
.notice--booking-info strong { color: var(--wine, #5f1205); font-weight: 700; }
.ays-sw-book { display: inline-block; margin-top: .3rem; padding: 0; border: none; background: none; color: var(--wine, #5f1205); font: inherit; font-size: .72rem; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; text-decoration-color: rgba(95, 18, 5, .4); cursor: pointer; }
.ays-sw-book:hover { text-decoration-color: currentColor; color: var(--wine-dark, #451008); }

@container ays-sw (max-width: 860px) {
  .ays-sw-grid { display: block; }
  .ays-sw-day { border-left: none; padding: 0; margin-bottom: 1.1rem; }
  .ays-sw-day:last-child { margin-bottom: 0; }
  .ays-sw-day-head { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .15rem; padding: .3rem .4rem; border-radius: .4rem; text-align: left; }
  .ays-sw-day-head .ays-sw-daynum { margin-top: 0; font-size: .92rem; }
  .ays-sw-item { padding: .55rem 0; gap: .6rem; }
  .ays-sw-item--booked, .ays-sw-item--waitlisted { padding: .55rem .5rem; }
  .ays-sw-dot { margin-top: .3rem; }
  .ays-sw-time { display: inline; font-size: .74rem; }
  .ays-sw-name { display: inline; margin-top: 0; margin-left: .45rem; font-size: .92rem; }
  .ays-sw-meta { margin-top: .1rem; }
  .ays-sw-status, .ays-sw-book { margin-left: 1.3rem; }
}

/* Public schedule on a phone: this week starts at today. Earlier days and today's finished classes are folded behind one button (js/ays-schedule-widget.js).
   Wider screens keep the whole week; the button is only ever shown in this phone-width container. */
.ays-sw-earlier { display: none; }
.ays-sw-over { display: none; }
@container ays-sw (max-width: 560px) {
  .ays-sw-earlier:not([hidden]) { display: block; margin: 0 auto 1rem; padding: .45rem 1rem; border: 1px solid var(--line, rgba(37, 31, 29, .18)); border-radius: 999px; background: none; color: var(--wine, #5f1205); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
  .ays-sw-grid:not(.show-earlier) .ays-sw-day.is-past, .ays-sw-grid:not(.show-earlier) .ays-sw-item.is-done { display: none; }
  .ays-sw-grid:not(.show-earlier) .ays-sw-over { display: block; }
}

/* Detail modal -- shared by the widget's anonymous view and the member app's
   own signed-in view; .ays-sw-modal-action is the one slot that differs
   (public: a "Book" link into login; member: a real book/cancel button, or
   an entitlement explanation with a buy link). */
.ays-sw-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(37, 31, 29, .45); }
.ays-sw-overlay[hidden] { display: none; }
.ays-sw-modal { position: relative; width: 100%; max-width: 26rem; max-height: 85vh; overflow-y: auto; padding: clamp(1.5rem, 4vw, 2.25rem); border-radius: 1.25rem; background: var(--paper, #fbf8f3); box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.ays-sw-modal-close { position: absolute; top: .9rem; right: .9rem; width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line, rgba(37, 31, 29, .18)); border-radius: 999px; background: var(--white, #fff); cursor: pointer; font-size: 1rem; line-height: 1; color: inherit; }
.ays-sw-modal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .5rem; vertical-align: middle; }
.ays-sw-modal h3 { margin: .9rem 0 0; font-family: var(--display, Georgia, serif); font-size: 1.5rem; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; padding-right: 2rem; }
.ays-sw-modal-when { margin: .5rem 0 0; font-size: .9rem; opacity: .75; }
.ays-sw-modal-facts { margin: 1.1rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line, rgba(37, 31, 29, .14)); }
.ays-sw-modal-facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .85rem; }
.ays-sw-modal-facts dt { opacity: .55; }
.ays-sw-modal-facts dd { margin: 0; }
.ays-sw-modal-desc { margin: 1rem 0 0; font-size: .9rem; line-height: 1.6; opacity: .85; }
.ays-sw-modal-cancelled { display: inline-block; margin-top: .75rem; padding: .2rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #a13a2e; background: rgba(161, 58, 46, .1); }
.ays-sw-modal-book { display: block; width: 100%; margin-top: 1.5rem; padding: .85rem 1rem; border: none; border-radius: .6rem; background: var(--wine, #5f1205); color: #fff; font: inherit; font-weight: 600; font-size: .9rem; text-align: center; cursor: pointer; text-decoration: none; box-sizing: border-box; }
.ays-sw-modal-book:hover { background: var(--wine-dark, #451008); }
.ays-sw-modal-book[disabled] { opacity: .6; cursor: default; }
.ays-sw-modal-book--outline { background: none; border: 1px solid var(--wine, #5f1205); color: var(--wine, #5f1205); }
.ays-sw-modal-book--outline:hover { background: rgba(95, 18, 5, .06); }
.ays-sw-modal-note { margin: .9rem 0 0; padding: .85rem 1rem; border-radius: .6rem; background: rgba(95, 18, 5, .05); font-size: .85rem; line-height: 1.55; }

/* Week navigation wrapper used by the member app (browse/mine tabs sit above
   the same .ays-sw-panel, so they need their own small header rule, not
   duplicated panel chrome). */
.ays-sw-week-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; opacity: .75; }

/* A moon day (new or full moon): no ordinary classes run, and the schedule says so instead of looking empty. A calendar marker, not a class: nothing to book. Shared by the public
   widget, the member schedule and (as .cal-moon in ays.css) the Admin calendar. */
.ays-sw-moon { margin: .1rem 0 .6rem; padding: .5rem .6rem; border-radius: .5rem; background: rgba(138, 107, 31, .1); color: #8a6b1f; font-size: .78rem; font-weight: 600; text-align: center; }
@container ays-sw (max-width: 860px) {
  .ays-sw-moon { margin: .2rem 0 .3rem; text-align: left; }
}
