/**
 * Copyright since 2026 Solauv
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License 3.0 (AFL-3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 *
 * @author    Solauv
 * @copyright Since 2026 Solauv
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 *
 * Home page.
 *
 * Image slider of the hummingbird theme (ps_imageslider), at the size it had in the shop
 * (1110 x 340 px on computers): the text of a slide on its left, over the dark part of the
 * image, without the blurred box of the theme; the same on phones and tablets, the image
 * whole and the text scaled down (the theme crops the image and hides the text there). A
 * link in the text of a slide looks like a button.
 *
 * Shortcuts of the logged-in customers (hook displayHome), first, above the slider.
 */

/* The theme sorts its CSS in cascade layers, in this order (theme.css). Stated again in
   case this file is read first: the layer named below would otherwise come first. */
@layer vendors, bs-base, bs-components, bs-custom-components, ps-base, ps-components, ps-pages, ps-modules, utilities;

/* The theme hides the text of the slides under 992 px with .d-none, an !important rule of
   its "utilities" layer: a rule outside the layers cannot override it. */
@layer utilities {
  .ps-imageslider .ps-imageslider__figcaption {
    display: block !important;
  }
}

/* The whole image, 1110 x 340 at every width (the theme crops it to 320 px high under
   992 px, 240 px under 768 px, by the height of the figure). */
.ps-imageslider .ps-imageslider__figure {
  height: auto;
}

.ps-imageslider .carousel-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 1110 / 340;
  object-fit: cover;
  object-position: center top;
}

/* Text sizes follow the width of the screen, down to phones. */
.ps-imageslider .ps-imageslider__figcaption {
  top: 50%;
  right: auto;
  bottom: auto;
  left: 5%;
  max-width: 36%;
  padding: 0;
  transform: translateY(-50%);
  text-align: left;
  color: #fff;
  background: none;
  border-radius: 0;
  backdrop-filter: none;
}

.ps-imageslider .ps-imageslider__figcaption h2 {
  margin-bottom: 0.4em;
  font-size: clamp(0.8rem, 2.2vw, 2.5rem);
  line-height: 1.1;
  color: inherit;
}

.ps-imageslider .ps-imageslider__figcaption div > * {
  margin-bottom: 0.8em;
  font-size: clamp(0.6rem, 1.3vw, 1.4rem);
  font-weight: 500;
  line-height: 1.3;
  color: inherit;
}

.ps-imageslider .ps-imageslider__figcaption div > :last-child {
  margin-bottom: 0;
}

.ps-imageslider .ps-imageslider__figcaption a {
  display: inline-block;
  padding: 0.6em 1.25em;
  font-size: clamp(0.6rem, 1vw, 1rem);
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background-color: var(--bs-primary);
  border-radius: var(--bs-border-radius);
}

.ps-imageslider .ps-imageslider__figcaption a:hover,
.ps-imageslider .ps-imageslider__figcaption a:focus-visible {
  filter: brightness(0.9);
}

/* A single slide: no arrows, no dots. */
.ps-imageslider .carousel:has(> .carousel-inner > .carousel-item:only-child) :is(.carousel-indicators, .carousel-control-prev, .carousel-control-next) {
  display: none;
}

/* Computers: 1110 px wide (930 px under 1200 px), as in the shop; the shortcuts, above it,
   take the same width. */
@media (min-width: 992px) {
  .ps-imageslider,
  .ebi43-shortcuts {
    max-width: 954px;
    margin-inline: auto;
    padding-inline: 0.75rem;
  }

  .ps-imageslider {
    margin-top: 1rem;
  }

  .ps-imageslider .carousel {
    overflow: hidden;
    border-radius: var(--bs-border-radius-lg);
  }
}

@media (min-width: 1200px) {
  .ps-imageslider,
  .ebi43-shortcuts {
    max-width: 1134px;
  }
}

/* Shortcuts of the logged-in customers, first on the home page, right under the menu. */
.ebi43-shortcuts {
  margin-top: 1rem;
}

/* The home page of the theme is a grid with 2.5 rem between its blocks: 1 rem only between
   the shortcuts and the slider. */
.ebi43-shortcuts + .ps-imageslider {
  margin-top: -1.5rem;
}

.ebi43-shortcuts__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ebi43-shortcut {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  height: 100%;
  padding: 1rem 1.25rem;
  color: var(--bs-body-color, #1c1d21);
  text-decoration: none;
  background-color: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: var(--bs-border-radius-lg, 0.5rem);
}

.ebi43-shortcut:hover,
.ebi43-shortcut:focus-visible {
  color: var(--bs-body-color, #1c1d21);
  border-color: var(--bs-primary, #3d87ff);
}

.ebi43-shortcut .material-icons {
  flex: none;
  width: auto;
  height: auto;
  font-size: 2rem;
  line-height: 1;
  color: var(--bs-primary, #3d87ff);
}

.ebi43-shortcut__body {
  display: flex;
  flex-direction: column;
}

.ebi43-shortcut__title {
  font-weight: 600;
}

.ebi43-shortcut__text {
  font-size: 0.875rem;
  color: var(--bs-secondary-color, #6c757d);
}

@media (max-width: 575.98px) {
  .ebi43-shortcuts__list {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .ebi43-shortcut {
    padding: 0.75rem 1rem;
  }

  .ebi43-shortcut .material-icons {
    font-size: 1.5rem;
  }
}
