/**
 * ============================================================
 * STFE Discovery Calendar
 * Interface publique V1.0
 * ============================================================
 *
 * Rôle :
 * Afficher la grille des jours et le panneau de présentation
 * dans une mise en page claire, responsive et accessible.
 */

.stfe-discovery-calendar {
    box-sizing: border-box;
    width: 100%;
    max-width: 1240px;
    margin: 2rem auto;
    padding: clamp(1rem, 2.5vw, 2rem);
    color: #000000;
}

.stfe-discovery-calendar *,
.stfe-discovery-calendar *::before,
.stfe-discovery-calendar *::after {
    box-sizing: inherit;
}

.stfe-discovery-calendar-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.stfe-discovery-calendar-title {
    margin: 0 0 0.4rem;
    color: #0156b2;
    font-size: clamp(1.6rem, 4vw, 2.35rem);
    line-height: 1.2;
}

.stfe-discovery-calendar-start {
    margin: 0;
    color: #000000;
    font-size: 0.95rem;
}

.stfe-discovery-calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr);
    overflow: hidden;
    border: 1px solid rgba(12, 113, 195, 0.18);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 0.75rem 2.5rem rgba(1, 86, 178, 0.08);
}

.stfe-discovery-calendar-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-content: start;
    gap: clamp(0.55rem, 1.2vw, 0.9rem);
    padding: clamp(1rem, 2.5vw, 2rem);
}

.stfe-discovery-calendar-box {
    position: relative;
    display: flex;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 88px;
    overflow: hidden;
    border: 1px solid rgba(12, 113, 195, 0.2);
    border-radius: 0.65rem;
    background: #ffffff;
    box-shadow: 0 0.2rem 0.65rem rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.stfe-discovery-calendar-box::before {
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    left: 0;
    height: 0.45rem;
    background: #0c71c3;
    content: "";
}

.stfe-day-button,
.stfe-day-content {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: inherit;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 0.45rem 0.55rem;
    border: 0;
    background: transparent;
    color: #000000;
    font: inherit;
    text-align: center;
}

.stfe-day-button {
    border-radius: inherit;
    cursor: pointer;
}

.stfe-day-number {
    font-size: clamp(1.35rem, 2.7vw, 2rem);
    font-weight: 700;
    line-height: 1;
}

.stfe-day-date {
    max-width: 100%;
    margin-top: 0.5rem;
    overflow: hidden;
    color: #000000;
    font-size: clamp(0.63rem, 1.2vw, 0.76rem);
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stfe-day-past {
    background: #ffffff;
}

.stfe-day-current {
    border-color: #0c71c3;
    background: rgba(12, 113, 195, 0.04);
}

.stfe-day-future {
    border-color: rgba(0, 0, 0, 0.12);
    background: #f7f7f7;
    color: rgba(0, 0, 0, 0.58);
}

.stfe-day-future::before {
    background: rgba(0, 0, 0, 0.28);
}

.stfe-day-future .stfe-day-number,
.stfe-day-future .stfe-day-date {
    color: rgba(0, 0, 0, 0.58);
}

.stfe-day-lock {
    position: absolute;
    z-index: 2;
    top: 0.65rem;
    right: 0.45rem;
    width: 1rem;
    height: 1rem;
    object-fit: contain;
    opacity: 0.78;
}

.stfe-day-clickable:hover {
    border-color: #0c71c3;
    box-shadow: 0 0.45rem 1rem rgba(1, 86, 178, 0.16);
    transform: translateY(-2px);
}

.stfe-day-button:focus {
    outline: none;
}

.stfe-day-button:focus-visible {
    outline: 3px solid #0c71c3;
    outline-offset: -4px;
}

.stfe-discovery-calendar-box.is-selected {
    border-color: #0c71c3;
    box-shadow: 0 0 0 3px rgba(12, 113, 195, 0.24), 0 0.5rem 1.1rem rgba(1, 86, 178, 0.16);
}

.stfe-discovery-calendar-box.is-selected::before {
    background: #0156b2;
}

.stfe-discovery-calendar-presentation {
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-left: 1px solid rgba(12, 113, 195, 0.14);
    background: #ffffff;
}

.stfe-discovery-calendar-media {
    width: 100%;
    max-width: 420px;
}

.stfe-discovery-calendar-media[hidden],
.stfe-discovery-calendar-action[hidden] {
    display: none;
}

.stfe-discovery-calendar-image {
    display: block;
    width: 100%;
    max-height: 440px;
    object-fit: contain;
    border-radius: 0.8rem;
}

.stfe-discovery-calendar-action {
    display: inline-flex;
    width: 100%;
    max-width: 390px;
    min-height: 3.5rem;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.4rem;
    border: 2px solid #dc0100;
    border-radius: 0.55rem;
    background: #dc0100;
    box-shadow: 0 0.35rem 0.9rem rgba(220, 1, 0, 0.2);
    color: #ffffff;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.stfe-discovery-calendar-action:hover,
.stfe-discovery-calendar-action:focus-visible {
    border-color: #0156b2;
    background: #0156b2;
    box-shadow: 0 0.45rem 1rem rgba(1, 86, 178, 0.22);
    color: #ffffff;
}

.stfe-discovery-calendar-action:focus-visible {
    outline: 3px solid #0c71c3;
    outline-offset: 3px;
}

.stfe-screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

@media screen and (max-width: 980px) {
    .stfe-discovery-calendar-layout {
        grid-template-columns: 1fr;
    }

    .stfe-discovery-calendar-presentation {
        min-height: 360px;
        border-top: 1px solid rgba(12, 113, 195, 0.14);
        border-left: 0;
    }
}

@media screen and (max-width: 720px) {
    .stfe-discovery-calendar {
        margin: 1rem auto;
    }

    .stfe-discovery-calendar-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media screen and (max-width: 480px) {
    .stfe-discovery-calendar {
        padding: 0.5rem;
    }

    .stfe-discovery-calendar-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .stfe-discovery-calendar-box {
        min-height: 82px;
    }

    .stfe-discovery-calendar-presentation {
        min-height: 300px;
        padding: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stfe-discovery-calendar-box,
    .stfe-discovery-calendar-action {
        transition: none;
    }
}
