@import url("palette.26f7ee8698a7.css");
@import url("font-family.6d5a421310cf.css");
@import url("fem.16fc26add59f.css");
@import url("card.4ed569ea8c3e.css");

:root {
  --container-max-inline-size: clamp(18rem, 90vw, 76rem);
}

/* The cookie banner (cookieconsent) sets its own system font: make it follow the theme */
:root #cc-main {
  --cc-font-family: var(--wa-font-family-body);
}

.container {
  max-inline-size: var(--container-max-inline-size);
  margin-inline: auto;

  &:not(:has(header)) {
    height: 100vh;
    margin-inline: 0;
    max-inline-size: 100%;
    background: linear-gradient(15deg, var(--wa-color-brand) 10%, var(--wa-color-brand-90) 80%, var(--wa-color-success-90));
    display: grid;
    align-content: center;
    justify-content: center;
  }
}

/* FEM · Learning Box logo. Images are rounded and clipped by default: the logo keeps its own corners. */
.pinot-logo-link {
  display: inline-flex;
  align-items: center;
}

.pinot-logo {
  display: block;
  block-size: var(--wa-font-size-3xl);
  inline-size: auto;
  border-radius: 0;
}

main.container {
  padding: var(--wa-space-m) 0;
}

caption {
  caption-side: bottom;
  text-align: start;
}

/* Current user card at the bottom of the sidebar */
.pinot-current-user {
  display: flex;
  align-items: center;
  gap: var(--wa-space-s);
  inline-size: 100%;
  padding: var(--wa-space-xs) var(--wa-space-s);
  color: var(--wa-color-text-normal);
  background: var(--wa-color-surface-default);
  border-radius: var(--wa-border-radius-m);
  box-shadow: var(--wa-shadow-s);
  text-decoration: none;
  transition: background var(--wa-transition-fast) var(--wa-transition-easing);

  &:hover {
    background: var(--wa-color-brand-fill-quiet);
  }

  wa-avatar {
    --size: 2.5rem;
    flex-shrink: 0;
  }

  > div {
    flex: 1;
    min-inline-size: 0;
    line-height: var(--wa-line-height-condensed);
  }

  strong,
  span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  strong {
    font-size: var(--wa-font-size-s);
    font-weight: var(--wa-font-weight-bold);
  }

  span {
    color: var(--wa-color-text-quiet);
    font-size: var(--wa-font-size-xs);
  }

  > wa-icon {
    flex-shrink: 0;
    color: var(--wa-color-text-quiet);
  }

  /* Plan of the user: "Free" or the name of the subscription */
  .pinot-current-user-plan {
    display: inline-flex;
    max-inline-size: 100%;
    margin-block-start: var(--wa-space-3xs);
    font-size: var(--wa-font-size-2xs);
    font-weight: var(--wa-font-weight-semibold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Form controls have a thin, light border (see fem.css): darker on hover, brand colored on focus */
wa-input,
wa-textarea,
wa-select {
  &:hover:not([disabled])::part(base),
  &:hover:not([disabled])::part(combobox) {
    border-color: var(--wa-color-neutral-border-loud);
  }

  &:focus-within::part(base),
  &:focus-within::part(combobox) {
    border-color: var(--wa-color-brand-border-loud);
  }

  &[disabled]::part(base),
  &[disabled]::part(combobox) {
    background: var(--wa-color-surface-lowered);
  }
}

/* Outlined neutral buttons (filters, chips) share the same light border */
wa-button[variant="neutral"][appearance="outlined"] {
  &::part(base) {
    border-color: var(--wa-color-neutral-border-normal);
  }

  &:hover::part(base) {
    border-color: var(--wa-color-neutral-border-loud);
  }
}

/* A column of a grid never grows wider than the track (otherwise its content pushes the page sideways) */
.wa-grid > * {
  min-inline-size: 0;
}

wa-button-group.wa-nowrap::part(base) {
  flex-wrap: nowrap;
}

wa-radio-group.pinot-subject-area-widget {
  &::part(form-control-input) {
    gap: var(--wa-space-xs) var(--wa-space-s);
  }

  wa-radio {
    border-radius: var(--wa-border-radius-pill);
  }
  &::part(form-control-label) {
    text-transform: uppercase;
    color: var(--wa-color-text-quiet);
    font-size: var(--wa-font-size-xs);
    font-weight: var(--wa-font-weight-bold);
  }
}
