/* ============================================================
   IME — Events / Life at Infome page
   Uses the design tokens declared in mystyle.css
   (--ime-ink, --ime-red, --ime-red-tint, --ime-radius, --ime-shadow)
   ============================================================ */

.ime-events-filters {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.ime-events-filter-bar { margin-bottom: 0; }
.ime-events-filter-divider {
    width: 1px;
    height: 26px;
    background: var(--ime-line);
    display: inline-block;
}
@media (max-width: 575px) {
    .ime-events-filter-divider { display: none; }
}

.ime-events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 8px;
}
.ime-events-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--ime-line);
    border-radius: var(--ime-radius);
    overflow: hidden;
    background: var(--ime-paper);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.ime-events-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ime-shadow);
    border-color: transparent;
}
.ime-events-card-media {
    position: relative;
    flex: 0 0 auto;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: repeating-linear-gradient(135deg, #E9F7F1 0 10px, #fff 10px 20px);
}
.ime-events-card-media img { transition: transform .35s ease; }
.ime-events-card:hover .ime-events-card-media img { transform: scale(1.04); }
.ime-events-card-media img,
.ime-events-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ime-events-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
    padding: 20px 22px 22px;
}
.ime-events-card-title {
    font-size: 17px !important;
    font-weight: 800;
    line-height: 1.35;
    color: var(--ime-ink);
    margin: 0 0 8px;
}

.ime-events-empty {
    text-align: center;
    color: var(--ime-muted);
    font-size: 14px;
    padding: 30px 0 4px;
}

@media (max-width: 992px) {
    .ime-events-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
    .ime-events-grid { grid-template-columns: 1fr; }
}

.ime-events-cta {
    margin-top: 40px;
    border: 1px solid var(--ime-line);
    border-radius: var(--ime-radius);
    background: var(--ime-paper-alt);
    padding: 32px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.ime-events-cta h3 {
    font-size: 19px;
    font-weight: 800;
    color: var(--ime-ink);
    margin: 0 0 6px;
}
.ime-events-cta p {
    font-size: 14px;
    color: var(--ime-ink-soft);
    margin: 0;
    max-width: 560px;
}

.ime-btn-red {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ime-red);
    color: #fff;
    font-weight: 700;
    font-size: 14.5px;
    padding: 14px 26px;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--ime-shadow-red);
    transition: background .2s ease, transform .2s ease;
}
.ime-btn-red:hover {
    background: var(--ime-red-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

@media (max-width: 575px) {
    .ime-events-cta { padding: 26px 22px; }
    .ime-btn-red { width: 100%; justify-content: center; }
}

/* ============================================================
   Event card details (shared by /events and the "More Events"
   strip on the event detail page)
   ============================================================ */
.ime-events-placeholder,
.ime-events-card-media > span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ime-muted);
}
.ime-events-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ime-red);
    background: var(--ime-red-tint);
    padding: 5px 11px;
    border-radius: 999px;
    margin-bottom: 12px;
    line-height: 1.3;
}
/* The meta line currently prints the title a second time — hide it
   until it carries a date / location */
.ime-events-meta { display: none; }

.ime-events-desc {
    font-size: 14px !important;
    line-height: 1.65 !important;
    color: var(--ime-ink-soft);
    margin: 0 0 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ime-events-desc p { display: inline; margin: 0; font-size: inherit; line-height: inherit; }
.ime-events-desc br { display: none; }

.ime-events-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ime-red) !important;
    text-decoration: none !important;
}
.ime-events-link i { font-size: 12px; transition: transform .2s ease; }
.ime-events-card:hover .ime-events-link i { transform: translateX(4px); }


/* ============================================================
   Event detail page  (info_event_inner.php — .ievt-*)
   ============================================================ */

/* Font Awesome 4 icon names used in the view → FA 6 glyphs */
.fa.fa-calendar-o::before { content: "\f133"; }
.fa.fa-clock-o::before    { content: "\f017"; }
.fa.fa-map-marker::before { content: "\f3c5"; }
.fa.fa-calendar-o,
.fa.fa-clock-o { font-weight: 400; }

/* ---- Title block ---- */
.ievt-title-block { margin-bottom: 26px; }
.ievt-category-tag {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ime-red);
    background: var(--ime-red-tint);
    padding: 6px 13px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.ievt-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--ime-ink);
    margin: 0 0 14px;
    letter-spacing: -.01em;
}
.ievt-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 14px;
    color: var(--ime-ink-soft);
}
.ievt-meta-item { display: inline-flex; align-items: center; gap: 7px; }
.ievt-meta-item i { color: var(--ime-red); font-size: 13px; }
.ievt-meta-dot { color: #c4c6cc; }

/* ---- Cover image ---- */
.ievt-cover-wrap {
    border-radius: var(--ime-radius);
    overflow: hidden;
    margin-bottom: 32px;
    background: var(--ime-paper-alt);
    box-shadow: var(--ime-shadow);
}
.ievt-cover-img {
    display: block;
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    object-position: center top;
}

/* ---- Write-up ---- */
.ievt-body {
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--ime-ink-soft);
    margin-bottom: 44px;
}
.ievt-body p { font-size: 15.5px; line-height: 1.8; margin: 0 0 18px; color: var(--ime-ink-soft); }
.ievt-body h2,
.ievt-body h3,
.ievt-body h4 {
    font-size: 21px !important;
    font-weight: 800;
    color: var(--ime-ink);
    margin: 32px 0 12px;
    line-height: 1.35;
}
.ievt-body h4 { font-size: 18px !important; }
.ievt-body ul,
.ievt-body ol { padding-left: 22px; margin: 0 0 20px; }
.ievt-body li { margin-bottom: 8px; line-height: 1.7; }
.ievt-body li::marker { color: var(--ime-red); }
.ievt-body a { color: var(--ime-red); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(200,48,42,.3); }
.ievt-body a:hover { border-bottom-color: var(--ime-red); }
.ievt-body img { max-width: 100%; height: auto; border-radius: 10px; }
.ievt-body strong { color: var(--ime-ink); }

/* ---- Gallery ---- */
.ievt-gallery-section {
    border-top: 1px solid var(--ime-line);
    padding-top: 36px;
    margin-bottom: 20px;
}
.ievt-gallery-header { margin-bottom: 22px; }

/* Hide the leftover static demo grid ("Photo coming soon" tiles).
   It is the first of two grids; once it's removed from the view,
   the real grid is the only one and stays visible. */
.ievt-gallery-grid:has(~ .ievt-gallery-grid) { display: none; }

.ievt-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 190px;
    grid-auto-flow: dense;
    gap: 14px;
}
.ievt-gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: var(--ime-paper-alt);
    border: 1px solid var(--ime-line);
    transition: transform .22s ease, box-shadow .22s ease;
}
.ievt-gallery-item:hover { transform: translateY(-3px); box-shadow: var(--ime-shadow); }
.ievt-gallery-item--wide { grid-column: span 2; }
.ievt-gallery-item--tall { grid-row: span 2; }
.ievt-gallery-item--big  { grid-column: span 2; grid-row: span 2; }

.ievt-gallery-media { position: absolute; inset: 0; }
.ievt-gallery-media img,
.ievt-gallery-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.ievt-gallery-item:hover .ievt-gallery-media img { transform: scale(1.05); }
.ievt-gallery-media:not(:has(img)) {
    background: repeating-linear-gradient(135deg, #f0f0f2 0 12px, #fafafa 12px 24px);
}
.ievt-gallery-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ime-muted);
}
.ievt-gallery-video-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(20,22,27,.66);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
}
.ievt-gallery-video-badge i { font-size: 9px; }
.ievt-gallery-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    padding: 34px 14px 12px;
    background: linear-gradient(180deg, rgba(20,22,27,0) 0%, rgba(20,22,27,.78) 100%);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .22s ease, transform .22s ease;
}
.ievt-gallery-item:hover .ievt-gallery-caption { opacity: 1; transform: translateY(0); }
.ievt-gallery-caption-text {
    color: #fff;
    font-size: 13px !important;
    font-weight: 700;
    line-height: 1.35 !important;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ievt-gallery-empty {
    text-align: center;
    color: var(--ime-muted);
    font-size: 14px;
    padding: 30px 0 4px;
}

/* ---- Lightbox ---- */
.ievt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(14,15,18,.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
}
.ievt-lightbox.active { display: flex; }
.ievt-lightbox-inner { position: relative; max-width: 1000px; width: 100%; }
.ievt-lightbox-media {
    width: 100%;
    max-height: 78vh;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
}
.ievt-lightbox-media img,
.ievt-lightbox-media video {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    display: block;
    border-radius: 10px;
}
.ievt-lightbox-caption {
    color: #fff !important;
    text-align: center;
    margin: 14px 0 0;
    font-weight: 600;
}
.ievt-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background .2s ease, border-color .2s ease;
}
.ievt-lightbox-close:hover { background: var(--ime-red); border-color: var(--ime-red); }

/* ---- Sidebar ---- */
.ievt-sidebar {
    position: sticky;
    top: 110px;
    padding-left: 12px;
}
.ievt-info-card {
    background: var(--ime-paper);
    border: 1px solid var(--ime-line);
    border-radius: var(--ime-radius);
    box-shadow: var(--ime-shadow);
    padding: 24px 24px 22px;
    margin-bottom: 18px;
}
.ievt-info-card-title {
    font-size: 17px !important;
    font-weight: 800;
    color: var(--ime-ink);
    margin: 0 0 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ime-line);
}
.ievt-info-list { list-style: none; padding: 0; margin: 0 0 20px; }
.ievt-info-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px dashed var(--ime-line);
    font-size: 14px;
}
.ievt-info-list li:last-child { border-bottom: none; }
.ievt-info-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ime-muted);
    font-weight: 600;
    white-space: nowrap;
}
.ievt-info-label i { width: 14px; text-align: center; color: var(--ime-red); }
.ievt-info-value {
    color: var(--ime-ink);
    font-weight: 700;
    text-align: right;
}
.ievt-info-list li:last-child .ievt-info-value { text-transform: capitalize; }

.ievt-sidebar-gallery-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--ime-red);
    color: #fff !important;
    font-weight: 700;
    font-size: 14px;
    padding: 13px 20px;
    border-radius: 10px;
    text-decoration: none !important;
    box-shadow: var(--ime-shadow-red);
    transition: background .2s ease, transform .2s ease;
}
.ievt-sidebar-gallery-btn:hover { background: var(--ime-red-dark); transform: translateY(-2px); }
.ievt-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ime-ink) !important;
    text-decoration: none !important;
    padding: 4px 2px;
    transition: color .2s ease;
}
.ievt-back-link i { font-size: 12px; transition: transform .2s ease; }
.ievt-back-link:hover { color: var(--ime-red) !important; }
.ievt-back-link:hover i { transform: translateX(-3px); }

/* ---- More Events strip ---- */
.ievt-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
/* Compact cards for the "More Events" strip */
.ievt-related-grid .ime-events-card-media { display: block; aspect-ratio: 16 / 10; }
.ievt-related-grid .ime-events-card-body { padding: 16px 18px 18px; }
.ievt-related-grid .ime-events-tag { font-size: 10px; padding: 4px 9px; margin-bottom: 10px; }
.ievt-related-grid .ime-events-card-title {
    font-size: 15px !important;
    line-height: 1.4 !important;
    margin: 0 0 6px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ievt-related-grid .ime-events-desc {
    font-size: 13px !important;
    line-height: 1.6 !important;
    -webkit-line-clamp: 2;
    margin-bottom: 14px;
}
.ievt-related-grid .ime-events-link { font-size: 13.5px; }
/* Safety net: if rich HTML ever lands in a card, keep only the summary */
.ievt-related-grid .ime-events-card-body > :is(h1, h2, h3, h5, h6, ul, ol, div, figure, table, img),
.ievt-related-grid .ime-events-card-body > h4:not(.ime-events-card-title) { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 1199px) {
    .ievt-related-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991px) {
    .ievt-title { font-size: 30px; }
    .ievt-sidebar { position: static; padding-left: 0; margin-top: 8px; }
    .ievt-related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .ievt-gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
}
@media (max-width: 575px) {
    .ievt-title { font-size: 25px; }
    .ievt-cover-img { max-height: 280px; }
    .ievt-body, .ievt-body p { font-size: 15px; }
    .ievt-gallery-grid { gap: 10px; grid-auto-rows: 130px; }
    .ievt-gallery-item--wide,
    .ievt-gallery-item--big { grid-column: span 2; }
    .ievt-related-grid { grid-template-columns: 1fr; }
    .ievt-info-card { padding: 20px; }
}

/* When a description contains its own <p> tags the browser splits it out
   of .ime-events-desc — clamp those paragraphs too and drop the empty ones */
.ime-events-card-body > p:empty { display: none; }
.ime-events-card-body > p:not(.ime-events-desc):not(.ime-events-meta) {
    font-size: 14px !important;
    line-height: 1.65 !important;
    color: var(--ime-ink-soft);
    margin: 0 0 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ime-events-card-body > p:not(.ime-events-desc):not(.ime-events-meta) ~ p:not(:empty) { display: none; }

@media (max-width: 575px) {
    .ievt-meta-dot { display: none; }
    .ievt-meta-row { gap: 6px 16px; }
}

/* ---- Event gallery pagination ---- */
.ievt-gallery-pager-wrap {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--ime-line);
}
.ievt-gallery-pager-wrap .ievt-gallery-count {
    margin: 0 !important;
    font-size: 13.5px !important;
    line-height: 1.4 !important;
    color: var(--ime-muted) !important;
    font-weight: 600;
}
.ievt-gallery-pager-wrap .ievt-gallery-pager {
    display: flex !important;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
}
.ievt-gallery-pager .ievt-page-btn {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    min-width: 38px;
    height: 38px;
    margin: 0;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ime-line) !important;
    border-radius: 10px !important;
    background: var(--ime-paper) !important;
    color: var(--ime-ink) !important;
    font-family: inherit;
    font-size: 14px !important;
    font-weight: 700;
    line-height: 1 !important;
    box-shadow: none;
    outline: none;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease, transform .2s ease;
}
.ievt-gallery-pager .ievt-page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--ime-red) !important;
    color: var(--ime-red) !important;
    transform: translateY(-1px);
}
.ievt-gallery-pager .ievt-page-btn.active {
    background: var(--ime-red) !important;
    border-color: var(--ime-red) !important;
    color: #fff !important;
    box-shadow: var(--ime-shadow-red);
    cursor: default;
}
.ievt-gallery-pager .ievt-page-btn:disabled { opacity: .35; cursor: not-allowed; }
.ievt-gallery-pager .ievt-page-btn:focus-visible { outline: 2px solid var(--ime-red); outline-offset: 2px; }
.ievt-gallery-pager .ievt-page-arrow { padding: 0; width: 38px; }
.ievt-gallery-pager .ievt-page-arrow i { font-size: 12px; }
.ievt-gallery-pager .ievt-page-dots {
    min-width: 22px;
    text-align: center;
    color: var(--ime-muted);
    font-weight: 700;
    letter-spacing: 1px;
}

@media (max-width: 575px) {
    .ievt-gallery-pager-wrap { flex-direction: column-reverse; align-items: center; }
    .ievt-gallery-pager .ievt-page-btn { min-width: 34px; height: 34px; font-size: 13px !important; }
    .ievt-gallery-pager .ievt-page-arrow { width: 34px; }
}

/* Clicked tab pills: no black browser focus ring (keyboard users still get one) */
.ime-tab-btn:focus { outline: none; box-shadow: none; }
.ime-tab-btn:focus-visible { outline: 2px solid var(--ime-red); outline-offset: 2px; }

/* ============================================================
   Whole event card is clickable (Events page + More Events).
   The "View Event" link is stretched over the full card.
   ============================================================ */
.ime-events-card { position: relative; cursor: pointer; }
.ime-events-card .ime-events-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
}
.ime-events-card:hover .ime-events-card-title { color: var(--ime-red); }
.ime-events-card .ime-events-card-title { transition: color .2s ease; }
/* keyboard focus outlines the whole card */
.ime-events-card:focus-within { box-shadow: 0 0 0 2px var(--ime-red); }
.ime-events-card .ime-events-link:focus { outline: none; }
