/* ==========================================================================
   FS Trade — Base stylesheet
   Fluid/intrinsic layout primitives — shared by theme templates AND the
   FS Trade Modules plugin, so layout logic lives in one place.
   ========================================================================== */

/* -------------------- Reset (minimal) -------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--font-size-base, 16px);
	line-height: 1.5;
	color: var(--color-secondary);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	line-height: 1.2;
	margin: 0 0 0.6em;
}

/* -------------------- Fluid typography scale -------------------- */
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 1rem + 2vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 1rem + 1vw, 2rem); }
p  { font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem); }

/* -------------------- Layout primitives -------------------- */

/* Fluid grid — used by Columns / Card Grid / Logo Grid modules */
.fs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: clamp(1rem, 2vw, 2rem);
}

/* Fluid flex row — used by Testimonials / inline lists */
.fs-flex-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(1rem, 2vw, 2rem);
}
.fs-flex-wrap > * {
	flex: 1 1 250px;
}

/* Container widths */
.fs-container {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2.5rem);
}
.fs-container--narrow { max-width: 800px; }
.fs-container--full { max-width: none; padding-inline: 0; }

/* Fluid section padding — used as the default module wrapper spacing */
.fs-module {
	padding-block: clamp(2rem, 6vw, 5rem);
}
.fs-module--pad-sm { padding-block: clamp(1rem, 3vw, 2.5rem); }
.fs-module--pad-lg { padding-block: clamp(3rem, 8vw, 7rem); }

/* Container query opt-in — module partials add container-type: inline-size
   on their own wrapper when they need to respond to their own width
   rather than the viewport (e.g. nested inside a Columns module). */
.fs-module-boundary {
	container-type: inline-size;
}

/* -------------------- Header -------------------- */
.site-header {
	background: #fff;
	border-bottom: 1px solid #eee;
}
body.header-has-border .site-header { border-bottom: 1px solid #eee; }
body:not(.header-has-border) .site-header { border-bottom: none; }

.site-header .fs-container {
	max-width: var(--header-container-width, 1200px);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-block: clamp(0.75rem, 2vw, 1.25rem);
	flex-wrap: wrap;
	gap: 1rem;
}
body.header-logo-center .site-header .fs-container {
	justify-content: center;
	flex-direction: column;
	text-align: center;
}
body.header-sticky .site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	transition: transform 0.3s ease;
}
body.header-hide-on-scroll.is-scrolled-down .site-header {
	transform: translateY(-100%);
}
body.has-transparent-header .site-header {
	background: transparent;
	border-bottom: none;
	position: absolute;
	inset-inline: 0;
	z-index: 20;
}

/* Logo sizing — driven by Theme Settings */
.site-logo-img {
	width: var(--logo-width-desktop, 180px);
	height: auto;
	padding: var(--logo-padding, 0);
}
@media (max-width: 782px) {
	.site-logo-img { width: var(--logo-width-mobile, 130px); }
}
.site-title-text {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 1.4rem;
	color: var(--color-secondary);
	text-decoration: none;
}

/* Header search */
.fs-header-search-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.4rem;
	display: inline-flex;
}
.fs-header-search-panel {
	border-top: 1px solid #eee;
	padding-block: 1rem;
	background: #fff;
}
.fs-header-search-panel input[type="search"] {
	width: 100%;
	padding: 0.6rem 1rem;
	border: 1px solid #ddd;
	border-radius: 4px;
}
.header-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
}

/* Hamburger — hidden by default; the wp_head-generated media query
   (breakpoint is user-configurable via Theme Settings) shows it below
   the configured breakpoint. */
.fs-hamburger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	width: 32px;
	height: 32px;
	padding: 0;
}
.fs-hamburger span {
	display: block;
	height: 2px;
	background: var(--color-secondary);
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.fs-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.fs-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.fs-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -------------------- Mobile menu -------------------- */
.fs-mobile-menu-overlay {
	position: fixed;
	inset: 0;
	background: var(--mobile-menu-overlay-color, rgba(0,0,0,0.6));
	z-index: 199;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}
.fs-mobile-menu-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

.fs-mobile-menu {
	position: fixed;
	top: 0;
	bottom: 0;
	width: min(320px, 85vw);
	background: #fff;
	z-index: 200;
	padding: clamp(1.5rem, 5vw, 2.5rem);
	overflow-y: auto;
	transition: transform 0.3s ease;
}
.fs-mobile-menu-close {
	background: none;
	border: none;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	margin-bottom: 1.5rem;
}
.fs-mobile-nav ul {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
}
.fs-mobile-nav a {
	display: block;
	padding: 0.75rem 0;
	color: var(--color-secondary);
	text-decoration: none;
	font-weight: 600;
	font-size: 1.1rem;
	border-bottom: 1px solid #f0f0f0;
}
.fs-mobile-menu-cta {
	display: block;
	text-align: center;
	margin-bottom: 1.5rem;
}
.fs-mobile-menu-social {
	padding-top: 1rem;
	border-top: 1px solid #f0f0f0;
}

/* Slide from right (default) */
body.mobile-menu-type-slide-right .fs-mobile-menu { right: 0; transform: translateX(100%); }
body.mobile-menu-type-slide-right .fs-mobile-menu.is-open { transform: translateX(0); }

/* Slide from left */
body.mobile-menu-type-slide-left .fs-mobile-menu { left: 0; transform: translateX(-100%); }
body.mobile-menu-type-slide-left .fs-mobile-menu.is-open { transform: translateX(0); }

/* Full-screen overlay */
body.mobile-menu-type-full-screen .fs-mobile-menu {
	width: 100vw;
	left: 0;
	transform: translateY(-100%);
	display: flex;
	flex-direction: column;
	justify-content: center;
}
body.mobile-menu-type-full-screen .fs-mobile-menu.is-open { transform: translateY(0); }
body.mobile-menu-type-full-screen .fs-mobile-nav a { font-size: 1.5rem; text-align: center; border-bottom: none; }

/* Dropdown below header */
body.mobile-menu-type-dropdown .fs-mobile-menu {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	width: 100%;
	bottom: auto;
	transform: translateY(-10px);
	opacity: 0;
	pointer-events: none;
	box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
body.mobile-menu-type-dropdown .fs-mobile-menu.is-open {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}
body.mobile-menu-type-dropdown .fs-mobile-menu-overlay { display: none !important; }

.main-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(0.75rem, 2vw, 2rem);
	list-style: none;
	margin: 0;
	padding: 0;
}
.main-navigation a {
	color: var(--color-secondary);
	text-decoration: none;
	font-weight: 600;
}
.main-navigation a:hover { color: var(--color-primary); }

/* -------------------- Social links (shared: header top bar + footer) -------------------- */
.fs-social-links {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}
.fs-social-links a {
	text-decoration: none;
	font-weight: 600;
}
.footer-social-links {
	margin-bottom: 1.5rem;
}

/* -------------------- Footer -------------------- */
.site-footer {
	background: var(--color-secondary);
	color: #fff;
	padding-block: clamp(2rem, 5vw, 4rem);
}
.site-footer a { color: #fff; }
.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 2rem;
	margin-bottom: 2rem;
}
.footer-bottom {
	border-top: 1px solid rgba(255,255,255,0.15);
	padding-top: 1.5rem;
	font-size: 0.875rem;
	opacity: 0.8;
}

/* -------------------- Buttons -------------------- */
.fs-btn {
	display: inline-block;
	padding: 0.75em 1.5em;
	background: var(--color-primary);
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
	border: none;
	cursor: pointer;
}
.fs-btn:hover { opacity: 0.9; }
.fs-btn--accent { background: var(--color-accent); color: var(--color-secondary); }
