/* Loaded after nearby-libraries.css. Palette follows the home page (landing.css). */
:root {
    --events-ink: #0f172a;
    --events-muted: #64748b;
    --events-accent: #4f46e5;
    --events-accent-light: #eef2ff;
    --events-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --events-highlight: #fbbf24;
    --events-line: #e2e8f0;
    --events-paper: #f8fafc;
}

body {
    background:
        radial-gradient(ellipse at 88% 15%, rgba(99, 102, 241, .08), transparent 30%),
        var(--events-paper);
}

.public-events-page { width: min(1160px, calc(100% - 56px)); margin: 0 auto; padding: 24px 0 32px; }
.events-back-link { display: inline-flex; min-height: 41px; align-items: center; gap: 9px; margin: 0 0 18px; padding: 5px 14px 5px 6px; border: 1px solid var(--events-line); border-radius: 999px; background: rgba(255, 255, 255, .82); color: #475569; font-size: .83rem; font-weight: 700; box-shadow: 0 3px 10px rgba(15, 23, 42, .045); transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.events-back-link i { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; background: var(--events-accent-light); color: var(--events-accent); transition: background .18s ease, color .18s ease, transform .18s ease; }
.events-back-link:hover { transform: translateX(-2px); border-color: #c7d2fe; background: #fff; color: var(--events-accent); box-shadow: 0 6px 16px rgba(79, 70, 229, .1); }
.events-back-link:hover i { transform: translateX(-2px); background: var(--events-gradient); color: #fff; }
.events-back-link:focus-visible, .events-primary-action:focus-visible, .events-secondary-action:focus-visible, .events-footer a:focus-visible { border-radius: 999px; outline: 3px solid var(--events-highlight); outline-offset: 3px; }

.events-hero {
    position: relative;
    display: flex;
    min-height: 310px;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    overflow: hidden;
    margin-bottom: 42px;
    padding: 42px 52px;
    border: 1px solid rgba(99, 102, 241, .18);
    border-radius: 27px;
    background:
        radial-gradient(ellipse at 82% 52%, rgba(99, 102, 241, .38), transparent 37%),
        linear-gradient(120deg, #111a2d 0%, #1d2943 56%, #363f91 100%);
    color: #fff;
    box-shadow: 0 22px 48px rgba(15, 23, 42, .16);
}

.events-hero::after {
    position: absolute;
    right: 173px;
    bottom: -210px;
    width: 400px;
    height: 400px;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 50%;
    box-shadow: 0 0 0 35px rgba(255,255,255,.025), 0 0 0 75px rgba(255,255,255,.02);
    content: "";
    pointer-events: none;
}

.events-hero-copy { position: relative; z-index: 1; max-width: 700px; }
.events-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #c4b5fd; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.events-eyebrow i { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(196, 181, 253, .42); border-radius: 9px; background: rgba(167, 139, 250, .12); font-size: .9rem; }
.events-hero h1 { margin: 15px 0 12px; font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.05em; line-height: 1.02; }
.events-hero h1 em { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); -webkit-background-clip: text; background-clip: text; color: var(--events-highlight); -webkit-text-fill-color: transparent; font-style: normal; }
.events-hero-copy > p { max-width: 570px; margin: 0; color: rgba(255, 255, 255, .77); font-size: .96rem; line-height: 1.65; }
.events-hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 22px; }
.events-primary-action, .events-secondary-action { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 9px; padding: 0 15px; border: 1px solid transparent; border-radius: 11px; font-size: .82rem; font-weight: 700; transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.events-primary-action { background: var(--events-gradient); color: #fff; box-shadow: 0 8px 22px rgba(99, 102, 241, .35); }
.events-primary-action:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 10px 26px rgba(99, 102, 241, .45); }
.events-secondary-action { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06); color: #fff; }
.events-secondary-action:hover { border-color: rgba(255, 255, 255, .65); background: rgba(255, 255, 255, .13); color: #fff; }
.events-hero-count { position: relative; z-index: 1; display: flex; width: 142px; height: 142px; flex: 0 0 142px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, .24); border-radius: 50%; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 30px rgba(255, 255, 255, .035); }
.events-hero-count i { color: var(--events-highlight); font-size: 1.2rem; }
.events-hero-count strong { margin-top: 3px; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.events-hero-count span { margin-top: 4px; color: rgba(255, 255, 255, .75); font-size: .72rem; }

.public-event-section { margin: 0 0 43px; }
.public-event-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.events-section-kicker { color: var(--events-accent); font-size: .69rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.public-event-section-heading h2 { margin: 3px 0 0; color: var(--events-ink); font-size: 1.6rem; font-weight: 800; letter-spacing: -.035em; }
.events-section-count { display: grid; min-width: 34px; height: 34px; padding: 0 9px; place-items: center; border: 1px solid #c7d2fe; border-radius: 50px; background: var(--events-accent-light); color: #4338ca; font-size: .78rem; font-weight: 800; }
.public-event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 18px; }
.public-event-grid-past { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.public-event-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--events-line); border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .055); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.public-event-card:hover { transform: translateY(-3px); border-color: #c7d2fe; box-shadow: 0 16px 34px rgba(79, 70, 229, .12); }
.public-event-card-past { background: #f8fafc; }
.public-event-image { position: relative; display: grid; height: 178px; flex: 0 0 178px; place-items: center; overflow: hidden; background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 47%, #ede9fe 100%); }
.public-event-image::after { position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(15, 23, 42, .18)); content: ""; pointer-events: none; }
.public-event-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.public-event-card:hover .public-event-image img { transform: scale(1.045); }
.public-event-image-fallback { background: radial-gradient(circle at 72% 32%, rgba(255, 255, 255, .64), transparent 22%), linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 47%, #ede9fe 100%); color: rgba(79, 70, 229, .3); }
.public-event-image-fallback > i { font-size: 4rem; }
.public-event-type { position: absolute; z-index: 1; top: 13px; left: 13px; padding: 6px 9px; border: 1px solid rgba(255, 255, 255, .36); border-radius: 50px; background: rgba(15, 23, 42, .8); color: #fff; font-size: .61rem; font-weight: 700; letter-spacing: .025em; }
.public-event-date-badge { position: absolute; z-index: 1; right: 13px; bottom: 13px; display: flex; width: 49px; height: 55px; flex-direction: column; align-items: center; justify-content: center; border-radius: 11px; background: #fff; color: var(--events-accent); box-shadow: 0 5px 16px rgba(15, 23, 42, .15); }
.public-event-date-badge strong { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.public-event-date-badge small { margin-top: 3px; font-size: .59rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.public-event-content { display: flex; min-width: 0; flex: 1; flex-direction: column; padding: 17px 17px 15px; }
.public-event-content h3 { display: -webkit-box; overflow: hidden; min-height: 2.65em; margin: 0 0 9px; color: var(--events-ink); font-size: 1.04rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.32; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.public-event-date, .public-event-host, .public-event-location, .public-event-speakers { display: flex; align-items: flex-start; gap: 8px; color: var(--events-muted); font-size: .74rem; line-height: 1.45; }
.public-event-date i, .public-event-host i, .public-event-location i, .public-event-speakers i { flex: 0 0 auto; margin-top: 1px; color: #6366f1; }
.public-event-host { color: #334155; font-weight: 700; }
.public-event-date, .public-event-host, .public-event-location, .public-event-speakers { margin: 0 0 6px; }
.public-event-description { display: -webkit-box; overflow: hidden; min-height: 3.9em; margin: 7px 0 13px; color: var(--events-muted); font-size: .78rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.public-event-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid #eef2f7; }
.public-event-meta > span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 7px; background: #f1f5f9; color: #475569; font-size: .67rem; font-weight: 700; }
.public-event-meta .event-free { background: #ccfbf1; color: #0f766e; }
.public-event-meta .event-fee { background: #fef3c7; color: #b45309; }

.events-empty { margin: 0; padding: 24px; border: 1px dashed #cbd5e1; border-radius: 15px; background: rgba(255, 255, 255, .62); color: var(--events-muted); font-size: .88rem; text-align: center; }
.events-footer { display: flex; justify-content: space-between; gap: 16px; padding: 18px 2px 0; border-top: 1px solid var(--events-line); color: #94a3b8; font-size: .77rem; }
.events-footer a { color: var(--events-accent); font-weight: 700; }
.events-footer a:hover { color: #8b5cf6; }

@media (max-width: 1050px) {
    .public-event-grid, .public-event-grid-past { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .public-events-page { width: calc(100% - 30px); padding: 18px 0 24px; }
    .events-back-link { margin-bottom: 14px; }
    .events-hero { min-height: 0; gap: 13px; margin-bottom: 32px; padding: 27px 21px; border-radius: 21px; }
    .events-hero::after { right: 16px; bottom: -270px; }
    .events-hero h1 { margin: 12px 0 9px; font-size: clamp(2.1rem, 9vw, 2.8rem); }
    .events-hero-copy > p { font-size: .83rem; }
    .events-hero-actions { gap: 8px; margin-top: 17px; }
    .events-primary-action, .events-secondary-action { min-height: 39px; padding: 0 11px; font-size: .72rem; }
    .events-hero-count { width: 78px; height: 78px; flex-basis: 78px; }
    .events-hero-count i { font-size: .82rem; }
    .events-hero-count strong { font-size: 1.3rem; }
    .events-hero-count span { font-size: .55rem; }
    .public-event-section { margin-bottom: 33px; }
    .public-event-section-heading h2 { font-size: 1.4rem; }
    .public-event-grid, .public-event-grid-past { grid-template-columns: 1fr; gap: 13px; }
    .public-event-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); flex-direction: row; border-radius: 15px; }
    .public-event-image { height: auto; min-height: 100%; }
    .public-event-type { top: 8px; left: 7px; padding: 4px 6px; font-size: .51rem; }
    .public-event-date-badge { right: 7px; bottom: 8px; width: 40px; height: 47px; border-radius: 9px; }
    .public-event-date-badge strong { font-size: 1.08rem; }
    .public-event-content { padding: 12px 12px 11px; }
    .public-event-content h3 { min-height: 0; margin-bottom: 7px; font-size: .94rem; }
    .public-event-date, .public-event-host, .public-event-location, .public-event-speakers { gap: 6px; margin-bottom: 5px; font-size: .66rem; }
    .public-event-description { min-height: 0; margin: 3px 0 9px; font-size: .71rem; -webkit-line-clamp: 2; }
    .public-event-meta { gap: 5px; padding-top: 8px; }
    .public-event-meta > span { padding: 4px 6px; font-size: .61rem; }
    .events-footer { flex-direction: column; gap: 8px; }
}

@media (max-width: 390px) {
    .events-hero { padding-inline: 16px; }
    .events-hero-count { width: 65px; height: 65px; flex-basis: 65px; }
    .events-hero-count span { display: none; }
    .public-event-card { grid-template-columns: 92px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Guest event filters and pagination */
.events-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0 0 26px; padding: 16px 18px; border: 1px solid var(--events-line); border-radius: 16px; background: #fff; }
.events-filters label { display: flex; flex-direction: column; gap: 4px; color: var(--events-muted); font-size: .8rem; font-weight: 600; }
.events-filters select { min-width: 170px; min-height: 42px; padding: 0 10px; border: 1px solid var(--events-line); border-radius: 10px; background: #fff; color: var(--events-ink); font-size: .9rem; }
.events-clear { display: inline-flex; min-height: 42px; align-items: center; color: var(--events-accent); font-size: .88rem; }
.events-pagination { margin-top: 18px; }
@media (max-width: 560px) { .events-filters label { flex: 1 1 100%; } .events-filters select { width: 100%; } }
