/*!
 * Copyright (C) 2023 StApps
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, version 3.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <https://www.gnu.org/licenses/>.
 */

ion-card {
  z-index: 2;

  width: inherit;
  margin-right: 0;
  margin-left: 0;

  border-radius: 0;

  &::after {
    content: '';

    position: absolute;
    bottom: 0;

    width: 100%;
    height: 33%;
  }

  ion-card-header,
  ion-card-title,
  ion-card-subtitle span,
  ion-card-content ion-note {
    font-family: var(--headline-font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-overflow: ellipsis;
  }

  ion-card-header {
    height: available;
    padding-bottom: var(--spacing-xs);

    ion-card-title {
      overflow-wrap: break-word;
    }

    ion-card-subtitle {
      display: flex;

      ion-icon.icon-white {
        margin-right: var(--spacing-xs);
        color: var(--ion-color-primary-contrast);
      }
    }
  }

  ion-card-content .place-name {
    display: block;
    font-family: var(--headline-font-family);
  }

  div {
    position: absolute;
    bottom: 0;

    width: 100%;
    height: 20px;

    background: linear-gradient(rgb(255 255 255 / 0%) 0%, rgb(255 255 255 / 25500%) 100%);
  }

  @each $name in lecture, exercise, default {
    &.#{$name}Card {
      --background: var(--calender-#{$name}-card);

      &::after {
        background: linear-gradient(
          rgb(var(--calender-#{$name}-card-rgb) 0%),
          rgb(var(--calender-#{$name}-card-rgb) 100%)
        );
      }

      ion-card-title,
      ion-card-subtitle span,
      ion-card-content ion-note,
      ion-card-content ion-text {
        color: var(--calender-#{$name}-card-contrast);
      }
    }
  }
}
