/*
 * Component and WordPress-specific styles that sit on top of the compiled
 * utility stylesheet (theme.css). Colors reference the same design tokens.
 */

/* --------------------------------------------------------- Sticky header */
.ga-header.is-scrolled {
	background-color: color-mix(in oklab, var(--background) 95%, transparent);
	box-shadow: 0 1px 0 var(--line);
	backdrop-filter: blur(8px);
}

/* Sliding underline on the primary navigation (matches the design). */
.ga-nav-link {
	position: relative;
}

.ga-nav-link::after {
	content: "";
	position: absolute;
	inset-inline: 0.75rem;
	bottom: -0.125rem;
	height: 2px;
	border-radius: 9999px;
	background-color: var(--primary);
	opacity: 0;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

[dir="rtl"] .ga-nav-link::after {
	transform-origin: right;
}

.ga-nav-link:hover::after,
.ga-nav-link.is-active::after {
	opacity: 1;
	transform: scaleX(1);
}

.ga-nav-link:hover,
.ga-nav-link.is-active {
	color: var(--primary);
}

/* ------------------------------------------------------ Certificate modal */
html.ga-modal-open {
	overflow: hidden;
}

.ga-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.ga-modal[hidden] {
	display: none;
}

.ga-modal-backdrop {
	position: absolute;
	inset: 0;
	background-color: oklch(0.2 0.02 150 / 55%);
	backdrop-filter: blur(2px);
}

.ga-modal-panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 56rem;
	max-height: 92vh;
	overflow-y: auto;
	border-radius: var(--radius);
	background-color: var(--card);
	box-shadow: var(--shadow-lift);
}

.ga-modal-close {
	position: absolute;
	inset-inline-end: 0.75rem;
	top: 0.75rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: calc(var(--radius) - 3px);
	background-color: color-mix(in oklab, var(--background) 90%, transparent);
	color: var(--forest);
}

.ga-modal-close:hover {
	background-color: var(--secondary);
}

/* -------------------------------------------- WordPress editor content */
.ga-entry > * + * {
	margin-top: 1.25rem;
}

.ga-entry h2,
.ga-entry h3,
.ga-entry h4 {
	font-family: var(--font-display);
	color: var(--forest);
	margin-top: 2.25rem;
}

.ga-entry h2 {
	font-size: 1.75rem;
	font-weight: 600;
}

.ga-entry h3 {
	font-size: 1.375rem;
	font-weight: 600;
}

.ga-entry p,
.ga-entry li {
	line-height: 1.75;
	color: var(--muted-foreground);
}

.ga-entry a {
	color: var(--primary);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.ga-entry ul,
.ga-entry ol {
	padding-inline-start: 1.25rem;
}

.ga-entry ul {
	list-style: disc;
}

.ga-entry ol {
	list-style: decimal;
}

.ga-entry blockquote {
	border-inline-start: 3px solid var(--leaf);
	padding-inline-start: 1.25rem;
	font-style: italic;
}

.ga-entry img,
.ga-entry iframe {
	border-radius: var(--radius);
	max-width: 100%;
	height: auto;
}

.ga-entry table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.ga-entry th,
.ga-entry td {
	border: 1px solid var(--line);
	padding: 0.75rem 1rem;
	text-align: start;
}

/* WordPress core alignment + caption classes. */
.alignleft {
	float: left;
	margin: 0 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0 0 1rem 1.5rem;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.wp-caption-text,
.ga-entry figcaption {
	font-size: 0.8125rem;
	color: var(--muted-foreground);
	margin-top: 0.5rem;
}

/* Accessibility helper required by WordPress themes. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed;
	inset-inline-start: 1rem;
	top: 1rem;
	z-index: 200;
	padding: 0.75rem 1rem;
	border-radius: calc(var(--radius) - 3px);
	background-color: var(--card);
	box-shadow: var(--shadow-lift);
	clip: auto;
	width: auto;
	height: auto;
}

/* Admin bar offset for the sticky header. */
body.admin-bar .ga-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .ga-header {
		top: 46px;
	}
}
