/**
 * Sewing Supplies Direct — storefront
 * Retail department layout. Tokens: docs/04-design-system.md
 */

:root {
	--ssd-navy: #0e2244;
	--ssd-navy-deep: #09182f;
	--ssd-red: #e10600;
	--ssd-red-dark: #b80500;
	--ssd-ink: #1c1c1c;
	--ssd-muted: #5c6570;
	--ssd-line: #e4e7eb;
	--ssd-bg: #f3f4f6;
	--ssd-white: #ffffff;
	--ssd-font: "Segoe UI", system-ui, sans-serif;
	--ssd-max: 1180px;
	--ssd-space: 16px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: var(--ssd-font);
	font-size: 1rem;
	line-height: 1.5;
	color: var(--ssd-ink);
	background: var(--ssd-bg);
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--ssd-navy);
}

.skip-link {
	position: absolute;
	left: 12px;
	top: -40px;
	background: var(--ssd-white);
	color: var(--ssd-navy);
	padding: 8px 12px;
	z-index: 100;
}

.skip-link:focus {
	top: 8px;
}

.design-preview-note {
	margin: 0;
	padding: 8px 16px;
	background: #fff8e8;
	color: #744210;
	font-size: 0.85rem;
	text-align: center;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.wrap {
	width: min(var(--ssd-max), calc(100% - 32px));
	margin-inline: auto;
}

/* Top bar */

.topbar {
	background: var(--ssd-navy-deep);
	color: #fff;
	font-size: 0.82rem;
	font-weight: 650;
}

.topbar__inner {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: center;
	min-height: 36px;
	width: min(var(--ssd-max), calc(100% - 32px));
	margin-inline: auto;
}

.topbar p {
	margin: 0;
}

.topbar__points {
	display: none;
	gap: 14px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Header */

.site-header {
	background: var(--ssd-white);
	border-bottom: 1px solid var(--ssd-line);
}

.site-header__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"brand tools"
		"search search";
	gap: 12px 16px;
	align-items: center;
	width: min(var(--ssd-max), calc(100% - 32px));
	margin-inline: auto;
	padding: 12px 0;
}

.site-branding {
	grid-area: brand;
	line-height: 0;
	min-width: 0;
}

.site-logo,
.custom-logo {
	width: min(220px, 62vw);
	height: auto;
	display: block;
}

.site-title {
	font-weight: 800;
	color: var(--ssd-navy);
	text-decoration: none;
	font-size: 1.1rem;
}

.site-search {
	grid-area: search;
	min-width: 0;
}

.site-search form {
	display: flex;
	border: 2px solid var(--ssd-navy);
	border-radius: 4px;
	overflow: hidden;
	background: #fff;
}

.site-search input[type="search"] {
	flex: 1;
	border: 0;
	padding: 12px 14px;
	font: inherit;
	font-size: 1rem;
	min-width: 0;
	min-height: 48px;
}

.site-search input[type="search"]:focus {
	outline: 2px solid var(--ssd-red);
	outline-offset: -2px;
}

.site-search button {
	border: 0;
	background: var(--ssd-red);
	color: #fff;
	font: inherit;
	font-weight: 750;
	padding: 0 18px;
	min-height: 48px;
	cursor: pointer;
}

.site-search button:hover,
.site-search button:focus-visible {
	background: var(--ssd-red-dark);
}

.site-header__tools {
	grid-area: tools;
	display: flex;
	gap: 8px;
}

.tool-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 64px;
	min-height: 44px;
	padding: 4px 8px;
	text-decoration: none;
	color: var(--ssd-navy);
	font-size: 0.78rem;
	font-weight: 750;
	line-height: 1.2;
}

.tool-link:hover,
.tool-link:focus-visible {
	color: var(--ssd-red);
}

.tool-link__count {
	display: inline-grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 99px;
	background: var(--ssd-red);
	color: #fff;
	font-size: 0.75rem;
}

/* Department bar */

.dept-nav {
	background: var(--ssd-navy);
}

.dept-nav__list {
	display: flex;
	gap: 2px;
	list-style: none;
	margin: 0 auto;
	padding: 0;
	width: min(var(--ssd-max), calc(100% - 16px));
	overflow-x: auto;
	scrollbar-width: none;
}

.dept-nav__list::-webkit-scrollbar {
	display: none;
}

.dept-nav__list a {
	display: flex;
	align-items: center;
	min-height: 46px;
	padding: 8px 14px;
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.92rem;
	white-space: nowrap;
}

.dept-nav__list a:hover,
.dept-nav__list a:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	box-shadow: inset 0 -3px 0 var(--ssd-red);
}

.dept-nav__empty {
	color: #fff;
	padding: 12px 14px;
	font-size: 0.9rem;
}

/* Homepage */

.site-main--front {
	width: min(var(--ssd-max), calc(100% - 32px));
	margin: 20px auto 40px;
}

.hero {
	display: grid;
	gap: 12px;
}

.hero__main,
.hero__promo {
	border-radius: 6px;
	padding: 28px 24px;
}

.hero__main {
	background: var(--ssd-navy);
	color: #fff;
}

.eyebrow {
	margin: 0 0 8px;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #ffb4b0;
}

.hero__main h1 {
	margin: 0 0 10px;
	font-size: clamp(1.7rem, 4vw, 2.5rem);
	line-height: 1.1;
	letter-spacing: -0.03em;
}

.hero__main p {
	margin: 0 0 18px;
	max-width: 38rem;
	color: #e7edf5;
}

.hero__promo {
	background: var(--ssd-red);
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 160px;
}

.hero__promo .eyebrow {
	color: #ffe1df;
}

.hero__promo h2 {
	margin: 0 0 8px;
	font-size: 1.8rem;
	line-height: 1;
	letter-spacing: -0.03em;
}

.hero__promo p {
	margin: 0;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 10px 18px;
	background: var(--ssd-red);
	color: #fff;
	text-decoration: none;
	font-weight: 800;
	border-radius: 4px;
	border: 0;
}

.button:hover,
.button:focus-visible {
	background: var(--ssd-red-dark);
	color: #fff;
}

.home-block {
	margin-top: 28px;
}

.home-block__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 12px;
}

.home-block h2 {
	margin: 0;
	font-size: 1.35rem;
	letter-spacing: -0.02em;
	color: var(--ssd-navy);
}

.home-block__head a {
	font-weight: 750;
	color: var(--ssd-red);
	text-decoration: none;
	white-space: nowrap;
}

.dept-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.dept-grid a {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 148px;
	padding: 16px 10px;
	background: var(--ssd-white);
	border: 1px solid var(--ssd-line);
	border-radius: 6px;
	text-decoration: none;
	color: var(--ssd-navy);
	text-align: center;
	font-weight: 800;
}

.dept-grid a:hover,
.dept-grid a:focus-visible {
	border-color: var(--ssd-red);
	box-shadow: 0 8px 18px rgba(14, 34, 68, 0.08);
}

.dept-grid__mark {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--ssd-navy);
	color: #fff;
	font-size: 1.4rem;
}

.dept-grid__img {
	width: 88px;
	height: 88px;
	object-fit: cover;
	border-radius: 12px;
	background: #f4f6f8;
}

.home-note,
.dept-grid__admin {
	color: var(--ssd-muted);
	font-size: 0.92rem;
}

.trust {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	list-style: none;
	margin: 28px 0 0;
	padding: 0;
}

.trust li {
	background: var(--ssd-white);
	border: 1px solid var(--ssd-line);
	border-top: 3px solid var(--ssd-red);
	border-radius: 6px;
	padding: 14px;
}

.trust strong {
	display: block;
	color: var(--ssd-navy);
}

.trust span {
	color: var(--ssd-muted);
	font-size: 0.88rem;
}

.home-editor {
	margin-top: 28px;
	background: var(--ssd-white);
	border: 1px solid var(--ssd-line);
	border-radius: 6px;
	padding: 8px 16px;
}

.entry-header,
.entry-content {
	width: min(var(--ssd-max), calc(100% - 32px));
	margin-inline: auto;
}

.entry-title {
	color: var(--ssd-navy);
}

/* Footer */

.site-footer {
	background: var(--ssd-navy);
	color: #d5deea;
	margin-top: 12px;
}

.site-footer__inner {
	width: min(var(--ssd-max), calc(100% - 32px));
	margin-inline: auto;
	padding: 28px 0 20px;
	display: grid;
	gap: 20px;
}

.site-footer h2 {
	margin: 0 0 8px;
	color: #fff;
	font-size: 0.95rem;
}

.site-footer a {
	color: #fff;
	text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
	text-decoration: underline;
}

.site-footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-footer li + li {
	margin-top: 6px;
}

.site-footer__copy {
	margin: 0;
	font-size: 0.85rem;
	grid-column: 1 / -1;
}

.site-main--shop,
.site-main--blog,
.site-main--page {
	width: min(var(--ssd-max), calc(100% - 32px));
	margin: 20px auto 48px;
}

.cat-hero,
.page-hero {
	background: #fff;
	border: 1px solid var(--ssd-line);
	border-radius: 6px;
	padding: 20px;
	margin-bottom: 20px;
}

.cat-hero {
	display: grid;
	gap: 16px;
	align-items: center;
}

.cat-hero__img {
	width: 140px;
	height: 140px;
	border-radius: 16px;
	background: #f4f6f8;
}

.cat-hero h1,
.page-hero h1,
.guide h1 {
	margin: 0 0 8px;
	color: var(--ssd-navy);
	letter-spacing: -0.03em;
	line-height: 1.15;
}

.cat-hero__text p,
.page-hero p,
.guide__answer {
	margin: 0;
	color: var(--ssd-muted);
}

.guide__answer {
	margin-top: 12px;
	color: var(--ssd-ink);
	font-size: 1.05rem;
}

.dept-grid--sub {
	margin-bottom: 20px;
}

.post-list {
	display: grid;
	gap: 12px;
}

.post-card {
	background: #fff;
	border: 1px solid var(--ssd-line);
	border-radius: 6px;
	padding: 16px 18px;
}

.post-card h2 {
	margin: 0 0 4px;
	font-size: 1.25rem;
}

.post-card a {
	color: var(--ssd-navy);
	text-decoration: none;
}

.post-card a:hover,
.post-card a:focus-visible {
	color: var(--ssd-red);
}

.post-card__meta {
	margin: 0 0 8px;
	color: var(--ssd-muted);
	font-size: 0.85rem;
}

.guide__body {
	background: #fff;
	border: 1px solid var(--ssd-line);
	border-radius: 6px;
	padding: 8px 18px 18px;
	max-width: 42rem;
}

.nav-links {
	display: flex;
	gap: 12px;
	margin-top: 16px;
}

@media (min-width: 700px) {
	.cat-hero {
		grid-template-columns: 160px 1fr;
	}
}

@media (min-width: 700px) {
	.dept-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.trust {
		grid-template-columns: repeat(4, 1fr);
	}

	.site-footer__inner {
		grid-template-columns: 1.4fr 1fr 1fr;
	}
}

@media (min-width: 900px) {
	.topbar__points {
		display: flex;
	}

	.site-logo,
	.custom-logo {
		width: 280px;
	}

	.site-header__inner {
		grid-template-areas: "brand search tools";
		grid-template-columns: auto minmax(0, 1fr) auto;
		padding: 14px 0;
	}

	.hero {
		grid-template-columns: 1.7fr 0.8fr;
	}

	.hero__promo {
		clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
		padding-left: 48px;
	}

	.dept-grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}
