/*
Theme Name:  ScamWise Seniors
Theme URI:   https://scamwiseseniors.com
Description: Thin classic theme providing header/footer chrome only. All page content is rendered by the scamwise-directory plugin via shortcodes.
Version:     0.1.0
Author:      ScamWise Seniors
Text Domain: scamwise-theme
Requires at least: 6.3
Requires PHP: 7.4
*/

/* =============================================================================
   DESIGN TOKENS — match demo (:root variables from 01-homepage-v2.html)
   ============================================================================= */
:root {
	--sws-primary:          #FFDC0F;
	--sws-primary-hover:    #E5C600;
	--sws-primary-light:    #FFF9DB;
	--sws-primary-text:     #1A1A1A;

	--sws-dark:             #1A1A1A;
	--sws-dark-medium:      #2D2D2D;
	--sws-dark-light:       #3D3D3D;

	--sws-text:             #1A1A1A;
	--sws-text-secondary:   #525252;
	--sws-text-muted:       #6B6B6B; /* WCAG AA (~5:1 on white); was #A3A3A3 (2.5:1, failed) */
	--sws-text-on-dark:     #FFFFFF;
	--sws-text-on-dark-muted: rgba(255,255,255,0.82); /* aligned to plugin canon */

	--sws-border:           #E5E5E5;
	--sws-bg:               #FAFAFA;
	--sws-bg-alt:           #F5F5F5;
	--sws-white:            #FFFFFF;

	/* Trust-band colours — `-dark` aligned to the plugin's WCAG-AA-tuned canon
	   (was the un-tuned demo hues #16A34A / #D97706 / #DC2626). */
	--sws-safe:             #22C55E;
	--sws-safe-dark:        #15803D;
	--sws-safe-light:       #DCFCE7;
	--sws-warning:          #F59E0B;
	--sws-warning-dark:     #A14E0B;
	--sws-warning-light:    #FEF3C7;
	--sws-danger:           #EF4444;
	--sws-danger-dark:      #B91C1C;
	--sws-danger-light:     #FEE2E2;

	/* Shadows */
	--sws-shadow-sm:        0 1px 3px rgba(0,0,0,0.1);
	--sws-shadow-md:        0 4px 12px rgba(0,0,0,0.1);
	--sws-shadow-lg:        0 8px 30px rgba(0,0,0,0.15);

	/* Radii */
	--sws-radius-sm:        4px;
	--sws-radius-md:        8px;
	--sws-radius-lg:        12px;
	--sws-radius-xl:        16px;
	--sws-radius-2xl:       20px;
	--sws-radius-full:      9999px;

	/* Typography — identical to the plugin's stacks so the shared --sws-font-*
	   variables resolve the same regardless of stylesheet cascade order. */
	--sws-font-body:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--sws-font-display:     'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

	/* Senior-friendly minimum sizes */
	--sws-font-base:        18px;
	--sws-font-sm:          16px;
	--sws-font-xs:          14px;
	--sws-tap-min:          48px; /* WCAG 2.5.5 large target */
}

/* =============================================================================
   RESET / BASE
   ============================================================================= */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: var(--sws-font-base);
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	font-family: var(--sws-font-body);
	background: var(--sws-bg);
	color: var(--sws-text);
	line-height: 1.6;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* =============================================================================
   SKIP LINK (accessibility — WCAG 2.4.1)
   ============================================================================= */
.sws-skip-link {
	position: absolute;
	top: -9999px;
	left: 6px;
	z-index: 9999;
	padding: 12px 20px;
	background: var(--sws-dark);
	color: var(--sws-primary);
	font-family: var(--sws-font-body);
	font-size: var(--sws-font-sm);
	font-weight: 700;
	text-decoration: none;
	border-radius: 0 0 var(--sws-radius-md) var(--sws-radius-md);
	border: 2px solid var(--sws-primary);
	outline: none;
}

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

/* =============================================================================
   SITE HEADER — yellow bar (matches demo .site-header)
   ============================================================================= */
.site-header {
	background: var(--sws-primary);
	padding: 16px 24px;
	position: sticky;
	top: 0;
	z-index: 1002; /* above the off-canvas panel (1001) so the close toggle stays tappable */
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sws-header-container {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

/* --- Logo ------------------------------------------------------------------ */
.sws-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	flex-shrink: 0;
}

.sws-logo__icon {
	width: 44px;
	height: 44px;
	background: var(--sws-dark);
	border-radius: var(--sws-radius-md);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.sws-logo__icon svg {
	width: 28px;
	height: 28px;
	display: block;
}

.sws-logo__text {
	font-family: var(--sws-font-display);
	font-size: 22px;
	font-weight: 800;
	color: var(--sws-dark);
	white-space: nowrap;
}

.sws-logo__text span {
	color: var(--sws-dark-medium);
}

/* --- Primary nav ---------------------------------------------------------- */
.sws-primary-nav {
	display: flex;
	align-items: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* wp_nav_menu wraps the list in a <div>; target the inner ul */
.sws-primary-nav ul,
.sws-primary-nav .menu {
	display: flex;
	align-items: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.sws-primary-nav li {
	list-style: none;
}

.sws-primary-nav a {
	display: inline-flex;
	align-items: center;
	min-height: var(--sws-tap-min);
	padding: 0 12px;
	color: var(--sws-dark);
	text-decoration: none;
	font-weight: 600;
	font-size: var(--sws-font-xs);
	border-radius: var(--sws-radius-md);
	transition: background 0.2s, color 0.2s;
	white-space: nowrap;
}

.sws-primary-nav a:hover,
.sws-primary-nav a:focus-visible,
.sws-primary-nav .current-menu-item > a,
.sws-primary-nav .current-page-ancestor > a {
	background: rgba(0,0,0,0.08);
	color: var(--sws-dark);
	outline: none;
}

/* "Report a Scam" CTA — dark button in nav */
.sws-primary-nav .menu-item-report-a-scam > a,
.sws-primary-nav .menu-item-type-custom.sws-nav-cta > a {
	background: var(--sws-dark);
	color: var(--sws-white);
	padding: 10px 20px;
	border-radius: var(--sws-radius-md);
	font-weight: 700;
}

.sws-primary-nav .menu-item-report-a-scam > a:hover,
.sws-primary-nav .menu-item-report-a-scam > a:focus-visible,
.sws-primary-nav .menu-item-type-custom.sws-nav-cta > a:hover,
.sws-primary-nav .menu-item-type-custom.sws-nav-cta > a:focus-visible {
	background: var(--sws-dark-medium);
	color: var(--sws-white);
}

/* Fallback nav (when no menu is assigned) */
.sws-nav-fallback {
	display: flex;
	align-items: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.sws-nav-fallback li {
	list-style: none;
}

.sws-nav-fallback a {
	display: inline-flex;
	align-items: center;
	min-height: var(--sws-tap-min);
	padding: 0 12px;
	color: var(--sws-dark);
	text-decoration: none;
	font-weight: 600;
	font-size: var(--sws-font-xs);
	border-radius: var(--sws-radius-md);
	transition: background 0.2s, color 0.2s;
	white-space: nowrap;
}

.sws-nav-fallback a:hover,
.sws-nav-fallback a:focus-visible {
	background: rgba(0,0,0,0.08);
}

/* Active page — the current nav item is highlighted so visitors know where they
   are (the CTA stays a dark button). Covers the fallback nav (aria-current set
   in header.php) and an assigned wp_nav_menu. */
.sws-nav-fallback li:not(.sws-nav-cta) > a[aria-current="page"],
.sws-primary-nav li:not(.sws-nav-cta) > a[aria-current="page"] {
	background: rgba(0, 0, 0, 0.10);
	font-weight: 700;
}

.sws-nav-fallback .sws-nav-cta a {
	background: var(--sws-dark);
	color: var(--sws-white);
	padding: 10px 20px;
	border-radius: var(--sws-radius-md);
	font-weight: 700;
}

.sws-nav-fallback .sws-nav-cta a:hover,
.sws-nav-fallback .sws-nav-cta a:focus-visible {
	background: var(--sws-dark-medium);
	color: var(--sws-white);
}

/* Mobile menu toggle (visible only on small screens) */
.sws-menu-toggle {
	display: none;
	background: none;
	border: 2px solid var(--sws-dark);
	border-radius: var(--sws-radius-md);
	padding: 8px 12px;
	cursor: pointer;
	font-size: var(--sws-font-xs);
	font-weight: 700;
	color: var(--sws-dark);
	min-height: var(--sws-tap-min);
	min-width: var(--sws-tap-min);
	transition: background 0.2s, color 0.2s;
}

.sws-menu-toggle:hover,
.sws-menu-toggle:focus-visible {
	background: var(--sws-dark);
	color: var(--sws-white);
	outline: none;
}

/* On desktop the panel wrapper is transparent to layout (its children act as
   direct header-flex items); the close button + backdrop only exist on mobile. */
.sws-nav-panel {
	display: contents;
}

.sws-nav-close {
	display: none;
}

/* Off-canvas backdrop — present only on small screens (see the media query). */
.sws-nav-backdrop {
	display: none;
}

/* =============================================================================
   MAIN CONTENT AREA
   ============================================================================= */
#main {
	flex: 1;
	outline: none; /* skip-link target: no visible ring on programmatic focus */
}

/* =============================================================================
   SITE FOOTER — dark bar (matches demo .site-footer)
   ============================================================================= */
.site-footer {
	background: var(--sws-dark);
	color: var(--sws-text-on-dark);
	padding: 60px 24px 32px;
}

.sws-footer-container {
	max-width: 1100px;
	margin: 0 auto;
}

/* Top row: brand block on the left, the three link columns grouped on the right
   (matches the mockup footer). */
.sws-footer-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 48px;
	margin-bottom: 40px;
}

/* Brand block: logo above a short description, capped so it sits to the left. */
.sws-footer-brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	max-width: 360px;
}

/* The three link columns side by side, to the right of the brand. */
.sws-footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 64px;
}

.sws-footer-brand .sws-footer-logo {
	display: inline-flex;
	margin: 0;
	flex-shrink: 0;
}

/* The shared logo recolored for the dark footer: a subtle elevated panel keeps
   the full shield + check mark legible against the dark bar, and the wordmark
   goes light. */
.site-footer .sws-logo__icon {
	background: rgba(255, 255, 255, 0.08);
}

.site-footer .sws-logo__text {
	color: var(--sws-white);
}

.site-footer .sws-logo__text span {
	color: var(--sws-text-on-dark-muted);
}

/* Short description under the logo, at the same size as the menu links. */
.sws-footer-about {
	margin: 0;
	color: var(--sws-text-on-dark-muted);
	font-size: var(--sws-font-xs);
	line-height: 1.5;
}

.sws-footer-col h4 {
	font-family: var(--sws-font-body);
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 20px;
	color: var(--sws-primary);
}

.sws-footer-col a {
	display: block;
	color: var(--sws-text-on-dark-muted);
	text-decoration: none;
	font-size: var(--sws-font-xs);
	padding: 6px 0;
	min-height: 36px; /* touch-friendly */
	transition: color 0.2s;
}

.sws-footer-col a:hover,
.sws-footer-col a:focus-visible {
	color: var(--sws-primary);
	outline: none;
}

.sws-footer-bottom {
	border-top: 1px solid rgba(255,255,255,0.1);
	padding-top: 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}

.sws-footer-legal {
	display: flex;
	gap: 24px;
	flex-wrap: wrap;
}

.sws-footer-legal a {
	color: var(--sws-text-on-dark-muted);
	text-decoration: none;
	font-size: 13px;
	min-height: 36px;
	display: inline-flex;
	align-items: center;
	transition: color 0.2s;
}

.sws-footer-legal a:hover,
.sws-footer-legal a:focus-visible {
	color: var(--sws-white);
	outline: none;
}

/* Copyright sits in the bottom row, opposite the legal links (space-between). */
.sws-footer-copyright {
	margin: 0;
	color: var(--sws-text-on-dark-muted);
	font-size: 13px;
}

/* =============================================================================
   GLOBAL FOCUS STYLES (WCAG 2.4.7 / 2.4.11)
   ============================================================================= */
:focus-visible {
	outline: 3px solid var(--sws-dark);
	outline-offset: 2px;
	border-radius: var(--sws-radius-sm);
}

/* On dark backgrounds swap focus ring to primary yellow */
.site-footer :focus-visible {
	outline-color: var(--sws-primary);
}

/* =============================================================================
   RESPONSIVE — mobile nav
   ============================================================================= */
@media (max-width: 768px) {
	/* Menu (toggle) first — on the left; logo last — on the right. */
	.sws-menu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		order: -1;
	}

	.sws-logo {
		order: 1;
	}

	/* Off-canvas panel: slides in from the left, full height, over a backdrop. The
	   panel (not the header toggle) carries the close button, since it covers the
	   toggle when open. */
	.sws-nav-panel {
		display: flex;
		flex-direction: column;
		gap: 10px;
		position: fixed;
		top: 0; /* full-height off-canvas panel (its own close button sits top-right) */
		left: 0;
		bottom: 0;
		width: min(82vw, 320px);
		background: var(--sws-primary);
		padding: 16px 20px 24px;
		box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
		overflow-y: auto;
		z-index: 1001;
		transform: translateX(-100%);
		transition: transform 0.28s ease;
	}

	.sws-nav-panel.is-open {
		transform: translateX(0);
	}

	/* Close button — top-right inside the panel. */
	.sws-nav-close {
		display: flex;
		align-items: center;
		justify-content: center;
		align-self: flex-end;
		flex: none;
		width: 44px;
		height: 44px;
		padding: 0;
		background: none;
		border: 2px solid var(--sws-dark);
		border-radius: var(--sws-radius-md);
		color: var(--sws-dark);
		font-size: 20px;
		line-height: 1;
		cursor: pointer;
		transition: background 0.2s, color 0.2s;
	}

	.sws-nav-close:hover,
	.sws-nav-close:focus-visible {
		background: var(--sws-dark);
		color: var(--sws-white);
		outline: none;
	}

	/* The list inside the panel is a simple vertical stack. */
	.sws-primary-nav,
	.sws-nav-fallback,
	.sws-primary-nav ul,
	.sws-primary-nav .menu {
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
		width: 100%;
		margin: 0;
	}

	.sws-primary-nav a,
	.sws-nav-fallback a {
		font-size: var(--sws-font-sm);
		width: 100%;
		justify-content: flex-start;
	}

	/* Dim backdrop + scroll lock while the off-canvas menu is open. */
	.sws-nav-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.5);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.28s ease;
		z-index: 1000;
	}

	body.sws-nav-open .sws-nav-backdrop {
		opacity: 1;
		pointer-events: auto;
	}

	body.sws-nav-open {
		overflow: hidden;
	}

	.sws-footer-grid {
		gap: 32px;
	}

	.sws-footer-links {
		gap: 40px;
	}

	.sws-footer-bottom {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 480px) {
	.site-header {
		padding: 12px 16px;
	}

	.sws-logo__text {
		font-size: 18px;
	}

	.sws-footer-grid {
		gap: 24px;
	}

	.sws-footer-links {
		flex-direction: column;
		gap: 16px;
	}
}

/* =============================================================================
   PRINT
   ============================================================================= */
@media print {
	.site-header,
	.site-footer,
	.sws-skip-link,
	.sws-menu-toggle {
		display: none;
	}
}
