/* ============================================================
   Pass 1 — Typography & spacing foundation
   Loaded last in base.html so it wins specificity.
   Scoped to content; explicitly does NOT touch:
     - .banner / .banner-content (Pass 2 will redo)
     - .navbar / .header
     - .footer
   ============================================================ */

/* ---------- Body baseline ---------- */

body {
	color: var(--text-dark);
	font-weight: 400; /* bump from default 300 — too thin for body */
	line-height: 1.65;
}

/* ---------- Heading hierarchy inside content ---------- */

/* All headings use Montserrat for the display rhythm; body stays Inter. */
h1, h2, h3, h4, h5, h6,
.content h1, .content h2, .content h3, .content h4 {
	font-family: 'Montserrat', 'Inter', sans-serif;
}

.content h2,
.content h3,
.content h4 {
	color: var(--text-dark);
	letter-spacing: -0.015em;
	line-height: 1.15;
}

.content h2 {
	font-size: 31px;
	font-weight: 600;
	text-transform: none;
	margin-top: var(--spacing-3);
	margin-bottom: var(--spacing-2);
}

/* In-content H1 — used on internal pages where the banner H1 is the
   page heading. Slightly larger than H2 for hierarchy. */
.content h1 {
	font-size: 36px;
	font-weight: 700;
	text-transform: none;
	letter-spacing: -0.015em;
	margin-top: var(--spacing-3);
	margin-bottom: var(--spacing-2);
}

/* Hero H1 — overrides the in-content rule above. Big, bold, editorial. */
.content .banner-content h1 {
	font-family: 'Montserrat', 'Inter', sans-serif;
	font-size: clamp(2.5rem, 5.5vw, 5rem);
	font-weight: 700;
	line-height: 1.04;
	letter-spacing: -0.025em;
	color: #fff;
	margin: 0;
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

/* The 'East Anglia' span — same weight as the rest of the H1, full white. */
.content .banner-content h1 .text-primary {
	font-weight: inherit;
	color: #fff;
	opacity: 1;
}

.content h3 {
	font-size: 22px;
	font-weight: 600;
	text-transform: none;
	margin-top: var(--spacing-2);
	margin-bottom: var(--spacing-1);
}

.content h4 {
	font-weight: 600;
	text-transform: none;
	letter-spacing: -0.01em;
	font-size: var(--button);
	margin-top: var(--spacing-2);
	margin-bottom: var(--spacing-1);
}

/* First heading inside a section shouldn't have huge top margin
   — the section padding already handles that. */
.section .flex-column > h2:first-child,
.section .flex-column > h3:first-child,
.section .flex-column > div > h2:first-child,
.section .flex-column > div > h3:first-child {
	margin-top: 0;
}

/* ---------- Paragraphs ---------- */

.content p {
	color: var(--text-dark);
	line-height: 1.7;
	max-width: 70ch;
	margin-bottom: 1em;
}

.content p:last-child {
	margin-bottom: 0;
}

/* Bring strong inline elements forward properly */
.content p strong,
.content li strong {
	font-weight: 600;
	color: var(--text-dark);
}

/* ---------- Sections — more breathing room ---------- */

.content section {
	padding-block: calc(var(--spacing-3) * 1.25);
}

/* Subtle divider before each H2 except the first on the page
   — gives long content visual rhythm without a heavy rule. */
.content section + section {
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ---------- Lists — em-dash markers ---------- */

.content .custom-list {
	list-style: none;
	padding-left: 0;
	/* Override list.css's '.content ul { margin-left: 3rem }' so the
	   bullet hangs at the same left edge as the surrounding paragraphs. */
	margin-left: 0;
	margin-block: 1em;
}

/* list.css sets font-size: var(--text) on .content ul (only) — so bare
   text inside an <ol> inherits html's 62.5% root and renders tiny next
   to the explicit var(--text) on <strong>. Fix all list items here. */
.content li {
	font-size: var(--text);
}

.content .custom-list li {
	position: relative;
	padding-left: 1.75rem;
	margin-bottom: 0.6em;
	line-height: 1.6;
	color: var(--text-dark);
}

/* Larger round bullet marker — neutral dark, sized up from the default
   browser dot for better visibility. */
.content .custom-list li::before {
	content: "\2022"; /* • */
	position: absolute;
	left: 0.2rem;
	top: 0;
	color: var(--text-dark);
	font-size: 1.5em;
	line-height: 1;
}

/* Ordered custom-list (e.g. HETAS page) — keep numbers, just tidy spacing */
.content ol.custom-list {
	counter-reset: ol-counter;
}

.content ol.custom-list li {
	counter-increment: ol-counter;
	padding-left: 2.5rem;
}

.content ol.custom-list li::before {
	content: counter(ol-counter) ".";
	color: var(--colour-primary);
	font-weight: 600;
	width: 2rem;
}

/* ---------- FAQ blocks — breathing room ---------- */

/* The Stream 1 rewrites use:  <p><strong>Q: ...</strong><br>A: ...</p>
   Make these stand apart a touch without restructuring HTML. */
.content section p strong:first-child {
	display: inline; /* keep inline but visually distinct */
}

/* Add space between successive FAQ paragraphs that start with Q: */
.content p + p {
	margin-top: 1.1em;
}

/* ---------- Links inside content ---------- */

.content a:not(.button):not(.nav-link):not(.nav-logo):not(.anim-underline):not(.banner-content a) {
	color: var(--colour-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.content a:not(.button):not(.nav-link):not(.nav-logo):not(.anim-underline):not(.banner-content a):hover {
	color: var(--colour-primary-dark);
}

/* Heading-level anchor links (e.g. linked H3s on services overview)
   shouldn't be underlined — keep them looking like headings. */
.content h2 a,
.content h3 a,
.content h4 a {
	color: inherit;
	text-decoration: none;
}

.content h2 a:hover,
.content h3 a:hover,
.content h4 a:hover {
	color: var(--colour-primary);
}

/* ---------- Opening-hours / contact-us cards — soften ---------- */

.opening-hours,
.contact-us {
	border-radius: 6px;
	padding: var(--spacing-3);
	gap: 0.8rem 2rem;
	color: #fff;
}

.opening-hours h3,
.contact-us h3 {
	font-family: 'Montserrat', 'Inter', sans-serif;
	font-weight: 600;
	letter-spacing: -0.005em;
	text-transform: none;
	/* Match the .content h3 size (22px) used by 'Suffolk' / 'Norfolk'
	   sub-headings elsewhere on the contact page. */
	font-size: 22px;
	color: #fff;
	margin: 2rem 0 1rem;
}

/* First heading sits flush with the card's top padding. */
.opening-hours h3:first-of-type,
.opening-hours h3:first-child,
.contact-us h3:first-of-type,
.contact-us h3:first-child {
	margin-top: 0;
}

/* All text inside the dark cards reads white. */
.content .opening-hours p,
.content .opening-hours b,
.content .opening-hours strong,
.content .contact-us p,
.content .contact-us b,
.content .contact-us strong,
.content .contact-us li {
	color: #fff;
	font-size: var(--text);
	margin: 0;
}

/* ---------- Banner content — white text wins over Pass 1 body colour ---------- */

.content .banner-content p,
.content .banner-content li,
.content .banner-content b,
.content .banner-content strong {
	color: rgba(255, 255, 255, 0.94);
}

.content .banner-content h1,
.content .banner-content h2,
.content .banner-content .text-white {
	color: #fff;
}

/* ---------- Header / nav stacking ---------- */

/* base.css sets header z-index to 2, which ties with .banner > .container's
   z-index (2) — the nav dropdown then renders at the same stacking layer as
   the hero text and bleeds through. Bumping header well above everything in
   the page content. */
header,
.header {
	z-index: 100;
}

/* Make sure dropdown sub-menus stack above sibling nav items too. */
.nav-sub-menu {
	z-index: 101;
}

/* ---------- <small> with inline emphasis ---------- */

/* base.css sets <strong> and <b> to var(--text), which overrides the
   smaller font-size of any enclosing <small>. That produces text where
   bold words render bigger than the surrounding small text. Force
   inline emphasis inside <small> to inherit the small size. */
small strong,
small b,
small em,
small i {
	font-size: inherit;
}

/* ---------- Single-column .section pages ----------
   Pages like /showroom/, /form-submitted/, /gallery/ use
   <section class="section"><div class="flex-column">...</div></section>.
   section.css gives all direct children of .section width: 50% which
   leaves content squashed into the left half. When the .flex-column is
   the ONLY child of .section, give it the full width so it reads like
   the service page main column. Pages with two children (e.g. homepage
   text+opening-hours, contact form+sidebar) keep the 50/50 split. */

.content .section > .flex-column:only-child {
	width: 100%;
}

/* Lift paragraph/list max-width inside those single-column flex-columns
   so content extends to the right edge of the section (matches the
   service page treatment). */
.content .section > .flex-column:only-child p,
.content .section > .flex-column:only-child ul,
.content .section > .flex-column:only-child ol {
	max-width: none;
}

/* ---------- Service detail page layout ----------
   Shared template at templates/frontend/services/_service_base.html.
   Two-column grid on desktop: main content (~2fr) + sticky sidebar (320px).
   Stacks on tablet/mobile. */

.service-page {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: var(--spacing-4);
	align-items: start;
}

.service-main {
	min-width: 0; /* prevents grid blowout from long words / inline-block kids */
}

/* ---------- Lead paragraph — large, sets the page ---------- */

.service-lead {
	margin-bottom: var(--spacing-3);
}

.service-lead p {
	font-size: clamp(1.25rem, 1.4vw + 1rem, 1.65rem);
	font-weight: 400;
	line-height: 1.5;
	color: var(--text-dark);
	max-width: none;
}

/* ---------- Body content ---------- */

.service-body {
	/* Fills the main column — meets up to the sidebar on the right.
	   Inner paragraphs keep their reading-friendly cap from the global
	   '.content p { max-width: 65ch }' rule, which still applies. */
	max-width: none;
}

/* Generous spacing between H2 sections on service pages */
.service-body > h2 {
	margin-top: calc(var(--spacing-3) * 1.75);
	margin-bottom: var(--spacing-2);
}

/* Mobile: --spacing-3 narrows to 2rem so the calc above gives only
   3.5rem — tighter than the desktop break. Set an explicit larger
   gap on phone-sized viewports for a clearer section rhythm. */
@media (max-width: 767px) {
	.service-body > h2 {
		margin-top: 9.5rem;
		margin-bottom: 1.75rem;
	}
	.service-faq {
		margin-top: 9.5rem;
		padding-top: var(--spacing-3);
	}
}

.service-body > h2:first-child,
.service-body > h3:first-child {
	margin-top: 0;
}

/* Body paragraphs and lists extend to the column edge, overriding the
   global .content p { max-width: 65ch } so the visual rhythm matches
   the sidebar's right edge. */
.service-body p,
.service-body ul,
.service-body ol {
	max-width: none;
}

/* ---------- FAQ section ---------- */

.service-faq {
	max-width: none;
	margin-top: var(--spacing-3);
	padding-top: var(--spacing-3);
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.service-faq h2 {
	margin-top: 0;
	margin-bottom: var(--spacing-2);
}

/* ---------- Sidebar ---------- */

.service-sidebar {
	position: sticky;
	top: 10rem; /* below the 8rem navbar with a touch of breathing room */
	display: flex;
	flex-direction: column;
	gap: var(--spacing-2);
}

.service-cta-card {
	background: var(--text-dark);
	color: #fff;
	padding: 1.75rem;
	border-radius: 8px;
}

.service-cta-card h3 {
	color: #fff;
	font-size: 1.65rem;
	line-height: 1.2;
	margin: 0 0 1rem;
	letter-spacing: -0.015em;
}

.service-cta-card p {
	color: rgba(255, 255, 255, 0.85);
	font-size: 14px;
	line-height: 1.55;
	margin: 0 0 1.5rem;
	max-width: none;
}

.service-cta-card .button {
	display: block;
	width: 100%;
	text-align: center;
	margin-bottom: 0.7rem;
	padding: 0.85rem 1rem;
	font-size: 15px;
}

.service-cta-card .button:last-child {
	margin-bottom: 0;
}

/* Make the white-outline secondary button readable on the dark card */
.service-cta-card .button-inverse {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.6);
}

.service-cta-card .button-inverse:hover {
	background-color: #fff;
	color: var(--text-dark);
}

/* Other services list */
.service-related {
	padding: 1.5rem 1.5rem 1.5rem 1rem;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 8px;
}

.service-related h4 {
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	color: var(--text-light);
	margin: 0 0 1.25rem;
}

.service-related ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.service-related li {
	padding: 0.85rem 0;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.service-related li:first-child {
	border-top: none;
	padding-top: 0;
}

.service-related li:last-child {
	padding-bottom: 0;
}

.service-related a {
	color: var(--text-dark);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	display: block;
	transition: color 0.15s;
}

.service-related a:hover {
	color: var(--colour-primary);
	/* override global a:hover scale */
	transform: none !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
	.service-page {
		grid-template-columns: 1fr;
		gap: var(--spacing-3);
	}
	.service-sidebar {
		position: static;
	}
	.service-cta-card {
		max-width: 480px;
	}
	.service-related {
		max-width: 480px;
	}
}

/* ---------- Bottom CTA strip (dark) ---------- */

.service-cta {
	background-color: var(--text-dark);
	color: #fff;
	padding: var(--spacing-4) var(--spacing-4);
	margin: 0 var(--spacing-4);
	border-radius: 12px;
	text-align: center;
}

/* Push the footer down 40px on service pages so there's breathing
   room between the CTA card and the footer. Done at the body flex
   level — margin-bottom on .service-cta itself gets absorbed by
   .content's flex-grow:1 stretch. */
.service-page ~ .service-cta + * {
	margin-top: 40px;
}

.service-cta-inner {
	max-width: 640px;
	margin: 0 auto;
}

.service-cta h2 {
	color: #fff;
	margin: 0 0 1rem;
}

.service-cta p {
	color: rgba(255, 255, 255, 0.85);
	margin: 0 auto var(--spacing-2);
	max-width: 56ch;
}

.service-cta-actions {
	display: flex;
	gap: 1rem;
	justify-content: center;
	flex-wrap: wrap;
}

/* Make button-inverse readable on the dark CTA strip */
.service-cta .button-inverse {
	color: #fff;
	border-color: #fff;
}

.service-cta .button-inverse:hover {
	background-color: #fff;
	color: var(--text-dark);
}

@media (max-width: 767px) {
	.service-cta {
		padding: var(--spacing-3) var(--spacing-4);
		/* Bigger horizontal margin on mobile so the rounded card sits
		   noticeably inset from the screen edges. */
		margin-left: 1.5rem;
		margin-right: 1.5rem;
	}
}

/* ---------- Showroom gallery — hero photo + 2x2 grid ---------- */

.showroom-gallery {
	margin-block: var(--spacing-3);
	max-width: none;
	/* Flex column with explicit gap so the spacing between the hero
	   and the first grid row is identical to the spacing within the
	   grid. Previously the hero used margin-bottom and the grid used
	   gap — same variable, different render. */
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.showroom-gallery figure {
	margin: 0;
	overflow: hidden;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.05); /* placeholder tint until images load */
}

.showroom-gallery img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.showroom-gallery__hero {
	aspect-ratio: 21 / 9;
}

.showroom-gallery__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
}

.showroom-gallery__grid figure {
	aspect-ratio: 4 / 3;
}

@media (max-width: 767px) {
	.showroom-gallery__hero {
		aspect-ratio: 16 / 9;
	}
	.showroom-gallery__grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Areas-we-cover grid (Contact page) ---------- */

.areas-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--spacing-3);
	margin-block: var(--spacing-2);
	width: 100%;
	max-width: none;
}

.areas-grid > div h3 {
	margin-top: 0;
	margin-bottom: var(--spacing-1);
}

.areas-grid .custom-list {
	margin-block: 0;
}

@media (max-width: 767px) {
	.areas-grid {
		grid-template-columns: 1fr;
		gap: var(--spacing-2);
	}
}

/* Footer areas block. NB: font-size set to 13px in footer.css too;
   kept consistent here so this later-loading file doesn't override. */
.footer-areas p {
	font-size: 13px;
	line-height: 1.7;
	margin-top: 0.5rem;
	max-width: none;
}

/* ---------- FAQ accordions ---------- */

.faq-list {
	margin-block: var(--spacing-2);
	width: 100%;
	max-width: none;
}

.faq-item {
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	width: 100%;
	max-width: none;
}

.faq-item:last-child {
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.faq-item summary {
	list-style: none;
	cursor: pointer;
	padding: 1.5rem 0;
	font-family: 'Montserrat', 'Inter', sans-serif;
	font-weight: 600;
	font-size: var(--text);
	color: var(--text-dark);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.5rem;
	transition: color 0.2s ease-in-out;
}

.faq-item summary::-webkit-details-marker {
	display: none; /* Safari */
}

.faq-item summary::after {
	content: "+";
	color: var(--colour-primary);
	font-size: 1.8em;
	line-height: 1;
	font-weight: 400;
	transition: transform 0.2s ease-in-out;
	flex-shrink: 0;
	display: inline-block;
	width: 1em;
	text-align: center;
}

.faq-item[open] summary::after {
	content: "\2212"; /* minus sign — wider than hyphen */
}

.faq-item summary:hover {
	color: var(--colour-primary);
}

.faq-item p {
	padding: 0 0 1.5rem 0;
	max-width: none; /* override Pass 1's 70ch */
	color: var(--text-dark);
	margin: 0;
	line-height: 1.7;
}

/* ---------- Testimonials carousel — white text on the dark red quote card ---------- */

.content .quote-container .quote,
.content .quote-container .quote p,
.content .quote-container .quote cite,
.content .quote-container .quote cite span,
.content .quote-container blockquote,
.content .quote-container blockquote p,
.content .quote-container blockquote cite {
	color: #fff;
}

/* ---------- Mobile spacing tweaks ---------- */

@media (max-width: 767px) {
	.content section {
		padding-block: var(--spacing-3);
	}
	.content h2 {
		margin-top: var(--spacing-2);
	}
}
