/* ==========================================================
   HORIZON BEE AFRICA — TRAINING & EVENTS
   Event cards (News -> Training & Events, Training page, admin
   preview), the home-page feature card, the visitor preview with
   its fade and sign-up panel, the poster viewer and the small
   list on the dashboard.
   Works on its own (does not need site.css).
   ========================================================== */

.ev-list,
.ev-card,
.ev-card *,
.ev-mini,
.ev-mini * {
    box-sizing: border-box;
}


/* ----------------------------------------------------------
   Section on the Training page
   ---------------------------------------------------------- */

.ev-section[hidden] {
    display: none !important;
}

.ev-list {
    display: grid;
    gap: 20px;
}

.ev-empty {
    margin: 0;
    padding: 18px 20px;

    background: #fafafa;
    border: 1px solid #ececec;

    color: #555555;

    font-size: 15px;
}


/* ----------------------------------------------------------
   Card
   ---------------------------------------------------------- */

.ev-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
    gap: 26px;

    padding: 20px;

    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 8px;

    color: #1f1c16;

    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

    scroll-margin-top: 110px;

    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.ev-card.no-poster {
    grid-template-columns: 84px minmax(0, 1fr);
}

.ev-card.is-highlighted {
    border-color: #d89b00;
    box-shadow: 0 0 0 3px rgba(216, 155, 0, 0.25);
}

.ev-card.is-cancelled .ev-title {
    color: #777777;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}


/* Poster (never cropped: posters carry words) */

.ev-poster-open {
    display: block;

    width: 100%;
    padding: 0;

    background: none;
    border: 0;

    cursor: zoom-in;
}

.ev-poster {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    aspect-ratio: 4 / 5;

    background: #f4f1ea;
    overflow: hidden;
}

.ev-poster img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    border-radius: 0;
}


/* Date block (events without a poster) */

.ev-date {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;

    width: 84px;
    height: 84px;

    background: #412e03;

    color: #ffffff;

    text-align: center;
}

.ev-date-day {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.ev-date-month {
    color: #d89b00;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


/* Text */

.ev-body {
    min-width: 0;
}

.ev-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;

    margin: 0 0 6px;

    color: #6b5a3a;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ev-flag {
    padding: 3px 8px;

    font-size: 11px;
    letter-spacing: 0.06em;
}

.ev-flag-live {
    background: #d89b00;
    color: #2c1f02;
}

.ev-flag-cancelled {
    background: #f3e9e8;
    color: #9a2a20;
}

.ev-title {
    margin: 0 0 12px;

    color: #2c1f02;

    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.ev-meta {
    display: grid;
    gap: 6px;

    margin: 0 0 12px;
}

.ev-meta-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;

    font-size: 15px;
    line-height: 1.45;
}

.ev-meta dt {
    color: #777777;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.7;
}

.ev-meta dd {
    margin: 0;

    color: #1f1c16;
}

.ev-meta a {
    color: #412e03;

    text-decoration: underline;
    text-underline-offset: 3px;
}

.ev-meta a:hover {
    color: #d89b00;
}

.ev-summary,
.ev-details {
    margin: 0 0 12px;

    color: #555555;

    font-size: 15px;
    line-height: 1.6;
}

.ev-note {
    margin: 0 0 12px;
    padding: 8px 12px;

    background: #fdf8ea;
    border-left: 3px solid #d89b00;

    color: #412e03;

    font-size: 14px;
}

.ev-cancel-note {
    margin: 0 0 12px;

    color: #9a2a20;

    font-size: 14.5px;
    font-weight: 600;
}


/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */

.ev-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;

    margin-top: 16px;
}

.ev-actions:empty {
    display: none;
}

.ev-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 0 18px;

    background: #412e03;
    border: 1px solid #412e03;
    border-radius: 8px;

    color: #ffffff;

    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;

    cursor: pointer;

    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ev-btn:hover,
.ev-btn:focus-visible {
    background: #d89b00;
    border-color: #d89b00;
    color: #2c1f02;
}

.ev-btn-outline {
    background: transparent;
    color: #412e03;
}

.ev-text-btn {
    padding: 0 4px;

    background: none;
    border: 0;

    color: #412e03;

    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;

    cursor: pointer;
}

.ev-text-btn:hover {
    color: #d89b00;
}


/* Add to calendar menu */

.ev-cal {
    position: relative;
}

.ev-cal-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;

    display: grid;

    min-width: 220px;
    padding: 6px 0;

    background: #ffffff;
    border: 1px solid #e3ddd0;
    box-shadow: 0 12px 30px rgba(44, 31, 2, 0.14);
}

.ev-cal-menu[hidden] {
    display: none;
}

.ev-cal-menu a,
.ev-cal-menu button {
    display: block;

    width: 100%;
    padding: 10px 16px;

    background: none;
    border: 0;

    color: #1f1c16;

    font: inherit;
    font-size: 14.5px;
    text-align: left;
    text-decoration: none;

    cursor: pointer;
}

.ev-cal-menu a:hover,
.ev-cal-menu button:hover,
.ev-cal-menu a:focus-visible,
.ev-cal-menu button:focus-visible {
    background: #fdf6e3;
    color: #412e03;
}


/* ----------------------------------------------------------
   Past events
   ---------------------------------------------------------- */

.ev-past {
    margin-top: 36px;
}

.ev-past-title {
    margin: 0 0 10px;

    color: #2c1f02;

    font-size: 17px;
}

.ev-past-list {
    margin: 0;
    padding: 0;

    list-style: none;

    border-top: 1px solid #ececec;
}

.ev-past-list li {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;

    padding: 12px 0;

    border-bottom: 1px solid #ececec;

    font-size: 14.5px;
}

.ev-past-date,
.ev-past-kind {
    color: #777777;
}

.ev-past-kind {
    font-size: 13px;
}

.ev-past-name {
    color: #1f1c16;
}


/* ----------------------------------------------------------
   Visitors: faded preview + sign-up panel
   ---------------------------------------------------------- */

.ev-teaser {
    max-height: 4.8em;             /* about three lines */
    margin: 0 0 2px;

    overflow: hidden;

    color: #555555;

    font-size: 15px;
    line-height: 1.6;

    /* The words fade out towards the bottom */
    -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
}

.ev-teaser p {
    margin: 0;
}

.ev-lock {
    padding: 14px 16px 16px;

    background: #fbf8f1;
    border-top: 2px solid #d89b00;
}

.ev-lock-text {
    margin: 0;

    color: #412e03;

    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.5;
}

.ev-lock .ev-actions {
    margin-top: 12px;
}


/* ----------------------------------------------------------
   Registered users: full details
   ---------------------------------------------------------- */

.ev-details-wrap {
    margin: 0 0 12px;
}

.ev-details {
    color: #555555;

    font-size: 15px;
    line-height: 1.65;
}

.ev-details p {
    margin: 0 0 10px;
}

.ev-details p:last-child {
    margin-bottom: 0;
}

.ev-details.is-folded {
    position: relative;

    max-height: 10em;

    overflow: hidden;
}

.ev-details.is-folded::after {
    content: "";

    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;

    height: 3em;

    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
}

.ev-details-wrap .ev-text-btn {
    margin-top: 6px;
    padding: 0;
}

.ev-soon {
    color: #777777;

    font-size: 13.5px;
}

.ev-all-link {
    display: inline-block;

    margin-top: 16px;

    color: #412e03;

    font-size: 14.5px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.ev-all-link:hover {
    color: #d89b00;
}


/* ----------------------------------------------------------
   Home page: one feature card
   ---------------------------------------------------------- */

.ev-feature {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 30px;

    padding: 24px;
}

.ev-feature.no-poster {
    grid-template-columns: 84px minmax(0, 1fr);
}

.ev-feature .ev-title {
    font-size: 24px;
}

.ev-feature .ev-title a {
    color: inherit;

    text-decoration: none;
}

.ev-feature .ev-title a:hover {
    color: #d89b00;
}


/* ----------------------------------------------------------
   Poster, full size
   ---------------------------------------------------------- */

.ev-lightbox {
    width: auto;
    max-width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    padding: 0;

    background: transparent;
    border: 0;

    overflow: visible;
}

.ev-lightbox::backdrop {
    background: rgba(20, 14, 2, 0.8);
}

.ev-lightbox img {
    display: block;

    max-width: min(900px, calc(100vw - 24px));
    max-height: calc(100vh - 80px);

    object-fit: contain;

    border-radius: 0;
}

.ev-lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;

    width: 40px;
    height: 40px;

    background: transparent;
    border: 0;

    color: #ffffff;

    font-size: 30px;
    line-height: 1;

    cursor: pointer;
}

.ev-lightbox-close:hover {
    color: #d89b00;
}

.ev-lightbox[open] {
    margin: auto;
    padding-top: 0;
    overflow: visible;
}


/* ----------------------------------------------------------
   Dashboard: next events
   ---------------------------------------------------------- */

.ev-mini {
    display: grid;
    gap: 2px;

    margin: 12px 0 0;
    padding: 0;

    list-style: none;
}

.ev-mini-link {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 12px;

    padding: 8px 0;

    color: inherit;

    text-decoration: none;
}

.ev-mini-link + .ev-mini-link,
.ev-mini li + li .ev-mini-link {
    border-top: 1px solid #efece5;
}

.ev-mini .ev-date {
    width: 46px;
    height: 46px;
}

.ev-mini .ev-date-day {
    font-size: 17px;
}

.ev-mini .ev-date-month {
    font-size: 10px;
}

.ev-mini-text {
    display: grid;
    gap: 2px;

    min-width: 0;
}

.ev-mini-text strong {
    display: -webkit-box;
    overflow: hidden;

    color: #1f1c16;

    font-size: 14px;
    line-height: 1.35;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ev-mini-text span {
    overflow: hidden;

    color: #777777;

    font-size: 12.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ev-mini-link:hover strong {
    color: #d89b00;
}

.ev-mini-empty {
    margin: 10px 0 0;

    color: #777777;

    font-size: 13.5px;
}


/* ----------------------------------------------------------
   Phones
   ---------------------------------------------------------- */

@media (max-width: 700px) {

    .ev-card {
        grid-template-columns: 1fr;
        gap: 16px;

        padding: 16px;
    }

    .ev-card.no-poster {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 14px;
    }

    .ev-card.no-poster .ev-date {
        width: 64px;
        height: 64px;
    }

    .ev-card.no-poster .ev-date-day {
        font-size: 24px;
    }

    .ev-card.no-poster .ev-body {
        grid-column: 1 / -1;
    }

    .ev-card.no-poster .ev-date {
        grid-row: 1;
    }

    .ev-poster {
        aspect-ratio: auto;
    }

    .ev-poster img {
        height: auto;
        max-height: 520px;
    }

    .ev-title {
        font-size: 19px;
    }

    .ev-meta-row {
        grid-template-columns: 56px minmax(0, 1fr);
        font-size: 14.5px;
    }

    .ev-actions .ev-btn {
        flex: 1 1 auto;
    }

    .ev-cal {
        flex: 1 1 auto;
    }

    .ev-cal > .ev-btn {
        width: 100%;
    }

    .ev-cal-menu {
        right: 0;
    }

    .ev-past-list li {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .ev-past-kind {
        display: none;
    }

    .ev-feature {
        grid-template-columns: 1fr;
        gap: 16px;

        padding: 16px;
    }

    .ev-feature .ev-title {
        font-size: 20px;
    }

    .ev-lightbox img {
        max-height: calc(100vh - 100px);
    }
}


/* ----------------------------------------------------------
   Dashboard card (account/indexx.html)
   ---------------------------------------------------------- */

.events-card .settings-button {
    text-decoration: none;
}

@media (max-width: 900px) {
    .events-card {
        order: 6;
    }
}


/* ----------------------------------------------------------
   News -> Training & Events (/blogs/training/)
   ---------------------------------------------------------- */

.news-events {
    margin: 0 0 32px;
}

.news-events[hidden] {
    display: none !important;
}

.news-events-head {
    margin-bottom: 18px;
}

.news-events-eyebrow {
    margin: 0 0 6px;

    color: #d89b00;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.news-events-head h2 {
    margin: 0 0 6px;

    color: #2c1f02;

    font-size: 26px;
    line-height: 1.2;
}

.news-events-head p {
    max-width: 640px;
    margin: 0;

    color: #555555;

    font-size: 15px;
    line-height: 1.55;
}

.news-events .ev-card {
    scroll-margin-top: 130px;
}

.news-events-articles {
    margin: 36px 0 0;
    padding-top: 22px;

    border-top: 1px solid #e7e2d6;

    color: #2c1f02;

    font-size: 20px;
}

@media (max-width: 700px) {

    .news-events-head h2 {
        font-size: 22px;
    }
}


/* ----------------------------------------------------------
   Home page: row of event cards  (data-events-grid)
   ---------------------------------------------------------- */

.ev-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

/* One or two events: keep the cards a sensible width, centred */
.ev-grid[data-count="1"] {
    grid-template-columns: minmax(0, 400px);
    justify-content: center;
}

.ev-grid[data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 400px));
    justify-content: center;
}

.ev-tile {
    display: flex;
    flex-direction: column;

    background: #ffffff;
    border: 1px solid #ececec;

    color: #1f1c16;

    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

    transition: box-shadow 0.2s ease;
}

.ev-tile:hover {
    box-shadow: 0 14px 34px rgba(44, 31, 2, 0.1);
}

.ev-tile-media {
    display: flex;
    align-items: center;
    justify-content: center;

    aspect-ratio: 4 / 3;

    background: #f4f1ea;
    overflow: hidden;
}

.ev-tile-media img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    border-radius: 0;
}

.ev-tile-media.is-date {
    flex-direction: column;
    gap: 4px;

    background: #412e03;

    color: #ffffff;

    text-decoration: none;
}

.ev-tile-day {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
}

.ev-tile-month {
    color: #d89b00;

    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ev-tile-weekday {
    color: rgba(255, 255, 255, 0.7);

    font-size: 14px;
}

.ev-tile-body {
    display: flex;
    flex: 1;
    flex-direction: column;

    padding: 20px 22px 22px;
}

.ev-tile-kind {
    margin: 0 0 8px;

    color: #6b5a3a;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ev-tile-title {
    margin: 0 0 8px;

    font-size: 19px;
    line-height: 1.3;
}

.ev-tile-title a {
    color: #2c1f02;

    text-decoration: none;
}

.ev-tile-title a:hover {
    color: #d89b00;
}

.ev-tile-when {
    margin: 0 0 10px;

    color: #412e03;

    font-size: 14.5px;
    font-weight: 600;
}

.ev-tile-summary {
    display: -webkit-box;

    margin: 0 0 16px;
    overflow: hidden;

    color: #555555;

    font-size: 14.5px;
    line-height: 1.55;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Visitors: the summary fades out */
.ev-tile-summary.is-faded {
    -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 25%, transparent 100%);
}

.ev-tile-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;

    margin-top: auto;
    padding-top: 14px;

    border-top: 1px solid #efece5;
}

.ev-tile-lock {
    flex-basis: 100%;

    margin: 0;

    color: #6b5a3a;

    font-size: 13.5px;
}

.ev-tile-foot .ev-text-btn {
    text-decoration: underline;
}

.ev-grid-empty {
    max-width: 620px;
    margin: 0 auto;
    padding: 26px 24px;

    background: #ffffff;
    border: 1px solid #ececec;

    color: #555555;

    text-align: center;
}

.ev-grid-empty p {
    margin: 0;
}

.ev-grid-empty .ev-all-link {
    margin-top: 12px;
}

@media (max-width: 1024px) {

    .ev-grid,
    .ev-grid[data-count="2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ev-grid[data-count="3"] > :nth-child(3) {
        display: none;
    }
}

@media (max-width: 640px) {

    .ev-grid,
    .ev-grid[data-count="1"],
    .ev-grid[data-count="2"] {
        grid-template-columns: 1fr;
    }

    .ev-grid[data-count="3"] > :nth-child(3) {
        display: flex;
    }
}
