/* Calendário */

.calendar-main {
    background: #f4f7f8;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.calendar-hero {
    margin-bottom: 12px;
    background:
        linear-gradient(120deg, rgba(21, 56, 68, 0.88), rgba(21, 56, 68, 0.58)),
        url('../img/news-header-bg.jpg') center/cover;
}

.calendar-hero h1 {
    color: #f4fbff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.calendar-hero p {
    color: #e6f2f8;
}

.calendar-quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.calendar-quick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #bdd0db;
    background: #2E5F6F;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
}

.calendar-quick-btn:hover {
    background: #1d3f4f;
    color: #fff;
}

.calendar-quick-btn-ghost {
    background: #fff;
    color: #123c4c;
}

.calendar-quick-btn-ghost:hover {
    background: #f0f6fa;
    color: #123c4c;
}

.calendar-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    margin-top: 20px;
}

.calendar-container {
    background: #fff;
    border: 1px solid #dde6ec;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(31, 53, 66, 0.08);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: linear-gradient(120deg, var(--primary-strong), var(--primary));
    color: #fff;
    gap: 12px;
}

.calendar-header h2 {
    margin: 0;
    flex: 1;
    text-align: center;
    font-size: 1.3rem;
    color: #f4fbff !important;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.calendar-month-help {
    margin: 0;
    padding: 8px 12px;
    background: #f2f7fa;
    border-bottom: 1px solid #dde6ec;
    color: #51636e;
    font-size: 0.88rem;
}

.calendar-nav {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 1.2rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.calendar-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #eef4f7;
    padding: 1px;
}

.weekday {
    background: #f9fcfd;
    padding: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-strong);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #dde6ec;
    padding: 1px;
    min-height: 400px;
}

.calendar-day {
    background: #fff;
    padding: 8px;
    min-height: 60px;
    position: relative;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: background 0.2s, border-color 0.2s;
}

.calendar-day:hover {
    background: #f8fbfd;
}

.calendar-day:focus-visible {
    outline: 2px solid #6c9cb3;
    outline-offset: -2px;
}

.calendar-day.empty {
    background: #f5f5f5;
}

.calendar-day-num {
    font-weight: 700;
    color: #1f3542;
    font-size: 0.95rem;
}

.calendar-day.has-events {
    background: #f0f8fb;
    border: 1px solid #b8d4e3;
    cursor: pointer;
}

.calendar-day.has-events:hover {
    background: #e6f1f7;
    border-color: #7ea2b7;
}

.calendar-day.active {
    background: #d4e8f0;
    border: 2px solid #7ea2b7;
    box-shadow: 0 0 0 1px #7ea2b7;
}

.calendar-day.today {
    box-shadow: inset 0 0 0 2px rgba(46, 95, 111, 0.35);
}

.calendar-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.calendar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    background: #fff;
    border: 1px solid #dde6ec;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(31, 53, 66, 0.08);
}

.sidebar-card h3 {
    margin: 0 0 12px;
    color: var(--primary-strong);
    font-size: 1.15rem;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-item {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef4f7;
}

.upcoming-event-btn {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 10px;
    padding: 8px;
    margin: 0;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.upcoming-event-btn:hover {
    background: #f6fafc;
    border-color: #d7e6ee;
}

.upcoming-event-btn:focus-visible {
    outline: 2px solid #7ea2b7;
    outline-offset: 1px;
}

.event-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.event-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid #cfe0e9;
    background: #ecf4f8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #174356;
    font-weight: 800;
    font-size: 1rem;
}

.event-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    background: #f0f8fb;
    border-radius: 8px;
    padding: 6px;
    text-align: center;
}

.event-day {
    font-weight: 700;
    color: var(--primary-strong);
    font-size: 1.1rem;
    line-height: 1;
}

.event-month {
    font-size: 0.75rem;
    color: #607784;
}

.event-info {
    flex: 1;
    min-width: 0;
}

.event-info h4 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    color: #1f3542;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-location {
    margin: 2px 0;
    font-size: 0.85rem;
    color: #607784;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-time {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

.selected-events {
    min-height: 200px;
}

.event-detail {
    padding-bottom: 12px;
    border-bottom: 1px solid #eef4f7;
    margin-bottom: 12px;
}

.event-detail:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.event-detail h4 {
    margin: 0 0 8px;
    color: #1f3542;
    font-size: 1rem;
}

.event-detail p {
    margin: 4px 0;
    font-size: 0.9rem;
    color: #607784;
}

.event-open-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 7px 12px;
    border-radius: 9px;
    border: 1px solid #bcd2de;
    background: #2E5F6F;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.86rem;
}

.event-open-link:hover {
    background: #1d3f4f;
    color: #fff;
}

.event-detail strong {
    color: #1f3542;
}

.event-desc {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #243946;
    line-height: 1.4;
}

.event-desc img,
.event-detail img {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 220px;
    height: auto !important;
    object-fit: cover;
    display: block;
    float: none !important;
    margin: 10px 0 0;
    border-radius: 10px;
    border: 1px solid #cfe0e9;
    box-shadow: 0 6px 16px rgba(17, 42, 52, 0.12);
    background: #eef4f7;
}

.no-events,
.loading,
.error {
    padding: 20px;
    text-align: center;
    color: #607784;
    font-size: 0.95rem;
}

.error {
    color: #c23d3d;
    background: #fff8f8;
    border-radius: 6px;
}

#selected-date-title {
    margin: 0 0 12px;
    color: var(--primary-strong);
    font-size: 1.05rem;
    text-transform: capitalize;
}

@media (max-width: 1024px) {
    .calendar-wrapper {
        grid-template-columns: 1fr;
    }

    .calendar-sidebar {
        flex-direction: row;
    }

    .sidebar-card {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .calendar-main {
        margin-top: 10px;
        padding: 10px;
    }

    .calendar-wrapper {
        gap: 12px;
    }

    .calendar-container {
        overflow-x: auto;
    }

    .calendar-sidebar {
        flex-direction: column;
    }

    .calendar-day {
        min-height: 50px;
        padding: 4px;
    }

    .calendar-day-num {
        font-size: 0.85rem;
    }

    .weekday {
        padding: 6px 2px;
        font-size: 0.75rem;
    }

    .calendar-header {
        padding: 12px;
    }

    .calendar-header h2 {
        font-size: 1.1rem;
    }

    .calendar-hero h1 {
        font-size: 1.85rem;
    }
}
