/*
 * iWebAndSEO theme — layout layer
 * Header, navigation, hero, page heroes, stats band, sections, entries,
 * footer. Dark hero, light body, glass accents.
 */

/* ---------- Header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgb(255 255 255 / 88%);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
	transition: box-shadow var(--duration);
}

.site-header.is-scrolled {
	box-shadow: var(--shadow-sm);
}

.site-header-inner {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	min-height: var(--header-h);
}

.site-branding {
	display: flex;
	align-items: center;
}

.site-branding img {
	max-height: 44px;
	width: auto;
}

.site-title {
	font-size: 1.15rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.site-title a {
	color: var(--ink);
	text-decoration: none;
}

.site-title a:hover {
	color: var(--brand-strong);
}

.site-nav-desktop {
	margin-left: auto;
}

.site-header-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.nav-toggle {
	display: none;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}

.nav-toggle:hover {
	border-color: var(--ink);
}

.nav-toggle[aria-expanded="true"] .icon-toggle-open { display: none; }
.nav-toggle[aria-expanded="false"] .icon-toggle-close { display: none; }

/* ---------- Menus ---------- */

.menu {
	display: flex;
	align-items: center;
	gap: 0.125rem;
}

.menu-item a {
	display: block;
	padding: 0.5rem 0.85rem;
	border-radius: 999px;
	color: var(--text);
	font-weight: 500;
	font-size: 0.9375rem;
	text-decoration: none;
	transition: background-color var(--duration), color var(--duration);
}

.menu-item a:hover,
.menu-item.current-menu-item > a {
	background: var(--brand-soft);
	color: var(--brand-strong);
}

.menu-desktop .menu-item-has-children { position: relative; }

.menu-desktop .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 230px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
	padding: 0.5rem;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity var(--duration), transform var(--duration), visibility var(--duration);
}

.menu-desktop .menu-item-has-children:hover > .sub-menu,
.menu-desktop .menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.menu-desktop .sub-menu a {
	border-radius: 6px;
}

/* ---------- Mobile panel ---------- */

.nav-panel {
	display: none;
}

@media (max-width: 899px) {
	.site-nav-desktop,
	.header-cta {
		display: none;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.nav-panel {
		display: block;
		position: fixed;
		inset: var(--header-h) 0 0 0;
		z-index: 90;
		background: var(--ink);
		color: var(--text-inverse);
		overflow-y: auto;
		visibility: hidden;
		opacity: 0;
		transition: opacity var(--duration), visibility 0s linear var(--duration);
	}

	.nav-panel.is-open {
		visibility: visible;
		opacity: 1;
		transition: opacity var(--duration);
	}

	body.nav-open {
		overflow: hidden;
	}

	.nav-panel-inner {
		padding: 1.5rem 0 3rem;
	}

	.nav-panel-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		border: 1px solid rgb(255 255 255 / 0.2);
		border-radius: var(--radius-sm);
		background: transparent;
		color: var(--text-inverse);
		cursor: pointer;
		margin-bottom: 1rem;
	}

	.menu-mobile {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.menu-mobile .menu-item a {
		padding: 0.9rem 0;
		font-size: 1.15rem;
		color: var(--text-inverse);
		border-bottom: 1px solid rgb(255 255 255 / 0.1);
		border-radius: 0;
	}

	.menu-mobile .menu-item a:hover,
	.menu-mobile .menu-item.current-menu-item > a {
		background: none;
		color: #fff;
	}

	.menu-mobile .sub-menu {
		list-style: none;
		padding-left: 1.25rem;
		flex-direction: column;
	}

	.menu-mobile .sub-menu a {
		font-size: 0.95rem;
		color: var(--text-inverse-muted);
	}

	.nav-panel-footer {
		margin-top: 2rem;
		display: flex;
		flex-direction: column;
		gap: 1rem;
	}

	.nav-panel-footer .btn-primary {
		background: var(--brand);
		color: #fff;
	}

	.nav-panel-contact {
		display: flex;
		align-items: center;
		gap: 0.6rem;
		color: var(--text-inverse-muted);
		font-size: 0.95rem;
	}

	.nav-panel-contact a {
		color: var(--text-inverse-muted);
	}

	/* No-JS fallback: panel contents render inline, toggle hidden. */
	html:not(.iweb-js) .nav-toggle {
		display: none;
	}

	html:not(.iweb-js) .nav-panel {
		position: static;
		visibility: visible;
		opacity: 1;
		background: var(--paper);
		color: var(--text);
		border-top: 1px solid var(--line);
		overflow: visible;
	}

	html:not(.iweb-js) .nav-panel-close,
	html:not(.iweb-js) .nav-panel-footer {
		display: none;
	}

	html:not(.iweb-js) .menu-mobile .menu-item a {
		color: var(--text);
		border-bottom-color: var(--line);
	}
}

/* ---------- Hero ---------- */

.hero {
	position: relative;
	background: linear-gradient(160deg, var(--ink) 0%, #101a3a 60%, #142850 100%);
	color: var(--text-inverse);
	padding: clamp(4rem, 10vw, 8rem) 0 clamp(3.5rem, 8vw, 6rem);
	overflow: hidden;
}

.hero::before {
	content: "";
	position: absolute;
	width: 55vw;
	aspect-ratio: 1;
	right: -12%;
	top: -35%;
	background: radial-gradient(closest-side, rgb(37 99 235 / 0.35), transparent 72%);
	pointer-events: none;
}

.hero-media {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	opacity: 0.22;
}

.hero-inner {
	position: relative;
	max-width: 820px;
}

.hero-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: #8fb4ff;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.8125rem;
	font-weight: 700;
	margin-bottom: 1rem;
}

.hero-eyebrow .icon svg {
	width: 1.1em;
	height: 1.1em;
}

.hero-title {
	color: #fff;
	font-size: var(--h1);
	line-height: 1.08;
	margin-bottom: 1.25rem;
}

.hero-tagline {
	font-size: var(--lead);
	color: var(--text-inverse-muted);
	max-width: 660px;
	margin-bottom: 2.25rem;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
}

.hero-search {
	margin-top: 1.75rem;
}

.hero-search .search-form {
	margin-inline: auto;
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
	background: linear-gradient(180deg, var(--paper-2), var(--paper));
	border-bottom: 1px solid var(--line);
	padding: clamp(2.5rem, 6vw, 4.5rem) 0 2.25rem;
}

.page-hero-center {
	text-align: center;
}

.page-hero-center .page-intro,
.page-hero-center .page-title {
	margin-inline: auto;
}

.page-hero-center .breadcrumbs-list {
	justify-content: center;
}

.page-hero-center .hero-actions {
	justify-content: center;
}

.page-title {
	color: var(--ink);
	max-width: 780px;
}

.page-intro {
	color: var(--text-muted);
	font-size: var(--lead);
	margin-top: 0.9rem;
	max-width: 680px;
}

/* ---------- Stats band ---------- */

.stats-band {
	background: var(--ink);
	color: var(--text-inverse);
	padding: 2.25rem 0;
}

.stats-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 1.5rem;
	list-style: none;
	padding: 0;
	text-align: center;
}

.stat-number {
	display: block;
	font-size: clamp(1.7rem, 3vw, 2.4rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: #fff;
}

.stat-label {
	color: var(--text-inverse-muted);
	font-size: 0.9rem;
}

/* ---------- Sections ---------- */

.section {
	padding-block: clamp(3.5rem, 8vw, 6rem);
}

.section-header {
	max-width: 740px;
	margin: 0 auto 2.5rem;
	text-align: center;
}

.section-eyebrow {
	color: var(--brand);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.8125rem;
	margin-bottom: 0.75rem;
}

.section-title {
	margin-bottom: 0.75rem;
}

.section-intro {
	color: var(--text-muted);
	font-size: var(--lead);
}

.section-title-sm {
	font-size: 1.2rem;
	margin-bottom: 1rem;
}

.section-cta {
	text-align: center;
	margin-top: 2.5rem;
}

.work-section,
.testimonials-section,
.related-section,
.faq-section,
.front-page-content {
	background: var(--paper-2);
}

/* ---------- Entry content ---------- */

.entry {
	padding-block: 2.75rem;
}

.entry-hero-image {
	margin: 0 auto 2rem;
	border-radius: var(--radius-lg);
	overflow: hidden;
}

.entry-hero-image img {
	width: 100%;
}

.entry-content > * + * {
	margin-top: 1.1em;
}

.entry-content h2 {
	font-size: 1.75rem;
	margin-top: 2em;
}

.entry-content h3 {
	font-size: 1.35rem;
	margin-top: 1.75em;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.4rem;
}

.entry-content li + li {
	margin-top: 0.4em;
}

.entry-content blockquote {
	border-left: 3px solid var(--brand);
	background: var(--paper-2);
	padding: 1rem 1.25rem;
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.entry-content pre {
	background: var(--ink);
	color: #e5ecff;
	padding: 1.1rem 1.25rem;
	border-radius: var(--radius-sm);
	overflow-x: auto;
	font-family: var(--font-mono);
	font-size: 0.875rem;
	line-height: 1.6;
}

.entry-content :not(pre) > code {
	font-family: var(--font-mono);
	font-size: 0.9em;
	background: var(--brand-soft);
	padding: 0.15em 0.4em;
	border-radius: 4px;
}

.entry-content pre code {
	background: none;
	padding: 0;
	font-size: inherit;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
}

.entry-content th,
.entry-content td {
	padding: 0.6rem 0.85rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
}

.entry-content th {
	border-bottom: 2px solid var(--ink);
}

.entry-content img {
	border-radius: var(--radius);
}

.entry-meta {
	color: var(--text-muted);
	font-size: 0.875rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin-top: 1rem;
}

.entry-meta .sep {
	opacity: 0.5;
}

/* ---------- TOC ---------- */

.toc {
	background: var(--paper-2);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.5rem 1.75rem;
	margin-bottom: 2.5rem;
}

.toc h2 {
	font-size: 1.05rem;
	margin-bottom: 0.75rem;
}

.toc-list {
	list-style: none;
	padding: 0;
	margin: 0;
	columns: 2;
	column-gap: 2rem;
}

.toc-item {
	margin-bottom: 0.45rem;
	break-inside: avoid;
}

.toc-item a {
	color: var(--text);
	text-decoration: none;
	font-size: 0.925rem;
	font-weight: 500;
}

.toc-item a:hover {
	color: var(--brand-strong);
	text-decoration: underline;
}

.toc-item-h3 {
	padding-left: 1.1rem;
}

@media (max-width: 600px) {
	.toc-list {
		columns: 1;
	}
}

/* ---------- Footer ---------- */

.site-footer {
	background: var(--ink);
	color: var(--text-inverse-muted);
	padding: 4rem 0 2rem;
	margin-top: auto;
}

.site-footer-grid {
	display: grid;
	grid-template-columns: 1.6fr repeat(3, 1fr);
	gap: 2.5rem;
}

.site-footer .site-title a {
	color: #fff;
}

.site-footer .site-branding img {
	max-height: 40px;
}

.site-tagline {
	font-size: 0.9rem;
	margin-top: 0.6rem;
	max-width: 340px;
}

.footer-contact-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-top: 0.65rem;
	font-size: 0.9rem;
}

.footer-contact-item .icon {
	color: #8fb4ff;
}

.footer-contact-item a {
	color: var(--text-inverse-muted);
	text-decoration: none;
}

.footer-contact-item a:hover {
	color: #fff;
	text-decoration: underline;
}

.site-footer-heading {
	color: #fff;
	font-size: 0.9rem;
	margin-bottom: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.09em;
}

.site-footer-links {
	list-style: none;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	font-size: 0.9rem;
}

.site-footer-links a {
	color: var(--text-inverse-muted);
	text-decoration: none;
}

.site-footer-links a:hover {
	color: #fff;
	text-decoration: underline;
}

.site-footer .social-links {
	margin-top: 1.25rem;
}

.site-footer .social-links a {
	background: rgb(255 255 255 / 0.07);
	border-color: rgb(255 255 255 / 0.15);
	color: var(--text-inverse);
}

.site-footer .social-links a:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: #06281d;
}

.site-footer-bottom {
	border-top: 1px solid rgb(255 255 255 / 0.12);
	margin-top: 3rem;
	padding-top: 1.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	align-items: center;
	font-size: 0.85rem;
}

.site-footer-legal {
	list-style: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
}

.site-footer-legal a {
	color: var(--text-inverse-muted);
	text-decoration: none;
}

.site-footer-legal a:hover {
	color: #fff;
	text-decoration: underline;
}

@media (max-width: 950px) {
	.site-footer-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 600px) {
	.site-footer-grid {
		grid-template-columns: 1fr;
		gap: 2rem;
	}
}