/**
 * AbleGhana base styles: typography, links, buttons, layout helpers, forms.
 * Loaded after Hello Elementor's reset, so these rules win.
 */

/* ---------- Document ---------- */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--ag-header-h) + 16px);
}

body {
	margin: 0;
	background-color: var(--ag-ivory);
	color: var(--ag-charcoal);
	font-family: var(--ag-font-body);
	font-size: var(--ag-body);
	font-weight: 400;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--ag-brass);
	color: var(--ag-charcoal);
}

img,
svg,
video {
	max-width: 100%;
}

img,
video {
	height: auto;
}

hr {
	height: 0;
	margin: var(--ag-gap) 0;
	border: 0;
	border-top: 1px solid var(--ag-sand);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em;
	color: inherit;
	font-family: var(--ag-font-display);
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: 1.1;
	text-wrap: balance;
}

h1 {
	font-size: var(--ag-h1);
	line-height: 1.05;
}

h2 {
	font-size: var(--ag-h2);
}

h3 {
	font-size: var(--ag-h3);
	line-height: 1.15;
}

h4 {
	font-size: var(--ag-h4);
	line-height: 1.2;
}

h5,
h6 {
	font-family: var(--ag-font-body);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.4;
}

h1 em,
h2 em,
h3 em,
.ag-accent {
	font-style: italic;
	font-weight: 500;
}

p {
	margin: 0 0 1.25em;
}

p:last-child {
	margin-bottom: 0;
}

small {
	font-size: var(--ag-small);
}

blockquote {
	margin: 0 0 1.25em;
	padding: 0 0 0 1.5em;
	border-left: 1px solid var(--ag-brass);
	font-family: var(--ag-font-display);
	font-size: 1.5rem;
	line-height: 1.35;
}

.ag-eyebrow {
	display: block;
	margin: 0 0 1.25rem;
	color: var(--ag-brass-text);
	font-family: var(--ag-font-body);
	font-size: var(--ag-eyebrow);
	font-weight: 600;
	letter-spacing: 0.18em;
	line-height: 1.5;
	text-transform: uppercase;
}

.ag-lead {
	font-size: clamp(1.125rem, 0.5vw + 1rem, 1.3125rem);
	line-height: 1.6;
}

.ag-muted {
	color: var(--ag-graphite);
}

.ag-nowrap {
	white-space: nowrap;
}

/* ---------- Links ---------- */
a {
	color: var(--ag-brass-text);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--ag-speed) var(--ag-ease);
}

a:hover,
a:active {
	color: var(--ag-charcoal);
}

:focus-visible {
	outline: 2px solid var(--ag-brass-text);
	outline-offset: 3px;
}

/* Signature text link with a re-drawing underline. */
.ag-link {
	display: inline-flex;
	align-items: center;
	gap: 0.75em;
	padding-bottom: 6px;
	background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
	color: var(--ag-charcoal);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.3;
	text-decoration: none;
	text-transform: uppercase;
}

.ag-link .ag-icon {
	flex: none;
	transition: transform var(--ag-speed) var(--ag-ease);
}

.ag-link:hover {
	color: var(--ag-charcoal);
	animation: ag-underline 0.6s var(--ag-ease);
}

.ag-link:hover .ag-icon {
	transform: translateX(4px);
}

@keyframes ag-underline {
	0% {
		background-position: 100% 100%;
		background-size: 100% 1px;
	}

	49% {
		background-position: 100% 100%;
		background-size: 0 1px;
	}

	50% {
		background-position: 0 100%;
		background-size: 0 1px;
	}

	100% {
		background-position: 0 100%;
		background-size: 100% 1px;
	}
}

/* ---------- Buttons ---------- */
/* Neutralise Hello's pink default buttons. */
button,
[type="button"],
[type="submit"],
[type="reset"] {
	border-color: var(--ag-charcoal);
	border-radius: var(--ag-radius);
	color: var(--ag-charcoal);
	font-family: inherit;
}

button:hover,
button:focus,
[type="button"]:hover,
[type="button"]:focus,
[type="submit"]:hover,
[type="submit"]:focus,
[type="reset"]:hover,
[type="reset"]:focus {
	background-color: var(--ag-charcoal);
	color: var(--ag-ivory);
}

.ag-btn,
a.ag-btn,
button.ag-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.75em;
	padding: 16px 32px;
	border: 1px solid transparent;
	border-radius: var(--ag-radius);
	cursor: pointer;
	font-family: var(--ag-font-body);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	white-space: normal;
	transition: background-color var(--ag-speed) var(--ag-ease), border-color var(--ag-speed) var(--ag-ease), color var(--ag-speed) var(--ag-ease);
}

.ag-btn .ag-icon {
	flex: none;
}

.ag-btn--primary,
a.ag-btn--primary,
button.ag-btn--primary {
	border-color: var(--ag-brass);
	background-color: var(--ag-brass);
	color: var(--ag-charcoal);
}

.ag-btn--primary:hover,
.ag-btn--primary:focus,
a.ag-btn--primary:hover,
button.ag-btn--primary:hover,
button.ag-btn--primary:focus {
	border-color: var(--ag-brass-hover);
	background-color: var(--ag-brass-hover);
	color: var(--ag-charcoal);
}

.ag-btn--secondary,
a.ag-btn--secondary,
button.ag-btn--secondary {
	border-color: var(--ag-charcoal);
	background-color: transparent;
	color: var(--ag-charcoal);
}

.ag-btn--secondary:hover,
.ag-btn--secondary:focus,
a.ag-btn--secondary:hover,
button.ag-btn--secondary:hover,
button.ag-btn--secondary:focus {
	background-color: var(--ag-charcoal);
	color: var(--ag-ivory);
}

.ag-btn--light,
a.ag-btn--light,
button.ag-btn--light {
	border-color: var(--ag-ivory);
	background-color: transparent;
	color: var(--ag-ivory);
}

.ag-btn--light:hover,
.ag-btn--light:focus,
a.ag-btn--light:hover,
button.ag-btn--light:hover,
button.ag-btn--light:focus {
	background-color: var(--ag-ivory);
	color: var(--ag-charcoal);
}

.ag-btn--sm,
a.ag-btn--sm {
	padding: 12px 22px;
	font-size: 0.75rem;
}

.ag-btn--block {
	display: flex;
	width: 100%;
}

/* Elementor's own Button widget, on-brand by default (widget style settings still override this). */
.ag-theme .elementor-button {
	padding: 16px 32px;
	border-radius: var(--ag-radius);
	background-color: var(--ag-brass);
	color: var(--ag-charcoal);
	fill: var(--ag-charcoal);
	font-family: var(--ag-font-body);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.3;
	text-transform: uppercase;
}

.ag-theme .elementor-button:hover,
.ag-theme .elementor-button:focus {
	background-color: var(--ag-brass-hover);
	color: var(--ag-charcoal);
}

/* ---------- Layout ---------- */
.ag-container {
	width: 100%;
	max-width: calc(var(--ag-container) + (2 * var(--ag-gutter)));
	margin-inline: auto;
	padding-inline: var(--ag-gutter);
}

.ag-section {
	padding-block: var(--ag-section-y);
}

.ag-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--ag-gap);
}

.ag-bg-ivory {
	background-color: var(--ag-ivory);
	color: var(--ag-charcoal);
}

.ag-bg-stone {
	background-color: var(--ag-stone);
	color: var(--ag-charcoal);
}

/* Dark sections: ivory headings, mist body copy, brass accents. */
.ag-bg-charcoal,
.ag-dark {
	background-color: var(--ag-charcoal);
	color: var(--ag-ivory);
}

.ag-dark .ag-eyebrow,
.ag-bg-charcoal .ag-eyebrow {
	color: var(--ag-brass);
}

.ag-dark .ag-muted,
.ag-bg-charcoal .ag-muted {
	color: var(--ag-mist);
}

.ag-dark a:not(.ag-btn),
.ag-bg-charcoal a:not(.ag-btn) {
	color: var(--ag-ivory);
}

.ag-dark a:not(.ag-btn):hover,
.ag-bg-charcoal a:not(.ag-btn):hover {
	color: var(--ag-brass);
}

.ag-dark :focus-visible,
.ag-bg-charcoal :focus-visible {
	outline-color: var(--ag-brass);
}

/* ---------- Media ---------- */
.ag-media {
	position: relative;
	display: block;
	overflow: hidden;
	background-color: var(--ag-stone);
}

.ag-media img,
.ag-media video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ag-ratio-portrait {
	aspect-ratio: 4 / 5;
}

.ag-ratio-landscape {
	aspect-ratio: 3 / 2;
}

.ag-ratio-hero {
	aspect-ratio: 16 / 9;
}

/* Subtle zoom for images inside linked cards. */
.ag-zoom img {
	transition: transform 0.9s var(--ag-ease);
}

a:hover .ag-zoom img,
.ag-zoom:hover img {
	transform: scale(1.03);
}

/* Placeholder shown where an image has not been chosen yet. */
.ag-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 160px;
	padding: 1rem;
	background:
		linear-gradient(135deg, rgba(203, 187, 160, 0.35) 0%, rgba(203, 187, 160, 0) 60%),
		var(--ag-stone);
	color: var(--ag-graphite);
	font-size: var(--ag-eyebrow);
	font-weight: 600;
	letter-spacing: 0.18em;
	text-align: center;
	text-transform: uppercase;
}

.ag-dark .ag-placeholder,
.ag-placeholder--dark {
	background:
		linear-gradient(135deg, rgba(176, 141, 87, 0.22) 0%, rgba(176, 141, 87, 0) 60%),
		#2a2926;
	color: var(--ag-mist);
}

/* ---------- Icons ---------- */
.ag-icon {
	display: inline-block;
	flex: none;
	vertical-align: middle;
}

/* ---------- Forms ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="password"],
input[type="date"],
select,
textarea {
	width: 100%;
	padding: 0.85rem 1rem;
	border: 1px solid var(--ag-sand);
	border-radius: var(--ag-radius);
	background-color: var(--ag-white);
	color: var(--ag-charcoal);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
	transition: border-color var(--ag-speed) var(--ag-ease), box-shadow var(--ag-speed) var(--ag-ease);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
	border-color: var(--ag-charcoal);
	outline: 2px solid var(--ag-brass-text);
	outline-offset: 1px;
}

::placeholder {
	color: #6f6a62;
	opacity: 1;
}

label {
	font-size: var(--ag-small);
	font-weight: 500;
}

/* ---------- Accessibility helpers ---------- */
.screen-reader-text,
.ag-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed !important;
	top: 12px;
	left: 12px;
	z-index: 100000;
	width: auto;
	height: auto;
	margin: 0;
	padding: 12px 20px;
	clip: auto;
	background: var(--ag-charcoal);
	color: var(--ag-ivory);
	font-size: var(--ag-small);
	font-weight: 600;
	text-decoration: none;
}

/* ---------- Scroll reveal (only when motion is allowed and JS is running) ---------- */
.ag-motion .ag-reveal {
	opacity: 0;
	transform: translateY(var(--ag-reveal-distance));
	transition: opacity var(--ag-reveal-speed) var(--ag-ease), transform var(--ag-reveal-speed) var(--ag-ease);
	transition-delay: var(--ag-reveal-delay, 0s);
	will-change: opacity, transform;
}

.ag-motion .ag-reveal.is-visible {
	opacity: 1;
	transform: none;
	will-change: auto;
}

/* Inside the Elementor editor everything stays visible. */
.elementor-editor-active .ag-reveal {
	opacity: 1 !important;
	transform: none !important;
}

/* ---------- Default (non-Elementor) pages ---------- */
.ag-theme .site-main {
	padding-block: clamp(3rem, 6vw, 6rem);
}

.ag-theme.elementor-page .site-main {
	padding-block: 0;
}

/* Elementor "Full Width" pages: our widgets run edge to edge. */
.ag-main {
	display: block;
}

.ag-theme .page-header .entry-title {
	margin-bottom: 0.6em;
	font-size: var(--ag-h2);
}

.ag-theme .page-content > *:first-child {
	margin-top: 0;
}

.ag-menu-hint {
	margin: 0;
	font-size: var(--ag-small);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}

	.ag-reveal {
		opacity: 1 !important;
		transform: none !important;
	}
}
