/*
 * Admiralty Chart: the shell of the content pages = top bar (partial/menu.phtml) and footer (partial/footer.phtml).
 * Needs the tokens of css/admiralty.css. Self-contained on purpose (the overview pages and the chart can load it too): it does not
 * depend on Bootstrap or on css/admiralty-base.css. Behavior: js/shell.js.
 */

.ac-wrap {
	width: min(1376px, calc(100% - 32px));
	margin-inline: auto;
}
@media (min-width: 900px) {
	.ac-wrap { width: min(1376px, calc(100% - 64px)); }
}

.ac-sr-only {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- top bar ---------- */
.ac-bar {
	position: relative;
	z-index: 100;
	background: var(--ac-water);
	border-bottom: 1px solid var(--ac-line);
	color: var(--ac-ink);
	font-family: var(--ac-font);
	font-size: 15px;
	line-height: 24px;
}
.ac-bar__in {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 56px;
}
.ac-bar .ac-logo {
	display: block;
	text-decoration: none;
	flex: none;
	line-height: 0;
}
.ac-logo img {
	display: block;
	width: 197px;
	height: 36px;
	max-width: none;
}
:root[data-theme="dark"] .ac-logo img { filter: brightness(0) invert(.93); } /* the logo file is ink on transparent: in the night chart it is drawn in the light ink */

.ac-bar .ac-skip {
	position: absolute;
	left: 8px;
	top: -64px;
	z-index: 200;
	padding: 8px 16px;
	background: var(--ac-ink);
	color: var(--ac-on-ink);
	border-radius: var(--ac-radius);
	font-weight: 600;
}
.ac-bar .ac-skip:focus { top: 8px; color: var(--ac-on-ink); }

/* navigation */
.ac-nav { flex: 1 1 auto; margin-left: 24px; }
.ac-nav__list {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ac-item { position: relative; margin: 0; padding: 0; }
.ac-bar .ac-item > a,
.ac-bar .ac-item__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 12px;
	border: 0;
	border-radius: var(--ac-radius);
	background: none;
	color: var(--ac-ink);
	font: 600 15px/24px var(--ac-font);
	text-decoration: none;
	cursor: pointer;
}
.ac-bar .ac-item > a:hover,
.ac-bar .ac-item__btn:hover,
.ac-bar .ac-item.is-open > .ac-item__btn { background: var(--ac-shallow-soft); color: var(--ac-ink); }
.ac-caret { transition: transform .15s ease-out; }
.ac-item.is-open > .ac-item__btn .ac-caret { transform: rotate(180deg); }

.ac-menu {
	display: none;
	position: absolute;
	left: 0;
	top: calc(100% + 4px);
	z-index: 110;
	min-width: 240px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: var(--ac-panel);
	border: 1px solid var(--ac-line);
	border-radius: var(--ac-radius);
	box-shadow: var(--ac-shadow);
}
.ac-item.is-open > .ac-menu { display: block; }
.ac-menu--wide {
	display: none;
	grid-template-columns: repeat(2, minmax(150px, 1fr));
	gap: 8px 24px;
	min-width: 360px;
}
.ac-item.is-open > .ac-menu--wide { display: grid; }
.ac-bar .ac-menu a {
	display: flex;
	align-items: center;
	min-height: 36px;
	padding: 0 12px;
	border-radius: var(--ac-radius);
	color: var(--ac-ink);
	font-weight: 400;
	text-decoration: none;
	white-space: nowrap;
}
.ac-bar .ac-menu a:hover { background: var(--ac-shallow-soft); color: var(--ac-ink); }
.ac-menu ul { margin: 0; padding: 0; list-style: none; }
.ac-menu__group { margin: 0; padding: 0; }
.ac-menu__title {
	display: block;
	padding: 4px 12px;
	border-bottom: 1px solid var(--ac-line-soft);
	color: var(--ac-ink-muted);
	font-size: 13px;
	font-weight: 600;
	line-height: 20px;
}

/* no JavaScript: the dropdowns open by focus or hover */
html:not(.js) .ac-item--menu:hover > .ac-menu,
html:not(.js) .ac-item--menu:focus-within > .ac-menu { display: block; }
html:not(.js) .ac-item--menu:hover > .ac-menu--wide,
html:not(.js) .ac-item--menu:focus-within > .ac-menu--wide { display: grid; }

/* right side of the bar */
.ac-bar__tools { display: flex; align-items: center; gap: 16px; flex: none; margin-left: auto; }
.ac-theme {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--ac-line);
	border-radius: var(--ac-radius);
	background: var(--ac-panel);
	color: var(--ac-ink);
	cursor: pointer;
}
.ac-theme:hover { background: var(--ac-shallow-soft); }
.ac-theme__sun { display: none; }
:root[data-theme="dark"] .ac-theme__moon { display: none; }
:root[data-theme="dark"] .ac-theme__sun { display: block; }

/* solid ink button */
.ac-btn,
.ac-body a.ac-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 24px;
	border: 1px solid var(--ac-ink);
	border-radius: var(--ac-radius);
	background: var(--ac-ink);
	color: var(--ac-on-ink);
	font: 700 15px/24px var(--ac-font);
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}
.ac-btn:hover,
.ac-body a.ac-btn:hover { background: var(--ac-ink-soft); border-color: var(--ac-ink-soft); color: var(--ac-on-ink); text-decoration: none; }

.ac-menubtn {
	display: none;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid var(--ac-line);
	border-radius: var(--ac-radius);
	background: var(--ac-panel);
	color: var(--ac-ink);
	font: 600 15px/24px var(--ac-font);
	cursor: pointer;
}
.ac-item--panel { display: none; }

/* focus: 2px magenta ring with 2px offset (the one annotation color), on every control of the bar */
.ac-bar :focus-visible,
.ac-footer :focus-visible {
	outline: 2px solid var(--ac-magenta);
	outline-offset: 2px;
}

/* narrow screens: the navigation is a panel below the bar, opened by the Menu button */
@media (max-width: 799px) {
	.ac-bar__in { flex-wrap: wrap; gap: 8px 12px; padding-block: 8px; }
	.ac-bar__tools { margin-left: auto; gap: 8px; }
	.ac-bar a.ac-btn--bar { display: none; }
	.ac-item--panel { display: block; padding: 8px 12px 4px; }
	.ac-item--panel .ac-btn { width: 100%; }
	.js .ac-menubtn { display: inline-flex; }
	.ac-nav { flex: 1 0 100%; order: 5; margin-left: 0; }
	.js .ac-nav { display: none; }
	.js .ac-bar.is-open .ac-nav { display: block; }
	.ac-nav__list { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 8px; }
	.ac-bar .ac-item > a,
	.ac-bar .ac-item__btn { width: 100%; justify-content: space-between; min-height: 44px; }
	.ac-menu,
	.ac-menu--wide {
		position: static;
		display: none;
		min-width: 0;
		margin: 0 0 8px 12px;
		box-shadow: none;
	}
	.ac-item.is-open > .ac-menu { display: block; }
	.ac-item.is-open > .ac-menu--wide { display: block; }
	.ac-menu--wide .ac-menu__group + .ac-menu__group { margin-top: 8px; }
	.ac-bar .ac-menu a { min-height: 44px; }
}
@media (pointer: coarse) {
	.ac-theme { width: 44px; height: 44px; }
	.ac-btn, .ac-menubtn { min-height: 44px; }
}

/* ---------- footer ---------- */
.ac-footer {
	margin-top: 64px;
	padding: 32px 0 24px;
	background: var(--ac-shallow-soft);
	border-top: 1px solid var(--ac-line);
	color: var(--ac-ink);
	font-family: var(--ac-font);
	font-size: 15px;
	line-height: 24px;
}
.ac-footer__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr)); /* four columns spread over the whole width of the page column */
	gap: 24px 32px;
}
.ac-footer__col ul { margin: 0; padding: 0; list-style: none; }
.ac-footer__title {
	margin: 0 0 8px;
	padding-bottom: 4px;
	border-bottom: 1px solid var(--ac-ink);
	color: var(--ac-ink-soft);
	font-size: 13px;
	font-weight: 600;
	line-height: 20px;
}
.ac-footer .ac-footer__col a {
	display: inline-block;
	padding: 4px 0;
	min-height: 32px;
	color: var(--ac-ink);
	text-decoration: underline;
	text-decoration-color: var(--ac-line);
	text-underline-offset: 3px;
}
.ac-footer .ac-footer__col a:hover { text-decoration-color: var(--ac-ink); color: var(--ac-ink); }
.ac-footer__line {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--ac-line-soft);
	color: var(--ac-ink-soft);
	font-size: 14px;
}
.ac-footer__line b { font-weight: 600; }
@media (max-width: 899px) {
	.ac-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
	.ac-footer__grid { grid-template-columns: minmax(0, 1fr); }
	.ac-footer .ac-footer__col a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (pointer: coarse) {
	.ac-footer .ac-footer__col a { min-height: 44px; display: inline-flex; align-items: center; }
}

@media print {
	.ac-bar, .ac-footer { display: none; }
}
