/* ==========================================================================
   EVENTS CALENDAR - Personalizacion de FullCalendar para Son Sant Jordi
   Sobreescribe estilos de fullcalendar.min.css para adaptar el calendario
   a la identidad visual del proyecto (tipografia, colores, espaciados).
   ========================================================================== */

/* ----------------------------------------------------------------------------
   Padding del middle para compensar header fixed
   ---------------------------------------------------------------------------- */

body.events #middle {
    padding-top: 132px;
}

/* ----------------------------------------------------------------------------
   Contenedor principal y titulo de seccion
   ---------------------------------------------------------------------------- */

#eventsCalendarSec {
    padding: 80px 64px;
}

#eventsCalendarSec .section-title {
    margin: 0 0 48px 0;
    font-family: 'Playfair Display';
    font-size: 3.375rem;
    color: #00181a;
    font-weight: 400;
    line-height: 4.25rem;
    text-transform: uppercase;
    text-wrap: balance;
    text-align: center;
}

/* ----------------------------------------------------------------------------
   Toolbar de navegacion (mes anterior/siguiente, titulo, vistas)
   ---------------------------------------------------------------------------- */

#eventsCalendarSec .fc .fc-toolbar {
    margin-bottom: 24px;
    gap: 16px;
}

#eventsCalendarSec .fc .fc-toolbar-title {
    font-family: 'Playfair Display';
    font-size: 1.75rem;
    color: #00181a;
    font-weight: 400;
    line-height: 2.25rem;
    text-transform: capitalize;
}

/* Botones de la toolbar (prev, next, today, cambio de vista) */
#eventsCalendarSec .fc .fc-button {
    padding: 8px 16px;
    border: 1px solid #2A2A2A;
    border-radius: 2px;
    background-color: transparent;
    font-family: 'Inter';
    font-size: 0.8125rem;
    color: #00181a;
    font-weight: 700;
    line-height: 1.375rem;
    text-transform: uppercase;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

#eventsCalendarSec .fc .fc-button:not(.fc-button-active):hover {
    border-color: #2A2A2A;
    background-color: #2A2A2A;
    color: #ffffff;
}

#eventsCalendarSec .fc .fc-button:focus {
    outline: none;
    box-shadow: none;
}

/* Boton activo (vista seleccionada, today pulsado) */
#eventsCalendarSec .fc .fc-button-active {
    border-color: #008691;
    background-color: #008691;
    color: #ffffff;
    cursor: initial;
}

/* Flechas de navegacion (prev/next) */
#eventsCalendarSec .fc .fc-prev-button,
#eventsCalendarSec .fc .fc-next-button {
    padding: 8px 12px;
}

/* ----------------------------------------------------------------------------
   Grid del calendario — cabecera de dias y celdas
   ---------------------------------------------------------------------------- */

/* Bordes generales del grid */
#eventsCalendarSec .fc .fc-scrollgrid {
    border-color: #D9D9D9;
}

#eventsCalendarSec .fc td,
#eventsCalendarSec .fc th {
    border-color: #D9D9D9;
}

/* Cabecera de dias (Lun, Mar, Mie...) */
#eventsCalendarSec .fc .fc-col-header-cell {
    padding: 12px 0;
    background-color: #2A2A2A;
}

#eventsCalendarSec .fc .fc-col-header-cell-cushion {
    font-family: 'Inter';
    font-size: 0.8125rem;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
}

/* Numeros de dia */
#eventsCalendarSec .fc .fc-daygrid-day-number {
    padding: 8px 10px;
    font-family: 'Inter';
    font-size: 0.875rem;
    color: #00181a;
    font-weight: 400;
    text-decoration: none;
}

/* Dia actual */
#eventsCalendarSec .fc .fc-day-today {
    background-color: rgba(0, 168, 181, 0.08);
}

#eventsCalendarSec .fc .fc-col-header-cell.fc-day-today {
    background-color: #00A8B5;
}

#eventsCalendarSec .fc .fc-day-today .fc-daygrid-day-number {
    color: #00A8B5;
    font-weight: 700;
}

/* Dias de otros meses */
#eventsCalendarSec .fc .fc-day-other .fc-daygrid-day-number {
    opacity: 0.35;
}

/* ----------------------------------------------------------------------------
   Eventos dentro del calendario
   ---------------------------------------------------------------------------- */

#eventsCalendarSec .fc .fc-daygrid-event {
    border: none;
    border-radius: 2px;
    padding: 2px 6px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

#eventsCalendarSec .fc .fc-daygrid-event:hover {
    opacity: 0.85;
}

/* Color de fondo de eventos (dot y block) */
#eventsCalendarSec .fc .fc-event {
    background-color: #00A8B5;
    border-color: #00A8B5;
}

/* Texto del evento */
#eventsCalendarSec .fc .fc-event-title {
    font-family: 'Inter';
    font-size: 0.75rem;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.125rem;
}

/* Hora del evento */
#eventsCalendarSec .fc .fc-event-time {
    font-family: 'Inter';
    font-size: 0.6875rem;
    color: #ffffff;
    font-weight: 400;
}

/* Evento tipo dot (cuando hay muchos en un dia) */
#eventsCalendarSec .fc .fc-daygrid-event-dot {
    border-color: #00A8B5;
}

/* Enlace "more" cuando hay muchos eventos en un dia */
#eventsCalendarSec .fc .fc-daygrid-more-link {
    font-family: 'Inter';
    font-size: 0.75rem;
    color: #00A8B5;
    font-weight: 700;
    text-decoration: none;
}

#eventsCalendarSec .fc .fc-daygrid-more-link:hover {
    color: #008691;
}

/* Popover de "more events" */
#eventsCalendarSec .fc .fc-popover {
    border: 1px solid #D9D9D9;
    border-radius: 2px;
    box-shadow: 0 4px 16px rgba(42, 42, 42, 0.12);
}

#eventsCalendarSec .fc .fc-popover-header {
    padding: 10px 14px;
    background-color: #2A2A2A;
    font-family: 'Inter';
    font-size: 0.8125rem;
    color: #ffffff;
    font-weight: 700;
}

/* ----------------------------------------------------------------------------
   Vista lista / agenda (fc-list)
   ---------------------------------------------------------------------------- */

#eventsCalendarSec .fc .fc-list {
    border-color: #D9D9D9;
}

/* Cabecera de grupo de dia en vista lista */
#eventsCalendarSec .fc .fc-list-day-cushion {
    padding: 10px 14px;
    background-color: #2A2A2A;
}

#eventsCalendarSec .fc .fc-list-day-cushion a {
    font-family: 'Playfair Display';
    font-size: 1rem;
    color: #ffffff;
    font-weight: 400;
    text-decoration: none;
}

/* Filas de evento en vista lista */
#eventsCalendarSec .fc .fc-list-event td {
    padding: 10px 14px;
    border-color: #D9D9D9;
}

#eventsCalendarSec .fc .fc-list-event:hover td {
    background-color: rgba(0, 168, 181, 0.06);
}

/* Dot de color en vista lista */
#eventsCalendarSec .fc .fc-list-event-dot {
    border-color: #00A8B5;
}

/* Titulo del evento en vista lista */
#eventsCalendarSec .fc .fc-list-event-title a {
    font-family: 'Inter';
    font-size: 0.9375rem;
    color: #00181a;
    font-weight: 600;
    text-decoration: none;
}

/* Hora del evento en vista lista */
#eventsCalendarSec .fc .fc-list-event-time {
    font-family: 'Inter';
    font-size: 0.8125rem;
    color: #00181a;
    font-weight: 400;
}

/* Mensaje "sin eventos" en vista lista */
#eventsCalendarSec .fc .fc-list-empty {
    padding: 48px 24px;
    font-family: 'Inter';
    font-size: 1rem;
    color: #00181a;
    text-align: center;
}

/* ----------------------------------------------------------------------------
   Desktop Grande (>1920px)
   ---------------------------------------------------------------------------- */

@media (min-width: 1921px) {
    #eventsCalendarSec {
        padding: 100px 64px;
    }

    #eventsCalendarSec .section-title {
        margin-bottom: 56px;
        font-size: 4rem;
        line-height: 5rem;
    }

    #eventsCalendarSec .fc .fc-toolbar-title {
        font-size: 2rem;
        line-height: 2.5rem;
    }
}

/* ----------------------------------------------------------------------------
   Desktop Pequeno (992px - 1920px) — estilos base cubren este rango
   ---------------------------------------------------------------------------- */

/* ----------------------------------------------------------------------------
   Tablet (768px - 991px)
   ---------------------------------------------------------------------------- */

@media (min-width: 768px) and (max-width: 991px) {
    body.events #middle {
        padding-top: 88px;
    }
    #eventsCalendarSec {
        padding: 50px 15px;
    }

    #eventsCalendarSec .section-title {
        margin-bottom: 32px;
        font-size: 2.5rem;
        line-height: 2.8125rem;
    }

    #eventsCalendarSec .fc .fc-toolbar-title {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    #eventsCalendarSec .fc .fc-button {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

/* ----------------------------------------------------------------------------
   Movil (<768px)
   ---------------------------------------------------------------------------- */

@media (max-width: 767px) {
    body.events #middle {
        padding-top: 60px;
    }
    #eventsCalendarSec {
        padding: 30px 15px;
    }

    #eventsCalendarSec .section-title {
        margin-bottom: 24px;
        font-size: 1.875rem;
        line-height: 2.1875rem;
    }

    /* Toolbar: apilar titulo y botones en columna */
    #eventsCalendarSec .fc .fc-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    #eventsCalendarSec .fc .fc-toolbar-title {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    #eventsCalendarSec .fc .fc-button {
        padding: 6px 10px;
        font-size: 0.6875rem;
    }

    /* Cabecera de dias: abreviatura corta para caber en movil */
    #eventsCalendarSec .fc .fc-col-header-cell {
        padding: 8px 0;
    }

    #eventsCalendarSec .fc .fc-col-header-cell-cushion {
        font-size: 0.6875rem;
    }

    /* Numeros de dia mas compactos */
    #eventsCalendarSec .fc .fc-daygrid-day-number {
        padding: 4px 6px;
        font-size: 0.75rem;
    }

    /* Eventos: texto mas pequeno */
    #eventsCalendarSec .fc .fc-event-title {
        font-size: 0.6875rem;
        line-height: 1rem;
    }

    #eventsCalendarSec .fc .fc-event-time {
        font-size: 0.625rem;
    }
}

/* ----------------------------------------------------------------------------
   Accesibilidad: movimiento reducido
   ---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    #eventsCalendarSec .fc .fc-button,
    #eventsCalendarSec .fc .fc-daygrid-event {
        transition: none;
    }
}

/* ==========================================================================
   EVENT MODAL - Layout 50/50 imagen + contenido (solo desktop)
   ========================================================================== */

/* Modal content sin padding propio (lo gestiona el layout interno) */
.event-modal .modal-content {
    overflow: hidden;
}

/* Layout 50/50 en desktop */
@media (min-width: 992px) {
    .event-modal .modal-dialog {
        max-width: max(60vw, 900px);
    }
    .event-modal .modal-content {
        padding: 0;
    }
    .event-modal .event-modal-layout {
        display: flex;
        min-height: 500px;
    }
    .event-modal .event-modal-image {
        width: 50%;
        flex-shrink: 0;
    }
    .event-modal .event-modal-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    .event-modal .event-modal-content {
        width: 50%;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    .event-modal .event-modal-content .modal-header {
        padding: 40px 40px 0 40px;
        border-bottom: none;
    }
    .event-modal .event-modal-content .modal-header .modal-title {
        font-family: "Playfair Display";
        font-size: 1.75rem;
        color: #00181a;
        font-weight: 400;
        line-height: 2.25rem;
        text-transform: uppercase;
        text-wrap: balance;
    }
    .event-modal .event-modal-content .modal-body {
        padding: 16px 40px 40px 40px;
        flex-grow: 1;
    }
    .event-modal .event-modal-content .event-time {
        margin: 0 0 24px 0;
        font-family: "Inter";
        font-size: 0.875rem;
        color: #00A8B5;
        font-weight: 600;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }
    .event-modal .event-modal-content p {
        font-family: "Inter";
        font-size: 0.9375rem;
        color: #00181a;
        line-height: 1.5rem;
        margin: 0 0 12px 0;
    }
    .event-modal .event-modal-content p:last-child {
        margin-bottom: 0;
    }
}

/* Responsive (<992px): layout apilado, igual que un modal normal */
@media (max-width: 991px) {
    .event-modal .event-modal-layout {
        display: block;
    }
    .event-modal .event-modal-image {
        width: 100%;
        max-height: 250px;
        overflow: hidden;
    }
    .event-modal .event-modal-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    .event-modal .event-modal-content .modal-header {
        padding: 24px 24px 0 24px;
        border-bottom: none;
    }
    .event-modal .event-modal-content .modal-header .modal-title {
        font-family: "Playfair Display";
        font-size: 1.375rem;
        color: #00181a;
        font-weight: 400;
        line-height: 1.75rem;
        text-transform: uppercase;
    }
    .event-modal .event-modal-content .modal-body {
        padding: 12px 24px 24px 24px;
    }
    .event-modal .event-modal-content .event-time {
        margin: 0 0 16px 0;
        font-family: "Inter";
        font-size: 0.8125rem;
        color: #00A8B5;
        font-weight: 600;
        text-transform: uppercase;
    }
    .event-modal .event-modal-content p {
        font-family: "Inter";
        font-size: 0.9375rem;
        color: #00181a;
        line-height: 1.375rem;
        margin: 0 0 12px 0;
    }
}
