/**
 * Abakan Online — event-card specifics inside the shared .ao-home-tabs shell.
 */

.ao-home-events {
    --ao-events-text: #182033;
    --ao-events-muted: #687086;
    --ao-events-line: #e6eaf2;
    --ao-events-blue: #2757d7;
    --ao-events-blue-soft: #eaf0ff;
    --ao-events-orange: #f0784a;
    --ao-events-surface: #ffffff;
}

.ao-home-events__title {
    margin: 0;
    color: var(--ao-events-text);
    font-size: 28px;
    font-weight: 500;
    line-height: 1.2;
}

.ao-home-events > .ao-home-tabs__nav {
    margin-bottom: 18px;
}

.ao-home-events__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ao-home-events__card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--ao-events-line);
    border-radius: 16px;
    background: var(--ao-events-surface);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.ao-home-events__card:hover {
    border-color: #d4dceb;
    box-shadow: 0 8px 22px rgba(31, 48, 86, .07);
    transform: translateY(-1px);
}

.ao-home-events__card-link {
    display: grid;
    min-width: 0;
    min-height: 100px;
    grid-template-columns: 150px 62px minmax(0, 1fr) 24px;
    align-items: stretch;
    color: inherit;
    text-decoration: none;
}

.ao-home-events__card-link:hover,
.ao-home-events__card-link:focus-visible {
    color: inherit;
    text-decoration: none;
}

.ao-home-events__card-link:focus-visible {
    outline: 3px solid rgba(39, 87, 215, .2);
    outline-offset: -3px;
}

.ao-home-events__media {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    align-self: center;
    overflow: hidden;
    background: var(--ao-events-blue-soft);
}

.ao-home-events__image {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

.ao-home-events__placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: var(--ao-events-blue);
    background: linear-gradient(135deg, var(--ao-events-blue-soft), #f6f8ff);
}

.ao-home-events__placeholder svg {
    width: 34px;
    height: 34px;
}

.ao-home-events__date {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    align-self: stretch;
    background: var(--ao-events-blue-soft);
    color: var(--ao-events-blue);
    line-height: 1;
}

.ao-home-events__date strong {
    font-size: 23px;
    font-weight: 700;
}

.ao-home-events__date span {
    margin-top: 5px;
    color: var(--ao-events-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.ao-home-events__body {
    display: flex;
    min-width: 0;
    padding: 12px 10px 12px 16px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.ao-home-events__meta {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    color: var(--ao-events-orange);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.ao-home-events__meta span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.ao-home-events__card-title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ao-events-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ao-home-events__venue {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    color: var(--ao-events-muted);
    font-size: 12.5px;
    line-height: 1.35;
}

.ao-home-events__venue svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.ao-home-events__venue span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ao-home-events__arrow {
    display: grid;
    align-self: stretch;
    place-items: center;
    color: #8a94a8;
}

.ao-home-events__arrow svg {
    width: 18px;
    height: 18px;
}

.ao-home-events__empty {
    margin: 0;
    padding: 20px;
    border: 1px solid var(--ao-events-line);
    border-radius: 14px;
    color: var(--ao-events-muted);
    background: var(--ao-events-surface);
    text-align: center;
}

@media (max-width: 991.98px) {
    .ao-home-events__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .ao-home-events__title {
        font-size: 20px;
        letter-spacing: -.025em;
    }

    .ao-home-events > .ao-home-tabs__nav {
        margin-bottom: 10px;
    }

    .ao-home-events__card {
        border-radius: 14px;
    }

    .ao-home-events__card-link {
        min-height: 88px;
        grid-template-columns: 108px 48px minmax(0, 1fr) 22px;
    }

    .ao-home-events__body {
        padding: 10px 7px 10px 10px;
        gap: 4px;
    }

    .ao-home-events__date strong {
        font-size: 19px;
    }

    .ao-home-events__date span,
    .ao-home-events__meta,
    .ao-home-events__venue {
        font-size: 11px;
    }

    .ao-home-events__card-title {
        font-size: 14px;
    }

    .ao-home-events__venue svg {
        width: 13px;
        height: 13px;
        flex-basis: 13px;
    }

    .ao-home-events__arrow svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 374.98px) {
    .ao-home-events__card-link {
        grid-template-columns: 92px 44px minmax(0, 1fr) 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ao-home-events__card {
        transition: none;
    }
}

/* New information is desktop-only; keep the accepted mobile layout unchanged. */
.ao-home-events__time,
.ao-home-events__schedule,
.ao-home-events__details,
.ao-home-events__card > .ao-company-card__favorite {
    display: none;
}

@media (min-width: 992px) {
    .ao-home-events__grid {
        gap: 18px;
    }

    .ao-home-events__card {
        position: relative;
    }

    .ao-home-events__card-link {
        min-height: 210px;
        height: 100%;
        grid-template-columns: minmax(160px, 34%) 70px minmax(0, 1fr);
    }

    body.site .ao-home-events__media {
        position: relative;
        height: auto;
        min-height: 210px;
        aspect-ratio: auto;
        align-self: stretch;
    }

    body.site .ao-home-events__image {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: cover;
        object-position: center;
    }

    body.site .ao-home-events__placeholder {
        position: absolute;
        inset: 0;
    }

    .ao-home-events__date {
        padding: 18px 4px;
        gap: 8px;
    }

    .ao-home-events__date strong {
        font-size: 32px;
    }

    .ao-home-events__date span {
        margin: 0;
        font-size: 12px;
    }

    .ao-home-events__time {
        display: block;
        margin-top: 8px;
        padding-top: 14px;
        border-top: 1px solid #d9e2f5;
        font-size: 15px;
        font-weight: 600;
    }

    .ao-home-events__body {
        padding: 24px 18px;
        gap: 10px;
    }

    .ao-home-events__meta {
        min-height: 20px;
        padding-right: 34px;
        color: var(--ao-events-muted);
        font-size: 13px;
        font-weight: 400;
        white-space: normal;
    }

    .ao-home-events__meta > time,
    .ao-home-events__meta > span:first-child,
    .ao-home-events__meta > span[aria-hidden] {
        display: none;
    }

    .ao-home-events__meta span:last-child {
        overflow: visible;
    }

    .ao-home-events__card-title {
        font-size: 20px;
        line-height: 1.3;
        -webkit-line-clamp: 3;
    }

    .ao-home-events__schedule {
        display: block;
        color: var(--ao-events-blue);
        font-size: 13px;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    .ao-home-events__venue {
        align-items: flex-start;
        font-size: 14px;
    }

    .ao-home-events__venue svg {
        margin-top: 2px;
    }

    .ao-home-events__venue span {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .ao-home-events__details {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 8px;
    }

    .ao-home-events__details > span {
        max-width: 100%;
        padding: 6px 11px;
        border-radius: 20px;
        background: var(--ao-events-blue-soft);
        color: var(--ao-events-blue);
        font-size: 13px;
        font-weight: 600;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .ao-home-events__arrow {
        display: none;
    }

    /* Same 20px icon and red selected state as home organization cards. */
    .ao-home-events__card > .ao-company-card__favorite {
        position: absolute;
        display: grid;
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 12px;
        place-items: center;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #8190a8;
        box-shadow: none;
        cursor: pointer;
    }

    .ao-home-events__card > .ao-company-card__favorite svg {
        display: block;
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .ao-home-events__card > .ao-company-card__favorite:hover,
    .ao-home-events__card > .ao-company-card__favorite:active {
        background: transparent;
    }

    .ao-home-events__card > .ao-company-card__favorite.is-active,
    .ao-home-events__card > .ao-company-card__favorite[aria-pressed="true"] {
        color: #ef4444;
        background: transparent;
    }

    .ao-home-events__card > .ao-company-card__favorite.is-active svg,
    .ao-home-events__card > .ao-company-card__favorite[aria-pressed="true"] svg {
        fill: currentColor;
        stroke: currentColor;
    }

    .ao-home-events__card > .ao-company-card__favorite:focus-visible {
        outline: 3px solid rgba(39, 87, 215, .3);
        outline-offset: 2px;
    }
}

/* Larger mobile event photo; date sits over the photo, not in a separate column. */
@media (max-width: 767.98px) {
  body.site.itemid-101 .ao-home-events__card-link {
    position: relative;
    min-height: 124px;
    grid-template-columns: minmax(118px, 38%) minmax(0, 1fr) 18px;
  }
  body.site.itemid-101 .ao-home-events__media {
    height: 100%;
    min-height: 124px;
    align-self: stretch;
    aspect-ratio: auto;
  }
  body.site.itemid-101 .ao-home-events__image {
    width: 100%;
    height: 100% !important;
    aspect-ratio: auto;
    object-fit: cover;
  }
  body.site.itemid-101 .ao-home-events__date {
    position: absolute;
    top: 7px;
    left: 7px;
    z-index: 1;
    width: 40px;
    height: 47px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 2px 8px rgba(22, 47, 93, .11);
  }
  body.site.itemid-101 .ao-home-events__date strong { font-size: 18px; }
  body.site.itemid-101 .ao-home-events__date span { margin-top: 3px; font-size: 9px; }
  body.site.itemid-101 .ao-home-events__body {
    padding: 10px 4px 10px 10px;
    gap: 5px;
  }
  body.site.itemid-101 .ao-home-events__arrow svg { width: 15px; height: 15px; }
}
@media (max-width: 374.98px) {
  body.site.itemid-101 .ao-home-events__card-link {
    min-height: 118px;
    grid-template-columns: 112px minmax(0, 1fr) 16px;
  }
  body.site.itemid-101 .ao-home-events__media { min-height: 118px; }
}
