/**
 * @package     Joomla.Site
 * @subpackage  mod_epfswiper
 *
 * @copyright   Copyright (C) 2026. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 *
 * Layout/skin for mod_epfswiper. Only presentational rules live here —
 * Swiper's own mechanics (transitions, effects, breakpoints) are entirely
 * driven by the JSON config in media/js/module.js, not by CSS overrides.
 */


 :root {
    --slider-radius: 0;
 }

.epfswiper {
    position: relative;
}

.epfswiper__empty {
    margin: 0;
    color: var(--bs-secondary-color, #6c757d);
}

.epfswiper__swiper {
    /* padding-bottom: 2.5rem; */
}

/* Set via inline style (--epfswiper-slide-height) from the "Slide Height" param;
   falls back to Swiper's normal content-driven auto height when unset. */
.epfswiper__swiper .swiper-slide {
    height: var(--epfswiper-slide-height, auto);
}

.epfswiper__item {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: var(--slider-radius, 0.375rem);
    background-color: var(--bs-body-bg, #fff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.epfswiper__image-link {
    display: block;
    line-height: 0;
    height:100%;
}

.epfswiper__image {
    display: block;
    width: 100%;
    object-fit: cover;
}

.epfswiper__content {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
}

/* --- "Cards" layout (default): image above, content below. --- */
.epfswiper__item--cards .epfswiper__image {
    height: 12rem;
}

/* --- "Cover" layout: full-bleed background image, content centered on top. --- */
.epfswiper__item--cover {
    /* Falls back to a sensible hero-height default when no explicit
       "Slide Height" param is set; otherwise matches it exactly so the
       two never fight over the slide's final height. */
    min-height: var(--epfswiper-slide-height, 22rem);
    color: #fff;
}

.epfswiper__item--cover .epfswiper__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.epfswiper__item--cover .epfswiper__image {
    height: 100%;
}

/* Gradient scrim behind the centered text, for legibility over any photo. */
.epfswiper__item--cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
}

.epfswiper__item--cover .epfswiper__content {
    z-index: 2;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1.5rem;
    text-align: center;
}

.epfswiper__item--cover .epfswiper__category {
    color: rgba(255, 255, 255, 0.85);
}

.epfswiper__item--cover .epfswiper__date {
    color: rgba(255, 255, 255, 0.75);
}

.epfswiper__item--cover .epfswiper__intro,
.epfswiper__item--cover .epfswiper__readmore {
    color: #fff;
}

.epfswiper__category {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--bs-primary, #0d6efd);
}

.epfswiper__title {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.3;
}

.epfswiper__title a {
    color: inherit;
    text-decoration: none;
}

.epfswiper__title a:hover,
.epfswiper__title a:focus-visible {
    text-decoration: underline;
}

.epfswiper__date {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color, #6c757d);
}

.epfswiper__intro {
    margin: 0;
    color: var(--bs-body-color, #212529);
}

.epfswiper__readmore {
    margin-top: auto;
    font-weight: 600;
    text-decoration: none;
}

.epfswiper__readmore:hover,
.epfswiper__readmore:focus-visible {
    text-decoration: underline;
}

/* Visually hide text while keeping it in the accessibility tree. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Consistent, visible focus states for keyboard users (WCAG 2.1 SC 2.4.7). */
.epfswiper__swiper .swiper-button-prev:focus-visible,
.epfswiper__swiper .swiper-button-next:focus-visible,
.epfswiper__swiper .swiper-pagination-bullet:focus-visible,
.epfswiper__item a:focus-visible,
.epfswiper__autoplay-toggle:focus-visible {
    outline: 3px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

.epfswiper__swiper .swiper-button-prev,
.epfswiper__swiper .swiper-button-next {
    width: 2.5rem;
    height: 2.5rem;
    margin-top: -1.25rem;
    color: var(--bs-body-color, #212529);
    background-color: var(--bs-body-bg, #fff);
    border-radius: 50%;
    border:0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.epfswiper__swiper .swiper-button-prev::after,
.epfswiper__swiper .swiper-button-next::after {
    font-size: 1rem;
}

.epfswiper__swiper .swiper-pagination-bullet {
    background-color: var(--bs-secondary, #6c757d);
    opacity: 0.6;
}

.epfswiper__swiper .swiper-pagination-bullet-active {
    background-color: var(--bs-primary, #0d6efd);
    opacity: 1;
}

.epfswiper__autoplay-toggle {
    position: absolute;
    z-index: 2;
    bottom: 0;
    right: 0;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--bs-body-color, #212529);
    background-color: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--slider-radius, 0.375rem);
    cursor: pointer;
}

/* Respect the visitor's reduced-motion preference for the slide transition itself. */
@media (prefers-reduced-motion: reduce) {
    .epfswiper__swiper .swiper-wrapper {
        transition-duration: 0ms !important;
    }
}
