/*
Theme Name: Avarcado Theme
Theme URI: https://avarcado.com
Author: Avarcado
Author URI: https://avarcado.com
Description: Custom theme for Avarcado — clean, brand-aligned foundation.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: avarcado-theme
Tags: custom-logo, custom-menu, featured-images, translation-ready
*/

/* =========================================================
   Google Fonts
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Poppins:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

/* =========================================================
   Brand Color Variables
   ========================================================= */
:root {
	--color-teal:   #028A86;
	--color-coral:  #DF744A;
	--color-peach:  #FEDCD2;
	--color-gold:   #DCB239;
	--color-navy:   #012141;
	--color-white:  #FFFFFF;

	/* Typography */
	--font-heading: 'Anton', sans-serif;
	--font-body:    'Poppins', sans-serif;

	/* Spacing scale */
	--space-xs:  0.25rem;
	--space-sm:  0.5rem;
	--space-md:  1rem;
	--space-lg:  1.5rem;
	--space-xl:  2rem;
	--space-2xl: 3rem;
	--space-3xl: 4rem;

	/* Layout */
	--container-max: 1440px;
	--container-pad: clamp(1.5rem, 4vw, 3rem);

	/* Nav */
	--nav-height: 72px;
}

/* =========================================================
   Reset & Box Model
   ========================================================= */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

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

body {
	font-family: var(--font-body);
	font-size: 1.5rem;
	font-weight: 500;
	line-height: 1.7;
	color: var(--color-navy);
	background-color: var(--color-white);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	color: var(--color-teal);
}

ul,
ol {
	list-style: none;
}

button,
input,
select,
textarea {
	font: inherit;
}

/* =========================================================
   Typography
   ========================================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-heading);
	font-weight: 400; /* Anton is display-weight by default */
	line-height: 1.15;
	color: var(--color-navy);
	letter-spacing: 0.01em;
}

h1 { font-size: clamp(3.5rem, 6.5vw, 5.5rem); }
h2 { font-size: clamp(2.75rem, 5vw, 4rem); }
h3 { font-size: clamp(2rem, 3.5vw, 2.75rem); }
h4 { font-size: 2rem; }
h5 { font-size: 1.75rem; }
h6 { font-size: 1.5rem; }

p {
	margin-bottom: var(--space-md);
}

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

strong,
b {
	font-weight: 600;
}

em,
i {
	font-style: italic;
}

small {
	font-size: 1rem;
}

/* =========================================================
   Layout Utilities
   ========================================================= */
.container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-pad);
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-sm);
	padding: 0.875rem 1.875rem;
	font-family: var(--font-body);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1;
	border: 2px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	white-space: nowrap;
}

.btn-coral {
	background-color: var(--color-coral);
	color: var(--color-white);
	border-color: var(--color-coral);
}

.btn-coral:hover {
	background-color: #c95f35;
	border-color: #c95f35;
	color: var(--color-white);
}

.btn-teal {
	background-color: var(--color-teal);
	color: var(--color-white);
	border-color: var(--color-teal);
}

.btn-teal:hover {
	background-color: #016b68;
	border-color: #016b68;
	color: var(--color-white);
}

.btn-outline {
	background-color: transparent;
	color: var(--color-navy);
	border-color: var(--color-navy);
}

.btn-outline:hover {
	background-color: var(--color-navy);
	color: var(--color-white);
}

/* =========================================================
   Skip Link (Accessibility)
   ========================================================= */
.skip-link {
	position: absolute;
	top: -100%;
	left: var(--space-md);
	background: var(--color-navy);
	color: var(--color-white);
	padding: var(--space-sm) var(--space-md);
	border-radius: 0 0 4px 4px;
	font-weight: 600;
	font-size: 0.875rem;
	z-index: 9999;
	transition: top 0.2s;
}

.skip-link:focus {
	top: 0;
}

/* =========================================================
   WordPress Core Classes
   ========================================================= */
.alignleft  { float: left; margin-right: var(--space-lg); margin-bottom: var(--space-md); }
.alignright { float: right; margin-left: var(--space-lg); margin-bottom: var(--space-md); }
.aligncenter { display: block; margin-inline: auto; margin-bottom: var(--space-md); }
.alignwide  { max-width: calc(var(--container-max) + 8rem); margin-inline: auto; }
.alignfull  { max-width: 100%; margin-inline: calc(-1 * var(--container-pad)); }

.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.875rem; color: #666; margin-top: var(--space-xs); }

/* =========================================================
   Pagination
   ========================================================= */
.site-pagination {
	display: flex;
	justify-content: center;
	gap: var(--space-sm);
	padding: var(--space-2xl) 0;
}

/* =========================================================
   Site Header / Sticky Nav
   ========================================================= */
.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	height: var(--nav-height);
	background-color: var(--color-white);
	box-shadow: 0 1px 0 rgba(1, 33, 65, 0.08);
}

.nav-inner {
	display: flex;
	align-items: center;
	gap: var(--space-xl);
	height: 100%;
}

.site-logo {
	flex-shrink: 0;
	display: flex;
	align-items: center;
}

/* Fallback img and WordPress custom-logo img */
.site-logo img,
.site-logo .custom-logo-link img,
.site-logo .custom-logo {
	display: block;
	max-height: 48px;
	width: auto;
	height: auto;
}

.primary-nav {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: var(--space-lg);
}

.nav-menu {
	display: flex;
	align-items: center;
	gap: var(--space-xl);
}

.nav-menu a {
	font-weight: 700;
	font-size: 1.0625rem;
	color: var(--color-navy);
	transition: color 0.2s ease;
	position: relative;
}

.nav-menu a::after {
	content: '';
	position: absolute;
	bottom: -3px;
	left: 0;
	width: 0;
	height: 2px;
	background-color: var(--color-teal);
	transition: width 0.2s ease;
}

.nav-menu a:hover {
	color: var(--color-teal);
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item > a::after,
.nav-menu .current-page-ancestor > a::after {
	width: 100%;
}

.nav-menu .current-menu-item > a,
.nav-menu .current-page-ancestor > a {
	color: var(--color-teal);
}

.nav-cta {
	flex-shrink: 0;
}

/* Dropdown sub-menu */
.nav-menu .menu-item-has-children {
	position: relative;
}

.nav-menu .menu-item-has-children > a::after {
	display: none; /* hide underline on parent; chevron below handles affordance */
}

.nav-menu .menu-item-has-children > a .nav-chevron {
	display: inline-block;
	margin-left: 0.3em;
	transition: transform 0.2s ease;
	vertical-align: middle;
}

.nav-menu .sub-menu {
	position: absolute;
	top: calc(100% + 12px);
	left: 50%;
	transform: translateX(-50%);
	min-width: 300px;
	background: var(--color-white);
	border-radius: 10px;
	box-shadow:
		0 0 0 1px rgba(1, 33, 65, 0.07),
		0 8px 32px rgba(1, 33, 65, 0.14);
	padding: 0.5rem 0;
	opacity: 0;
	pointer-events: none;
	transform: translateX(-50%) translateY(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 200;
	list-style: none;
}

/* Arrow notch */
.nav-menu .sub-menu::before {
	content: '';
	position: absolute;
	top: -6px;
	left: 50%;
	transform: translateX(-50%);
	width: 12px;
	height: 12px;
	background: var(--color-white);
	border-radius: 2px;
	clip-path: polygon(0 100%, 50% 0, 100% 100%);
}

.nav-menu .menu-item-has-children.is-open > .sub-menu {
	opacity: 1;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

.nav-menu .menu-item-has-children.is-open > a .nav-chevron {
	transform: rotate(180deg);
}

.nav-menu .sub-menu li {
	display: block;
}

.nav-menu .sub-menu a {
	display: block;
	padding: 0.625rem 1.25rem;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--color-navy);
	white-space: nowrap;
	border-radius: 0;
	transition: background 0.15s ease, color 0.15s ease;
}

.nav-menu .sub-menu a::after {
	display: none;
}

.nav-menu .sub-menu a:hover {
	background: rgba(1, 33, 65, 0.05);
	color: var(--color-teal);
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: var(--space-sm);
	margin-left: auto;
}

.nav-toggle__bar {
	display: block;
	width: 24px;
	height: 2px;
	background-color: var(--color-navy);
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Tablet — tighten nav gaps before hamburger kicks in */
@media (max-width: 1100px) {
	.nav-inner {
		gap: var(--space-lg);
	}

	.nav-menu {
		gap: var(--space-lg);
	}

	.nav-cta {
		margin-left: var(--space-sm);
		padding: 0.65rem 1.1rem;
		font-size: 0.875rem;
	}
}

/* Mobile nav — hamburger */
@media (max-width: 900px) {
	.nav-toggle {
		display: flex;
	}

	.primary-nav {
		position: absolute;
		top: var(--nav-height);
		left: 0;
		right: 0;
		background-color: var(--color-white);
		box-shadow: 0 4px 16px rgba(1, 33, 65, 0.1);
		padding: var(--space-lg) var(--container-pad) var(--space-xl);
		transform: translateY(-8px);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.25s ease, transform 0.25s ease;
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-lg);
	}

	.primary-nav.is-open {
		opacity: 1;
		transform: translateY(0);
		pointer-events: auto;
	}

	.nav-menu {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-lg);
	}

	.nav-cta {
		margin-left: 0;
		width: 100%;
		text-align: center;
		font-size: 0.9375rem;
		padding: 0.75rem 1.5rem;
	}

	/* Mobile sub-menu: shown inline, no hover needed */
	.nav-menu .sub-menu {
		position: static;
		transform: none;
		opacity: 1;
		pointer-events: auto;
		box-shadow: none;
		border-radius: 0;
		padding: 0.25rem 0 0 1rem;
		min-width: 0;
	}

	.nav-menu .sub-menu::before {
		display: none;
	}

	.nav-menu .menu-item-has-children > a .nav-chevron {
		display: none;
	}

	.nav-menu .sub-menu a {
		padding: 0.4rem 0;
		font-size: 0.9375rem;
		background: none;
	}

	/* Animated hamburger → X */
	.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}

	.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
		opacity: 0;
	}

	.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}
}

/* Small mobile */
@media (max-width: 480px) {
	:root {
		--nav-height: 64px;
	}

	body {
		font-size: 1.125rem;
	}

	.site-logo img,
	.site-logo .custom-logo-link img,
	.site-logo .custom-logo {
		max-height: 36px;
	}
}

/* =========================================================
   Site Footer
   ========================================================= */
.site-footer {
	background-color: var(--color-navy);
	color: rgba(255, 255, 255, 0.75);
}

/* Upper footer */
.footer-upper {
	padding: var(--space-3xl) 0;
}

.footer-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1fr;
	gap: var(--space-2xl);
}

/* Tablet footer */
@media (max-width: 900px) {
	.footer-upper {
		padding: var(--space-2xl) 0;
	}

	.footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: var(--space-xl);
	}

	.footer-col--brand {
		grid-column: 1 / -1;
	}

	.footer-tagline {
		max-width: 100%;
	}
}

/* Mobile footer */
@media (max-width: 540px) {
	.footer-grid {
		grid-template-columns: 1fr;
		gap: var(--space-xl);
	}

	.footer-bottom__inner {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-md);
	}

	.footer-legal-nav {
		flex-wrap: wrap;
		gap: var(--space-md);
	}
}

/* Small mobile footer */
@media (max-width: 480px) {
	.footer-logo img,
	.footer-logo .custom-logo-link img,
	.footer-logo .custom-logo {
		max-height: 32px;
	}
}

/* Brand column */
.footer-logo {
	display: inline-flex;
	margin-bottom: var(--space-lg);
}

.footer-logo img,
.footer-logo .custom-logo-link img,
.footer-logo .custom-logo {
	display: block;
	max-height: 40px;
	width: auto;
	height: auto;
	filter: brightness(0) invert(1);
}

.footer-tagline {
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.7;
	max-width: 320px;
}

/* Column heading */
.footer-col__heading {
	font-family: var(--font-body);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-white);
	margin-bottom: var(--space-lg);
}

/* Nav links */
.footer-nav {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.footer-nav a {
	font-size: 1rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.7);
	transition: color 0.2s ease;
}

.footer-nav a:hover {
	color: var(--color-peach);
}

/* Contact list */
.footer-contact-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.footer-contact-list li {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.footer-contact-list__label {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-gold);
}

.footer-contact-list a,
.footer-contact-list span {
	font-size: 1rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.7);
	transition: color 0.2s ease;
}

.footer-contact-list a:hover {
	color: var(--color-peach);
}

/* Bottom bar */
.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: var(--space-lg) 0;
}

.footer-bottom__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-lg);
	flex-wrap: wrap;
}

.footer-copyright {
	font-size: 0.9375rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.5);
	margin-bottom: 0;
}

.footer-copyright a {
	color: rgba(255, 255, 255, 0.7);
	transition: color 0.2s ease;
}

.footer-copyright a:hover {
	color: var(--color-peach);
}

.footer-legal-nav {
	display: flex;
	gap: var(--space-lg);
}

.footer-legal-nav a {
	font-size: 0.9375rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.5);
	transition: color 0.2s ease;
}

.footer-legal-nav a:hover {
	color: var(--color-peach);
}

/* =========================================================
   Footer Newsletter Band
   ========================================================= */
.footer-nl {
	background: linear-gradient(130deg, #016e6b 0%, var(--color-teal) 50%, #017b78 100%);
	padding: 5rem 0;
	position: relative;
	overflow: hidden;
}

/* Subtle teal grid overlay for texture */
.footer-nl::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
	background-size: 48px 48px;
	-webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 40%, transparent 90%);
	mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 40%, transparent 90%);
	pointer-events: none;
}

/* A soft coral glow accent in the far right */
.footer-nl::after {
	content: '';
	position: absolute;
	top: -30%;
	right: -10%;
	width: 420px;
	height: 420px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(223, 116, 74, 0.18) 0%, transparent 65%);
	filter: blur(40px);
	pointer-events: none;
}

.footer-nl__inner {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: 1fr 1.25fr;
	gap: 4.5rem;
	align-items: center;
}

/* Left — copy */
.footer-nl__eyebrow {
	display: block;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.65);
	margin-bottom: 1rem;
}

.footer-nl__h2 {
	font-family: var(--font-heading);
	font-size: clamp(2.25rem, 3.5vw, 3.75rem);
	color: var(--color-white);
	line-height: 1.06;
	margin-bottom: 1.125rem;
}

.footer-nl__sub {
	font-size: 1.0625rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.72);
	line-height: 1.75;
	max-width: 38ch;
	margin-bottom: 0;
}

/* Right — iframe wrapper */
.footer-nl__form-wrap {
	width: 100%;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
	background: var(--color-white);
}

.footer-nl__form-wrap iframe {
	display: block;
	width: 100%;
	min-height: 300px;
	border: none;
}

/* Responsive newsletter band */
@media (max-width: 900px) {
	.footer-nl {
		padding: 4rem 0;
	}

	.footer-nl__inner {
		grid-template-columns: 1fr;
		gap: 2.5rem;
	}

	.footer-nl__sub {
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	.footer-nl {
		padding: 3rem 0;
	}

	.footer-nl__form-wrap iframe {
		min-height: 340px;
	}
}
