/* =========================================================================
   Windsor Dental Centre — Joomla 6 template
   Lightweight, modern, subtle animation. Brand-driven CSS custom properties.
   ========================================================================= */

/* ---- Design tokens (overridable values injected inline from params) ---- */
:root {
	--wd-primary: #c72c2f;
	--wd-accent: #f58328;
	--wd-bg: #f6f3ed;
	--wd-ink: #1c1c1c;
	--wd-container: 1200px;
	--wd-logo-h: 56px;
	--wd-logo-sticky-h: 44px;
	--wd-font-heading: "Poppins", system-ui, sans-serif;
	--wd-font-body: "Inter", system-ui, sans-serif;

	/* Derived neutrals */
	--wd-bg-2: #fffdf9;
	--wd-card: #ffffff;
	--wd-muted: #6b665d;
	--wd-line: rgba(28, 28, 28, 0.10);
	--wd-shadow-sm: 0 2px 8px rgba(28, 28, 28, 0.06);
	--wd-shadow-md: 0 10px 30px rgba(28, 28, 28, 0.08);
	--wd-shadow-lg: 0 20px 50px rgba(28, 28, 28, 0.12);
	--wd-radius: 14px;
	--wd-radius-sm: 9px;
	--wd-radius-pill: 999px;
	--wd-header-h: 80px;
	--wd-ease: cubic-bezier(0.16, 1, 0.3, 1);
	--wd-transition: 0.35s var(--wd-ease);
}

/* ----------------------------- Reset ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--wd-font-body);
	font-size: 17px;
	line-height: 1.65;
	color: var(--wd-ink);
	background: var(--wd-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--wd-primary); text-decoration: none; transition: color var(--wd-transition); }
a:hover { color: var(--wd-accent); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--wd-font-heading);
	color: var(--wd-ink);
	line-height: 1.2;
	margin: 0 0 0.6em;
	font-weight: 600;
	letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1.1em; }

/* --------------------------- Utilities --------------------------------- */
.wd-container {
	width: 100%;
	max-width: var(--wd-container);
	margin-inline: auto;
	padding-inline: 24px;
}

.wd-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	background: var(--wd-primary);
	color: #fff;
	padding: 10px 16px;
	border-radius: 0 0 var(--wd-radius-sm) 0;
}
.wd-skip-link:focus { left: 0; color: #fff; }

/* --------------------------- Buttons ----------------------------------- */
.wd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	font-family: var(--wd-font-heading);
	font-weight: 600;
	font-size: 0.97rem;
	line-height: 1;
	padding: 0.85em 1.6em;
	border-radius: var(--wd-radius-pill);
	border: 2px solid transparent;
	cursor: pointer;
	transition: transform var(--wd-transition), box-shadow var(--wd-transition), background var(--wd-transition), color var(--wd-transition);
	white-space: nowrap;
}
.wd-btn--accent { background: var(--wd-accent); color: #fff; box-shadow: 0 6px 18px rgba(245, 131, 40, 0.32); }
.wd-btn--accent:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(245, 131, 40, 0.42); }
.wd-btn--primary { background: var(--wd-primary); color: #fff; box-shadow: 0 6px 18px rgba(199, 44, 47, 0.28); }
.wd-btn--primary:hover { color: #fff; transform: translateY(-2px); }
.wd-btn--outline { background: transparent; color: var(--wd-ink); border-color: var(--wd-line); }
.wd-btn--outline:hover { border-color: var(--wd-primary); color: var(--wd-primary); transform: translateY(-2px); }

/* --------------------------- Top bar ----------------------------------- */
.wd-topbar {
	background: var(--wd-ink);
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.86rem;
}
.wd-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 42px;
	flex-wrap: wrap;
}
.wd-topbar__info { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.wd-topbar__item { display: inline-flex; align-items: center; gap: 7px; color: rgba(255, 255, 255, 0.85); }
.wd-topbar__item:hover { color: #fff; }
.wd-topbar__item svg { width: 15px; height: 15px; fill: var(--wd-accent); flex: 0 0 auto; }
.wd-topbar__social { display: inline-flex; gap: 6px; }
.wd-topbar__social a { display: inline-flex; padding: 6px; border-radius: 50%; transition: background var(--wd-transition); }
.wd-topbar__social a svg { width: 15px; height: 15px; fill: rgba(255, 255, 255, 0.85); transition: fill var(--wd-transition); }
.wd-topbar__social a:hover { background: rgba(255, 255, 255, 0.12); }
.wd-topbar__social a:hover svg { fill: #fff; }

/* --------------------------- Header ------------------------------------ */
.wd-header {
	background: var(--wd-bg);
	border-bottom: 1px solid transparent;
	position: relative;
	z-index: 100;
	transition: box-shadow var(--wd-transition), background var(--wd-transition), padding var(--wd-transition);
}
.wd-header__inner {
	display: flex;
	align-items: center;
	gap: 28px;
	min-height: var(--wd-header-h);
}
.wd-logo { display: inline-flex; align-items: center; }
.wd-logo__img { max-height: var(--wd-logo-h); width: auto; transition: max-height var(--wd-transition); }

.wd-nav { margin-left: auto; }
.wd-header__actions { display: flex; align-items: center; gap: 14px; }

/* Sticky header behaviour */
.has-sticky-header .wd-header.is-sticky {
	position: fixed;
	top: 0; left: 0; right: 0;
	background: color-mix(in srgb, var(--wd-bg) 88%, #fff);
	backdrop-filter: saturate(140%) blur(10px);
	box-shadow: var(--wd-shadow-sm);
	animation: wdSlideDown 0.4s var(--wd-ease);
}
.has-sticky-header .wd-header.is-sticky .wd-header__inner { min-height: 64px; }
.has-sticky-header .wd-header.is-sticky .wd-logo__img { max-height: var(--wd-logo-sticky-h); }
.has-sticky-header.header-pinned { padding-top: var(--wd-header-h); }

@keyframes wdSlideDown {
	from { transform: translateY(-100%); }
	to { transform: translateY(0); }
}

/* --------------------------- Main menu --------------------------------- */
.wd-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 4px;
}
.wd-nav ul ul { display: none; }
.wd-nav > ul > li { position: relative; }
.wd-nav > ul > li > a,
.wd-nav > ul > li > span {
	display: inline-block;
	padding: 10px 14px;
	font-family: var(--wd-font-heading);
	font-weight: 500;
	font-size: 0.98rem;
	color: var(--wd-ink);
	position: relative;
}
.wd-nav > ul > li > a::after {
	content: "";
	position: absolute;
	left: 14px; right: 14px;
	bottom: 4px;
	height: 2px;
	background: var(--wd-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--wd-transition);
	border-radius: 2px;
}
.wd-nav > ul > li > a:hover { color: var(--wd-primary); }
.wd-nav > ul > li > a:hover::after,
.wd-nav > ul > li.current > a::after,
.wd-nav > ul > li.active > a::after { transform: scaleX(1); }
.wd-nav > ul > li.current > a,
.wd-nav > ul > li.active > a { color: var(--wd-primary); }

/* Dropdowns */
.wd-nav li.parent > a,
.wd-nav li.deeper > a { padding-right: 24px; }
.wd-nav li.parent > a::before {
	content: "";
	position: absolute;
	right: 8px; top: 50%;
	width: 6px; height: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-70%) rotate(45deg);
	opacity: 0.6;
}
.wd-nav > ul > li.parent:hover > ul,
.wd-nav > ul > li.parent:focus-within > ul {
	display: block;
	position: absolute;
	top: 100%; left: 0;
	min-width: 220px;
	background: var(--wd-card);
	border-radius: var(--wd-radius-sm);
	box-shadow: var(--wd-shadow-md);
	padding: 8px;
	animation: wdFadeUp 0.25s var(--wd-ease);
	z-index: 50;
}
.wd-nav ul ul li a {
	display: block;
	padding: 9px 12px;
	border-radius: var(--wd-radius-sm);
	color: var(--wd-ink);
	font-size: 0.95rem;
	font-family: var(--wd-font-heading);
	font-weight: 500;
}
.wd-nav ul ul li a:hover { background: var(--wd-bg); color: var(--wd-primary); }

@keyframes wdFadeUp {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* --------------------------- Mobile nav -------------------------------- */
.wd-nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px; height: 44px;
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 10px;
}
.wd-nav-toggle__bar {
	display: block;
	height: 2px;
	width: 100%;
	background: var(--wd-ink);
	border-radius: 2px;
	transition: transform var(--wd-transition), opacity var(--wd-transition);
}
.wd-nav-toggle[aria-expanded="true"] .wd-nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.wd-nav-toggle[aria-expanded="true"] .wd-nav-toggle__bar:nth-child(2) { opacity: 0; }
.wd-nav-toggle[aria-expanded="true"] .wd-nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.wd-mobile-nav {
	display: none;
	background: var(--wd-bg-2);
	border-bottom: 1px solid var(--wd-line);
	padding: 16px 24px 24px;
}
.wd-mobile-nav.is-open { display: block; animation: wdFadeUp 0.3s var(--wd-ease); }
.wd-mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.wd-mobile-nav ul a,
.wd-mobile-nav ul span {
	display: block;
	padding: 12px 6px;
	border-bottom: 1px solid var(--wd-line);
	font-family: var(--wd-font-heading);
	font-weight: 500;
	color: var(--wd-ink);
}
.wd-mobile-nav ul ul a { padding-left: 22px; font-weight: 400; font-size: 0.95rem; }
.wd-mobile-nav__cta { margin-top: 18px; width: 100%; }

/* --------------------------- Hero -------------------------------------- */
.wd-hero { position: relative; }

/* --------------------------- Sections ---------------------------------- */
.wd-main { padding: 56px 0; }
.is-home .wd-main { padding: 0; }
.wd-content { min-width: 0; }

.wd-layout { display: grid; gap: 40px; align-items: start; }
.wd-layout.has-left { grid-template-columns: 300px minmax(0, 1fr); }
.wd-layout.has-right { grid-template-columns: minmax(0, 1fr) 300px; }
.wd-layout.has-left.has-right { grid-template-columns: 280px minmax(0, 1fr) 280px; }

.wd-main-top, .wd-main-bottom { margin-bottom: 32px; }

/* --------------------------- Cards ------------------------------------- */
.card, .moduletable.card, .wd-features__col, .wd-banner .moduletable {
	background: var(--wd-card);
	border-radius: var(--wd-radius);
	box-shadow: var(--wd-shadow-sm);
	padding: 28px;
	transition: transform var(--wd-transition), box-shadow var(--wd-transition);
}
.wd-features__col:hover { transform: translateY(-4px); box-shadow: var(--wd-shadow-md); }

.moduletable .module-title, .moduletable h3 { margin-top: 0; }

/* --------------------------- Features grid ----------------------------- */
.wd-features { padding: 64px 0; }
.wd-features__grid { display: grid; gap: 26px; }
.wd-features__grid.cols-1 { grid-template-columns: 1fr; }
.wd-features__grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.wd-features__grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.wd-features__grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* --------------------------- Footer ------------------------------------ */
.wd-footer { background: var(--wd-ink); color: rgba(255, 255, 255, 0.78); margin-top: 64px; }
.is-home .wd-footer { margin-top: 0; }
.wd-footer__top { padding: 56px 0 40px; }
.wd-footer a { color: rgba(255, 255, 255, 0.85); }
.wd-footer a:hover { color: var(--wd-accent); }
.wd-footer h1, .wd-footer h2, .wd-footer h3, .wd-footer .module-title { color: #fff; font-size: 1.1rem; margin-bottom: 1rem; }
.wd-footer__grid { display: grid; gap: 36px; }
.wd-footer__grid.cols-1 { grid-template-columns: 1fr; }
.wd-footer__grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.wd-footer__grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.wd-footer__grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.wd-footer ul { list-style: none; margin: 0; padding: 0; }
.wd-footer ul li { margin-bottom: 8px; }

.wd-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 20px 0; font-size: 0.88rem; }
.wd-footer__bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wd-footer__copy { margin: 0; }
.wd-footer__social { display: inline-flex; gap: 8px; }
.wd-footer__social a { display: inline-flex; padding: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); transition: background var(--wd-transition); }
.wd-footer__social a svg { width: 16px; height: 16px; fill: rgba(255, 255, 255, 0.85); transition: fill var(--wd-transition); }
.wd-footer__social a:hover { background: var(--wd-accent); }
.wd-footer__social a:hover svg { fill: #fff; }

/* --------------------------- Scroll reveal ----------------------------- */
.anim-on [data-reveal] {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s var(--wd-ease), transform 0.7s var(--wd-ease);
	will-change: opacity, transform;
}
.anim-on [data-reveal].is-visible { opacity: 1; transform: none; }
.anim-on [data-reveal][data-reveal-delay="1"] { transition-delay: 0.08s; }
.anim-on [data-reveal][data-reveal-delay="2"] { transition-delay: 0.16s; }
.anim-on [data-reveal][data-reveal-delay="3"] { transition-delay: 0.24s; }

/* --------------------------- Responsive -------------------------------- */
@media (max-width: 991px) {
	.wd-nav, .wd-header__search, .wd-header__cta { display: none; }
	.wd-nav-toggle { display: flex; }
	.wd-header__actions { margin-left: auto; }
	.wd-layout.has-left, .wd-layout.has-right, .wd-layout.has-left.has-right { grid-template-columns: 1fr; }
	.wd-features__grid.cols-3, .wd-features__grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
	.wd-footer__grid.cols-3, .wd-footer__grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
	body { font-size: 16px; }
	.wd-container { padding-inline: 18px; }
	.wd-topbar__info { gap: 14px; }
	.wd-topbar__address { display: none; }
	.wd-features__grid.cols-2, .wd-features__grid.cols-3, .wd-features__grid.cols-4 { grid-template-columns: 1fr; }
	.wd-footer__grid.cols-2, .wd-footer__grid.cols-3, .wd-footer__grid.cols-4 { grid-template-columns: 1fr; }
}

/* --------------------------- Reduced motion ---------------------------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
	.anim-on [data-reveal] { opacity: 1; transform: none; }
}
