/*
 * Schooma's layout pieces of a page's text, made in the page editor: sections (<section class="s s-light">), cards
 * in a grid (<div class="cards cards-3"><div class="card">…), links as buttons (<a class="button">), videos
 * (<div class="video"><iframe>), and what the live blocks are filled with (.b-news, .b-contact, .b-teachers,
 * .b-gallery). Loaded by every homepage before the theme's style.css,
 * which can change any of it; it uses the theme's colours (--color-primary, --color-surface, --color-text…).
 */
html {
  overflow-x: clip;
}

/* a section: a band of the page, with its own look */
.s {
  --s-padding: 32px;
  margin: 24px 0;
}
.s::after {
  content: "";
  display: table;
  clear: both;
}
.s > :first-child {
  margin-top: 0;
}
.s > :last-child {
  margin-bottom: 0;
}
.s-light,
.s-accent,
.s-dark,
.s-image {
  padding: var(--s-padding) 24px;
  border-radius: 12px;
}
.s-light {
  --s-background: var(--color-surface, #f3f6fa);
  background: var(--s-background);
}
.s-accent {
  --s-background: var(--color-primary, #1d4f91);
  background: var(--s-background);
  color: #fff;
}
.s-dark {
  --s-background: var(--color-text, #1f2328);
  background: var(--s-background);
  color: #fff;
}
.s-image {
  background: linear-gradient(rgb(0 0 0 / 0.45), rgb(0 0 0 / 0.45)), var(--s-image, none) center / cover no-repeat,
    var(--color-text, #1f2328);
  color: #fff;
}
.s-accent a,
.s-dark a,
.s-image a {
  color: inherit;
}
/* the whole width of the window: the colour reaches the edges, the text stays in the page's column */
.s-full.s-light,
.s-full.s-accent,
.s-full.s-dark {
  border-radius: 0;
  padding-inline: 0;
  box-shadow: 0 0 0 100vmax var(--s-background);
  clip-path: inset(0 -100vmax);
}
.s-full.s-image {
  border-radius: 0;
  margin-inline: calc(50% - 50vw);
  padding-inline: max(16px, calc(50vw - 50%));
}
@media (max-width: 599px) {
  .s {
    --s-padding: 24px;
  }
  .s-light,
  .s-accent,
  .s-dark,
  .s-image {
    padding-inline: 16px;
  }
}

/* cards: side by side on a wide screen (2, 3 or 4 in a row), one under another on a phone */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 16px 0;
}
@media (min-width: 600px) {
  .cards-2,
  .cards-3,
  .cards-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 900px) {
  .cards-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cards-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.card {
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgb(0 0 0 / 0.1);
  border-radius: 12px;
  background: var(--color-background, #fff);
  color: var(--color-text, #1f2328);
}
.card a {
  color: var(--color-primary, #1d4f91);
}
.card > :first-child {
  margin-top: 0;
}
.card > :last-child {
  margin-bottom: 0;
}
/* a picture at the top of a card: from edge to edge */
.card > img:first-child {
  display: block;
  width: calc(100% + 32px);
  max-width: none;
  height: auto;
  margin: -16px -16px 12px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.card img {
  max-width: 100%;
  height: auto;
}
.card h2,
.card h3 {
  margin: 0 0 8px;
}

/* a link shown as a button (and the join block's button) */
a.button,
.b-join button.button {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--color-primary, #1d4f91);
  color: #fff;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
a.button:hover,
a.button:focus-visible,
.b-join button.button:hover,
.b-join button.button:focus-visible {
  filter: brightness(1.1);
}
.s-accent a.button,
.s-dark a.button,
.s-image a.button,
.s-accent .b-join button.button,
.s-dark .b-join button.button,
.s-image .b-join button.button {
  background: #fff;
  color: var(--color-primary, #1d4f91);
}

/* a YouTube or Vimeo video, as wide as the text */
.video {
  margin: 16px 0;
  aspect-ratio: 16 / 9;
}
.video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

/* the live blocks */
.b {
  margin: 16px 0;
}
.b-news .cards {
  margin: 0;
}
.card > .b-cover:first-child {
  display: block;
  margin: -16px -16px 12px;
}
.card > .b-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.b-date,
.b-job {
  margin: 0 0 4px;
  font-size: 0.875em;
  opacity: 0.75;
}
.b-more {
  margin: 12px 0 0;
}
.b-contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
}
.b-contact dt {
  font-weight: 600;
}
.b-contact dd {
  margin: 0;
}
.s-accent .b-contact a,
.s-dark .b-contact a,
.s-image .b-contact a {
  color: inherit;
}
.b-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.b-photo {
  display: block;
  overflow: hidden;
  border-radius: 8px;
}
.b-photo img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.2s;
}
.b-photo:hover img {
  transform: scale(1.04);
}

/* joining a live activity with the code from the teacher (on the pupil's phone) */
.b-join {
  max-width: 420px;
  margin: 16px 0;
}
.b-join label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.b-join-row {
  display: flex;
  gap: 8px;
}
.b-join input[name="code"] {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--color-muted, #59636e);
  border-radius: 999px;
  background: var(--color-background, #fff);
  color: var(--color-text, #1f2328);
  font: inherit;
  font-size: 1.15em;
  letter-spacing: 0.08em;
}
.b-join button.button {
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.b-join-hint {
  margin: 6px 0 0;
  font-size: 0.9em;
  color: var(--color-muted, #59636e);
}
.s-accent .b-join-hint,
.s-dark .b-join-hint,
.s-image .b-join-hint {
  color: inherit;
  opacity: 0.85;
}

/* signing in to Schooma */
.b-login {
  margin: 16px 0;
}
