/*
 * Aaban Real Estate — theme component CSS.
 *
 * Two jobs:
 *  1. Style the PHP fallback header/footer (template-parts/header-fallback.php,
 *     footer-fallback.php) so the site never looks broken pre-Elementor-setup.
 *  2. Provide a utility class library (buttons, cards, reveal-on-scroll, 3D tilt,
 *     glass header, etc.) that editors can type into any Elementor widget's
 *     Advanced → CSS Classes field to get the premium look using real, fully
 *     Elementor-editable widgets — see README "3D animation system".
 *
 * Design tokens are defined once in style.css (:root) and reused here.
 */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	font-family: var(--font-body);
	color: var(--color-text);
	background: var(--color-bg);
}
img { max-width: 100%; height: auto; }

.aaban-wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 600px) { .aaban-wrap { padding: 0 20px; } }

h1, h2, h3, .aaban-h1, .aaban-h2, .aaban-h3 {
	font-family: var(--font-head);
	font-weight: 560;
	letter-spacing: -0.01em;
	color: var(--color-primary);
	margin: 0 0 0.5em;
}
h1, .aaban-h1 { font-size: 34px; line-height: 1.1; }
h2, .aaban-h2 { font-size: 28px; line-height: 1.15; font-weight: 500; }
h3, .aaban-h3 { font-size: 22px; line-height: 1.25; font-weight: 500; }
@media (min-width: 768px) {
	h1, .aaban-h1 { font-size: 44px; }
	h2, .aaban-h2 { font-size: 36px; }
	h3, .aaban-h3 { font-size: 26px; }
}
@media (min-width: 1280px) {
	h1, .aaban-h1 { font-size: 55px; }
	h2, .aaban-h2 { font-size: 44px; }
	h3, .aaban-h3 { font-size: 30px; }
}

.aaban-placeholder { color: var(--color-text-muted); font-style: italic; font-size: 0.85em; }

/* ---------- Buttons (apply via CSS Classes field on any Elementor Button widget) ---------- */
.btn, .aaban-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	padding: 16px 30px; border-radius: 999px; font-weight: 600; font-size: 15.5px;
	border: 1px solid transparent; text-decoration: none;
	transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, background .3s, color .3s, border-color .3s;
}
.btn-primary { background: var(--color-accent); color: var(--color-primary-dark); }
.btn-primary:hover { background: var(--color-accent-dark); transform: translateY(-3px); box-shadow: 0 16px 34px -12px rgba(201,160,92,0.55); }
.btn-outline { background: transparent; color: var(--color-on-dark); border-color: rgba(243,239,232,0.4); }
.btn-outline:hover { border-color: var(--color-on-dark); transform: translateY(-3px); }
.btn-dark { background: var(--color-primary); color: var(--color-on-dark); }
.btn-dark:hover { background: var(--color-primary-dark); transform: translateY(-3px); }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
	outline: 3px solid var(--color-accent); outline-offset: 3px;
}

/* ---------- Sticky glass header ---------- */
header.site-header {
	position: fixed; top: 0; left: 0; right: 0; z-index: 100;
	padding: 26px 0;
	transition: background .4s ease, box-shadow .4s ease, padding .4s ease;
}
header.site-header.is-stuck {
	background: rgba(11,30,51,0.82);
	backdrop-filter: blur(16px) saturate(140%);
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	box-shadow: 0 12px 40px -20px rgba(0,0,0,0.45);
	padding: 14px 0;
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); color: var(--color-on-dark); font-size: 21px; font-weight: 560; text-decoration: none; }
.brand-logo, .brand img { height: 40px; width: auto; display: block; transition: height .4s ease; }
header.site-header.is-stuck .brand-logo, header.site-header.is-stuck .brand img { height: 32px; }
.footer-brand .brand-logo, .footer-brand .brand img { height: 46px; }
nav.primary-nav { display: none; }
nav.primary-nav ul { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
nav.primary-nav a { font-size: 14.5px; font-weight: 500; color: var(--color-on-dark-muted); text-decoration: none; position: relative; padding: 6px 0; transition: color .3s; }
nav.primary-nav a:hover { color: var(--color-on-dark); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-actions .btn { padding: 12px 24px; font-size: 14px; }
.hamburger { display: flex; flex-direction: column; gap: 5px; background: none; border: none; padding: 8px; z-index: 210; }
.hamburger span { width: 24px; height: 2px; background: var(--color-on-dark); display: block; }
@media (min-width: 1080px) {
	nav.primary-nav { display: block; }
	.hamburger { display: none; }
}

.mobile-menu {
	position: fixed; inset: 0; background: var(--color-primary-dark); z-index: 190;
	display: flex; flex-direction: column; padding: 110px 32px 40px;
	transform: translateX(100%); transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu ul { display: flex; flex-direction: column; gap: 6px; list-style: none; margin: 0; padding: 0; }
.mobile-menu a { display: block; padding: 14px 4px; font-size: 20px; font-family: var(--font-head); color: var(--color-on-dark); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.08); }
.mobile-menu .btn { margin-top: 28px; width: 100%; }
@media (min-width: 1080px) { .mobile-menu { display: none; } }

/* ---------- Mobile sticky CTA bar ---------- */
.mobile-sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; display: flex; gap: 1px; background: var(--color-border); box-shadow: 0 -8px 24px -10px rgba(0,0,0,0.25); }
.mobile-sticky-cta a { flex: 1; background: var(--color-primary); color: #fff; text-align: center; padding: 14px 8px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.mobile-sticky-cta a.whatsapp { background: #1f8a4c; }
@media (min-width: 1080px) { .mobile-sticky-cta { display: none; } }

/* ---------- Footer ---------- */
footer.site-footer { background: var(--color-primary-dark); color: var(--color-on-dark-muted); padding-top: 72px; }
.footer-grid { display: grid; gap: 44px; grid-template-columns: 1fr; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.1); }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1.4fr repeat(3,1fr); } }
.footer-brand .brand { color: var(--color-on-dark); margin-bottom: 14px; }
.footer-brand p { font-size: 14.5px; max-width: 34ch; margin: 0 0 20px; }
.footer-col h4 { font-family: var(--font-head); font-weight: 500; color: var(--color-on-dark); font-size: 16px; margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 11px; list-style: none; margin: 0; padding: 0; }
.footer-col a { font-size: 14.5px; color: var(--color-on-dark-muted); text-decoration: none; transition: color .25s; }
.footer-col a:hover { color: var(--color-accent-light); }
.social-row { display: flex; gap: 10px; margin-top: 6px; }
.social-btn {
	width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18);
	display: flex; align-items: center; justify-content: center; color: var(--color-on-dark); text-decoration: none;
	transition: transform .35s cubic-bezier(.3,1.4,.4,1), border-color .3s, box-shadow .3s;
}
.social-btn:hover { transform: translateY(-4px) scale(1.08); border-color: var(--color-accent); box-shadow: 0 10px 24px -8px rgba(201,160,92,0.55); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; padding: 26px 0; font-size: 13px; }
.footer-bottom .legal-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom a { color: var(--color-on-dark-muted); text-decoration: none; }
.footer-bottom .legal-links a:hover { color: var(--color-accent-light); }

/* ---------- Cinematic reveal-on-scroll (used with theme.js IntersectionObserver) ---------- */
.reveal {
	opacity: 0; transform: translateY(36px) scale(.975); filter: blur(6px);
	transition: opacity 1s cubic-bezier(.16,.8,.24,1), transform 1s cubic-bezier(.16,.8,.24,1), filter 1s cubic-bezier(.16,.8,.24,1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; filter: none; transition: none; } }

/* ---------- Hero/CTA load-in stagger (add class + inline `style="--stagger-delay:.2s"`) ---------- */
.load-stagger {
	opacity: 0; transform: translateY(22px); filter: blur(4px);
	transition: opacity .9s cubic-bezier(.16,.8,.24,1) var(--stagger-delay,0s), transform .9s cubic-bezier(.16,.8,.24,1) var(--stagger-delay,0s), filter .9s cubic-bezier(.16,.8,.24,1) var(--stagger-delay,0s);
}
.is-loaded .load-stagger { opacity: 1; transform: translateY(0); filter: blur(0); }
@media (prefers-reduced-motion: reduce) { .load-stagger { opacity: 1; transform: none; filter: none; transition: none; } }

/* ---------- 3D tilt card (add data-tilt attribute; class for card shadow/hover) ---------- */
.aaban-tilt-card { position: relative; transition: transform .12s ease, box-shadow .4s ease; will-change: transform; box-shadow: 0 20px 60px -20px rgba(11,30,51,0.25); }
.aaban-tilt-card:hover { box-shadow: 0 30px 80px -24px rgba(11,30,51,0.35); }

/* ---------- Specular gloss overlay for [data-tilt] cards (add `<span class="gloss">` as first child) ---------- */
.gloss {
	position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s ease; z-index: 2;
	background: radial-gradient(circle at var(--gx,50%) var(--gy,50%), rgba(255,255,255,0.35), transparent 45%);
	mix-blend-mode: soft-light;
}
[data-tilt]:hover .gloss { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .gloss { display: none; } }

/* ---------- Magnetic buttons (add class `magnetic`; theme.js drives the pull) ---------- */
.magnetic { will-change: transform; }

/* ---------- Eyebrow label ---------- */
.eyebrow, .aaban-eyebrow {
	display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600;
	letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-accent-dark);
}
.eyebrow::before, .aaban-eyebrow::before {
	content: ''; width: 22px; height: 2px; background: var(--color-accent);
	transform: scaleX(0); transform-origin: left; transition: transform .9s cubic-bezier(.2,.8,.2,1) .1s;
}
.eyebrow.is-visible::before, .aaban-eyebrow.is-visible::before { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .eyebrow::before, .aaban-eyebrow::before { transform: scaleX(1); transition: none; } }

/* ---------- FAQ accordion (used by template-parts/faq.php) ---------- */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; text-align: left; background: none; border: none; padding: 22px 4px; font-family: var(--font-head); font-size: 18px; color: var(--color-primary); font-weight: 500; cursor: pointer; }
.faq-q .plus { width: 22px; height: 22px; flex: none; position: relative; }
.faq-q .plus::before, .faq-q .plus::after { content: ''; position: absolute; background: var(--color-accent); border-radius: 2px; }
.faq-q .plus::before { left: 0; top: 50%; width: 100%; height: 2px; transform: translateY(-50%); }
.faq-q .plus::after { top: 0; left: 50%; width: 2px; height: 100%; transform: translateX(-50%); transition: transform .3s; }
.faq-item[data-open="true"] .plus::after { transform: translateX(-50%) rotate(90deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .4s cubic-bezier(.2,.8,.2,1); }
.faq-a p { color: var(--color-text-muted); font-size: 15.5px; padding: 0 4px 22px; margin: 0; max-width: 70ch; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--color-accent); color: var(--color-primary-dark); padding: 12px 18px; z-index: 300; font-weight: 600; text-decoration: none; }
.skip-link:focus { left: 16px; top: 16px; }
.screen-reader-text { position: absolute; left: -9999px; }
.screen-reader-text:focus { left: 16px; top: 16px; position: fixed; z-index: 300; background: var(--color-accent); color: var(--color-primary-dark); padding: 12px 18px; }
