/* ==========================================================================
   TruckAccidentAid — layout: header, navigation, mobile menu, sticky CTA, sections, footer
   Breakpoints: utility bar >= 760px, desktop nav >= 1200px
   ========================================================================== */

/* Logo
   ========================================================================== */

.logo {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 10px;
	color: var(--c-ink);
	text-decoration: none;
}

.logo:hover {
	color: var(--c-ink);
}

.logo__mark {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 30px;
	height: 30px;
	padding: 0 7px;
	border-radius: var(--radius-xl);
	background: var(--c-green);
}

.logo__mark span {
	height: 3px;
	border-radius: 1px;
	background: var(--c-surface);
}

.logo__mark span:nth-child(2) {
	width: 60%;
	background: var(--c-orange);
}

/* Image logo (assets/img/logo.webp, 432×80 = 2× the largest displayed size). */
.logo__img {
	display: block;
	width: auto;
	height: 40px;
}

.logo__text {
	font-family: var(--f-serif);
	font-size: 21px;
	font-weight: 700;
	letter-spacing: -.01em;
}

.logo__text b {
	color: var(--c-accent);
	font-weight: inherit;
}

.logo--dark,
.logo--dark:hover {
	color: var(--c-on-dark);
}

.logo--dark .logo__mark {
	background: var(--c-logo-dark);
}

.logo--dark .logo__text b {
	color: var(--c-orange);
}

/* Header
   ========================================================================== */

.site-header {
	position: relative;
	z-index: 50;
	color: var(--c-ink);
}

.utility-bar {
	background: var(--c-dark);
	color: var(--c-dark-text);
	font-size: 13px;
}

.utility-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 36px;
}

.utility-bar__note {
	display: flex;
	align-items: center;
	gap: 8px;
}

.utility-bar__note::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--c-manila);
}

.utility-bar__inner > nav {
	margin-left: auto;
}

.utility-nav {
	display: flex;
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.utility-nav a {
	color: var(--c-dark-text);
	text-decoration: none;
}

.utility-nav a:hover {
	color: var(--c-on-dark);
}

/* Phones keep the "Not a law firm" note (a brand commitment); only the links go. */
@media (max-width: 759.98px) {
	.utility-bar {
		font-size: 12px;
	}

	.utility-bar__inner {
		min-height: 28px;
	}

	.utility-bar__inner > nav {
		display: none;
	}
}

.masthead {
	background: var(--c-manila);
	border-bottom: 2px solid var(--c-manila-edge);
}

.masthead__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 68px;
}

.masthead__actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 10px;
}

/* Narrow phones: logo + "Get Help" + menu button must fit in one row. */
@media (max-width: 420px) {
	.masthead__inner {
		gap: 12px;
	}

	.masthead .logo {
		gap: 8px;
	}

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

	.masthead .logo__img {
		height: 34px;
	}

	.masthead__actions {
		gap: 8px;
	}

	.masthead__actions .btn {
		padding: 0 14px;
	}
}

@media (max-width: 359.98px) {
	.masthead__inner {
		gap: 8px;
	}

	.masthead .logo__text {
		font-size: 15px;
	}

	.masthead .logo__img {
		height: 28px;
	}

	.masthead__actions {
		gap: 6px;
	}

	.masthead__actions .btn {
		padding: 0 10px;
		font-size: 14px;
	}

	.masthead .menu-toggle {
		width: 40px;
		height: 40px;
	}
}

/* Desktop navigation
   ========================================================================== */

.main-nav {
	display: flex;
	flex: 1 1 auto;
	align-self: flex-end;
	justify-content: center;
	margin-bottom: -2px;
}

.main-nav__list {
	display: flex;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-nav__item {
	position: relative;
}

.main-nav__trigger {
	display: flex;
	align-items: center;
	gap: 4px;
	/* Index tabs standing on the masthead's bottom edge. */
	padding: 11px 6px 12px;
	border: 1px solid transparent;
	border-bottom: 0;
	border-radius: var(--radius-tab) var(--radius-tab) 0 0;
	background: none;
	color: var(--c-ink);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

/* 8 tabs + logo + help button between 1200 and 1440px: tighter tabs (measured on the live menu). */
@media (min-width: 1200px) and (max-width: 1439.98px) {
	.masthead__inner {
		gap: 8px;
	}

	.main-nav__trigger {
		padding-right: 4px;
		padding-left: 4px;
		font-size: 13.5px;
	}

	.main-nav__trigger .icon {
		width: 12px;
	}
}

.main-nav__trigger:hover,
.main-nav__trigger[aria-expanded="true"] {
	border-color: var(--c-manila-edge);
	background: var(--c-manila-2);
	color: var(--c-ink);
}

.main-nav__trigger[aria-expanded="true"] .icon {
	transform: rotate(180deg);
}

/* The open folder: the active tab joins the page below it. */
.main-nav__item.is-active > .main-nav__trigger {
	border-color: var(--c-manila-edge);
	background: var(--c-manila-2);
	box-shadow: 0 2px 0 var(--c-manila-2);
	color: var(--c-ink);
}

.main-nav__dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	padding-top: 2px;
}

.main-nav__dropdown--right {
	right: 0;
	left: auto;
}

.main-nav__panel {
	width: 340px;
	padding: 10px;
	border: 1px solid var(--c-line);
	border-radius: var(--radius-lg);
	background: var(--c-surface);
	box-shadow: var(--shadow-pop);
}

.main-nav__sub {
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-nav__sub--nested {
	margin: 2px 0 6px 12px;
	padding-left: 6px;
	border-left: 2px solid var(--c-line-2);
}

.main-nav__link {
	display: block;
	padding: 9px 12px;
	border-radius: var(--radius-xl);
	color: var(--c-ink);
	font-size: 14.5px;
	line-height: 1.35;
	text-decoration: none;
}

.main-nav__link:hover,
.main-nav__link[aria-current="page"] {
	background: var(--c-hover-bg);
	color: var(--c-green);
}

/* Nested hub: expands inline inside the panel. */
.main-nav__subtrigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	border: 0;
	background: none;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
}

.main-nav__subtrigger .icon {
	flex: 0 0 auto;
	transition: transform .2s;
}

.main-nav__subtrigger[aria-expanded="true"] .icon {
	transform: rotate(180deg);
}

.main-nav__group.is-active > .main-nav__subtrigger {
	color: var(--c-green);
}

.main-nav__all {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
	padding: 11px 12px 6px;
	border-top: 1px solid var(--c-line-2);
	color: var(--c-green);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.main-nav__all:hover {
	text-decoration: underline;
}

/* "View all" as the first item of a list: no separator. */
.main-nav__sub > li:first-child > .main-nav__all {
	margin-top: 0;
	padding-top: 9px;
	border-top: 0;
}

@media (max-width: 1199.98px) {
	.main-nav {
		display: none;
	}
}

/* Mobile menu
   ========================================================================== */

.menu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	background: var(--c-surface);
	color: var(--c-ink);
	cursor: pointer;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-menu {
	display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
	display: block;
}

.mobile-menu {
	position: fixed;
	top: var(--mobile-menu-top, 68px);
	right: 0;
	bottom: 0;
	left: 0;
	padding: 8px var(--gutter) 120px;
	overflow: auto;
	overscroll-behavior: contain;
	border-top: 1px solid var(--c-line);
	background: var(--c-surface);
}

.mobile-nav__item {
	border-bottom: 1px solid var(--c-line-2);
}

.mobile-nav__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 16px 0;
	border: 0;
	background: none;
	color: var(--c-ink);
	font-size: 17px;
	font-weight: 600;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.mobile-nav__trigger .icon {
	transition: transform .2s;
}

.mobile-nav__trigger[aria-expanded="true"] .icon {
	transform: rotate(180deg);
}

.mobile-nav__sub {
	display: flex;
	flex-direction: column;
	padding: 0 0 14px;
}

.mobile-nav__link {
	padding: 11px 0 11px 14px;
	border-left: 2px solid var(--c-line-2);
	color: var(--c-text);
	font-size: 16px;
	text-decoration: none;
}

.mobile-nav__all {
	padding: 11px 0 4px 14px;
	color: var(--c-green);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

.mobile-nav__subtrigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	border-top: 0;
	border-right: 0;
	border-bottom: 0;
	background: none;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
}

.mobile-nav__subtrigger .icon {
	flex: 0 0 auto;
	transition: transform .2s;
}

.mobile-nav__subtrigger[aria-expanded="true"] .icon {
	transform: rotate(180deg);
}

.mobile-nav__group.is-active > .mobile-nav__subtrigger {
	color: var(--c-green);
}

.mobile-nav__sub--nested {
	padding: 0 0 6px 14px;
}

.mobile-menu__utility {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 0;
	padding: 18px 0;
	list-style: none;
	font-size: 15px;
}

.mobile-menu__utility a {
	color: var(--c-text);
}

.mobile-menu__note {
	margin: 10px 0 0;
	color: var(--c-muted);
	font-size: 13px;
	text-align: center;
}

@media (min-width: 1200px) {
	.menu-toggle,
	.mobile-menu {
		display: none !important;
	}
}

/* Sticky CTA (mobile/tablet, after scrolling)
   ========================================================================== */

.sticky-cta {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--c-line);
	background: var(--c-surface);
	box-shadow: 0 -6px 20px rgba(var(--c-dark-rgb), .08);
	transform: translateY(100%);
	visibility: hidden;
	transition: transform .25s, visibility .25s;
}

.sticky-cta.is-visible {
	transform: none;
	visibility: visible;
}

.sticky-cta__text {
	flex: 1 1 auto;
	min-width: 0;
	color: var(--c-text);
	font-size: 13px;
	line-height: 1.3;
}

.sticky-cta__text strong {
	display: block;
	color: var(--c-ink);
	font-size: 14px;
}

.btn--sticky {
	flex: 0 0 auto;
	min-height: 46px;
}

.btn--sticky:only-child {
	flex: 1 1 auto;
}

/* Room for the bar at the end of the page, so it never covers the footer's last line. */
@media (max-width: 1199px) {
	body:has(.sticky-cta) .site-footer {
		padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
	}
}

@media (min-width: 1200px) {
	.sticky-cta {
		display: none;
	}
}

/* Breadcrumbs (guides, section pages)
   ========================================================================== */

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 clamp(24px, 4vw, 40px);
	padding: 0;
	color: var(--c-muted);
	font-size: 13.5px;
	list-style: none;
}

.breadcrumbs li + li::before {
	content: "/";
	margin-right: 6px;
}

.breadcrumbs a {
	color: var(--c-text-2);
}

.breadcrumbs [aria-current] {
	color: var(--c-ink);
}

/* Content sections (home, category, ...)
   ========================================================================== */

.section {
	--section-pad: clamp(48px, 6vw, 80px);
	padding: var(--section-pad) 0;
	border-top: 2px solid var(--c-manila-edge);
}

/* A section is a folder: its label is the index tab standing on the folder's top edge. */
.section > .container > .section-head:first-child > .section-head__eyebrow:first-child,
.section > .container > .section-split:first-child > .section-head:first-child > .section-head__eyebrow:first-child,
.section > .container > :first-child > .section-head:first-child > .section-head__eyebrow:first-child {
	/* Bottom of the tab = top of the folder edge, whatever the tab's height. */
	margin-top: calc(-1 * var(--section-pad) - 2px);
	margin-bottom: calc(var(--section-pad) * .6 - var(--tab-h));
	transform: translateY(-100%);
}

.section--white {
	background: var(--c-surface);
}

.section--dark {
	border-bottom: 0;
	background: var(--c-dark);
	color: var(--c-dark-text);
}

.section-head {
	margin-bottom: 32px;
}

.section-head--narrow {
	max-width: 720px;
}

.section-head__eyebrow {
	margin-bottom: 14px;
}

.section-title {
	font-size: clamp(28px, 3.4vw, 40px);
	line-height: 1.1;
	letter-spacing: -.015em;
}

.section-head__text {
	margin-top: 14px;
	color: var(--c-text);
	font-size: 16.5px;
	line-height: 1.6;
}

.section--dark .section-head__eyebrow {
}

.section--dark .section-title {
	color: var(--c-on-dark);
}

.section--dark .section-head__text {
	color: var(--c-dark-text);
}

/* Heading on the left, link or short text on the right. */
.section-split {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 32px;
}

.section-split .section-head {
	max-width: 680px;
	margin-bottom: 0;
}

.section-split__link {
	display: inline-block;
	padding-block: 4px;
	font-size: 15px;
	font-weight: 600;
}

.section-split__text {
	max-width: 420px;
	color: var(--c-text-2);
	font-size: 15px;
	line-height: 1.55;
}

/* Footer
   ========================================================================== */

.site-footer {
	background: var(--c-dark);
	color: var(--c-dark-text);
	font-size: 14.5px;
}

.site-footer__inner {
	padding-top: 56px;
	padding-bottom: 28px;
}

.site-footer__top {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	padding-bottom: 36px;
	border-bottom: 1px solid var(--c-dark-line);
}

.site-footer__brand {
	max-width: 460px;
}

/* Long CTA label: wrap instead of overflowing on narrow screens. */
.site-footer__top .btn {
	max-width: 100%;
	white-space: normal;
	text-align: center;
}

.site-footer__brand p {
	margin-top: 14px;
	line-height: 1.6;
}

.site-footer__nav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 32px 24px;
	padding: 36px 0;
}

.site-footer__heading {
	margin: 0 0 14px;
	color: var(--c-dark-muted);
	font-family: var(--f-sans);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.site-footer__links {
	display: flex;
	flex-direction: column;
	gap: 9px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer a {
	color: var(--c-dark-text);
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--c-on-dark);
}

/* .site-footer a would turn the logo grey. */
.site-footer .logo--dark,
.site-footer .logo--dark:hover {
	color: var(--c-on-dark);
}

/* Without columns the disclaimer follows the top block directly. */
.site-footer__top + .site-footer__disclaimer {
	margin-top: 36px;
}

.site-footer__disclaimer {
	padding: 18px 20px;
	border: 1px solid var(--c-dark-line);
	border-radius: var(--radius-lg);
	color: var(--c-dark-text-2);
	font-size: 13.5px;
	line-height: 1.6;
}

.site-footer__disclaimer strong {
	color: var(--c-on-dark);
	font-weight: 600;
}

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	margin-top: 16px;
	padding-top: 20px;
	border-top: 1px solid var(--c-dark-line);
	color: var(--c-dark-muted);
	font-size: 13px;
}

/* Legal links stay on the right when there is no copyright. */
.site-footer__bottom > nav:only-child {
	margin-left: auto;
}

.site-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer .site-footer__legal a {
	color: var(--c-dark-muted);
}

.site-footer .site-footer__legal a:hover {
	color: var(--c-on-dark);
}

/* Help blocks are manila folders, not navy panels (navy stays for the utility bar and footer).
   The dark-surface tokens are remapped inside them; buttons keep their own colours. */
.section--dark,
.cta-lawyer,
.sol__cta,
.contact-help,
.featured li:first-child a {
	--c-dark: var(--c-manila);
	--c-dark-text: var(--c-ink);
	--c-dark-text-2: var(--c-manila-text);
	--c-dark-muted: var(--c-manila-text);
	--c-dark-line: var(--c-manila-edge);
	--c-on-dark-2: var(--c-ink);
	--c-on-dark-muted: var(--c-manila-text);
	--c-on-dark-icon: var(--c-ink);
	--c-on-dark-line: var(--c-manila-edge);
	--c-on-green-2: var(--c-ink);
	--c-accent-on-dark-hover: var(--c-accent-hover);
	--c-on-dark: var(--c-ink);
	--c-orange: var(--c-manila-text);
	color: var(--c-ink);
}

/* Buttons inside keep white text on their own fill. */
:is(.section--dark, .cta-lawyer, .sol__cta, .contact-help) .btn {
	--c-on-dark: var(--c-surface);
}

.section--dark .section-title,
.cta-lawyer__title,
.sol__cta-title,
.steps__title,
.contact-help strong,
.featured li:first-child a strong,
.featured li:first-child .more {
	color: var(--c-ink);
}

.section--dark .text-link,
.section--dark a:not(.btn) {
	color: var(--c-ink);
}

/* Secondary text on any manila surface takes the folder's brown, never grey. */
.home-hero,
.guide-head,
.tool-head,
.picker__results,
.cta-guide,
.takeaways,
.section--dark,
.cta-lawyer,
.sol__cta,
.contact-help {
	--c-muted: var(--c-manila-muted);
	--c-text-2: var(--c-manila-text);
}

/* A tab on a manila folder is the folder's paler inner flap, so it still reads as a tab. */
.section--dark .section-head__eyebrow,
.cta-lawyer__eyebrow {
	background: var(--c-manila-2);
}

/* The featured guide is a white sheet on the desk, not another manila block. */
.featured li:first-child a {
	--c-dark: var(--c-surface);
	border-color: var(--c-line);
	box-shadow: var(--shadow-paper);
}

/* Red is the one help action (data-lead-open) and real dates/deadlines. Steps, downloads
   and tool links are ordinary actions: carbon blue. */
.cta-guide .btn--accent,
.cta-calc .btn--accent,
.lead .btn--accent[data-lead-next] {
	background: var(--c-green);
}

.cta-guide .btn--accent:hover,
.cta-calc .btn--accent:hover,
.lead .btn--accent[data-lead-next]:hover {
	background: var(--c-green-dark);
}
