/* ===== Auvi Notices: OPPA skin =====
   The plugin is themed only from here (its --an-* custom properties plus a few
   targeted rules); plugin files stay untouched. When the plugin is inactive
   nothing in this file matches, so it is safe to load unconditionally.

   Popup: blush card, moss headline, white-on-pink primary button (client
   palette decision: every CTA is white on pink), moss outline for the
   secondary button. Banner: moss strip with white text, pink CTA pill. */

.an-notice {
	--an-bg: var(--surface);
	--an-text: var(--muted);
	--an-accent: var(--cta-bg);
	--an-accent-text: var(--cta-fg);
	--an-radius: var(--radius-sm);
	--an-font: var(--font-body);
	--an-overlay: rgba(34, 48, 26, 0.5); /* same scrim as the TableNow category sheet */
	/* Above the fixed header (50), the floating CTAs (40) and every TableNow
	   sheet or toast (<= 1200). */
	--an-z: 9999;
	--an-banner-bg: var(--brand);
	--an-banner-text: var(--surface-2);
}

/* --- Buttons: same pill shape and weight as the theme's .btn --- */

.an-notice .an-btn {
	min-height: 46px;
	padding: 0 24px;
	border-radius: 999px;
	font-size: 16px;
	font-weight: 500;
	transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s;
}

.an-notice .an-btn--primary {
	background: var(--cta-bg);
	border-color: var(--cta-bg);
	color: var(--cta-fg);
}

.an-notice .an-btn--primary:hover {
	background: var(--cta-bg-hover);
	border-color: var(--cta-bg-hover);
}

.an-notice .an-btn--primary:active {
	background: var(--cta-bg-active);
	border-color: var(--cta-bg-active);
}

/* Secondary stays readable on the blush card: pink text on blush would fail
   contrast, so the outline button is moss. */
.an-notice--popup .an-btn--secondary {
	border-color: var(--brand);
	color: var(--brand);
}

.an-notice--popup .an-btn--secondary:hover {
	background: var(--accent-tint);
}

/* The plugin's x glyph is small in Montserrat; keep it easy to see. */
.an-notice .an-close {
	font-size: 28px;
}

.an-notice .an-btn:focus-visible,
.an-notice .an-close:focus-visible {
	outline: 3px solid var(--ink);
	outline-offset: 3px;
}

/* --- Popup --- */

.an-notice--popup .an-popup {
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-card);
}

.an-popup__title {
	color: var(--heading);
	font-family: var(--font-display);
	font-size: 24px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	text-wrap: balance;
}

.an-popup__icon .an-icon {
	color: var(--accent);
}

.an-notice--popup .an-close {
	color: var(--brand);
}

/* --- Banner: moss strip, white text, pink CTA --- */

.an-notice--banner .an-banner {
	/* The banner sits at the very top of the viewport, so it clears the
	   notch itself (the header's own safe-area margin is dropped below). */
	padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px 16px;
	font-size: 15px;
}

.an-notice--banner .an-btn--primary,
.an-notice--banner .an-btn--secondary {
	min-height: 36px;
	padding: 0 18px;
	font-size: 14px;
	background: var(--cta-bg);
	border-color: var(--cta-bg);
	color: var(--cta-fg);
}

.an-notice--banner .an-btn--primary:hover,
.an-notice--banner .an-btn--secondary:hover {
	background: var(--cta-bg-hover);
	border-color: var(--cta-bg-hover);
}

.an-banner__icon .an-icon,
.an-notice--banner .an-close {
	color: var(--accent-soft);
}

.an-notice--banner .an-close {
	font-size: 24px;
}

/* The banner outline must contrast with moss, not with the blush page. */
.an-notice--banner .an-btn:focus-visible,
.an-notice--banner .an-close:focus-visible {
	outline-color: var(--surface-2);
}

/* --- Fixed banner together with the fixed header ---
   The plugin default keeps the banner in document flow, but .site-header is
   position: fixed, so an in-flow banner would scroll away and leave a gap
   above the header. The banner is therefore pinned to the viewport top, the
   header floats below it with its usual gap, and body padding replaces the
   flow space the banner no longer takes. notices.js sets --an-banner-height
   on <html> while a banner shows and removes it on dismissal. Every rule
   below sits under html.an-banner-visible, so the other stylesheets stay
   untouched. (.an-notice.an-notice--banner outranks the plugin's own
   .an-notice--banner rule regardless of stylesheet order.) */

.an-notice.an-notice--banner {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: var(--an-z);
}

html.an-banner-visible body {
	padding-top: var(--an-banner-height, 0px);
}

html.an-banner-visible .site-header {
	top: calc(var(--an-banner-height, 0px) + 32px);
	margin-top: 0;
}

/* Anchor jumps clear header and banner together. */
html.an-banner-visible {
	scroll-padding-top: calc(130px + var(--an-banner-height, 0px));
}

/* Sticky menu bars (static /speisekarte/ chips, TableNow search + tabs) sit
   12px below the header: header bottom moves down by the banner height. */
html.an-banner-visible .menu-chips {
	top: calc(130px + var(--an-banner-height, 0px));
}

html.an-banner-visible .menu-cat {
	scroll-margin-top: calc(210px + var(--an-banner-height, 0px));
}

html.an-banner-visible .tablenow-app {
	--oppa-sticky-top: calc(130px + var(--an-banner-height, 0px));
}

/* TableNow order sidebar (desktop). */
html.an-banner-visible .tablenow-app .tablenow-order {
	top: calc(140px + var(--an-banner-height, 0px));
	max-height: calc(100vh - 164px - var(--an-banner-height, 0px));
}

/* Phones use the smaller header (16px gap, 70px bar), see sections.css and
   pages.css. */
@media (max-width: 767px) {
	html.an-banner-visible .site-header {
		top: calc(var(--an-banner-height, 0px) + 16px);
	}

	html.an-banner-visible .menu-chips {
		top: calc(96px + var(--an-banner-height, 0px));
	}

	html.an-banner-visible .menu-cat {
		scroll-margin-top: calc(170px + var(--an-banner-height, 0px));
	}

	html.an-banner-visible .tablenow-app {
		--oppa-sticky-top: calc(96px + var(--an-banner-height, 0px));
	}
}
