/* IJCAI theme — ported from ijcai_org_page/next16 (globals.css + CSS modules).
   Breakpoints: 1130px (fluid nav), 1010px (grid 2-col), 833px (mobile). */

:root {
    --black: #000;
    --white: #fff;
    --text-light: #f0f0f0;
    --divider: #666;
    --legal: #ccc;
    --link: #00b1ec;
    --link-hover: #21759b;
    --th-bg: #db0000;
    --row-odd: #fff;
    --row-even: #f0f0f0;
    --container: 1152px;
    --header-h: 142px;
    --font: Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--black);
    color: var(--white);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
}

img { max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Header ---------- */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 999;
    background: var(--black);
}

.admin-bar .site-header { top: 32px; }

.site-header__bar {
    height: var(--header-h);
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header__spacer { width: 47px; }

.site-logo img { display: block; width: 247px; height: auto; }

.nav-toggle {
    width: 47px;
    height: 26px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-toggle span {
    display: block;
    height: 4px;
    width: 100%;
    background: var(--white);
    border-radius: 2px;
    transition: transform .3s ease, opacity .3s ease;
}

.nav-open .nav-toggle span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

/* Slide-down mega panel. grid-template-rows 0fr→1fr animates to content height. */
.nav-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s ease-out;
    background: var(--black);
}

.nav-open .nav-panel { grid-template-rows: 1fr; }

.nav-panel > * { overflow: hidden; }

/* Fixed header: a panel taller than the viewport must scroll on its own. */
.nav-open .nav-panel > * { max-height: calc(100vh - var(--header-h)); overflow-y: auto; }

.nav-panel__menu {
    list-style: none;
    margin: 0 auto;
    padding: 0 16px;
    max-width: 1120px;
    columns: 3 290px;
    column-gap: 40px;
}

.nav-open .nav-panel__menu { padding-bottom: 30px; }

.nav-panel__menu > li {
    break-inside: avoid;
    padding: 5px 0;
    font-size: 20px;
    font-weight: bold;
    font-style: italic;
}

.nav-panel__menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-panel__menu .sub-menu li {
    font-size: 13px;
    font-weight: normal;
    line-height: 2em;
}

.nav-panel a {
    color: var(--text-light);
    display: inline-block;
}

/* Underline that grows left→right on hover. */
.nav-panel a::after {
    content: "";
    display: block;
    border-bottom: 1px solid #feffff;
    transform: scaleX(0);
    transform-origin: 100% 50%;
    transition: transform 250ms ease-in-out;
}

.nav-panel a:hover::after {
    transform: scaleX(1);
    transform-origin: 0 50%;
}

/* ---------- Main / panels ---------- */

.site-main { padding-top: var(--header-h); }

.panel {
    max-width: var(--container);
    margin: 0 auto;
    padding: 25px 35px;
    background: var(--white);
    color: var(--black);
    word-break: break-word;
}

.panel__title {
    margin: 0;
    padding-bottom: 3%;
    font-size: 30px;
    line-height: 48px;
    font-weight: 700;
    text-align: center;
}

.entry-content a { color: var(--link); }
.entry-content a:hover { color: var(--link-hover); text-decoration: underline; }
.entry-content p { margin: 0 0 20px; }
.entry-content h2 { font-size: 26px; line-height: 1.3; margin: 30px 0 12px; }
.entry-content h3 { font-size: 24px; font-weight: bold; margin: 24px 0 10px; }
.entry-content ul, .entry-content ol { padding-left: 1.5em; margin: 0 0 20px; }

.entry-content table { width: 100%; border-collapse: collapse; margin: 0 0 20px; }
.entry-content th, .entry-content td { padding: 6px 10px; text-align: left; vertical-align: top; }
.entry-content th { background: var(--th-bg); color: var(--white); }
.entry-content tr:nth-child(odd) { background: var(--row-odd); }
.entry-content tr:nth-child(even) { background: var(--row-even); }

/* ---------- Person list (trustees / officers) ---------- */

.person-list .person {
    display: flex;
    padding: 20px 0;
    border-bottom: 1px solid var(--black);
}

.person-list .person:last-child { border-bottom: 0; }

.person__photo { flex: 0 0 14%; }
.person__photo img { display: block; width: 150px; max-width: 100%; aspect-ratio: 150 / 172; object-fit: cover; }

.person__name { flex: 0 0 22%; padding: 0 26px; }

.person__name .name {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.entry-content .person__name a.name { color: var(--black); }
.entry-content .person__name a.name:hover { color: var(--link-hover); }

.person__email { display: block; font-size: 12px; }

.person__body { flex: 1; }
.person__body p { margin: 0 0 15px; }
.person__body p:last-child { margin-bottom: 0; }
.person__roles { font-weight: bold; }

/* ---------- Carousel (home) ---------- */

.carousel { padding-bottom: 40px; overflow: hidden; }

.carousel__title {
    margin: 0;
    padding: 24px 16px 40px;
    font-size: 36px;
    line-height: 1.2;
    text-align: center;
}

.carousel__stage {
    position: relative;
    height: 420px;
    max-width: var(--container);
    margin: 0 auto;
    overflow: hidden;
}

.carousel__slide {
    --x: 0%;
    --s: .4;
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(760px, 64%);
    opacity: 0;
    z-index: 0;
    cursor: pointer;
    transform: translate(-50%, -50%) translateX(var(--x)) scale(var(--s));
    transition: transform 700ms ease-in-out, opacity 700ms ease-in-out;
}

.carousel__slide img { display: block; width: 100%; border-radius: 8px; }
.carousel__slide:not([data-slot="0"]) a { pointer-events: none; }

.carousel__slide[data-slot="-2"] { --x: -110%; --s: .55; opacity: 0;  z-index: 1; }
.carousel__slide[data-slot="-1"] { --x: -100%; --s: .75; opacity: .6; z-index: 2; }
.carousel__slide[data-slot="0"]  { --x: 0%;    --s: 1;   opacity: 1;  z-index: 3; }
.carousel__slide[data-slot="1"]  { --x: 100%;  --s: .75; opacity: .6; z-index: 2; }
.carousel__slide[data-slot="2"]  { --x: 110%;  --s: .55; opacity: 0;  z-index: 1; }

.carousel__nav {
    position: absolute;
    top: 50%;
    z-index: 10;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgb(0 0 0 / .5);
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    transform: translateY(-50%);
}

.carousel__nav:hover { background: rgb(0 0 0 / .7); }
.carousel__nav--prev { left: 0; }
.carousel__nav--next { right: 0; }

.carousel__dots { display: flex; justify-content: center; gap: 8px; padding-top: 16px; }

.carousel__dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / .4);
    cursor: pointer;
    transition: background-color .2s;
}

.carousel__dot.is-active { background: var(--white); }

/* ---------- Image grid ---------- */

.image-grid {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-grid__tile { display: block; }

.image-grid__img { display: block; aspect-ratio: 1; overflow: hidden; }

.image-grid__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.image-grid__tile:hover img { transform: scale(1.1); }

.image-grid__caption {
    display: block;
    padding: 6px 8px 23px;
    background: var(--white);
    color: var(--black);
    font-size: 25px;
    font-weight: bold;
    text-align: center;
}

/* ---------- Footer ---------- */

.sponsors { padding: 30px 0; }

.sponsors__title { margin: 0; padding-bottom: 41px; font-size: 30px; font-weight: bold; }

.sponsors__list { display: flex; align-items: center; gap: 40px; }

.sponsors__item { flex: 1; }
.sponsors__item img { display: block; max-width: 240px; width: 100%; height: auto; object-fit: contain; }

.sponsors__divider { border: 0; border-top: 1px solid var(--divider); margin: 45px 0 0; }

.site-footer__bottom { padding: 40px 0; }

.footer-columns { display: flex; gap: 40px; }

.footer-column { flex: 1; }

.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }

.footer-menu > li > a {
    display: block;
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: bold;
    font-style: italic;
    color: var(--white);
}

.footer-menu .sub-menu { list-style: none; margin: 0; padding: 0; }

.footer-menu .sub-menu a {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.6em;
    color: var(--text-light);
}

.footer-menu a:hover { text-decoration: underline; }

.back-to-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 50px;
    font-size: 24px;
    font-weight: bold;
}

.back-to-top__triangle {
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 14px solid var(--white);
}

.legal-row {
    display: flex;
    justify-content: center;
    gap: 45px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--divider);
    font-size: 14px;
}

.legal-row span { color: var(--legal); }

/* ---------- Responsive ---------- */

@media (max-width: 1010px) {
    .image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 833px) {
    :root { --header-h: 120px; }

    .site-logo img { width: 190px; }

    .nav-panel__menu { columns: 1; padding: 0 5%; }
    .nav-panel__menu .sub-menu li { line-height: 1.6em; }

    .panel { padding: 25px 25px 64px; }

    .person-list .person { flex-direction: column; }
    .person__name { padding: 10px 0 17px; }
    .person__name .name { margin-bottom: 4px; }

    .carousel__title { font-size: 28px; }
    .carousel__stage { height: 300px; }
    .carousel__slide { width: 90vw; }
    .carousel__slide:not([data-slot="0"]) { opacity: 0; }

    .image-grid { grid-template-columns: 1fr; gap: 25px; padding: 0 25px; }

    .sponsors__title { font-size: 22px; line-height: 1.2; text-align: center; }
    .sponsors__list { flex-direction: column; }

    .footer-columns { flex-direction: column; gap: 20px; }

    .legal-row { flex-direction: column; align-items: center; gap: 10px; text-align: center; }

    .entry-content th { background: transparent; color: var(--black); }
}

@media (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
}
