/*!
 * 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/>.
 */
@import '../../../../theme/util/mixins';

:host {
  display: block;
}

ion-item::part(native) {
  height: 100%;
  padding: var(--spacing-sm);
}

ion-item {
  --border-color: transparent;
  --inner-padding-end: 0;
  @include border-radius-in-parallax(var(--border-radius-default));

  overflow: hidden;
  height: 100%;
  margin: var(--spacing-sm);

  ion-thumbnail {
    --size: 36px;

    margin: 0;
    margin-inline: var(--spacing-md);
    padding: 0;
  }
}

.ion-text-wrap ::ng-deep ion-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  white-space: normal !important;

  -webkit-line-clamp: 3;
}

[slot='end'] {
  margin-block: auto;
  margin-inline-start: 0;
}

stapps-action-chip-list {
  float: bottom;
}

ion-item ::ng-deep {
  stapps-long-inline-text,
  .title {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;

    white-space: break-spaces;

    -webkit-line-clamp: 2;
  }

  .title-sub {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;

    margin-block: var(--spacing-xs);

    white-space: break-spaces;

    -webkit-line-clamp: 1;
  }
}

:host.square ::ng-deep {
  ion-item {
    align-items: flex-start;
    margin: 0;
  }

  ion-row {
    flex-direction: column;
    justify-content: space-between;
    height: 120px;
  }

  ion-col {
    flex-basis: min-content;
    flex-grow: 0;
  }

  .title {
    height: 2.5em;
  }

  .title ~ :last-child {
    margin-right: 42px;
  }

  stapps-rating,
  stapps-favorite-button {
    position: absolute;
    right: 0;
    bottom: 0;
  }

  stapps-rating {
    width: 100%;

    ion-button {
      float: right;
    }

    .rating-stars {
      gap: var(--spacing-xs);
      justify-content: center;
      width: 100%;
      padding-inline: 0;
    }
  }

  // fix for Safari
  stapps-offers-in-list {
    position: absolute;
    bottom: 0;
    left: 0;
  }

  stapps-offers-in-list .place {
    display: none;
  }
}
