/* ==========================================================================
   Edinburgh City — site styles (layered on top of Canvas)
   ========================================================================== */

:root {
	--ec-navy:      #16283d;
	--ec-navy-dk:   #0e1b2a;
	--ec-heather:   #6d4c7d;
	--ec-thistle:   #8d6ba0;
	--ec-stone:     #f4f2ee;
	--ec-line:      #e2ded6;
	--ec-gold:      #c8a34a;
	--ec-text:      #33383f;

	--cnvs-themecolor: var(--ec-heather);
	--cnvs-primary-font: 'Inter', sans-serif;
	--cnvs-body-font: 'Inter', sans-serif;
}

body { color: var(--ec-text); }

/* ---------------------------------------------------------------- header */
#header:not(.transparent-header) { border-bottom: 1px solid var(--ec-line); }

.ec-logo {
	display: flex;
	align-items: center;
	gap: .6rem;
	text-decoration: none;
	line-height: 1;
}

/* The logo is a transparent PNG — no background block behind it, or the fill
   colour shows through the transparent areas and clashes. */
.ec-logo-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	background: none;
	border-radius: 0;
}

/* Canvas sizes the header logo with `#header-wrap #logo img { height:
   var(--cnvs-header-height) }` — specificity (2,0,1), which beats a plain
   `.ec-logo-mark img` (0,1,1). A class-only rule here is silently ignored and
   the mark renders at the full 100px header height. These selectors match
   Canvas's own specificity and win on source order; the second one covers the
   sticky-shrink state, which Canvas sets at (3,2,1). */
#header-wrap #logo .ec-logo-mark img,
.is-expanded-menu #header.sticky-header-shrink #header-wrap #logo .ec-logo-mark img {
	display: block;
	width: auto;
	height: 26px;          /* natural aspect, never stretched */
	max-width: 100%;
	transition: none;
}

/* footer mark is outside #logo, so a plain class rule is enough there */
.ec-logo-mark img {
	display: block;
	width: auto;
	height: 26px;
	max-width: 100%;
}

.ec-logo-text {
	font-size: 1.1rem;
	letter-spacing: -.015em;
	color: var(--ec-navy);
	font-weight: 400;
	white-space: nowrap;
}

.ec-logo-text strong { font-weight: 700; }

.ec-logo-footer .ec-logo-text { color: #fff; }
.ec-logo-footer .ec-logo-mark { background: none; }
.ec-logo-footer { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; }

.menu-item.current > .menu-link { color: var(--ec-heather); }

/* ------------------------------------------------------------ page title */
/* Sized by padding, deliberately NOT flex: Canvas lays this out as a normal
   block, and making it a flex container turns .container into a flex item that
   shrink-wraps to its content instead of filling the row — which squashes the
   heading into a narrow column. */
#page-title {
	padding: 5rem 0 4.25rem;
	background-color: var(--ec-navy);
	position: relative;
	border-bottom: 0;
}

#page-title > .container {
	width: 100%;
}

#page-title.page-title-parallax::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(14,27,42,.62) 0%, rgba(14,27,42,.82) 100%);
}

#page-title .container { position: relative; z-index: 2; }

/* Titles on this site run from 10 to 58 characters ("Edinburgh Underfloor
   Heating Installers & Plumbing Fitters" is the longest). A fixed rem measure
   keeps every one of them to at most two lines, and text-wrap: balance splits
   those two lines evenly instead of leaving one orphaned word. */
#page-title h1 {
	color: #fff;
	font-weight: 700;
	font-size: clamp(1.6rem, 1.05rem + 1.9vw, 2.5rem);
	line-height: 1.25;
	letter-spacing: -.02em;
	text-transform: none;
	margin: 0 0 1rem;
	max-width: min(100%, 46rem);
	text-wrap: balance;
	hyphens: none;
}

#page-title .breadcrumb {
	position: static;
	transform: none;
	margin: 0;
	padding: 0;
	background: none;
	font-size: .875rem;
}

#page-title .breadcrumb a { color: rgba(255,255,255,.75); }
#page-title .breadcrumb a:hover { color: #fff; }
#page-title .breadcrumb .active { color: rgba(255,255,255,.55); }
#page-title .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.4); }

#page-title.ec-title-plain {
	background: linear-gradient(135deg, var(--ec-navy) 0%, var(--ec-heather) 140%);
}

/* ----------------------------------------------------------- article body */
.ec-body { font-size: 1.0625rem; line-height: 1.75; }

.ec-body > p { margin-bottom: 1.4rem; }

.ec-body h2.ec-h2 {
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--ec-navy);
	letter-spacing: -.015em;
	margin: 2.6rem 0 1rem;
	padding-top: 1.6rem;
	border-top: 3px solid var(--ec-line);
}

.ec-body > h2.ec-h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.ec-body h3 {
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--ec-heather);
	margin: 2rem 0 .75rem;
}

.ec-body ul, .ec-body ol { margin: 0 0 1.5rem 0; padding-left: 0; list-style: none; }

.ec-body ul > li {
	position: relative;
	padding-left: 1.6rem;
	margin-bottom: .5rem;
}

.ec-body ul > li::before {
	content: '';
	position: absolute;
	left: .35rem;
	top: .72em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--ec-gold);
}

.ec-body ol { counter-reset: ec; }
.ec-body ol > li { counter-increment: ec; position: relative; padding-left: 1.9rem; margin-bottom: .5rem; }
.ec-body ol > li::before {
	content: counter(ec) '.';
	position: absolute; left: 0; top: 0;
	color: var(--ec-heather); font-weight: 600;
}

/* --------------------------------------------------------------- link rules */
/* Text links are underlined everywhere. Buttons, the top navigation, the logo
   and icon links are deliberately excluded — underlining those reads as broken
   rather than as a link. */
a {
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
}

a:hover { text-decoration: underline; }

.button,
.ec-logo,
.social-icon,
.menu-link,
.primary-menu a,
#gotoTop,
.ec-trade,
.ec-card-media,
.header-misc-icon a,
.faux-button {
	text-decoration: none !important;
}

.ec-body a { color: var(--ec-heather); text-decoration: underline; text-underline-offset: 2px; }
.ec-body a:hover { color: var(--ec-navy); text-decoration-thickness: 2px; }

/* Links inside article copy.
 *
 * Canvas ships this at style.css:13805 —
 *     a:not(.btn-link):not(.text-decoration-underline):not(.more-link) {
 *         text-decoration: none !important;
 *     }
 * That is `!important`, so it beats ANY normal declaration no matter how
 * specific. Every earlier attempt here was a plain declaration and therefore
 * could never take effect. To win we need !important too, and then enough
 * specificity: Canvas's selector counts as (0,3,1) because each :not()
 * argument contributes a class. Adding #content (an ID, on the wrapping
 * <section>) puts these at (1,1,2), which outranks it outright.
 */
#content .ec-body p a,
#content .ec-body li a,
#content .ec-body td a,
#content .ec-body dd a,
#content .ec-listing p a {
	color: var(--ec-heather);
	text-decoration: underline !important;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

#content .ec-body p a:hover,
#content .ec-body li a:hover,
#content .ec-body td a:hover,
#content .ec-body dd a:hover,
#content .ec-listing p a:hover {
	color: var(--ec-navy);
	text-decoration: underline !important;
	text-decoration-thickness: 2px;
}

/* Breadcrumb, sidebar, footer, copyright and card links.
   Same story as the article links above: Canvas's
   `a:not(...):not(...):not(...) { text-decoration: none !important }` (0,3,1)
   defeats any plain declaration, so each of these needs !important plus an
   ID to outrank it. Without that they silently render with no underline. */
#page-title .breadcrumb a,
#content .ec-side-item a,
#content .ec-card .card-title a,
#footer .ec-foot-list a,
#copyrights a {
	text-decoration: underline !important;
	text-underline-offset: 2px;
}

/* .more-link needs no !important — Canvas explicitly exempts that class in
   its :not() list, so a normal declaration already applies. */
.more-link { text-decoration: underline; text-underline-offset: 2px; }

/* Base rule: an image is never scaled beyond its natural size. Upscaling the
   small company logos to the full column width was what made them blurry. */
.ec-figure {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	margin: 0 0 1.5rem;
	border-radius: 10px;
	box-shadow: 0 6px 24px rgba(22,40,61,.10);
}

/* Large photographs are allowed to fill the column (they are downscaled, which
   is safe). The build tags these by measuring the file. */
.ec-figure-wide {
	width: 100%;
}

/* Logos and other small artwork: natural size, no shadow, modest frame. */
.ec-figure-logo {
	width: auto;
	max-width: 100%;
	border-radius: 6px;
	box-shadow: none;
	margin-bottom: 1.25rem;
}

.ec-float-right {
	width: 46%;
	max-width: 340px;
	float: right;
	margin: .35rem 0 1.25rem 1.75rem;
}

.ec-caption {
	font-size: .8125rem;
	color: #7a8290;
	font-style: italic;
	margin: -1rem 0 1.6rem;
}

.ec-section { display: block; }

/* directory listing blocks (company pages) */
.ec-listing {
	background: #fff;
	border: 1px solid var(--ec-line);
	border-radius: 12px;
	padding: 1.75rem;
	margin-bottom: 1.75rem;
	box-shadow: 0 2px 10px rgba(22,40,61,.04);
}

.ec-listing-title {
	font-size: 1.35rem !important;
	font-weight: 700;
	color: var(--ec-navy);
	margin: 0 0 1rem !important;
	padding-top: 0 !important;
	border-top: 0 !important;
}

/* Company logos inside a directory listing: intrinsic size, never stretched. */
.ec-listing .ec-figure {
	width: auto;
	max-width: min(100%, 300px);
	height: auto;
	margin-bottom: 1.25rem;
	box-shadow: none;
	border: 1px solid var(--ec-line);
	background: #fff;
	padding: .5rem;
}

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

/* ------------------------------------------------------------- card grids */
.ec-cards { margin-bottom: 1rem; }

.ec-card {
	border: 1px solid var(--ec-line);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	transition: transform .18s ease, box-shadow .18s ease;
}

.ec-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 30px rgba(22,40,61,.12);
}

.ec-card-media { display: block; overflow: hidden; background: var(--ec-stone); }

.ec-card-media img {
	width: 100%;
	height: 190px;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}

.ec-card:hover .ec-card-media img { transform: scale(1.04); }

.ec-card .card-body { padding: 1.35rem; }

.ec-card .card-title { margin-bottom: .6rem; line-height: 1.3; }
.ec-card .card-title a { color: var(--ec-navy); text-decoration: none; font-weight: 700; }
.ec-card .card-title a:hover { color: var(--ec-heather); }

.ec-card .card-text {
	font-size: .9375rem;
	line-height: 1.65;
	color: #5c646f;
	margin-bottom: 1rem;
}

.more-link {
	font-size: .875rem;
	font-weight: 600;
	color: var(--ec-heather) !important;
	text-decoration: none !important;
	white-space: nowrap;
}

.more-link i { vertical-align: -2px; }
.more-link:hover { color: var(--ec-navy) !important; }

/* ---------------------------------------------------------------- sidebar */
.ec-sidebar { padding-top: .25rem; }

.ec-widget {
	background: var(--ec-stone);
	border-radius: 12px;
	padding: 1.5rem;
	margin-bottom: 1.75rem;
}

.ec-side-head {
	font-size: .8125rem;
	text-transform: uppercase;
	letter-spacing: .09em;
	font-weight: 700;
	color: var(--ec-navy);
	margin-bottom: 1rem;
	padding-bottom: .75rem;
	border-bottom: 1px solid var(--ec-line);
}

.ec-side-list { list-style: none; margin: 0; padding: 0; }

.ec-side-item + .ec-side-item { border-top: 1px solid rgba(0,0,0,.05); }

.ec-side-item a {
	display: block;
	padding: .6rem 0;
	font-size: .9375rem;
	color: var(--ec-text);
	text-decoration: none;
}

.ec-side-item a:hover { color: var(--ec-heather); padding-left: .3rem; transition: padding .15s ease; }
.ec-side-item.active a { color: var(--ec-heather); font-weight: 600; }

.ec-cta { background: var(--ec-navy); color: rgba(255,255,255,.8); }
.ec-cta .ec-side-head { color: #fff; border-bottom-color: rgba(255,255,255,.15); }
.ec-cta p { font-size: .9375rem; line-height: 1.6; margin-bottom: 1.15rem; }
.ec-cta .button { background: var(--ec-gold); color: var(--ec-navy-dk); font-weight: 600; }
.ec-cta .button:hover { background: #fff; }

/* ----------------------------------------------------------------- footer */
.ec-footer { background: var(--ec-navy-dk); }
.ec-footer .widget h4 {
	color: #fff;
	font-size: .8125rem;
	text-transform: uppercase;
	letter-spacing: .09em;
	margin-bottom: 1.1rem;
}
.ec-foot-list { list-style: none; margin: 0; padding: 0; }
.ec-foot-list li { margin-bottom: .5rem; }
.ec-foot-list a { font-size: .9375rem; color: rgba(255,255,255,.62); text-decoration: none; }
.ec-foot-list a:hover { color: #fff; }
.ec-footer #copyrights { background: rgba(0,0,0,.28); font-size: .875rem; }
.ec-footer #copyrights a { color: rgba(255,255,255,.62); }
.ec-footer #copyrights a:hover { color: #fff; }

/* ------------------------------------------------------------ home page */
.ec-hero {
	position: relative;
	background: var(--ec-navy);
	color: #fff;
	padding: 7rem 0 6rem;
	overflow: hidden;
}

.ec-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	/* relative to this stylesheet, so the site also works from file:/// */
	background-image: url('../images/edinburgh-castle-now/castle.jpg');
	background-size: cover;
	background-position: center 38%;
	opacity: .35;
}

.ec-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(14,27,42,.55) 0%, rgba(14,27,42,.9) 100%);
}

.ec-hero .container { position: relative; z-index: 3; }

.ec-hero h1 {
	font-size: clamp(2.1rem, 5vw, 3.4rem);
	font-weight: 700;
	letter-spacing: -.025em;
	line-height: 1.1;
	color: #fff;
	margin-bottom: 1.25rem;
	max-width: 18ch;
}

.ec-hero .lead {
	font-size: 1.15rem;
	line-height: 1.65;
	color: rgba(255,255,255,.8);
	max-width: 56ch;
	margin-bottom: 2rem;
}

.ec-eyebrow {
	display: inline-block;
	font-size: .75rem;
	letter-spacing: .16em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--ec-gold);
	margin-bottom: 1rem;
}

.ec-hero .button { margin-right: .75rem; }
.ec-hero .button-gold { background: var(--ec-gold); color: var(--ec-navy-dk); font-weight: 600; }
.ec-hero .button-gold:hover { background: #fff; }

.ec-band { background: var(--ec-stone); }

.ec-sec-head { max-width: 62ch; margin-bottom: 2.5rem; }
.ec-sec-head h2 {
	font-size: 2rem;
	font-weight: 700;
	color: var(--ec-navy);
	letter-spacing: -.02em;
	margin-bottom: .75rem;
}
.ec-sec-head p { font-size: 1.05rem; color: #5c646f; line-height: 1.7; margin: 0; }

.ec-stat { text-align: center; padding: 1rem 0; }
.ec-stat-num {
	display: block;
	font-size: 2.4rem;
	font-weight: 700;
	color: var(--ec-heather);
	line-height: 1;
	letter-spacing: -.03em;
}
.ec-stat-lbl {
	display: block;
	margin-top: .5rem;
	font-size: .8125rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #6c7480;
}

.ec-trade {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.15rem 1.25rem;
	background: #fff;
	border: 1px solid var(--ec-line);
	border-radius: 10px;
	text-decoration: none;
	height: 100%;
	transition: border-color .18s ease, transform .18s ease;
}

.ec-trade:hover { border-color: var(--ec-heather); transform: translateY(-2px); }

.ec-trade i {
	font-size: 1.5rem;
	color: var(--ec-heather);
	flex: 0 0 auto;
}

.ec-trade span { font-weight: 600; color: var(--ec-navy); font-size: .95rem; line-height: 1.3; }

/* ---------------------------------------------------------------- contact */
.ec-contact-card {
	background: var(--ec-stone);
	border-radius: 12px;
	padding: 1.75rem;
	height: 100%;
}
.ec-contact-card i { font-size: 1.6rem; color: var(--ec-heather); margin-bottom: .85rem; display: block; }
.ec-contact-card h3 { font-size: 1.05rem; color: var(--ec-navy); margin-bottom: .5rem; font-weight: 700; }
.ec-contact-card p { font-size: .9375rem; color: #5c646f; margin: 0; line-height: 1.6; }

.ec-form label { font-weight: 600; font-size: .875rem; color: var(--ec-navy); margin-bottom: .4rem; }
.ec-form .form-control { border-radius: 8px; border-color: var(--ec-line); padding: .7rem .9rem; }
.ec-form .form-control:focus { border-color: var(--ec-heather); box-shadow: 0 0 0 .18rem rgba(109,76,125,.12); }

/* ==========================================================================
   Responsive typography

   Desktop sizes are set for a ~700px article column. On a phone the same
   values read as oversized, so everything steps down together — body copy,
   headings, list items, cards, sidebar and footer — rather than only the
   headings shrinking, which leaves the rest looking heavy by comparison.
   ========================================================================== */

/* ---------------------------------------------------- tablet (<= 991.98px) */
@media (max-width: 991.98px) {
	.ec-sidebar { margin-top: 3rem; }

	#page-title { padding: 3.5rem 0 3rem; }

	.ec-body { font-size: 1.03125rem; line-height: 1.72; }
	.ec-body h2.ec-h2 { font-size: 1.45rem; margin-top: 2.2rem; padding-top: 1.35rem; }
	.ec-body h3 { font-size: 1.12rem; }

	.ec-sec-head h2 { font-size: 1.75rem; }
	.ec-stat-num { font-size: 2.1rem; }
}

/* ---------------------------------------------------- mobile (<= 767.98px) */
@media (max-width: 767.98px) {

	/* --- headings --- */
	#page-title { padding: 2.75rem 0 2.5rem; }
	#page-title h1 { font-size: 1.75rem; line-height: 1.25; margin-bottom: .75rem; }
	#page-title .breadcrumb { font-size: .8125rem; }

	/* --- body copy --- */
	.ec-body { font-size: 1rem; line-height: 1.68; }
	.ec-body > p { margin-bottom: 1.15rem; }

	.ec-body h2.ec-h2 {
		font-size: 1.3rem;
		margin: 2rem 0 .8rem;
		padding-top: 1.2rem;
		border-top-width: 2px;
	}

	.ec-body h3 { font-size: 1.05rem; margin: 1.5rem 0 .6rem; }

	/* --- list items --- */
	.ec-body ul, .ec-body ol { margin-bottom: 1.2rem; }
	.ec-body ul > li,
	.ec-body ol > li {
		font-size: .96875rem;
		line-height: 1.6;
		margin-bottom: .4rem;
		padding-left: 1.35rem;
	}
	.ec-body ul > li::before { left: .3rem; top: .66em; width: 5px; height: 5px; }
	.ec-body ol > li { padding-left: 1.65rem; }

	.ec-caption { font-size: .75rem; margin: -.75rem 0 1.25rem; }

	/* --- images / listings --- */
	.ec-float-right {
		float: none;
		width: 100%;
		max-width: none;
		margin: 0 0 1.5rem;
	}
	.ec-listing { padding: 1.25rem; margin-bottom: 1.35rem; }
	.ec-listing-title { font-size: 1.15rem !important; margin-bottom: .8rem !important; }
	.ec-listing .ec-figure { max-width: min(100%, 240px); }

	/* --- cards --- */
	.ec-card .card-body { padding: 1.1rem; }
	.ec-card .card-title { font-size: 1.05rem; margin-bottom: .5rem; }
	.ec-card .card-text { font-size: .875rem; line-height: 1.6; margin-bottom: .85rem; }
	.ec-card-media img { height: 165px; }
	.more-link { font-size: .8125rem; }

	/* --- sidebar --- */
	.ec-widget { padding: 1.25rem; margin-bottom: 1.35rem; }
	.ec-side-head { font-size: .75rem; margin-bottom: .85rem; padding-bottom: .6rem; }
	.ec-side-item a { font-size: .875rem; padding: .5rem 0; }
	.ec-cta p { font-size: .875rem; margin-bottom: 1rem; }

	/* --- footer --- */
	.ec-footer .widget h4 { font-size: .75rem; margin-bottom: .85rem; }
	.ec-foot-list li { margin-bottom: .35rem; }
	.ec-foot-list a { font-size: .875rem; }
	.ec-footer #copyrights { font-size: .8125rem; }
	.ec-logo-footer .ec-logo-text { font-size: 1rem; }

	/* --- home page --- */
	.ec-hero { padding: 3.5rem 0 3rem; }
	.ec-hero .lead { font-size: 1rem; line-height: 1.6; margin-bottom: 1.5rem; }
	.ec-eyebrow { font-size: .6875rem; }
	.ec-sec-head { margin-bottom: 1.75rem; }
	.ec-sec-head h2 { font-size: 1.5rem; margin-bottom: .6rem; }
	.ec-sec-head p { font-size: .9375rem; line-height: 1.6; }
	.ec-stat-num { font-size: 1.9rem; }
	.ec-stat-lbl { font-size: .75rem; }
	.ec-trade { padding: .95rem 1rem; gap: .8rem; }
	.ec-trade i { font-size: 1.3rem; }
	.ec-trade span { font-size: .9rem; }

	/* --- contact --- */
	.ec-contact-card { padding: 1.25rem; }
	.ec-contact-card h3 { font-size: 1rem; }
	.ec-contact-card p { font-size: .875rem; }
	.ec-form label { font-size: .8125rem; }
}

/* ----------------------------------------------- small phones (<= 479.98px) */
@media (max-width: 479.98px) {

	.ec-logo-text { font-size: 1rem; }

	#page-title { padding: 2.25rem 0 2rem; }
	#page-title h1 { font-size: 1.5rem; line-height: 1.28; }
	#page-title .breadcrumb { font-size: .75rem; }

	.ec-body { font-size: .9375rem; line-height: 1.65; }
	.ec-body h2.ec-h2 { font-size: 1.18rem; margin-top: 1.75rem; padding-top: 1rem; }
	.ec-body h3 { font-size: 1rem; }
	.ec-body ul > li,
	.ec-body ol > li { font-size: .9375rem; line-height: 1.55; }

	.ec-listing { padding: 1rem; }
	.ec-listing-title { font-size: 1.05rem !important; }

	.ec-card .card-title { font-size: 1rem; }
	.ec-card .card-text { font-size: .85rem; }
	.ec-card-media img { height: 150px; }

	.ec-side-item a { font-size: .85rem; }
	.ec-foot-list a { font-size: .8125rem; }
	.ec-footer #copyrights { font-size: .78125rem; }

	.ec-hero { padding: 2.75rem 0 2.5rem; }
	.ec-hero .lead { font-size: .9375rem; }
	.ec-hero .button { margin-bottom: .6rem; width: 100%; margin-right: 0; }
	.ec-sec-head h2 { font-size: 1.35rem; }
	.ec-sec-head p { font-size: .9rem; }
	.ec-stat-num { font-size: 1.7rem; }
	.ec-trade span { font-size: .875rem; }
}
