/* glictevout.com theme: night-blue background, cream text, rounded
   outlined cards (as on the previous site). Overrides the shared tokens
   and adds the site's components. */

@layer tokens {
  :root {
    color-scheme: dark;

    --night-950: #030414;
    --night-900: #0e0e2a;
    --night-800: rgb(14 18 79);
    --cream-200: rgb(232 219 179);
    --cream-50: #fff;
    --color-text: var(--cream-200);
    --color-text-muted: rgb(232 219 179 / 75%);
    --color-surface: var(--night-950);
    --color-border: rgb(232 219 179 / 30%);
    --color-accent: var(--cream-200);
    --color-on-accent: var(--night-950);
    --color-focus: var(--cream-50);
    --measure: 50rem;
    --radius-card: 25px;
    --radius-pill: 999px;
    --font-size-lg: 1.25rem;
  }
}

@layer components {
  a:hover {
    color: var(--cream-50);
  }

  .icon {
    display: inline-block;
    inline-size: 1em;
    block-size: 1em;
    fill: currentcolor;
    vertical-align: -0.125em;
  }

  /* The header: the name with its tagline, and the language codes. */
  .site-brand__tagline {
    font-size: var(--font-size-sm);
    font-style: italic;
    color: var(--color-text-muted);
  }

  .language-picker__list {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .language-picker__current {
    font-weight: 700;
  }

  .section-title {
    margin-block-start: var(--space-6);
  }

  /* Link cards: the home page and the music years. */
  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-6);
  }

  .link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-4);
    color: var(--color-text);
    text-align: center;
    text-decoration: none;
    border: 3px solid var(--color-text);
    border-radius: var(--radius-card);
    transition: background-color var(--duration-fast);

    &:hover,
    &:focus-visible {
      color: var(--cream-50);
      background: var(--night-800);
    }
  }

  .link-card--disabled {
    opacity: 0.4;
  }

  .link-card__icon {
    font-size: 3rem;
  }

  .link-card__label {
    font-size: 1.75rem;
    font-weight: 600;
  }

  .link-card__subtext {
    font-style: italic;
  }

  /* A playlist: cover, title, platforms, and the player opened in place. */
  .playlist {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: flex-start;
    padding: var(--space-4);
    border: 3px solid var(--color-text);
    border-radius: var(--radius-card);
  }

  .playlist__cover {
    inline-size: 200px;
    block-size: 200px;
    object-fit: cover;
    border-radius: calc(var(--radius-card) / 2);
  }

  .playlist__body {
    display: flex;
    flex: 1 1 16rem;
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .playlist__title {
    font-size: 2rem;
  }

  .playlist__platforms {
    display: flex;
    justify-content: space-evenly;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .platform {
    font-size: 3rem;
    color: var(--color-text);

    &[aria-current="true"] {
      color: var(--cream-50);
    }
  }

  .playlist__player iframe {
    border: 0;
    border-radius: 12px;
  }

  /* The library's search: the text, then the list's filters, side by
     side when there is room. */
  .library-search {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    align-items: flex-end;

    .library-search__text {
      flex: 1 1 16rem;
    }
  }

  /* Music library: grade and track forms sit on one line in tables. */
  .listen-form,
  .track-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
  }

  .listen-form__grade {
    inline-size: auto;
  }

  /* An album's form holds its tracklist: as wide as the page, its own
     fields as narrow as other forms' (forms.css). */
  .album-form {
    max-inline-size: none;

    > .field {
      max-inline-size: 28rem;
    }

    > .button {
      align-self: flex-start;
    }
  }

  /* Pictures of artists and albums on the library's pages: on the left
     of the name in lists. (The administration has its own `.media-thumb`.) */
  .media-name {
    display: inline-flex;
    gap: var(--space-2);
    align-items: center;
  }

  .library-thumb {
    flex: none;
    inline-size: 3rem;
    block-size: 3rem;
    object-fit: cover;
    border-radius: var(--radius-control);
  }

  .library-thumb--large {
    inline-size: 10rem;
    block-size: 10rem;
  }

  /* The album's check-off button: pressed once listened to. */
  .album-check[aria-pressed="true"]::before {
    content: "✓";

    /* Visual only: the state is `aria-pressed`. */
    content: "✓" / "";
    margin-inline-end: var(--space-2);
  }

  /* Rankings on profiles: artists and genres. */
  .ranked-list {
    display: grid;
    gap: var(--space-2);
    padding-inline-start: var(--space-6);
  }

  /* Grades given on a profile: one meter per grade. */
  .grade-chart {
    border-collapse: collapse;

    th,
    td {
      padding-block: var(--space-1);
      padding-inline-end: var(--space-2);
      text-align: start;
      white-space: nowrap;
    }
  }

  .grade-chart__bar {
    inline-size: min(20rem, 50vw);
    block-size: 0.5rem;
    vertical-align: middle;
  }

  .grade-chart__track {
    fill: var(--color-border);
  }

  .grade-chart__fill {
    fill: var(--color-text);
  }

  /* A profile's numbers and genres, side by side when there is room. */
  .profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--space-4);
  }

  .profile-card {
    padding: var(--space-4);
    border: 3px solid var(--color-text);
    border-radius: var(--radius-card);
  }
}
