/* ==========================================================================
   CJIP chrome styles (header + footer variants).
   Tokens are provided by the cjip-institutional plugin's tokens.css (single
   source, methodology §1/§2). This file only *references* them:
     colours  --color-azure --color-azure-deep --color-gold
              --color-paper --color-sky --color-ink
     fonts    --font-display (Unbounded)  --font-body (Golos Text)
   PLUGIN CONTRACT: C2.3 must define those custom properties in tokens.css.
   All rules are scoped under .cjip-* — nothing leaks site-wide.
   ========================================================================== */

/* --- base / skip link --------------------------------------------------- */
.cjip-main { display: block; }

.cjip-skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 100;
	background: var(--color-azure-deep); color: #fff;
	padding: 10px 16px; border-radius: 0 0 8px 0;
	font-family: var(--font-body); font-weight: 600; text-decoration: none;
}
.cjip-skip-link:focus { left: 0; }

.cjip-wrap {
	max-width: 1200px; margin-inline: auto;
	padding-inline: 24px;
}
@media (max-width: 900px) { .cjip-wrap { padding-inline: 20px; } }
@media (max-width: 600px) { .cjip-wrap { padding-inline: 16px; } }

/* --- header shell ------------------------------------------------------- */
.cjip-header {
	position: sticky; top: 0; z-index: 40;
	background: var(--color-paper);
	border-bottom: 1px solid var(--color-sky);
	transition: box-shadow .3s ease, border-color .3s ease;
}
.cjip-header.is-scrolled {
	border-bottom-color: transparent;
	box-shadow: 0 1px 2px rgba(22, 32, 46, .08), 0 1px 3px rgba(22, 32, 46, .06);
}
.cjip-header__bar {
	display: flex; align-items: center; justify-content: space-between;
	height: 72px; gap: 24px;
}

/* --- logo / wordmark ---------------------------------------------------- */
.cjip-logo {
	display: flex; flex-direction: column; justify-content: center;
	white-space: nowrap; max-width: 280px; text-decoration: none;
}
.cjip-logo__img { max-height: 48px; width: auto; display: block; }
.cjip-logo__mark {
	font-family: var(--font-display); font-weight: 700; font-size: 22px;
	line-height: 1; color: var(--color-azure-deep);
}
.cjip-logo__sub {
	font-family: var(--font-body); font-weight: 500; font-size: 11px;
	letter-spacing: .02em; margin-top: 4px;
	color: color-mix(in srgb, var(--color-ink) 60%, transparent);
	overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 767px) {
	.cjip-logo { max-width: 200px; }
	.cjip-logo__sub { display: none; }
}

/* --- desktop nav -------------------------------------------------------- */
.cjip-header__nav { display: flex; }
.cjip-nav {
	display: flex; align-items: center; gap: 32px;
	list-style: none; margin: 0; padding: 0;
}
.cjip-nav li { position: relative; }
.cjip-nav a {
	position: relative; display: inline-block;
	font-family: var(--font-body); font-size: 15px; font-weight: 500;
	color: var(--color-ink); text-decoration: none;
	white-space: nowrap; transition: color .2s ease; padding-bottom: 6px;
}
.cjip-nav a::after {
	content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
	background: var(--color-gold); transition: width .3s ease;
}
.cjip-nav a:hover { color: var(--color-azure-deep); }
.cjip-nav .current-menu-item > a,
.cjip-nav .current_page_item > a,
.cjip-nav .current-menu-ancestor > a { color: var(--color-azure-deep); }
.cjip-nav .current-menu-item > a::after,
.cjip-nav .current_page_item > a::after,
.cjip-nav .current-menu-ancestor > a::after { width: 100%; }

/* --- header actions ----------------------------------------------------- */
.cjip-header__actions { display: flex; align-items: center; gap: 16px; }

/* language dropdown (wraps Polylang <ul>) */
.cjip-lang { position: relative; }
.cjip-lang__toggle {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 8px; border: 0; background: transparent; cursor: pointer;
	font-family: var(--font-body); font-size: 14px; font-weight: 500;
	color: var(--color-ink); border-radius: 6px; transition: color .2s ease;
}
.cjip-lang__toggle:hover { color: var(--color-azure-deep); }
.cjip-lang__toggle:focus-visible {
	outline: 2px solid var(--color-azure); outline-offset: 2px;
}
.cjip-lang__globe { opacity: .8; }
.cjip-lang__chevron { opacity: .7; transition: transform .2s ease; }
.cjip-lang[data-open="true"] .cjip-lang__chevron { transform: rotate(180deg); }

.cjip-lang__panel {
	position: absolute; right: 0; top: calc(100% + 8px); min-width: 128px;
	background: var(--color-paper); border: 1px solid var(--color-sky);
	border-radius: 12px; box-shadow: 0 4px 12px rgba(22, 32, 46, .10);
	padding: 8px; margin: 0; list-style: none; z-index: 50;
}
.cjip-lang__panel[hidden] { display: none; }
.cjip-lang__panel li { margin: 0; }
.cjip-lang__panel a {
	display: flex; align-items: center; height: 40px; padding-inline: 12px;
	border-radius: 8px; text-decoration: none; text-transform: uppercase;
	font-family: var(--font-body); font-size: 14px; font-weight: 500;
	color: var(--color-ink); transition: background .15s ease, color .15s ease;
}
.cjip-lang__panel a:hover {
	background: color-mix(in srgb, var(--color-sky) 30%, transparent);
	color: var(--color-azure-deep);
}
.cjip-lang__panel .current-lang a,
.cjip-lang__panel .current-lang > a {
	background: color-mix(in srgb, var(--color-sky) 50%, transparent);
	color: var(--color-azure-deep); font-weight: 600;
}

/* CTA button (gold restraint: gold reserved for primary CTA) */
.cjip-cta-btn {
	display: inline-flex; align-items: center; justify-content: center;
	height: 44px; padding-inline: 20px; border-radius: 10px;
	font-family: var(--font-body); font-size: 15px; font-weight: 600;
	color: var(--color-azure-deep); background: var(--color-gold);
	text-decoration: none; white-space: nowrap;
	box-shadow: 0 1px 2px rgba(22, 32, 46, .08); transition: opacity .2s ease;
}
.cjip-cta-btn:hover { opacity: .9; }
.cjip-cta-btn:focus-visible { outline: 2px solid var(--color-azure); outline-offset: 2px; }

/* hamburger */
.cjip-burger {
	display: none; align-items: center; justify-content: center;
	width: 44px; height: 44px; margin-right: -8px;
	border: 0; background: transparent; cursor: pointer;
	color: var(--color-ink); transition: color .2s ease;
}
.cjip-burger:hover { color: var(--color-azure-deep); }

/* --- responsive collapse ------------------------------------------------ */
@media (max-width: 767px) {
	.cjip-header__nav,
	.cjip-header__actions .cjip-lang,
	.cjip-header__actions .cjip-cta-btn { display: none; }
	.cjip-burger { display: flex; }
}

/* --- mobile drawer ------------------------------------------------------ */
.cjip-scrim {
	position: fixed; inset: 0; z-index: 50;
	background: color-mix(in srgb, var(--color-ink) 40%, transparent);
	opacity: 0; transition: opacity .25s ease;
}
.cjip-scrim.is-open { opacity: 1; }
.cjip-scrim[hidden] { display: none; }

.cjip-drawer {
	position: fixed; top: 0; right: 0; height: 100%;
	width: min(86vw, 380px); z-index: 51;
	background: var(--color-paper); box-shadow: -8px 0 24px rgba(22, 32, 46, .18);
	display: flex; flex-direction: column;
	transform: translateX(100%); transition: transform .25s ease-out;
}
.cjip-drawer.is-open { transform: translateX(0); }
.cjip-drawer[hidden] { display: none; }

.cjip-drawer__head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 20px; flex-shrink: 0;
}
.cjip-drawer__close {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
	color: var(--color-ink); border-radius: 6px; transition: color .2s ease;
}
.cjip-drawer__close:hover { color: var(--color-azure-deep); }

.cjip-drawer__body { flex: 1; overflow-y: auto; padding-top: 8px; }
.cjip-drawer__nav { list-style: none; margin: 0; padding: 0; }
.cjip-drawer__nav li { margin: 0; }
.cjip-drawer__nav a {
	position: relative; display: flex; align-items: center; height: 56px;
	padding-inline: 24px; text-decoration: none;
	font-family: var(--font-body); font-size: 18px; font-weight: 500;
	color: var(--color-ink);
	border-bottom: 1px solid color-mix(in srgb, var(--color-sky) 50%, transparent);
	transition: background .15s ease, color .15s ease;
}
.cjip-drawer__nav a:hover {
	background: color-mix(in srgb, var(--color-sky) 15%, transparent);
}
.cjip-drawer__nav .current-menu-item > a,
.cjip-drawer__nav .current_page_item > a {
	color: var(--color-azure-deep);
	background: color-mix(in srgb, var(--color-sky) 20%, transparent);
}
.cjip-drawer__nav .current-menu-item > a::before,
.cjip-drawer__nav .current_page_item > a::before {
	content: ""; position: absolute; left: 0; top: 0; bottom: 0;
	width: 3px; background: var(--color-gold);
}

.cjip-drawer__lang { padding: 32px 24px; }
.cjip-drawer__lang-title {
	margin: 0 0 16px; font-family: var(--font-body); font-size: 12px;
	font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: color-mix(in srgb, var(--color-ink) 60%, transparent);
}
.cjip-lang-grid {
	display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
	list-style: none; margin: 0; padding: 0;
}
.cjip-lang-grid li { margin: 0; }
.cjip-lang-grid a {
	display: flex; align-items: center; justify-content: center; height: 40px;
	border-radius: 6px; text-decoration: none; text-transform: uppercase;
	font-family: var(--font-body); font-size: 14px; font-weight: 600;
	color: var(--color-ink); background: var(--color-sky);
	transition: background .15s ease, color .15s ease;
}
.cjip-lang-grid .current-lang a,
.cjip-lang-grid .current-lang > a {
	background: var(--color-azure-deep); color: #fff;
}

.cjip-drawer__foot {
	padding: 24px; padding-bottom: 32px; flex-shrink: 0;
	border-top: 1px solid color-mix(in srgb, var(--color-sky) 50%, transparent);
}
.cjip-drawer__foot .cjip-cta-btn { display: flex; width: 100%; height: 52px; font-size: 16px; }

/* --- footer ------------------------------------------------------------- */
.cjip-footer { background: var(--color-ink); color: var(--color-sky); }
.cjip-footer a { color: var(--color-sky); text-decoration: none; transition: color .2s ease; }
.cjip-footer a:hover { color: #fff; }
.cjip-footer__dot { opacity: .5; margin-inline: 6px; }

/* rich */
.cjip-footer--rich { padding-block: 48px; }
.cjip-footer__grid {
	display: flex; justify-content: space-between; align-items: center; gap: 24px;
}
.cjip-footer__name { font-weight: 700; font-size: 18px; margin: 0 0 4px; font-family: var(--font-body); }
.cjip-footer__tagline {
	font-size: 14px; margin: 0 0 12px;
	color: color-mix(in srgb, var(--color-sky) 70%, transparent);
}
.cjip-footer__meta {
	font-size: 14px; margin: 0;
	color: color-mix(in srgb, var(--color-sky) 50%, transparent);
}
.cjip-footer__contact { font-size: 14px; margin: 12px 0 0; }
.cjip-footer__right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.cjip-footer__nav-list {
	display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 24px;
	list-style: none; margin: 0; padding: 0; font-size: 14px;
}
.cjip-footer__nav-list li { margin: 0; }
.cjip-footer__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; font-size: 14px; }

@media (max-width: 767px) {
	.cjip-footer__grid { flex-direction: column; text-align: center; }
	.cjip-footer__right { align-items: center; }
	.cjip-footer__nav-list { justify-content: center; }
	.cjip-footer__links { justify-content: center; }
}

/* simple */
.cjip-footer--simple { padding-block: 24px; }
.cjip-footer__simple {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	flex-wrap: wrap; font-size: 14px;
}
.cjip-footer__org { margin: 0; }

/* --- 404 ---------------------------------------------------------------- */
.cjip-404 { padding-block: 96px; text-align: center; }
.cjip-404__title { font-family: var(--font-display); color: var(--color-azure-deep); margin: 0 0 12px; }
.cjip-404__text { color: color-mix(in srgb, var(--color-ink) 70%, transparent); margin: 0 0 24px; }

/* --- reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.cjip-header, .cjip-nav a::after, .cjip-lang__chevron,
	.cjip-scrim, .cjip-drawer { transition: none; }
}
