/* AIEI header navigation (mega panels, account, mobile accordion).
   Loaded after main.min.css. Colours follow the existing theme. */

:root {
	--aiei-ink: #0a2535;
	--aiei-mist: #eaf0f5;
	--aiei-line: #c6d5e2;
	--aiei-slate: #6584a1;
	--aiei-steel: #4c6b86;
	--aiei-blue: #3366ff;
	--aiei-teal: #009688;
	--aiei-mint: #bddedb;
	--aiei-ease: cubic-bezier(.16, 1, .3, 1);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.aiei-ico { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; display: block; }

/* ---------- top bar: right side ---------- */
.header-top__right { display: flex; align-items: center; gap: 6px; }
.header-top__right .socials { margin: 0; }
.aiei-util { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0 -8px 0 10px; padding: 0 0 0 14px; border-left: 1px solid rgba(234, 240, 245, .25); }
.aiei-util__link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; font-size: 12px; color: #eaf0f5; text-decoration: none; }
.aiei-util__link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.aiei-util__link .aiei-ico { width: 14px; height: 14px; }

/* account in the top bar: same look as the other top-bar links, long names truncated */
.aiei-util__acct { position: relative; }
.aiei-util .aiei-acct__btn { border: 0; border-radius: 6px; background: transparent; color: #eaf0f5; font-size: 12px; font-weight: 400; gap: 6px; padding: 6px 8px; }
.aiei-util .aiei-acct__btn:hover,
.aiei-util .aiei-acct__btn[aria-expanded="true"] { background: rgba(255, 255, 255, .08); color: #fff; }
.aiei-util .aiei-acct__btn .aiei-ico { color: currentColor; }
.aiei-util .aiei-acct__btn > .aiei-ico:first-child { width: 14px; height: 14px; }
.aiei-util .aiei-acct__btn > .aiei-ico:last-of-type { width: 10px; height: 10px; opacity: .8; }
.aiei-util .aiei-acct__who { display: block; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiei-util .aiei-acct__menu { top: calc(100% + 10px); right: -8px; z-index: 120; }

/* ---------- main nav ---------- */
.aiei-nav__list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.aiei-nav__item { position: relative; padding: 8px 0; }
.aiei-nav__top {
	font: inherit; font-size: 16px; line-height: 1.2; color: var(--aiei-ink);
	display: inline-flex; align-items: center; gap: 8px;
	padding: 9px 10px; border: 0; border-radius: 8px; background: transparent;
	cursor: pointer; white-space: nowrap; text-decoration: none;
	transition: background .2s ease, color .2s ease;
}
.aiei-nav__top .aiei-ico { width: 12px; height: 12px; color: var(--aiei-slate); transition: transform .3s var(--aiei-ease); }
.aiei-nav__top:hover,
.aiei-nav__top[aria-expanded="true"],
.aiei-nav__item.is-current > .aiei-nav__top { background: var(--aiei-line); }
.aiei-nav__top[aria-expanded="true"] .aiei-ico { transform: rotate(180deg); }
.aiei-nav__top:focus-visible,
.aiei-nav__link:focus-visible,
.aiei-acct__btn:focus-visible,
.aiei-acct__link:focus-visible,
.aiei-card a:focus-visible,
.aiei-util__link:focus-visible,
.aiei-mnav__toggle:focus-visible,
.aiei-mnav__link:focus-visible { outline: 2px solid var(--aiei-blue); outline-offset: 2px; }

/* panels (also used by the account menu) */
.aiei-nav__panel {
	position: absolute; top: calc(100% + 2px); left: -8px; z-index: 110;
	background: #fff; border: 1px solid var(--aiei-line); border-radius: 16px;
	box-shadow: 0 14px 24px 0 rgba(10, 37, 53, .15);
	opacity: 0; visibility: hidden; transform: translateY(-6px); pointer-events: none;
	transition: opacity .2s ease, transform .3s var(--aiei-ease), visibility 0s linear .2s;
}
.aiei-nav__panel.is-open,
.aiei-nav:not(.is-js) .aiei-nav__item:hover > .aiei-nav__panel,
.aiei-nav:not(.is-js) .aiei-nav__item:focus-within > .aiei-nav__panel {
	opacity: 1; visibility: visible; transform: none; pointer-events: auto;
	transition: opacity .18s ease, transform .3s var(--aiei-ease);
}
.aiei-nav__panel.is-end { left: auto; right: -8px; }

.aiei-nav__grid {
	display: grid; gap: 4px 18px; padding: 14px;
	grid-template-columns: repeat(var(--aiei-cols, 1), minmax(230px, max-content));
}
.aiei-nav__grid.has-card { grid-template-columns: repeat(var(--aiei-cols, 1), minmax(230px, max-content)) 300px; }
.aiei-nav__col { display: grid; align-content: start; gap: 2px; min-width: 0; }
.aiei-nav__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.aiei-nav__heading { margin: 8px 0 4px; padding: 0 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--aiei-slate); }
.aiei-nav__link { display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; color: var(--aiei-ink); text-decoration: none; transition: background .15s ease; }
.aiei-nav__link:hover { background: var(--aiei-mist); color: var(--aiei-ink); }
.aiei-nav__link[aria-current="page"] .aiei-nav__title { color: var(--aiei-blue); }
.aiei-nav__title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.aiei-nav__desc { font-size: 13px; line-height: 1.45; color: var(--aiei-steel); max-width: 34ch; }

/* latest-post card */
.aiei-card { background: var(--aiei-mist); border-radius: 12px; overflow: hidden; display: grid; align-content: start; min-width: 0; }
.aiei-card__img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--aiei-line); }
.aiei-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; transition: transform .5s var(--aiei-ease); }
.aiei-card:hover .aiei-card__img img { transform: scale(1.03); }
.aiei-card__body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.aiei-card__label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--aiei-teal); }
.aiei-card__title {
	font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--aiei-ink); text-decoration: none;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.aiei-card__title:hover { color: var(--aiei-blue); }
.aiei-card__date { font-size: 12.5px; color: var(--aiei-steel); }
.aiei-card__all { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--aiei-blue); text-decoration: none; }
.aiei-card__all:hover { color: var(--aiei-teal); }
.aiei-card__all .aiei-ico { width: 13px; height: 13px; }

/* ---------- actions: account + CTA ---------- */
.aiei-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.aiei-actions .btn { margin-top: 0; max-width: none; white-space: nowrap; }
.aiei-acct { position: relative; }
.aiei-acct__btn {
	display: inline-flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px;
	border-radius: 999px; border: 1px solid var(--aiei-line); background: #fff; color: var(--aiei-ink);
	font: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer;
}
.aiei-acct__btn:hover, .aiei-acct__btn[aria-expanded="true"] { border-color: var(--aiei-slate); }
.aiei-acct__btn .aiei-ico { width: 12px; height: 12px; color: var(--aiei-slate); }
.aiei-acct__av { width: 32px; height: 32px; border-radius: 50%; background: var(--aiei-ink); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.aiei-acct__who { display: grid; gap: 3px; text-align: left; }
.aiei-acct__menu { left: auto; right: 0; width: 280px; padding: 8px; }
.aiei-acct__head { padding: 12px 12px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--aiei-mist); display: grid; gap: 2px; }
.aiei-acct__head b { font-size: 15px; color: var(--aiei-ink); }
.aiei-acct__head span { font-size: 12.5px; color: var(--aiei-steel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiei-acct__link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 14.5px; color: var(--aiei-ink); text-decoration: none; }
.aiei-acct__link:hover { background: var(--aiei-mist); color: var(--aiei-ink); }
.aiei-acct__link .aiei-ico { width: 16px; height: 16px; }
.aiei-acct__out { color: var(--aiei-steel); border-top: 1px solid var(--aiei-mist); margin-top: 6px; border-radius: 0 0 8px 8px; }

/* sticky row: lighter hover on white */
.header-row.sticky .aiei-nav__top:hover,
.header-row.sticky .aiei-nav__top[aria-expanded="true"],
.header-row.sticky .aiei-nav__item.is-current > .aiei-nav__top { background: var(--aiei-mist); }

/* ---------- dark header, detected automatically by aiei-header.js (any template) ---------- */
.header-row.aiei-on-dark:not(.sticky) .aiei-nav__top { color: #eaf0f5; }
.header-row.aiei-on-dark:not(.sticky) .aiei-nav__top .aiei-ico { color: #c6d5e2; }
.header-row.aiei-on-dark:not(.sticky) :is(.aiei-nav__top:hover, .aiei-nav__top[aria-expanded="true"], .is-current > .aiei-nav__top) { background: rgba(255, 255, 255, .12); }
.header-row.aiei-on-dark:not(.sticky) .aiei-acct__btn { background: transparent; color: #fff; border-color: rgba(234, 240, 245, .35); }

/* ---------- known dark templates: instant styling before JS, exact hover colours ---------- */
:is(.page-template-individual-membership, .page-template-membership, .page-template-template-ai,
	.page-template-template-conference, .page-template-template-conference-2026, .page-template-template-conference-2026-2,
	.page-template-template-individual-membership, .page-template-template-individual-membership-2,
	.page-template-template-members, .page-template-template-organisational-membership,
	.page-template-template-organisational-membership-2) .header-row:not(.sticky) .aiei-nav__top { color: #eaf0f5; }
:is(.page-template-individual-membership, .page-template-membership, .page-template-template-ai,
	.page-template-template-conference, .page-template-template-conference-2026, .page-template-template-conference-2026-2,
	.page-template-template-individual-membership, .page-template-template-individual-membership-2,
	.page-template-template-members, .page-template-template-organisational-membership,
	.page-template-template-organisational-membership-2) .header-row:not(.sticky) .aiei-nav__top .aiei-ico { color: #c6d5e2; }
:is(.page-template-individual-membership, .page-template-membership, .page-template-template-ai,
	.page-template-template-conference, .page-template-template-conference-2026, .page-template-template-conference-2026-2,
	.page-template-template-individual-membership, .page-template-template-individual-membership-2,
	.page-template-template-members, .page-template-template-organisational-membership,
	.page-template-template-organisational-membership-2) .header-row:not(.sticky) :is(.aiei-nav__top:hover, .aiei-nav__top[aria-expanded="true"], .is-current > .aiei-nav__top) { background: #6584a1; }
:is(.page-template-template-conference, .page-template-template-conference-2026-2) .header-row:not(.sticky) :is(.aiei-nav__top:hover, .aiei-nav__top[aria-expanded="true"], .is-current > .aiei-nav__top) { background: rgba(255, 255, 255, .08); }
:is(.page-template-individual-membership, .page-template-membership, .page-template-template-ai,
	.page-template-template-conference, .page-template-template-conference-2026, .page-template-template-conference-2026-2,
	.page-template-template-individual-membership, .page-template-template-individual-membership-2,
	.page-template-template-members, .page-template-template-organisational-membership,
	.page-template-template-organisational-membership-2) .header-row:not(.sticky) .aiei-acct__btn { background: transparent; color: #fff; border-color: rgba(234, 240, 245, .35); }

/* ---------- laptop widths ---------- */
@media only screen and (max-width: 1200px) {
	.aiei-nav__list { gap: 0; }
	.aiei-nav__top { font-size: 15px; padding-inline: 8px; }
	.aiei-util { margin-left: 4px; padding-left: 8px; }
}

/* ---------- mobile menu ---------- */
@media only screen and (max-width: 1023px) {
	.aiei-actions { display: none; }
	.mobile-nav { overflow-y: auto; overscroll-behavior: contain; }
	.mobile-nav__body { padding-bottom: 32px; }
}
.aiei-macct { display: grid; gap: 10px; margin: 18px 0 8px; }
.aiei-macct__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mobile-nav .aiei-macct .btn { width: 100%; max-width: none; margin: 0; justify-content: center; }
.aiei-macct__login { display: flex; align-items: center; justify-content: center; border-radius: 8px; padding: 11px 10px; font-size: 14px; color: #fff; text-decoration: none; box-shadow: inset 0 0 0 1px rgba(234, 240, 245, .3); }
.aiei-macct__me { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.aiei-macct__me .aiei-acct__av { background: var(--aiei-blue); width: 40px; height: 40px; font-size: 14px; }
.aiei-macct__me div { display: grid; gap: 2px; min-width: 0; }
.aiei-macct__me b { font-size: 15px; color: #fff; }
.aiei-macct__me span { font-size: 12.5px; color: var(--aiei-mint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiei-macct__me a { margin-left: auto; padding: 8px; font-size: 13px; font-weight: 600; color: var(--aiei-mint); text-decoration: none; }

.aiei-mnav { list-style: none; margin: 8px 0 20px; padding: 0; border-top: 1px solid rgba(234, 240, 245, .1); }
.aiei-mnav__item { border-bottom: 1px solid rgba(234, 240, 245, .1); }
.aiei-mnav__toggle {
	width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 16px 4px; border: 0; background: transparent; color: #fff; text-align: left; text-decoration: none;
	font: inherit; font-size: 17px; font-weight: 600; line-height: 1.2; cursor: pointer;
}
.aiei-mnav__toggle .aiei-ico { width: 16px; height: 16px; color: #a9c0d4; transition: transform .3s var(--aiei-ease); }
.aiei-mnav__toggle[aria-expanded="true"] .aiei-ico { transform: rotate(180deg); }
.aiei-mnav__panel { display: grid; gap: 14px; padding: 0 4px 18px; }
.aiei-mnav__panel[hidden] { display: none; }
.aiei-mnav__group { display: grid; }
.aiei-mnav__heading { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8aa6bf; }
.aiei-mnav__link { display: block; padding: 10px 0; font-size: 15.5px; color: var(--aiei-mist); text-decoration: none; }
.aiei-mnav__link:hover { color: #fff; }
.aiei-card--compact { background: rgba(255, 255, 255, .06); grid-template-columns: 88px minmax(0, 1fr); }
.aiei-card--compact .aiei-card__img { aspect-ratio: auto; height: 100%; }
.aiei-card--compact .aiei-card__body { padding: 12px 14px; }
.aiei-card--compact .aiei-card__label { color: var(--aiei-mint); }
.aiei-card--compact .aiei-card__title { color: #fff; font-size: 14px; }
.aiei-card--compact .aiei-card__date { color: #a9c0d4; }

/* ---------- announcement bar (inc/announcement-bar.php) ---------- */
.aiei-bar {
	position: relative; overflow: hidden; flex-shrink: 0; color: #fff; /* body is a flex column in the theme */
	background: linear-gradient(90deg, var(--aiei-blue) 0%, #2b55e6 30%, #173c9e 62%, var(--aiei-ink) 100%);
	animation: aiei-bar-in .5s var(--aiei-ease) both;
}
.aiei-bar__shine {
	position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(45deg, transparent 25%, rgba(255, 255, 255, .11) 50%, transparent 75%);
	background-size: 250% 250%;
	animation: aiei-bar-shine 12s ease-in-out infinite;
}
.aiei-bar__in { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 8px; min-height: 48px; padding-block: 6px; }
.aiei-bar__link {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px;
	color: #fff; text-decoration: none; font-size: 15px; line-height: 1.3; text-align: center;
}
.aiei-bar__link:hover, .aiei-bar__link:focus { color: #fff; text-decoration: none; }
/* the one warm accent: a sparkle in the conference orange */
.aiei-bar__spark { width: 22px; height: 22px; margin-right: -6px; overflow: visible; fill: url(#aiei-bar-spark-g); filter: drop-shadow(0 0 6px rgba(255, 122, 61, .65)); }
.aiei-bar__spark path { transform-box: fill-box; transform-origin: center; }
.aiei-bar__spark-big { animation: aiei-bar-twinkle 3.2s ease-in-out infinite; }
.aiei-bar__spark-small { animation: aiei-bar-twinkle 3.2s ease-in-out 1.1s infinite; }
.aiei-bar__title { font-weight: 700; letter-spacing: .005em; }
.aiei-bar__sep { width: 1px; height: 16px; background: rgba(255, 255, 255, .4); }
.aiei-bar__count {
	padding: 3px 10px; border-radius: 999px; background: var(--aiei-mint); color: var(--aiei-ink);
	font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.aiei-bar__cta {
	display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px;
	background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
	font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .2s ease, color .2s ease;
}
.aiei-bar__cta .aiei-ico { width: 14px; height: 14px; transition: transform .3s var(--aiei-ease); }
.aiei-bar__link:hover .aiei-bar__cta { background: rgba(255, 255, 255, .26); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.aiei-bar__link:hover .aiei-bar__cta .aiei-ico { transform: translateX(3px); }
.aiei-bar__close {
	display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px;
	background: transparent; color: #fff; opacity: .75; cursor: pointer; transition: opacity .2s ease, background .2s ease;
}
.aiei-bar__close .aiei-ico { width: 16px; height: 16px; }
.aiei-bar__close:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.aiei-bar :focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }
.aiei-bar.is-closing { animation: aiei-bar-out .3s ease both; }
@keyframes aiei-bar-in { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes aiei-bar-out { to { opacity: 0; transform: translateY(-100%); } }
@keyframes aiei-bar-shine { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }
@keyframes aiei-bar-twinkle { 0%, 70%, 100% { transform: scale(1) rotate(0); opacity: 1; } 82% { transform: scale(1.25) rotate(20deg); opacity: .85; } 90% { transform: scale(.85) rotate(-6deg); opacity: 1; } }
@media only screen and (max-width: 1023px) {
	.aiei-bar__sep, .aiei-bar__text { display: none; }
}
@media only screen and (max-width: 743px) {
	.aiei-bar__in { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 0; padding-block: 8px; }
	.aiei-bar__link { gap: 6px 10px; font-size: 14px; }
	.aiei-bar__count { font-size: 11px; padding: 2px 8px; }
	.aiei-bar__cta { padding: 5px 10px; font-size: 13px; }
	.aiei-bar__close { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
	.aiei-nav__panel, .aiei-nav__top .aiei-ico, .aiei-mnav__toggle .aiei-ico, .aiei-card__img img, .aiei-bar__cta, .aiei-bar__cta .aiei-ico { transition: none; }
	.aiei-bar, .aiei-bar.is-closing, .aiei-bar__shine, .aiei-bar__spark path { animation: none; }
}
