/**
 * @package    EBR - Easybook Reloaded - Latest Entries Module
 * @version    6.1.0 - Joomla 6 port
 * @license    GNU/GPL v3 or later - https://www.gnu.org/licenses/gpl-3.0.html
 *
 * Slider display.
 *
 * Part 1: layout of the module itself.
 * Part 2: fallback for templates without UIkit CSS. These rules are wrapped in :where() and therefore have
 *         no specificity - if the template provides UIkit (e.g. JoomlaPlates, YOOtheme), its styles always win.
 *         The values follow UIkit 3.25 (MIT License, Copyright (c) YOOtheme GmbH).
 *
 * Override in your template: media/templates/site/<template>/css/mod_ebrlatestentries/ebrlatestentries-slider.css
 */

/* ---------- Part 1: module layout ---------- */

.easylast-slider .easylast-slider-inner {
    position: relative;
}

.easylast-slider .easylast-entry {
    margin-bottom: 0;
}

.easylast-slider .easylast-slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.easylast-slider.easylast-slider-arrows-bottom .easylast-slider-controls {
    justify-content: space-between;
}

.easylast-slider .easylast-slider-controls .easylast-dotnav {
    flex: 1 1 auto;
    justify-content: center;
}

.easylast-slider .easylast-slidenav {
    line-height: 0;
    text-decoration: none;
}

.easylast-slider .easylast-slidenav-inside {
    position: absolute;
    top: 50%;
    z-index: 1;
    margin: 0 8px;
    padding: 10px 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.85);
    color: #333;
    opacity: 1;
    transform: translateY(-50%);
    transition: opacity 0.2s ease-in-out;
}

.easylast-slider .easylast-slidenav-inside:hover,
.easylast-slider .easylast-slidenav-inside:focus-visible {
    background-color: #fff;
    color: #000;
}

/* Arrows inside the slider only on hover/focus (devices with mouse); always visible on touch devices */
@media (hover: hover) {
    .easylast-slider .easylast-slider-inner:not(:hover):not(:focus-within) .easylast-slidenav-inside {
        opacity: 0;
    }
}

.easylast-slider .easylast-slidenav-inside.easylast-slidenav-previous {
    left: 0;
}

.easylast-slider .easylast-slidenav-inside.easylast-slidenav-next {
    right: 0;
}

.easylast-slider.easylast-text-center .easylast-entry,
.easylast-slider.easylast-text-center .easylast-link,
.easylast-slider.easylast-text-center .easylast-small {
    text-align: center;
}

.easylast-slider.easylast-text-center .easylast-text :is(ul, ol) {
    list-style-position: inside;
    padding-left: 0;
}

/* ---------- Part 2: UIkit fallback ---------- */

/* Structure - identical to UIkit, needed against list resets of other frameworks (e.g. Bootstrap) */
.easylast-slider .uk-slider-container {
    overflow-x: hidden;
    overflow-x: clip;
}

.easylast-slider .uk-slider-items {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    list-style: none;
    touch-action: pan-y;
    will-change: transform;
    -webkit-touch-callout: none;
}

.easylast-slider .uk-slider-items > * {
    position: relative;
    flex: none !important;
    box-sizing: border-box;
    max-width: 100%;
    margin: 0;
}

.easylast-slider .uk-dotnav {
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    list-style: none;
}

.easylast-slider .uk-invisible {
    visibility: hidden !important;
}

.easylast-slider :is(.uk-card-primary, .uk-card-secondary) a {
    color: inherit;
}

/* Gaps */
:where(.easylast-slider .uk-grid) { margin-left: -30px; }
:where(.easylast-slider .uk-grid > *) { padding-left: 30px; }
:where(.easylast-slider .uk-grid > * > :last-child) { margin-bottom: 0; }
@media (min-width: 1200px) {
    :where(.easylast-slider .uk-grid) { margin-left: -40px; }
    :where(.easylast-slider .uk-grid > *) { padding-left: 40px; }
}
:where(.easylast-slider .uk-grid-small) { margin-left: -15px; }
:where(.easylast-slider .uk-grid-small > *) { padding-left: 15px; }
:where(.easylast-slider .uk-grid-medium) { margin-left: -30px; }
:where(.easylast-slider .uk-grid-medium > *) { padding-left: 30px; }
:where(.easylast-slider .uk-grid-large) { margin-left: -40px; }
:where(.easylast-slider .uk-grid-large > *) { padding-left: 40px; }
@media (min-width: 1200px) {
    :where(.easylast-slider .uk-grid-large) { margin-left: -70px; }
    :where(.easylast-slider .uk-grid-large > *) { padding-left: 70px; }
}
:where(.easylast-slider .uk-grid-collapse) { margin-left: 0; }
:where(.easylast-slider .uk-grid-collapse > *) { padding-left: 0; }

/* Equal height */
:where(.easylast-slider .uk-grid-match > *) {
    display: flex;
    flex-wrap: wrap;
}

:where(.easylast-slider .uk-grid-match > * > *) {
    box-sizing: border-box;
    width: 100%;
    flex: auto;
}

/* Columns (Smartphone / Tablet from 640px / Desktop from 960px) */
:where(.easylast-slider .uk-child-width-1-1 > *) { width: 100%; }
:where(.easylast-slider .uk-child-width-1-2 > *) { width: 50%; }
:where(.easylast-slider .uk-child-width-1-3 > *) { width: calc(100% / 3); }
@media (min-width: 640px) {
    :where(.easylast-slider .uk-child-width-1-1\@s > *) { width: 100%; }
    :where(.easylast-slider .uk-child-width-1-2\@s > *) { width: 50%; }
    :where(.easylast-slider .uk-child-width-1-3\@s > *) { width: calc(100% / 3); }
    :where(.easylast-slider .uk-child-width-1-4\@s > *) { width: 25%; }
}
@media (min-width: 960px) {
    :where(.easylast-slider .uk-child-width-1-1\@m > *) { width: 100%; }
    :where(.easylast-slider .uk-child-width-1-2\@m > *) { width: 50%; }
    :where(.easylast-slider .uk-child-width-1-3\@m > *) { width: calc(100% / 3); }
    :where(.easylast-slider .uk-child-width-1-4\@m > *) { width: 25%; }
    :where(.easylast-slider .uk-child-width-1-5\@m > *) { width: 20%; }
    :where(.easylast-slider .uk-child-width-1-6\@m > *) { width: calc(100% / 6); }
}

/* Cards */
:where(.easylast-slider .uk-card) {
    position: relative;
    box-sizing: border-box;
    border-radius: var(--bs-border-radius, 0);
}

:where(.easylast-slider .uk-card-body) {
    display: flow-root;
    padding: 30px;
}

:where(.easylast-slider .uk-card-small.uk-card-body) {
    padding: 20px;
}

:where(.easylast-slider .uk-card-default) {
    background-color: var(--bs-body-bg, #fff);
    color: inherit;
    border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

:where(.easylast-slider .uk-card-primary) {
    background-color: var(--bs-primary, #1e87f0);
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

:where(.easylast-slider .uk-card-secondary) {
    background-color: #222;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* Dot navigation */
:where(.easylast-slider .uk-dotnav) {
    display: flex;
    flex-wrap: wrap;
    margin-left: -12px;
}

:where(.easylast-slider .uk-dotnav > *) {
    flex: none;
    padding-left: 12px;
}

:where(.easylast-slider .uk-dotnav > * > *) {
    display: block;
    box-sizing: border-box;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    text-indent: 100%;
    overflow: hidden;
    white-space: nowrap;
    border: 1px solid currentColor;
    opacity: 0.45;
    transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

:where(.easylast-slider .uk-dotnav > * > :hover),
:where(.easylast-slider .uk-dotnav > .uk-active > *) {
    background-color: currentColor;
    opacity: 0.7;
}

/* Arrows */
:where(.easylast-slider .uk-slidenav) {
    padding: 5px 10px;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.1s ease-in-out;
}

:where(.easylast-slider .uk-slidenav:hover),
:where(.easylast-slider .uk-slidenav:focus-visible) {
    opacity: 1;
}

/* Icons (the arrows are inserted by UIkit as SVG) */
:where(.easylast-slider .uk-icon) {
    display: inline-block;
    fill: currentcolor;
    line-height: 0;
}

:where(.easylast-slider .uk-icon [fill*="#"]) {
    fill: currentcolor;
}

:where(.easylast-slider .uk-icon [stroke*="#"]) {
    stroke: currentcolor;
}
