/**
 * KSSBS.SK — úvod hlavnej stránky (sections/section-hero-dashboard.php):
 * slider zvýraznených článkov + widgety Aktuálne, Voľné dni, Rýchle odkazy.
 */

.home-hero {
    position: relative;
    /* hlavička pláva nad obsahom */
    padding: 116px 0 var(--space-12);
    background:
        radial-gradient(60% 50% at 10% 0%, rgba(82, 95, 225, 0.1), transparent 70%),
        radial-gradient(50% 45% at 95% 10%, rgba(240, 127, 0, 0.08), transparent 70%),
        var(--color-body-bg, var(--color5));
}

[data-theme="dark"] .home-hero {
    background:
        radial-gradient(60% 50% at 10% 0%, rgba(82, 95, 225, 0.18), transparent 70%),
        radial-gradient(50% 45% at 95% 10%, rgba(240, 127, 0, 0.08), transparent 70%),
        var(--color-body-bg);
}

.home-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.home-hero__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-top: 20px;
}

@media (min-width: 960px) {
    .home-hero__grid {
        grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
    }

    .home-hero__row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    }
}

/* ── Karta (spoločný vzhľad widgetov) ───────────────────────────────── */
.home-card {
    position: relative;
    border-radius: 24px;
    background: var(--color-white);
    box-shadow: var(--shadow-md);
    /* jemné vysunutie pri načítaní, postupne podľa --d */
    animation: kssHomeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--d, 0) * 90ms + 80ms);
}

[data-theme="dark"] .home-card {
    box-shadow: var(--shadow-md);
}

@keyframes kssHomeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

.home-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-gray-500);
}

.home-label .material-symbols-outlined {
    font-size: 18px;
    color: var(--color1);
}

.home-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--color1-opacity);
    color: var(--color1);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.home-chip--ms { background: var(--color-ms-tint); color: var(--color-ms-ink); }
.home-chip--zs { background: var(--color-zs-tint); color: var(--color-zs-ink); }
.home-chip--wsos { background: var(--color-wsos-tint); color: var(--color-wsos-ink); }
.home-chip--jedalen { background: var(--color-jedalen-tint); color: var(--color-jedalen-ink); }

.home-empty {
    margin: 12px 0 0;
    font-size: 0.9rem;
    color: var(--color-gray-500);
}

[data-theme="dark"] .home-label .material-symbols-outlined {
    color: #a5b4fc;
}

/* ── Slider zvýraznených článkov ────────────────────────────────────── */
.home-slider {
    overflow: hidden;
    min-height: 460px;
    background: #0f172a;
    isolation: isolate;
}

.home-slider__swiper,
.home-slider .swiper-wrapper,
.home-slide {
    height: 100%;
    min-height: 460px;
}

.home-slide {
    position: relative;
    overflow: hidden;
}

/* celý slide je odkaz na článok */
.home-slide__link {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    color: #fff;
    text-decoration: none;
}

.home-slide__link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -6px;
    border-radius: 24px;
}

.home-slide__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    transition: transform 7s linear;
}

/* pomalé priblíženie aktívnej fotky */
.home-slide.swiper-slide-active .home-slide__img {
    transform: scale(1);
}

.home-slide__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 18%, rgba(15, 23, 42, 0.6) 52%, rgba(15, 23, 42, 0.9) 100%);
}

.home-slide__body {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    padding: 32px 32px 72px;
    color: #fff;
}

.home-slide__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.home-slide__date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.home-slide__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(15, 23, 42, 0.45);
}

.home-slide__perex {
    margin: 10px 0 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
}

.home-slide__cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 9px 16px;
    border-radius: 999px;
    background: #fff;
    color: #1e293b;
    font-size: 0.85rem;
    font-weight: 600;
}

.home-slide__cta .material-symbols-outlined {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.home-slide:hover .home-slide__cta .material-symbols-outlined {
    transform: translateX(3px);
}

/* text slidu sa pri zmene jemne vysunie */
.home-slide .home-slide__body > * {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.home-slide.swiper-slide-active .home-slide__body > * {
    opacity: 1;
    transform: none;
}

.home-slide.swiper-slide-active .home-slide__body > :nth-child(2) { transition-delay: 0.08s; }
.home-slide.swiper-slide-active .home-slide__body > :nth-child(3) { transition-delay: 0.16s; }
.home-slide.swiper-slide-active .home-slide__body > :nth-child(4) { transition-delay: 0.24s; }

.home-slider__nav {
    position: absolute;
    right: 20px;
    bottom: 20px;
    left: 32px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-slider__dots {
    display: flex;
    gap: 6px;
    margin-right: auto;
}

.home-slider__dots .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    margin: 0 !important;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.home-slider__dots .swiper-pagination-bullet-active {
    width: 24px;
    background: #fff;
}

.home-slider__btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.home-slider__btn:hover,
.home-slider__btn:focus-visible {
    background: rgba(255, 255, 255, 0.32);
}

.home-slider__btn:active {
    transform: scale(0.94);
}

.home-slider .home-empty {
    padding: 32px;
    color: rgba(255, 255, 255, 0.8);
}

/* ── Aktuálne ───────────────────────────────────────────────────────── */
.home-now {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
}

.home-now__date {
    margin: 10px 0 0;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.home-now__names {
    margin: 4px 0 0;
    font-size: 0.86rem;
    color: var(--color-gray-600);
}

.home-now__names strong {
    color: var(--color-gray-900);
}

.home-now__names span {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--color-gray-500);
}

.home-weather {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
    background: var(--mh-fill);
}

.home-weather__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--color1);
    color: #fff;
    font-size: 26px;
}

.home-weather__temp {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-gray-900);
}

.home-weather__desc {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--color-gray-500);
}

.home-weather__place {
    align-self: flex-start;
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-gray-500);
    text-align: right;
}

.home-bell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 2px;
}

.home-bell__top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-bell__title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

.home-bell__bar {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-gray-100);
}

.home-bell__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--color-zs);
    transition: width 1s linear;
}

.home-bell--wsos .home-bell__bar span {
    background: var(--color-wsos);
}

.home-bell[data-state="break"] .home-bell__bar span {
    background: var(--color-gray-400);
}

.home-bell__text {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-gray-500);
}

/* ── Najbližšie voľné dni ───────────────────────────────────────────── */
.home-free,
.home-quick {
    padding: 22px;
}

.home-free__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.home-free__item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    transition: background-color 0.15s ease;
}

.home-free__item:hover {
    background: var(--mh-fill);
}

.home-free__date {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.home-free__label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--color-gray-700);
}

.home-free__when {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color1);
    white-space: nowrap;
}

[data-theme="dark"] .home-free__when {
    color: #a5b4fc;
}

/* ── Rýchle odkazy ──────────────────────────────────────────────────── */
.home-quick__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    margin-top: 14px;
}

@media (min-width: 640px) {
    .home-quick__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.home-quick__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--color-gray-800);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.home-quick__link:hover,
.home-quick__link:focus-visible {
    background: var(--mh-fill);
}

.home-quick__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--color1-opacity);
    color: var(--color1);
    font-size: 20px;
    transition: transform 0.2s ease;
}

[data-theme="dark"] .home-quick__icon {
    color: #a5b4fc;
}

.home-quick__link:hover .home-quick__icon {
    transform: scale(1.08) rotate(-4deg);
}

.home-quick__label {
    min-width: 0;
}

.home-quick__go {
    margin-left: auto;
    font-size: 17px;
    color: var(--color-gray-400);
    transition: transform 0.2s ease, color 0.15s ease;
}

.home-quick__link:hover .home-quick__go {
    color: var(--color1);
    transform: translateX(3px);
}

/* ── Mobil ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .home-hero {
        padding-top: 24px;
    }

    .home-slider,
    .home-slider__swiper,
    .home-slider .swiper-wrapper,
    .home-slide {
        min-height: 400px;
    }

    .home-slide__body {
        padding: 22px 20px 68px;
    }

    .home-slider__nav {
        left: 20px;
        right: 14px;
        bottom: 16px;
    }

    .home-free__item {
        grid-template-columns: 80px minmax(0, 1fr);
    }

    .home-free__when {
        grid-column: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-card,
    .home-slide__img,
    .home-slide .home-slide__body > *,
    .home-bell__bar span {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Karty škôl pod úvodom už nezasahujú do neho (pri starom slideri áno) */
.home-hero + .schools-section {
    margin-top: 0;
    padding-top: var(--space-4);
}

/* Mobil: lišta s logom na začiatku stránky (desktopová hlavička je skrytá) */
.mobile-topbar {
    display: none;
}

@media (max-width: 600px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 20px 0;
    }

    .mobile-topbar .mega-header__logo {
        margin: 0;
        padding: 0;
    }

    /* lupa a prepínač režimu vpravo vedľa seba */
    .mobile-topbar .mobile-topbar__search {
        margin-left: auto;
    }

    .mobile-topbar .mega-header__icon-btn + .mega-header__icon-btn {
        margin-left: -4px;
    }

    .mobile-topbar .kss-logo__icon {
        width: 38px;
        height: 38px;
    }

    .mobile-topbar .kss-logo__text {
        height: 27px;
    }

    .home-hero {
        padding-top: 16px;
    }

}
