/*
Theme Name: FSD Blog
Description: FoodServiceDirect blog theme, built to match the FS-770 homepage and post mockups.
Author: FoodServiceDirect
Version: 1.0.0
*/

:root {
	--navy: #375b89;
	--navy-dark: #2b4870;
	--brand: #21487d; /* header + footer background */
	--gray-bg: #e7e7e7;
	--light-bg: #eef2f5;
	--text: #222222;
	--muted: #555555;
	--green: #2e7d32;
	--max-width: 1200px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	color: var(--text);
	background: #fff;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- Header ---------- */

.utility-bar {
	background: var(--light-bg);
	font-size: 13px;
	padding: 8px 0;
}
.utility-bar .wrap {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}
.utility-bar .promo { color: var(--muted); }
.utility-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.utility-links a { color: var(--muted); font-weight: 600; }

.main-header {
	padding: 16px 0;
	background: var(--brand);
	color: #fff;
}
.main-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
}
/* The header logo is light artwork on a transparent background, so it sits
   directly on the brand-blue bar. A white plate behind it hides the mark. */
.site-logo {
	display: inline-flex;
	align-items: center;
	line-height: 0;
}
.site-logo img {
	display: block;
	height: 36px;
	width: auto;
	max-width: 150px;
}
.main-nav { display: flex; gap: 28px; flex-wrap: wrap; }
.main-nav a { font-weight: 600; font-size: 15px; color: #fff; }
.main-nav a:hover { text-decoration: underline; }

.blog-masthead { text-align: center; padding: 28px 0 8px; }
.blog-masthead h1 {
	font-size: 48px;
	margin: 0;
	font-weight: 800;
}

.category-tabs {
	display: flex;
	justify-content: center;
	gap: 48px;
	padding: 16px 0 32px;
	flex-wrap: wrap;
	scroll-margin-top: 120px;
}
.category-tabs a {
	font-size: 18px;
	font-weight: 600;
	color: var(--text);
	padding-bottom: 4px;
	border-bottom: 2px solid transparent;
}
.category-tabs a.active,
.category-tabs a:hover { color: var(--navy); border-bottom-color: var(--navy); }

/* ---------- Hero / banner ---------- */

.hero {
	position: relative;
	max-width: var(--max-width);
	height: 480px;
	margin: 24px auto 8px;
	overflow: hidden;
	background: var(--navy);
}
.hero .hero-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.hero--no-image { height: auto; min-height: 320px; display: flex; align-items: center; }
.hero-overlay {
	position: absolute;
	top: 50%;
	right: 6%;
	transform: translateY(-50%);
	width: 34%;
	min-width: 320px;
	background: rgba(35, 35, 35, 0.85);
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 32px 28px;
}
.hero--no-image .hero-overlay {
	position: static;
	transform: none;
	width: 100%;
	min-width: 0;
	background: transparent;
	text-align: center;
	align-items: center;
	padding: 48px 24px;
}
.hero-overlay h2 { font-size: 38px; margin: 0 0 16px; font-weight: 800; line-height: 1.1; }
.hero-overlay p { font-size: 16px; line-height: 1.55; margin: 0 0 20px; }
/* Long headings/excerpts are clipped so the box never outgrows the banner. */
.hero-overlay h2,
.hero-overlay p {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}
.hero-overlay h2 { -webkit-line-clamp: 4; line-clamp: 4; }
.hero-overlay p { -webkit-line-clamp: 5; line-clamp: 5; }
.btn-read-more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	color: var(--text);
	font-weight: 700;
	font-size: 14px;
	padding: 8px 14px;
	align-self: flex-start;
}
.btn-read-more:hover { background: #e9e9e9; }
.hero--no-image .btn-read-more { align-self: center; }

@media (max-width: 780px) {
	.hero { height: auto; }
	.hero .hero-img { position: static; height: 260px; }
	.hero-overlay { position: static; transform: none; width: 100%; min-width: 0; }
	.hero-overlay h2 { font-size: 28px; }
	.category-tabs { gap: 28px; }
}

/* ---------- Post grid ---------- */

.post-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	max-width: var(--max-width);
	margin: 0 auto 48px;
	padding: 0 24px;
}
/* Column layout so every card in a row is the same height. */
.post-card { background: #fff; display: flex; flex-direction: column; }
/* Logo on grey shows through when a post has no featured image. */
.post-card .thumb {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--light-bg) url(assets/images/logo.png) center / 45% auto no-repeat;
}
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .info { background: var(--gray-bg); padding: 20px; flex: 1; }
.post-card .info h3 { margin: 0 0 10px; font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.post-card .info p { margin: 0 0 14px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.post-card .info .cat { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.post-card:hover .info h3 { color: var(--navy); }
.post-grid-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--muted);
	padding: 48px 0;
}

@media (max-width: 900px) {
	.post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.post-grid { grid-template-columns: 1fr; }
}

/* ---------- Single post ---------- */

.post-hero { max-width: var(--max-width); margin: 0 auto 32px; }
.post-hero img { width: 100%; height: auto; max-height: 480px; object-fit: cover; }

.post-content { max-width: var(--max-width); margin: 32px auto 48px; padding: 0 24px; }
.post-content h1.post-title { font-size: 42px; font-weight: 800; margin: 0 0 24px; overflow-wrap: anywhere; }
/* Anything an editor drops into a post stays inside the column. */
.post-content img,
.post-content video { max-width: 100%; height: auto; }
.post-content iframe,
.post-content embed { max-width: 100%; }
.post-content figure { margin: 24px 0; max-width: 100%; }
.post-content figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
/* "Wide width" / "Full width" (align-wide) fill the whole post column. */
.post-content .alignwide,
.post-content .alignfull {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}
.post-content .alignwide img,
.post-content .alignfull img,
.post-content .alignwide video,
.post-content .alignfull video { width: 100%; height: auto; }
.post-content table { display: block; max-width: 100%; overflow-x: auto; }
.post-content p { line-height: 1.7; font-size: 16px; color: var(--text); }
/* The global `a` rule inherits the text colour and drops the underline, which
   made hyperlinks inside a post look like plain black text. Links in the
   article itself read as links: brand blue + underline. Button links keep
   their own styling. */
.post-content a:not(.wp-block-button__link):not(.btn-shop-all),
.post-content a:not(.wp-block-button__link):not(.btn-shop-all):visited {
	color: var(--brand);
	text-decoration: underline;
	text-underline-offset: 2px;
}
.post-content a:not(.wp-block-button__link):not(.btn-shop-all):hover {
	color: var(--navy-dark);
}
.post-content h2 { font-size: 24px; font-weight: 800; margin: 32px 0 16px; }

.post-aside-figure {
	float: right;
	width: 38%;
	margin: 0 0 16px 32px;
}
.post-aside-figure img { width: 100%; }

.btn-shop-all {
	display: inline-block;
	background: var(--navy);
	color: #fff;
	font-weight: 700;
	letter-spacing: 0.03em;
	padding: 16px 28px;
	margin: 8px 0 28px;
	clear: both;
}
.btn-shop-all:hover { background: var(--navy-dark); }

.related-heading {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 24px;
	font-size: 26px;
	font-weight: 800;
}

/* ---------- Newsletter ---------- */

.newsletter {
	background: var(--navy);
	color: #fff;
	padding: 36px 0;
}
.newsletter .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 24px 40px;
}
.newsletter-copy {
	display: flex;
	align-items: center;
	gap: 28px;
	flex-wrap: wrap;
}
.newsletter h3 {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	white-space: nowrap;
}
.newsletter-sub {
	margin: 0;
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.5;
	max-width: 260px;
	opacity: 0.9;
}
.newsletter-form { flex: 0 1 380px; min-width: 260px; }
.newsletter-field {
	display: flex;
	align-items: center;
	background: #fff;
	border-radius: 999px;
	padding: 4px 4px 4px 20px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.newsletter-field:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
.newsletter-field input[type="email"] {
	flex: 1;
	min-width: 0;
	border: none;
	background: transparent;
	font-size: 14px;
	color: var(--text);
	padding: 10px 0;
	outline: none;
}
.newsletter-field input::placeholder { color: #8a8a8a; }
.newsletter-field button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: var(--navy);
	color: #fff;
	cursor: pointer;
	transition: background 0.15s;
}
.newsletter-field button:hover { background: var(--navy-dark); }
.newsletter-note {
	margin: 10px 0 0 20px;
	font-size: 11px;
	opacity: 0.75;
}
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

@media (max-width: 780px) {
	.newsletter .wrap { flex-direction: column; align-items: stretch; text-align: center; }
	.newsletter-copy { justify-content: center; }
	.newsletter h3 { white-space: normal; }
	.newsletter-sub { max-width: none; }
	.newsletter-form { flex-basis: auto; }
	.newsletter-note { margin-left: 0; }
}

/* ---------- Footer ---------- */

.site-footer { background: var(--brand); color: #fff; padding: 40px 0 20px; font-size: 14px; }
.footer-cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 32px;
	margin-bottom: 32px;
}
.footer-cols:empty { display: none; margin: 0; }
.footer-cols h4 { font-size: 16px; margin: 0 0 16px; color: #fff; }
.footer-cols ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 20px;
}
.footer-cols li { margin: 0; min-width: 0; }
.footer-cols a { color: rgba(255, 255, 255, 0.85); }
.footer-cols a:hover { color: #fff; text-decoration: underline; }
.footer-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-cols .cta {
	display: inline-block;
	background: #fff;
	color: var(--brand);
	font-weight: 700;
	padding: 10px 18px;
}
.footer-cols .cta:hover { background: #e9eef5; text-decoration: none; }
.footer-cols .cta.ghost { background: transparent; border: 1px solid #fff; color: #fff; }
.footer-cols .cta.ghost:hover { background: rgba(255, 255, 255, 0.12); }
.follow-label { margin: 20px 0 0; }
.social-icons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.social-icons span {
	width: 28px; height: 28px; border-radius: 50%;
	background: #fff; color: var(--brand);
	display: flex; align-items: center; justify-content: center;
	font-size: 13px; font-weight: 700;
}
.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.25);
	padding-top: 16px;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 13px;
}
.footer-bottom a:hover { color: #fff; text-decoration: underline; }
.footer-bottom .legal-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
@media (max-width: 600px) {
	.footer-cols ul { grid-template-columns: 1fr; }
}
