/*
Theme Name: FSG
Theme URI: https://foodsafetyguy.com/
Author: FoodSafetyGuy
Description: Lightweight classic theme for FoodSafetyGuy. No page builder, no external font or script dependencies, full WooCommerce support. Replaces Divi.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fsg
Tags: e-commerce, accessibility-ready, custom-menu, translation-ready
*/

/* --------------------------------------------------------------------------
   Tokens — carried over from the previous Divi configuration so the site
   keeps its identity. Change them here, not in the rules below.
   -------------------------------------------------------------------------- */

:root {
	--fsg-navy:        #1c3664;
	--fsg-navy-dark:   #12224180;
	--fsg-red:         #cb2026;
	--fsg-red-dark:    #a4171c;
	--fsg-ink:         #1a1a1a;
	--fsg-muted:       #5b6270;
	--fsg-rule:        #d8dce3;
	--fsg-surface:     #ffffff;
	--fsg-surface-alt: #f4f6f9;
	--fsg-footer:      #222222;
	--fsg-bottom-bar:  #474747;

	--fsg-font: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

	--fsg-content: 1200px;
	--fsg-narrow:  760px;
	--fsg-gap:     clamp(1rem, 3vw, 2rem);
	--fsg-radius:  3px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

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

body {
	margin: 0;
	background: var(--fsg-surface);
	color: var(--fsg-ink);
	font-family: var(--fsg-font);
	font-size: 1rem;
	line-height: 1.65;
	font-weight: 400;
}

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

a { color: var(--fsg-navy); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--fsg-red); }

:focus-visible {
	outline: 3px solid var(--fsg-red);
	outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .6em;
	line-height: 1.2;
	font-weight: 700;
	color: var(--fsg-navy);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p, ul, ol, table, figure, details { margin: 0 0 1.25rem; }

hr {
	border: 0;
	border-top: 1px solid var(--fsg-rule);
	margin: 2rem 0;
}

table {
	width: 100%;
	border-collapse: collapse;
}

th, td {
	padding: .6rem .75rem;
	border: 1px solid var(--fsg-rule);
	text-align: left;
	vertical-align: top;
}

th { background: var(--fsg-surface-alt); }

blockquote {
	margin: 0 0 1.25rem;
	padding: .25rem 0 .25rem 1.25rem;
	border-left: 4px solid var(--fsg-red);
	color: var(--fsg-muted);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 200;
	padding: .75rem 1.25rem;
	background: var(--fsg-navy);
	color: #fff;
}

.skip-link:focus {
	left: 0;
	color: #fff;
}

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

.fsg-wrap {
	width: min(100% - 2rem, var(--fsg-content));
	margin-inline: auto;
}

.fsg-main { padding: 2.5rem 0 3.5rem; }

.fsg-entry > *:last-child { margin-bottom: 0; }

.fsg-page-header { margin-bottom: 1.75rem; }

.fsg-page-header p { color: var(--fsg-muted); margin: 0; }

/* --------------------------------------------------------------------------
   Utility bar
   -------------------------------------------------------------------------- */

.fsg-utility {
	background: var(--fsg-navy);
	color: #fff;
	font-size: .875rem;
}

.fsg-utility a { color: #fff; text-decoration: none; }
.fsg-utility a:hover, .fsg-utility a:focus { text-decoration: underline; color: #fff; }

.fsg-utility .fsg-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	min-height: 40px;
	padding-block: .35rem;
}

.fsg-utility-contact {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.fsg-header {
	border-bottom: 3px solid var(--fsg-navy);
	background: var(--fsg-surface);
}

.fsg-header .fsg-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: .9rem;
}

.fsg-brand {
	display: inline-flex;
	align-items: center;
	gap: .75rem;
	text-decoration: none;
	color: var(--fsg-navy);
	font-weight: 700;
	font-size: 1.35rem;
}

.fsg-brand img { height: 54px; width: auto; }

.fsg-nav-toggle {
	display: none;
	align-items: center;
	gap: .5rem;
	padding: .55rem .9rem;
	border: 1px solid var(--fsg-navy);
	border-radius: var(--fsg-radius);
	background: var(--fsg-surface);
	color: var(--fsg-navy);
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.fsg-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fsg-nav > ul {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1.25rem;
	align-items: center;
}

.fsg-nav li { position: relative; }

.fsg-nav a {
	display: block;
	padding: .5rem 0;
	color: var(--fsg-navy);
	font-size: .95rem;
	font-weight: 500;
	text-decoration: none;
}

.fsg-nav a:hover,
.fsg-nav a:focus,
.fsg-nav .current-menu-item > a,
.fsg-nav .current-menu-ancestor > a {
	color: var(--fsg-red);
	text-decoration: underline;
}

.fsg-nav .sub-menu {
	position: absolute;
	left: 0;
	top: 100%;
	z-index: 60;
	min-width: 240px;
	padding: .4rem 0;
	background: var(--fsg-surface);
	border: 1px solid var(--fsg-rule);
	border-top: 3px solid var(--fsg-red);
	box-shadow: 0 8px 20px rgba(18, 34, 65, .14);
	visibility: hidden;
	opacity: 0;
	transition: opacity .15s ease;
}

.fsg-nav .sub-menu .sub-menu { left: 100%; top: -.4rem; }

.fsg-nav li:hover > .sub-menu,
.fsg-nav li:focus-within > .sub-menu {
	visibility: visible;
	opacity: 1;
}

.fsg-nav .sub-menu a { padding: .5rem 1rem; }

@media (max-width: 900px) {
	.fsg-nav-toggle { display: inline-flex; }

	.fsg-nav {
		display: none;
		flex-basis: 100%;
	}

	.fsg-nav.is-open { display: block; }

	.fsg-nav > ul { display: block; }

	.fsg-nav li { border-top: 1px solid var(--fsg-rule); }

	.fsg-nav a { padding: .7rem 0; }

	.fsg-nav .sub-menu {
		position: static;
		visibility: visible;
		opacity: 1;
		border: 0;
		box-shadow: none;
		padding: 0 0 0 1rem;
	}
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.fsg-button,
button,
input[type="submit"],
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	display: inline-block;
	padding: .7rem 1.4rem;
	border: 1px solid var(--fsg-navy);
	border-radius: var(--fsg-radius);
	background: var(--fsg-navy);
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}

.fsg-button:hover,
.fsg-button:focus,
button:hover,
input[type="submit"]:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
	background: var(--fsg-red);
	border-color: var(--fsg-red);
	color: #fff;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt {
	background: var(--fsg-red);
	border-color: var(--fsg-red);
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
	background: var(--fsg-red-dark);
	border-color: var(--fsg-red-dark);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="date"],
select,
textarea {
	width: 100%;
	max-width: 100%;
	padding: .6rem .7rem;
	border: 1px solid #7a8190;
	border-radius: var(--fsg-radius);
	background: #fff;
	color: var(--fsg-ink);
	font: inherit;
}

label { font-weight: 500; }

/* --------------------------------------------------------------------------
   Content helpers emitted by the migration
   -------------------------------------------------------------------------- */

.fsg-figure { margin: 0 0 1.25rem; }

.fsg-panel {
	padding: var(--fsg-gap);
	margin-bottom: 1.5rem;
	background: var(--fsg-surface-alt);
	border-left: 4px solid var(--fsg-navy);
}

.fsg-toggle {
	padding: .85rem 1rem;
	border: 1px solid var(--fsg-rule);
	border-radius: var(--fsg-radius);
}

.fsg-toggle summary {
	font-weight: 700;
	color: var(--fsg-navy);
	cursor: pointer;
}

.fsg-toggle[open] summary { margin-bottom: .75rem; }

.fsg-legacy-module { margin-bottom: 1.25rem; }

/* --------------------------------------------------------------------------
   Posts
   -------------------------------------------------------------------------- */

.fsg-post-list { display: grid; gap: 2.5rem; }

.fsg-post-card h2 { margin-bottom: .35rem; }

.fsg-meta {
	margin-bottom: .75rem;
	color: var(--fsg-muted);
	font-size: .875rem;
}

.fsg-pagination {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--fsg-rule);
}

.fsg-pagination .page-numbers {
	display: inline-block;
	padding: .35rem .7rem;
	margin-right: .25rem;
	border: 1px solid var(--fsg-rule);
	text-decoration: none;
}

.fsg-pagination .current {
	background: var(--fsg-navy);
	border-color: var(--fsg-navy);
	color: #fff;
}

/* --------------------------------------------------------------------------
   WooCommerce
   -------------------------------------------------------------------------- */

.woocommerce div.product .product_title { margin-bottom: .35rem; }

.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: var(--fsg-navy);
	font-size: 1.6rem;
	font-weight: 700;
}

.woocommerce div.product p.price del { color: var(--fsg-muted); font-weight: 400; }
.woocommerce div.product p.price ins { color: var(--fsg-red); text-decoration: none; }

.woocommerce ul.products li.product .price {
	color: var(--fsg-navy);
	font-weight: 700;
}

.woocommerce span.onsale {
	background: var(--fsg-red);
	color: #fff;
}

.woocommerce div.product form.cart .variations th,
.woocommerce div.product form.cart .variations td {
	border: 0;
	padding: .35rem 0;
}

.woocommerce div.product form.cart .variations select { max-width: 100%; }

.woocommerce-message,
.woocommerce-info {
	border-top-color: var(--fsg-navy);
}

.woocommerce-message::before,
.woocommerce-info::before {
	color: var(--fsg-navy);
}

.woocommerce-error { border-top-color: var(--fsg-red); }
.woocommerce-error::before { color: var(--fsg-red); }

.woocommerce-breadcrumb {
	margin-bottom: 1.5rem !important;
	color: var(--fsg-muted);
	font-size: .875rem;
}

.woocommerce .quantity input.qty { width: 5rem; text-align: center; }

.fsg-cart-link {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	font-weight: 500;
}

.fsg-cart-count {
	display: inline-block;
	min-width: 1.4rem;
	padding: 0 .35rem;
	border-radius: 999px;
	background: var(--fsg-red);
	color: #fff;
	font-size: .78rem;
	line-height: 1.4rem;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.fsg-footer {
	background: var(--fsg-footer);
	color: #e6e8ec;
	padding: 2.5rem 0 0;
}

.fsg-footer a { color: #fff; }
.fsg-footer a:hover, .fsg-footer a:focus { color: #ffb3b6; }

.fsg-footer-widgets {
	display: grid;
	gap: var(--fsg-gap);
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	padding-bottom: 2rem;
}

.fsg-footer h2, .fsg-footer h3 { color: var(--fsg-red); font-size: 1.05rem; }

.fsg-footer ul { list-style: none; padding: 0; margin: 0; }
.fsg-footer li { padding: .2rem 0; }

.fsg-footer-menu { background: var(--fsg-navy); }

.fsg-footer-menu ul {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.5rem;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: .85rem 0;
}

.fsg-footer-menu a {
	color: #fff;
	font-size: .9rem;
	text-decoration: none;
}

.fsg-footer-menu a:hover, .fsg-footer-menu a:focus { text-decoration: underline; color: #fff; }

.fsg-bottom-bar {
	background: var(--fsg-bottom-bar);
	color: #fff;
	font-size: .8rem;
	text-align: center;
	padding: 1.25rem 0;
}

.fsg-bottom-bar p { margin: 0 0 .35rem; }
.fsg-bottom-bar p:last-child { margin: 0; }

/* --------------------------------------------------------------------------
   Print & motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
}

@media print {
	.fsg-utility, .fsg-nav, .fsg-nav-toggle, .fsg-footer-menu { display: none; }
	body { color: #000; }
}
