/**
 * Plastilam Archive Notice — Frontend Banner Styles
 *
 * The banner uses position: fixed so it is always visible at the top of
 * the viewport. A CSS custom property (--plastilam-banner-height) is set
 * dynamically by the accompanying inline JavaScript and used to push the
 * page body down so no content is hidden behind the banner.
 *
 * The .admin-bar body class (added by WordPress when the toolbar is
 * active) is detected via CSS selectors so the banner is offset below
 * the 32 px toolbar on desktop (782 px+) and the 46 px toolbar on
 * mobile (< 782 px), without any PHP conditional checks.
 *
 * @package PlastilamArchiveNotice
 * @since   1.0.0
 */

/* ─── Custom property fallback ─────────────────────────────────────── */
:root {
	--plastilam-banner-height: 52px;
}

/* ─── Banner wrapper ────────────────────────────────────────────────── */
.plastilam-archive-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100000; /* Above WP admin bar (99999) */
	background-color: #b71c1c;
	color: #ffffff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
	box-sizing: border-box;
}

/* ─── Admin bar offset — desktop (toolbar height: 32px) ─────────────── */
body.admin-bar .plastilam-archive-banner {
	top: 32px;
}

/* ─── Admin bar offset — mobile (toolbar height: 46px) ─────────────── */
@media screen and (max-width: 782px) {
	body.admin-bar .plastilam-archive-banner {
		top: 46px;
	}
}

/* ─── Inner layout ─────────────────────────────────────────────────── */
.plastilam-archive-banner .plastilam-banner-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 12px 20px;
	max-width: 1200px;
	margin: 0 auto;
	flex-wrap: wrap;
	text-align: center;
}

/* ─── Warning icon ─────────────────────────────────────────────────── */
.plastilam-archive-banner .plastilam-banner-icon {
	font-size: 18px;
	flex-shrink: 0;
	line-height: 1;
}

/* ─── Banner text ──────────────────────────────────────────────────── */
.plastilam-archive-banner .plastilam-banner-text {
	font-size: 14px;
	color: #ffffff;
}

/* ─── Link inside banner ───────────────────────────────────────────── */
.plastilam-archive-banner .plastilam-banner-text a,
.plastilam-archive-banner .plastilam-banner-text a:visited {
	color: #ffffff;
	font-weight: 700;
	text-decoration: underline;
}

.plastilam-archive-banner .plastilam-banner-text a:hover,
.plastilam-archive-banner .plastilam-banner-text a:focus {
	text-decoration: none;
	outline: 2px solid rgba(255, 255, 255, 0.7);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ─── Body padding — pushes page content below the fixed banner ────── */
body {
	padding-top: var(--plastilam-banner-height) !important;
}

/* When the admin bar is also present, stack both offsets */
body.admin-bar {
	padding-top: calc(32px + var(--plastilam-banner-height)) !important;
}

@media screen and (max-width: 782px) {
	body.admin-bar {
		padding-top: calc(46px + var(--plastilam-banner-height)) !important;
	}

	.plastilam-archive-banner .plastilam-banner-inner {
		padding: 10px 14px;
		gap: 8px;
	}

	.plastilam-archive-banner .plastilam-banner-text {
		font-size: 13px;
	}

	.plastilam-archive-banner .plastilam-banner-icon {
		font-size: 16px;
	}
}
