/*
 * AcadNews brand layer. Reads the Customizer palette (see :root vars printed
 * inline) and styles header, footer, logo and spacing. Loads after everything.
 */

body.an-brand {
	--an-soft: color-mix(in srgb, var(--an-tint) 30%, #fff);
	--an-line: color-mix(in srgb, var(--an-mid) 38%, #fff);
	--an-muted: color-mix(in srgb, var(--an-text) 62%, #fff);
	--an-ink: var(--an-text);
	--an-topbar-bg: var(--an-deep);
	--an-head-bg: #fff;
	--an-head-ink: var(--an-text);
	--an-head-title: var(--an-deep);
	--an-foot-bg: var(--an-deep);
	--an-foot-bg-2: color-mix(in srgb, var(--an-deep) 78%, #000);
	--an-foot-ink: #fff;
	--an-foot-muted: color-mix(in srgb, var(--an-tint) 85%, var(--an-deep));
}
body.an-brand.acadnews_main_body { --theme-color-red: var(--an-primary); --an-accent: var(--an-primary); }
body.an-brand.acadnews_dark_mode {
	--an-ink: #e8eaed; --an-muted: #a0a8b3; --an-line: #2f3640; --an-soft: #1d222a;
}

body.an-topbar--primary { --an-topbar-bg: var(--an-primary); }
body.an-topbar--tint { --an-topbar-bg: var(--an-tint); }
body.an-header--tint { --an-head-bg: color-mix(in srgb, var(--an-tint) 35%, #fff); }
body.an-header--deep { --an-head-bg: var(--an-deep); --an-head-ink: #fff; --an-head-title: #fff; }
body.an-footer--tint { --an-foot-bg: var(--an-tint); --an-foot-bg-2: color-mix(in srgb, var(--an-tint) 80%, var(--an-deep)); --an-foot-ink: var(--an-text); --an-foot-muted: color-mix(in srgb, var(--an-text) 70%, #fff); }
body.an-footer--light { --an-foot-bg: #fff; --an-foot-bg-2: color-mix(in srgb, var(--an-tint) 30%, #fff); --an-foot-ink: var(--an-text); --an-foot-muted: color-mix(in srgb, var(--an-text) 65%, #fff); }

/* ---------- Page ---------- */
body.an-brand:not(.acadnews_dark_mode) { background-color: color-mix(in srgb, var(--an-tint) 16%, #fff); color: var(--an-text); }
.an-brand .entry-content a:not(.acadnews-btn) { color: var(--an-deep); text-decoration-color: color-mix(in srgb, var(--an-deep) 40%, transparent); text-underline-offset: 3px; }
.an-brand .entry-content a:not(.acadnews-btn):hover { color: var(--an-primary); }
.an-brand .acadnews-section { margin-top: calc(28px * var(--an-space)); margin-bottom: calc(28px * var(--an-space)); }
.an-brand .acadnews-box, .an-brand .acadnews-toc, .an-brand .acadnews-callout, .an-brand .acadnews-q__opts button { border-radius: var(--an-radius); }

/* ---------- Top bar ---------- */
.an-brand .top-header { background: var(--an-topbar-bg) !important; background-image: none !important; border: 0; }
.an-brand .top-header,
.an-brand .top-header a,
.an-brand .top-header .date,
.an-brand .top-header .time,
.an-brand .top-header i,
.an-brand .top-header .title-text { color: #fff; }
.an-brand.an-topbar--tint .top-header,
.an-brand.an-topbar--tint .top-header a,
.an-brand.an-topbar--tint .top-header .ticker-item a,
.an-brand.an-topbar--tint .top-header .date,
.an-brand.an-topbar--tint .top-header .time,
.an-brand.an-topbar--tint .top-header i { color: var(--an-deep) !important; }
.an-brand .top-header a:hover { opacity: .8; }
.an-brand .top-header .top-date-time-inner { background: rgba(255,255,255,.14) !important; color: #fff !important; border-radius: var(--an-radius); box-shadow: none; }
.an-brand .top-header .top-date-time-inner span, .an-brand .top-header .top-date-time-inner i { color: inherit !important; }
.an-brand.an-topbar--tint .top-header .top-date-time-inner { background: rgba(8,101,134,.1) !important; color: var(--an-deep) !important; }

/* ---------- Header ---------- */
.an-brand .site-header, .an-brand .site-header .main-header { background: var(--an-head-bg) !important; border-bottom: 1px solid color-mix(in srgb, var(--an-mid) 40%, transparent); box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 6px 18px -12px rgba(8,101,134,.25); }
.an-brand .site-header .site-branding-section, .an-brand .site-header .menu-section, .an-brand .site-header .main-header .row { background: transparent !important; }
.an-brand .site-branding-section { padding-top: calc(14px * var(--an-space)); padding-bottom: calc(14px * var(--an-space)); }
.an-brand .site-branding-section > .acadnews-container > .row { align-items: center; }

.an-brand .site-branding { display: flex; align-items: center; gap: 14px; text-align: left; }
.an-brand .site-branding .custom-logo-link { display: inline-flex; line-height: 0; flex: 0 0 auto; }
.an-brand .site-branding .custom-logo { height: var(--an-logo-h) !important; width: auto !important; max-width: none; object-fit: contain; }
.an-brand .site-branding__text { min-width: 0; }
.an-brand .site-header .site-branding { flex: 0 0 auto; flex-wrap: nowrap; width: auto; max-width: 70%; }
.an-brand .site-branding__text .site-title { white-space: nowrap; }
.an-brand .site-header .row > .header-smh-button-wrap { flex: 1 1 auto; justify-content: flex-end; }
.an-brand .site-title { margin: 0; line-height: 1.15; font-size: clamp(18px, 2.2vw, 26px); }
.an-brand .site-title a { color: var(--an-head-title); }
.an-brand .site-description { margin: 2px 0 0; font-size: 13px; color: color-mix(in srgb, var(--an-head-ink) 60%, transparent); }
.an-brand.an-title-hidden .site-title,
.an-brand.an-title-hidden .site-description { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.an-brand .site-header .main-navigation a { color: var(--an-head-ink) !important; font-weight: 600; letter-spacing: .01em; }
.an-brand .main-navigation ul li > a { box-shadow: inset 0 -2px 0 transparent; transition: box-shadow .15s, color .15s; }
.an-brand .site-header .main-navigation ul li:hover > a,
.an-brand .site-header .main-navigation ul li:focus-within > a { color: var(--an-primary) !important; box-shadow: inset 0 -2px 0 var(--an-primary); }
.an-brand .site-header .main-navigation ul li.current-menu-item > a,
.an-brand .site-header .main-navigation ul li.current_page_item > a,
.an-brand .site-header .main-navigation ul li.current-menu-ancestor > a { color: var(--an-primary) !important; box-shadow: inset 0 -2px 0 var(--an-primary); }
.an-brand .main-navigation ul ul { background: #fff; border-radius: 0 0 var(--an-radius) var(--an-radius); box-shadow: 0 14px 30px -12px rgba(8,101,134,.35); }
.an-brand .site-header .main-navigation ul ul a { color: var(--an-text) !important; box-shadow: none; }
.an-brand .site-header .search-trigger, .an-brand .site-header .search-trigger i, .an-brand .site-header .menu-toggle, .an-brand .site-header .menu-toggle .menu_txt,
.an-brand .site-header .header-smh-button-wrap i { color: var(--an-head-ink) !important; }
.an-brand #acadnews_menu_burger span, .an-brand .acadnews_sidetoggle_menu_burger span { background: var(--an-head-ink) !important; }

/* ---------- Footer ---------- */
.an-brand #colophon, .an-brand #colophon.dark_bk { background: var(--an-foot-bg); color: var(--an-foot-ink); border-top: 4px solid var(--an-primary); }
.an-brand #colophon a { color: var(--an-foot-ink); }
.an-brand #colophon a:hover { color: var(--an-primary); }
.an-brand #colophon i { color: var(--an-foot-muted); }

.an-footer-brand { padding: calc(44px * var(--an-space)) 0 calc(30px * var(--an-space)); }
.an-footer-brand__inner.row { display: flex; margin: 0; flex-wrap: wrap; align-items: center; gap: 20px 32px; }
.an-footer-brand__logo { display: inline-flex; line-height: 0; }
.an-footer-brand__logo img { height: calc(var(--an-logo-h) * 1.15); width: auto; max-width: 260px; object-fit: contain; }
.an-footer-brand__logo:not(.has-own-logo) img { border-radius: 50%; }
.an-footer-brand__logo span { font: 700 24px/1.2 inherit; }
.an-footer-brand__about { flex: 1 1 320px; max-width: 62ch; margin: 0; font-size: 15px; line-height: 1.7; color: var(--an-foot-muted); }

.an-brand #colophon .main-footer { padding: calc(30px * var(--an-space)) 0; border-top: 1px solid rgba(127,127,127,.22); background: transparent; }
.an-brand #colophon .widget-title, .an-brand #colophon .widgettitle, .an-brand #colophon h2.wp-block-heading { color: var(--an-foot-ink); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--an-primary); display: inline-block; }
.an-brand #colophon .widget, .an-brand #colophon .widget li, .an-brand #colophon .widget p { color: var(--an-foot-muted); }
.an-brand #colophon .widget a { color: var(--an-foot-ink); }
.an-brand #colophon .widget li { border-color: rgba(127,127,127,.2); }

.an-brand #colophon .bottom-footer { background: var(--an-foot-bg-2); border-top: 1px solid rgba(127,127,127,.22); padding: 16px 0; }
.an-brand #colophon .bottom-footer .site-info,
.an-brand #colophon .bottom-footer .site-info a { color: var(--an-foot-muted); font-size: 13px; }
.an-brand #colophon .bottom-footer .bottom-inner-wrapper { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.an-brand #colophon .bottom-menu a { color: var(--an-foot-muted); font-size: 13px; }

.an-brand #acadnews-scroll-to-top, .an-brand .scroll-to-top { background: var(--an-primary); border-radius: var(--an-radius); }

@media (max-width: 768px) {
	.an-footer-brand__inner.row { justify-content: center; text-align: center; }
	.an-brand .site-branding .custom-logo { height: min(var(--an-logo-h), 48px) !important; }
	.an-footer-brand__logo img { height: min(calc(var(--an-logo-h) * 1.15), 64px); }
}

/* Footer brand block uses the same container width as the bottom bar. */
.an-footer-brand.width-full-width--layout > .acadnews-container { max-width: none; width: calc(100% - 60px); }
