/* =========================================================
   Ivím 2026 — component CSS for theme behaviors that need a
   little more than theme.json. Loaded site-wide via functions.php.
   ========================================================= */

/* ── Announcement bar (sticky top) ───────────────────────── */

.ivim-announcement-bar {
	position: sticky;
	top: 0;
	z-index: 90;
}
.ivim-announcement-bar[hidden] { display: none !important; }
.ivim-announcement-bar a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.ivim-announcement-dismiss {
	background: transparent;
	border: 0;
	color: inherit;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 0 6px;
	opacity: 0.7;
}
.ivim-announcement-dismiss:hover { opacity: 1; }

/* ── ISI drawer (sticky bottom on drug pages) ────────────── */

.ivim-isi-drawer {
	position: sticky;
	bottom: 0;
	z-index: 80;
	transition: max-height var(--wp--custom--motion--duration-base, 240ms)
	            var(--wp--custom--motion--ease-standard, cubic-bezier(0.2, 0.7, 0.2, 1));
	max-height: 84px;
	overflow: hidden;
}
.ivim-isi-drawer[data-isi-drawer="expanded"] {
	max-height: 60vh;
	overflow: auto;
}
.ivim-isi-body[hidden] { display: none; }

/* When the ISI drawer is on the page, push body bottom padding so the
   final content section isn't visually hidden behind the collapsed bar. */
body:has(.ivim-isi-drawer) main { padding-bottom: 100px; }

/* ── FAQ accordion polish (uses native <details>) ─────────── */

.ivim-faq .wp-block-details,
.wp-block-details.ivim-faq-item {
	border-bottom: 1px solid var(--wp--preset--color--gray-200);
	padding-top: var(--wp--preset--spacing--3-xl);
	padding-bottom: var(--wp--preset--spacing--3-xl);
}
.ivim-faq .wp-block-details summary,
.wp-block-details.ivim-faq-item summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--poppins);
	font-size: 18px;
	font-weight: 600;
	list-style: none;
	padding-right: 32px;
	position: relative;
	user-select: none;
}
.ivim-faq .wp-block-details summary::-webkit-details-marker,
.wp-block-details.ivim-faq-item summary::-webkit-details-marker { display: none; }
.ivim-faq .wp-block-details summary::after,
.wp-block-details.ivim-faq-item summary::after {
	content: "+";
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	font-size: 24px;
	font-weight: 400;
	color: var(--wp--preset--color--ivim-green-600);
	transition: transform var(--wp--custom--motion--duration-fast, 140ms);
}
.ivim-faq .wp-block-details[open] summary::after,
.wp-block-details.ivim-faq-item[open] summary::after { content: "–"; }
.ivim-faq .wp-block-details > :not(summary),
.wp-block-details.ivim-faq-item > :not(summary) {
	margin-top: var(--wp--preset--spacing--2-xl);
}

/* ── Hero image sizing (constrain so it doesn't dominate) ── */

.wp-block-column .wp-block-image img {
	max-height: 560px;
	object-fit: cover;
	width: 100%;
}

/* ── Mobile tweaks ────────────────────────────────────────── */

@media (max-width: 768px) {
	.ivim-announcement-bar p { font-size: 13px; line-height: 1.4; }
	.ivim-isi-drawer { max-height: 64px; padding-top: 12px; padding-bottom: 12px; }
	.ivim-isi-drawer[data-isi-drawer="expanded"] { max-height: 75vh; }
	.wp-block-column .wp-block-image img { max-height: 320px; }
}
