/* ClassIn on the iPad: the bar of tabs above the three experiences. ClassIn's own type (Gilroy, from the website's
   files) and green; the three keep their own look below it. */
@font-face { font-family: Gilroy; src: url(deck/fonts/Gilroy-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Gilroy; src: url(deck/fonts/Gilroy-Semibold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Gilroy; src: url(deck/fonts/Gilroy-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #1C1F25; --ink70: #545860; --green: #00734F; --bright: #00AA76; --amber: #B25E00;
  --line: #E3E6EA; --soft: #F2F4F6; --bar: 60px;
}
html, body { height: 100%; margin: 0; background: #fff; overflow: hidden; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
html { touch-action: manipulation; }   /* a double tap switches full screen, so Safari must not zoom on it */
[hidden] { display: none !important; }
body {
  display: flex; flex-direction: column; color: var(--ink);
  font-family: Gilroy, -apple-system, system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
}

.bar {
  flex: none; box-sizing: border-box; height: calc(var(--bar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 2;
}

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: 999px; }
.tabs button {
  appearance: none; border: 0; margin: 0; background: transparent; cursor: pointer;
  height: 42px; padding: 0 20px; border-radius: 999px; white-space: nowrap;
  font: 600 15px/1 Gilroy, -apple-system, system-ui, sans-serif; color: var(--ink70);
  transition: background-color .2s ease, color .2s ease;
}
.tabs button[aria-selected="true"] { background: var(--green); color: #fff; }

.bar__left { justify-self: start; display: flex; gap: 8px; }
/* language buttons (29 Oct): flags beside the offline status */
.bar__right { justify-self: end; display: flex; align-items: center; gap: 14px; }
.state__text { white-space: nowrap; }
.lang { display: flex; gap: 2px; padding: 4px; background: var(--soft); border-radius: 999px; }
.lang button {
  appearance: none; border: 0; margin: 0; cursor: pointer; background: transparent;
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px 0 9px; border-radius: 999px;
  font: 700 13px/1 Gilroy, -apple-system, system-ui, sans-serif; letter-spacing: .02em; color: var(--ink70);
  transition: background-color .2s ease, color .2s ease;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: #fff; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.lang .flag { display: block; flex: none; width: 21px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(28, 31, 37, .12); }
.tab__short { display: none; }
.sharebtn {
  appearance: none; border: 0; margin: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 18px 0 16px; border-radius: 999px;
  background: var(--soft); color: var(--ink); font: 600 14px/1 Gilroy, -apple-system, system-ui, sans-serif; white-space: nowrap;
}
.sharebtn:active { background: var(--line); }
.iconbtn { width: 42px; padding: 0; justify-content: center; }
.fullicon { display: block; flex: none; }
.fullicon--out, #full[aria-pressed="true"] .fullicon--in { display: none; }
#full[aria-pressed="true"] .fullicon--out { display: block; }

/* expanded: the tab on screen fills the whole screen and the bar steps away; a small handle at the top edge (and a
   double tap) brings it back. Works everywhere, the Home Screen app and phones included (28 Oct). */
.handle { display: none; }
body.expanded .bar { display: none; }
body.expanded .handle {
  display: block; position: fixed; z-index: 3; top: env(safe-area-inset-top); left: 50%; transform: translateX(-50%);
  width: 160px; height: 20px; padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
}
.handle i { display: block; width: 72px; height: 5px; margin: 6px auto 0; border-radius: 5px; background: rgba(28, 31, 37, .38); box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.handle:hover i { background: rgba(28, 31, 37, .6); }

.toast {
  position: fixed; left: 50%; top: calc(var(--barh, 60px) + 14px); z-index: 3; margin: 0;
  transform: translateX(-50%); padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff;
  font: 600 14px/1.2 Gilroy, -apple-system, system-ui, sans-serif; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.toast.on { opacity: 1; }

.state {
  justify-self: end; appearance: none; border: 0; background: none; padding: 8px 0; margin: 0; cursor: pointer;
  display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 8px; row-gap: 5px;
  font: 600 13px/1.2 Gilroy, -apple-system, system-ui, sans-serif; color: var(--ink70); text-align: left;
}
.state__icon { width: 10px; height: 10px; border-radius: 50%; background: #B0B6BC; }
/* nothing saved yet: the status is the button that starts saving */
.state[data-s="idle"] { height: 42px; padding: 0 16px; border-radius: 999px; background: var(--soft); color: var(--ink); }
.state[data-s="idle"] .state__icon { background: var(--bright); }
.state[data-s="idle"]:active { background: var(--line); }
.state[data-s="ready"] { color: var(--green); }
.state[data-s="ready"] .state__icon { background: var(--bright); }
.state[data-s="saving"] .state__icon { background: var(--bright); animation: pulse 1.4s ease-in-out infinite; }
.state[data-s="retry"], .state[data-s="incomplete"] { color: var(--amber); }
.state[data-s="retry"] .state__icon, .state[data-s="incomplete"] .state__icon { background: var(--amber); }
.state__bar { grid-column: 1 / -1; display: none; width: 150px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.state__bar i { display: block; height: 100%; width: 0; background: var(--bright); transition: width .3s ease; }
.state[data-s="saving"] .state__bar { display: block; }
@keyframes pulse { 50% { opacity: .35; } }

main { position: relative; flex: 1; min-height: 0; background: #fff; }
main iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: none; background: #fff; }
main iframe.on { display: block; animation: show .25s ease-out; }
@keyframes show { from { opacity: 0; } }

/* a tab opening for the first time: its name and a moving bar until its page has loaded (28 Oct: a blank screen gave
   no sign anything was happening) */
.loading {
  position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 18px;
  background: #fff; text-align: center; padding: 24px;
}
.loading__title { margin: 0; font: 600 20px/1.3 Gilroy, -apple-system, system-ui, sans-serif; color: var(--ink70); }
.loading__title b { color: var(--ink); font-weight: 700; }
.loading__bar { width: 240px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.loading__bar i { display: block; width: 40%; height: 100%; border-radius: 4px; background: var(--bright); animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.loading__note { margin: 0; min-height: 21px; max-width: 420px; font: 500 15px/1.4 Gilroy, -apple-system, system-ui, sans-serif; color: var(--ink70); }

.sheet {
  width: min(460px, calc(100vw - 48px)); box-sizing: border-box; padding: 28px 28px 24px; border: 0; border-radius: 20px;
  color: var(--ink); box-shadow: 0 24px 60px -20px rgba(28, 31, 37, .45);
}
.sheet::backdrop { background: rgba(28, 31, 37, .35); }
.sheet h2 { margin: 0 0 14px; font: 700 22px/1.2 Gilroy, -apple-system, system-ui, sans-serif; }
.sheet ol { margin: 0; padding-left: 22px; font: 500 16px/1.5 Gilroy, -apple-system, system-ui, sans-serif; color: var(--ink70); }
.sheet li + li { margin-top: 8px; }
.sheet ol[hidden] { display: none; }
.sheet b { color: var(--ink); font-weight: 700; }
.shareicon { display: inline-block; flex: none; vertical-align: -3px; }
.sheet .shareicon { width: 15px; height: 18px; color: var(--ink); }
.sheet__ok {
  display: block; width: 100%; margin-top: 22px; height: 50px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--green); color: #fff; font: 700 16px/1 Gilroy, -apple-system, system-ui, sans-serif;
}

/* a narrower iPad, or upright: smaller tabs, so the three keep one line */
@media (max-width: 1060px) {
  .tabs button { padding: 0 14px; font-size: 14px; }
  .sharebtn { width: 42px; padding: 0; justify-content: center; }
  .sharebtn__text { display: none; }
  .lang__code { display: none; }
  .state__text { display: none; }
  .state { grid-template-columns: auto; }
  .lang button { padding: 0 9px; }
  .bar__right { gap: 10px; }
}
@media (max-width: 760px) {
  .tabs button { padding: 0 10px; font-size: 13px; height: 38px; }
  .state__text { display: none; }
  .state { grid-template-columns: auto; }
  .state__bar { width: 60px; }
}
/* a phone: two rows, the buttons and the status on top, then all four tabs side by side with short names
   (28 Oct: on a phone the Room Designer and EDUtech slides tabs ran off the right edge) */
@media (max-width: 700px) {
  .bar {
    height: auto; grid-template-columns: 1fr auto; row-gap: 8px;
    padding-top: calc(env(safe-area-inset-top) + 8px); padding-bottom: 8px;
    padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right));
  }
  .bar__left { grid-column: 1; grid-row: 1; }
  .bar__right { grid-column: 2; grid-row: 1; }
  .state { grid-template-columns: auto auto; }
  .state__text { display: none !important; }
  .state__text { display: inline; }
  .tabs { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tabs button { padding: 0 4px; font-size: 13px; }
  .tab__long { display: none; }
  .tab__short { display: inline; }
  body[data-only] .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  main iframe.on { animation: none; }
  .loading__bar i { animation: none; width: 100%; opacity: .5; }
  .state[data-s="saving"] .state__icon { animation: none; }
}
