/* ============================================================
   Events Calendar Styles
   Dedicated styles for the public events calendar and event
   detail pages. Shares the palette used across News Center,
   Procurement and Annual Reports (#1a3a4a / #e2e8f0 / #f5f6fa).
   ============================================================ */

/* ------------------------------------------------------------
   Event Card

   The category colour arrives from the CMS - an operator picks it
   per category, and nothing constrains how light it is. It used to
   be painted across the whole card with .text-white on top, which
   made a pale category unreadable and put the card below the 4.5:1
   contrast floor with no way to fix it short of editing the data.

   It is an accent bar here instead. The swatch still identifies the
   category at a glance, body text stays on white, and contrast no
   longer depends on a colour the stylesheet does not control.
   ------------------------------------------------------------ */
.ec-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #ffffff;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ec-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.ec-card-accent {
    height: 5px;
    flex-shrink: 0;
    /* Fallback for a category with no colour on record. */
    background-color: #1a3a4a;
}

.ec-card-body {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ec-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.75rem;
}

.ec-card-title a {
    color: #1a3a4a;
    text-decoration: none;
}

.ec-card-title a:hover {
    text-decoration: underline;
}

/* The card is not one big click target - the headline and the two
   buttons are each their own control, so each carries its own focus
   ring rather than the card carrying one for all of them. */
.ec-card-title a:focus-visible {
    outline: 2px solid #1a3a4a;
    outline-offset: 2px;
    border-radius: 0.15rem;
}

.ec-card-actions {
    margin-top: auto;
    padding-top: 0.75rem;
}

/* ------------------------------------------------------------
   Date Badge
   ------------------------------------------------------------ */
.ec-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 3.75rem;
    padding: 0.4rem 0.5rem;
    background: rgba(26, 58, 74, 0.06);
    border-radius: 0.375rem;
    flex-shrink: 0;
    line-height: 1;
}

.ec-date-badge-month {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1a3a4a;
}

.ec-date-badge-day {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a3a4a;
    line-height: 1.2;
}

.ec-date-badge-weekday {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #4a5c68;
}

/* ------------------------------------------------------------
   Meta rows (time, place, category)
   ------------------------------------------------------------ */
.ec-meta {
    font-size: 0.875rem;
    /* #636270 on white clears 4.5:1; Bootstrap's .text-muted does not. */
    color: #636270;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: flex-start;
}

.ec-meta i {
    width: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.ec-category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 2rem;
    background: rgba(26, 58, 74, 0.06);
    border: 1px solid rgba(26, 58, 74, 0.12);
    color: #1a3a4a;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
}

/* The swatch carries the category colour where the accent bar is not
   visible. Decorative only - the category name sits beside it, so the
   colour is never the sole carrier of meaning. */
.ec-category-swatch {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    margin-right: 0.4rem;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

/* ------------------------------------------------------------
   Status flags

   Each pairs an icon and a word with its colour, so the state is
   never communicated by colour alone (WCAG 1.4.1).
   ------------------------------------------------------------ */
.ec-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    border-radius: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ec-flag-today {
    background: #1a3a4a;
    color: #ffffff;
}

.ec-flag-soon {
    background: #fff3cd;
    color: #6b4c00;
    border: 1px solid #ffe69c;
}

.ec-flag-past {
    background: #eef0f4;
    color: #4a5c68;
    border: 1px solid #dde1e8;
}

.ec-flag-community {
    background: #e7f1f6;
    color: #17546f;
    border: 1px solid #cfe3ec;
}

/* ------------------------------------------------------------
   Month grouping
   ------------------------------------------------------------ */
.ec-month-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #1a3a4a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #e2e8f0;
}

.ec-section-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a3a4a;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

/* ------------------------------------------------------------
   Empty state
   ------------------------------------------------------------ */
.ec-empty {
    border: 1px dashed #cdd3de;
    border-radius: 0.5rem;
    background: #f8f9fc;
    padding: 2rem 1.5rem;
    text-align: center;
    color: #4a5c68;
}

.ec-empty i {
    font-size: 2rem;
    color: #9aa7b4;
    display: block;
    margin-bottom: 0.5rem;
}

/* ------------------------------------------------------------
   Jump links
   ------------------------------------------------------------ */
.ec-jump {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    background: rgba(26, 58, 74, 0.06);
    border: 1px solid rgba(26, 58, 74, 0.12);
    color: #1a3a4a;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
}

.ec-jump:hover {
    background: rgba(26, 58, 74, 0.12);
    color: #1a3a4a;
}

.ec-jump:focus-visible {
    outline: 2px solid #1a3a4a;
    outline-offset: 2px;
}

.ec-jump .badge {
    margin-left: 0.4rem;
}

/* ------------------------------------------------------------
   Event detail page
   ------------------------------------------------------------ */
.ec-detail-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #ffffff;
    overflow: hidden;
}

.ec-detail-accent {
    height: 6px;
    background-color: #1a3a4a;
}

.ec-fact {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #ffffff;
    padding: 1.25rem;
    height: 100%;
}

.ec-fact-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4a5c68;
    margin-bottom: 0.6rem;
}

.ec-fact-head i {
    color: #1a3a4a;
    font-size: 1rem;
}

.ec-fact-body {
    margin: 0;
    line-height: 1.6;
    color: #23303a;
}

.ec-notes {
    line-height: 1.8;
}

.ec-notes p:last-child {
    margin-bottom: 0;
}

.ec-notes img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

/* The embedded Google map arrives as an operator-pasted iframe, so the
   width is forced here rather than trusted from the markup. */
.ec-map {
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    line-height: 0;
}

.ec-map iframe {
    width: 100%;
    min-height: 320px;
    border: 0;
    display: block;
}

.ec-download-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ec-download-item:hover {
    background: #f8f9fc;
    border-color: #cdd3de;
    color: inherit;
}

.ec-download-item:focus-visible {
    outline: 2px solid #1a3a4a;
    outline-offset: 2px;
}

/* ------------------------------------------------------------
   Past-event notice
   ------------------------------------------------------------ */
.ec-past-notice {
    border-left: 4px solid #6b4c00;
    background: #fff3cd;
    color: #4a3600;
    border-radius: 0.375rem;
    padding: 1rem 1.25rem;
}

/* ------------------------------------------------------------
   Motion and print
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .ec-card {
        transition: none;
    }

    .ec-card:hover {
        transform: none;
    }
}

@media print {
    .ec-jump,
    .ec-card-actions,
    .ec-map {
        display: none !important;
    }

    .ec-card,
    .ec-fact,
    .ec-detail-card {
        border: 1px solid #999;
        break-inside: avoid;
    }
}
