/* ==========================================================================
   Responsive layer — loaded after reset/style/grid/demo.
   Desktop (>900px) is untouched; this file only adds behaviour
   for tablet/mobile widths plus a couple of site-wide a11y baselines.
   ========================================================================== */

/* Baseline a11y: restore a visible keyboard focus ring (style.css removes
   the default outline globally via `a{outline:none}`). Doesn't change the
   default (mouse) appearance of anything. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 2px solid #619543;
	outline-offset: 2px;
}

/* Respect reduced-motion preference for anything animated (menu toggle,
   scrollTo, slider transitions). */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

@media (max-width: 900px) {

	/* ---- Escape the fixed 960px canvas ---- */
	html, body {
		min-width: 0;
		width: 100%;
		overflow-x: hidden;
	}
	.main,
	.container_12 {
		width: 100%;
		min-width: 0;
		max-width: 100%;
		box-sizing: border-box;
		padding-left: 15px;
		padding-right: 15px;
	}

	/* ---- Header: the logo/slider/nav were all built with
	   position:absolute (the .txt class) against a fixed-width
	   parent. Put them back into normal document flow so they
	   stack instead of overlapping. ---- */
	.tail-menu {
		height: auto;
		background-color: #154483; /* solid fallback: tail_menu.gif only repeats horizontally */
	}
	.tail-menu .main {
		padding-top: 12px;
		padding-bottom: 12px;
	}
	.tail-menu .txt {
		position: static;
		margin-bottom: 1rem;
	}

	/* Decorative rotating banner doesn't fit a phone-width viewport
	   at its native 651x453 size — hide it rather than force a
	   pixel-locked carousel to scale. */
	.slider-box {
		display: none;
	}
	.tail-slider {
		height: auto;
	}

	/* Logo: scale the fixed 330x311 box down and centre it.
	   aspect-ratio keeps height correct for the actual logo.png
	   proportions (330x156) automatically as width changes, and
	   background-position resets the desktop rule's "0px 80px"
	   offset (tuned for the original much-taller 311px box, which
	   otherwise pushes the visible logo toward the bottom edge). */
	.logo a {
		width: 160px;
		aspect-ratio: 330 / 156;
		height: auto;
		background-size: contain;
		background-position: center;
		margin: 0 auto;
	}

	/* ---- Nav: stack vertically, full width, no fixed per-item box.
	   Always visible (no JS-gated toggle) so it works with zero JS. ---- */
	.tail-menu nav {
		width: 100%;
	}
	.sf-menu {
		width: 100%;
		left: 0;
	}
	.sf-menu li {
		float: none;
		width: 100%;
		height: auto;
		margin: 0;
		border-bottom: 1px solid rgba(255,255,255,0.15);
	}
	.sf-menu > li > a {
		height: auto;
		padding: 14px 10px;
	}

	/* ---- Header-box feature panels (home page) ---- */
	.header-box .grid_4 {
		width: 100%;
		float: none;
		margin: 0 0 20px 0;
	}
	.header-box .title-marker {
		position: static;
		display: block;
		line-height: 1;
		margin: 18px 0 6px 0;
	}
	.header-box h2 {
		padding: 0;
		margin: 0 0 10px 0;
	}
	.header-box p.text-top {
		padding: 0;
		margin: 0 0 10px 0;
	}

	/* ---- Content columns (Our Advantages / Featured Services,
	   Contact Us) ---- */
	.container_12 .grid_7,
	.container_12 .grid_4 {
		width: 100%;
		float: none;
		margin: 0 0 20px 0;
	}

	/* ---- Images: fluid by default ---- */
	img {
		max-width: 100%;
		height: auto;
	}
	.abtmephoto img {
		width: 130px; /* keep the deliberate profile-photo size */
	}
	.box-img .fright,
	.box-img .fleft {
		float: none;
		display: flex;
		align-items: flex-start;
		gap: 20px;
		width: 100%;
		margin-left: 0;
		margin-bottom: 20px;
	}
	/* The two icons are different native widths (85px vs 63px), which
	   is what threw the text columns out of alignment — give both a
	   matching column width so "Personal Professional Service" and
	   "Timely communication" start at the same x position. */
	.box-img .fright img,
	.box-img .fleft img {
		float: none;
		margin: 0;
		flex: 0 0 70px;
		width: 70px;
		height: auto;
	}
	.box-img .fright p,
	.box-img .fleft p {
		margin: 0;
		flex: 1;
	}

	/* imptList buttons (Featured Services on the home page, the
	   Resources links, and the Important Dates month links) are all
	   a fixed 200px width from the desktop design, sitting
	   left-aligned on a full-width phone screen — stretch them to
	   look like proper mobile buttons instead. The 55px right padding
	   on the wrapping column (home page only) was eating into that
	   width unnecessarily.
	   Note: the base rule is `ul.imptList li a` (specificity 0,1,3) —
	   matching that prefix here, not just `.imptList li a`, so this
	   override actually wins instead of losing on specificity. */
	.right-indent {
		padding-right: 0;
	}
	.imptList {
		float: none;
		margin-right: 0;
	}
	ul.imptList li a {
		width: 100%;
		box-sizing: border-box;
	}

	/* ---- Contact page map ---- */
	.contact-left iframe {
		width: 100% !important;
		max-width: 970px;
	}

	/* ---- Footer nav wraps naturally; just give it breathing room ---- */
	footer p {
		padding-left: 10px;
		padding-right: 10px;
	}
}

@media (max-width: 480px) {
	.logo a {
		width: 120px;
		height: auto;
	}
	.header-box .title-marker {
		font-size: 60px;
		line-height: 72px;
	}
}
