/*
Theme Name: Dulwich Roofing
Theme URI: https://dulwichroofing.co.uk/
Description: Custom theme for Dulwich Roofing Contractors
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dulwich-roofing
*/

/* ==========================================================================
   Variables
   ========================================================================== */

:root {
	--color-dark:    #312f38;
	--color-teal:    #4db2b3;
	--color-teal-dk: #3d8f90;
	--color-text:    #424753;
	--color-muted:   #6b7280;
	--color-border:  #e0e0e5;
	--color-bg:      #ffffff;
	--color-bg-alt:  #f7f8fa;

	--font-body:    'Raleway', Helvetica, Tahoma, Geneva, Arial, sans-serif;
	--font-heading: 'Lato', Helvetica, Tahoma, Geneva, Arial, sans-serif;

	--container-width: 1140px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.7;
	color: var(--color-text);
	background: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	font-weight: 700;
	line-height: 1.3;
	color: var(--color-dark);
	margin: 0 0 0.75em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1.25em; }

a { color: var(--color-teal); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-teal-dk); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { padding-left: 1.5em; }

hr {
	border: none;
	border-top: 1px solid var(--color-border);
	margin: 2rem 0;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 1.5rem;
}

.site-content { padding: 3rem 0; }

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

#masthead {
	background: var(--color-dark);
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.site-branding {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 0;
	gap: 1rem;
}

.site-title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.site-title a { color: #ffffff; }
.site-title a:hover { color: var(--color-teal); }

.main-navigation { display: flex; align-items: center; }

.main-navigation ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-navigation li { position: relative; }

.main-navigation a {
	display: block;
	padding: 0.65rem 0.9rem;
	color: rgba(255,255,255,0.85);
	font-family: var(--font-heading);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	transition: color 0.2s, background 0.2s;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
	color: #ffffff;
	background: rgba(255,255,255,0.08);
}

.main-navigation .nav-emergency > a { color: #ffcc00; }
.main-navigation .nav-emergency > a:hover { color: #ffffff; background: #c0392b; }

.menu-toggle {
	display: none;
	background: none;
	border: 1px solid rgba(255,255,255,0.3);
	color: #ffffff;
	padding: 0.5rem 0.75rem;
	cursor: pointer;
	font-size: 1.25rem;
	border-radius: 3px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: var(--color-dark);
}

.hero img {
	width: 100%;
	height: auto;
	display: block;
}

@media (min-width: 1440px) {
	.hero img {
		height: 980px;
		object-fit: cover;
		object-position: center 25%;
	}
}

/* ==========================================================================
   CTA Band
   ========================================================================== */

.cta-band {
	background: var(--color-dark);
	padding: 1.25rem 0;
}

.cta-band-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2rem;
	flex-wrap: wrap;
}

.cta-phone {
	font-family: var(--font-heading);
	font-size: 1.75rem;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: 0.02em;
}
.cta-phone:hover { color: var(--color-teal); }

.btn {
	display: inline-block;
	background: var(--color-teal);
	color: #ffffff !important;
	padding: 0.75rem 1.75rem;
	border-radius: 3px;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border: none;
	cursor: pointer;
	transition: background 0.2s;
}
.btn:hover { background: var(--color-teal-dk); color: #ffffff !important; }

.btn-outline {
	background: transparent;
	border: 2px solid var(--color-teal);
}
.btn-outline:hover { background: var(--color-teal); }

/* ==========================================================================
   Tagline Section
   ========================================================================== */

.tagline-section {
	padding: 3.5rem 1.5rem;
	text-align: center;
}

.tagline-section h1 {
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	color: var(--color-dark);
	margin-bottom: 1rem;
	line-height: 1.2;
}

.tagline-section .lead {
	font-size: 1.1rem;
	color: var(--color-muted);
	max-width: 640px;
	margin: 0 auto;
	line-height: 1.7;
}

/* ==========================================================================
   Trust Bar
   ========================================================================== */

.trust-bar {
	background: var(--color-bg-alt);
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
	padding: 2rem 0;
}

.trust-items {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: center;
}

.trust-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	padding: 0.5rem;
}

.trust-icon {
	font-family: var(--font-heading);
	font-size: 1.75rem;
	font-weight: 900;
	color: var(--color-teal);
	line-height: 1;
	display: block;
	margin-bottom: 0.35rem;
}

.trust-item strong {
	display: block;
	font-family: var(--font-heading);
	font-size: 0.875rem;
	color: var(--color-dark);
	font-weight: 700;
}

.trust-item span {
	display: block;
	font-size: 0.78rem;
	color: var(--color-muted);
}

/* ==========================================================================
   About Section (front page)
   ========================================================================== */

.about-section { padding: 3.5rem 0; }

.about-columns {
	display: grid;
	grid-template-columns: 3fr 2fr;
	gap: 3rem;
	align-items: start;
}

.about-text p { font-size: 1rem; }

.about-divider { margin: 1.75rem 0; }

.about-photos {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.about-photos img {
	width: 100%;
	height: auto;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Services Grid Section (front page)
   ========================================================================== */

.services-grid-section {
	background: var(--color-bg-alt);
	border-top: 1px solid var(--color-border);
	padding: 3rem 0;
}

.services-grid-title {
	text-align: center;
	margin-bottom: 1.75rem;
}

.service-cards {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 0.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.service-card {
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: 4px;
	transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.service-card:hover {
	border-color: var(--color-teal);
	box-shadow: 0 2px 12px rgba(77,178,179,0.15);
	transform: translateY(-2px);
}

.service-card a {
	display: block;
	padding: 1.25rem 1rem;
	text-align: center;
	color: var(--color-dark);
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 0.9rem;
	line-height: 1.3;
}
.service-card a:hover { color: var(--color-teal); }

/* ==========================================================================
   Guarantee Section
   ========================================================================== */

.guarantee-section {
	padding: 3rem 0;
	text-align: center;
	border-top: 1px solid var(--color-border);
}

.guarantee-section img {
	margin: 0 auto 1rem;
}

.guarantee-section p {
	color: var(--color-muted);
	font-size: 0.95rem;
	margin: 0;
}

/* ==========================================================================
   Inner page: content + sidebar layout
   ========================================================================== */

.content-with-sidebar {
	display: grid;
	grid-template-columns: 1fr 240px;
	gap: 2.5rem;
	align-items: start;
}

.main-col { min-width: 0; }

.entry-header { margin-bottom: 2rem; }

.entry-title {
	font-size: 2rem;
	border-bottom: 3px solid var(--color-teal);
	padding-bottom: 0.5rem;
	display: inline-block;
}

.entry-content h2 { color: var(--color-dark); }
.entry-content h3 { color: var(--color-teal-dk); }
.entry-content img { border-radius: 3px; margin: 0.5rem 0 1rem; }

/* ==========================================================================
   Services Sidebar (inner pages)
   ========================================================================== */

.widget-area {
	position: sticky;
	top: 4rem;
	background: var(--color-bg-alt);
	border-left: 4px solid var(--color-teal);
	border-radius: 0 4px 4px 0;
	padding: 1.25rem 1rem;
}

.widget-title {
	font-family: var(--font-heading);
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--color-dark);
	margin-bottom: 0.75rem;
}

.widget-area ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.widget-area ul li { border-bottom: 1px solid var(--color-border); }
.widget-area ul li:last-child { border-bottom: none; }

.widget-area ul li a {
	display: block;
	padding: 0.5rem 0.25rem;
	color: var(--color-text);
	font-size: 0.875rem;
	transition: color 0.15s, padding-left 0.15s;
}

.widget-area ul li a:hover,
.widget-area ul li.current a { color: var(--color-teal); padding-left: 6px; }
.widget-area ul li.current a { font-weight: 700; }

/* ==========================================================================
   Forms — WPForms + CF7 (both supported)
   ========================================================================== */

/* Shared input styles */
.wpforms-field input[type="text"],
.wpforms-field input[type="email"],
.wpforms-field input[type="tel"],
.wpforms-field input[type="url"],
.wpforms-field input[type="number"],
.wpforms-field textarea,
.wpforms-field select,
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border: 1px solid var(--color-border);
	border-radius: 3px;
	font-family: var(--font-body);
	font-size: 1rem;
	color: var(--color-text);
	background: var(--color-bg);
	transition: border-color 0.2s, box-shadow 0.2s;
	-webkit-appearance: none;
}

.wpforms-field input:focus,
.wpforms-field textarea:focus,
.wpcf7 input:focus,
.wpcf7 textarea:focus {
	outline: none;
	border-color: var(--color-teal);
	box-shadow: 0 0 0 3px rgba(77,178,179,0.15);
}

/* WPForms layout */
.wpforms-container { margin: 1.5rem 0; }

.wpforms-field {
	margin-bottom: 1.25rem;
}

.wpforms-field-label {
	display: block;
	font-family: var(--font-heading);
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--color-dark);
	margin-bottom: 0.4rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.wpforms-required-label {
	color: var(--color-teal);
	margin-left: 2px;
}

/* First / Last name row */
.wpforms-field-row {
	display: flex;
	gap: 1rem;
}

.wpforms-field-row-block { flex: 1; }

.wpforms-field-sublabel {
	display: block;
	font-size: 0.75rem;
	color: var(--color-muted);
	margin-top: 0.3rem;
}

/* Textarea */
.wpforms-field textarea {
	min-height: 140px;
	resize: vertical;
}

/* Submit button */
.wpforms-submit-container { margin-top: 0.5rem; }

.wpforms-submit {
	background: var(--color-teal);
	color: #ffffff;
	border: none;
	padding: 0.85rem 2.5rem;
	border-radius: 3px;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	cursor: pointer;
	transition: background 0.2s;
}
.wpforms-submit:hover { background: var(--color-teal-dk); }

/* Hide honeypot */
.wpforms-field-hp { display: none !important; }

/* Confirmation / error messages */
.wpforms-confirmation-container-full {
	background: var(--color-bg-alt);
	border-left: 4px solid var(--color-teal);
	padding: 1rem 1.25rem;
	border-radius: 0 3px 3px 0;
	font-weight: 600;
	color: var(--color-dark);
}

.wpforms-error-container,
label.wpforms-error {
	color: #c0392b;
	font-size: 0.85rem;
	margin-top: 0.3rem;
	display: block;
}

.wpforms-field input.wpforms-error,
.wpforms-field textarea.wpforms-error {
	border-color: #c0392b;
}

/* CF7 submit */
.wpcf7 input[type="submit"] {
	background: var(--color-teal);
	color: #ffffff;
	border: none;
	padding: 0.85rem 2.5rem;
	border-radius: 3px;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	cursor: pointer;
	transition: background 0.2s;
}
.wpcf7 input[type="submit"]:hover { background: var(--color-teal-dk); }

/* ==========================================================================
   Footer
   ========================================================================== */

#colophon {
	background: var(--color-dark);
	color: rgba(255,255,255,0.75);
	padding: 2.5rem 0 1.5rem;
	margin-top: 0;
}

.footer-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 2rem;
	margin-bottom: 2rem;
}

.footer-col h3 {
	color: #ffffff;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 0.75rem;
}

.footer-col p { margin-bottom: 0.5rem; font-size: 0.9rem; }
.footer-col a { color: var(--color-teal); font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }

.footer-phone {
	font-size: 1.25rem;
	font-weight: 700;
	color: #ffffff;
	display: block;
	margin-bottom: 0.25rem;
}
.footer-phone:hover { color: var(--color-teal); }

.footer-bottom {
	border-top: 1px solid rgba(255,255,255,0.1);
	padding-top: 1.25rem;
	text-align: center;
	font-size: 0.8rem;
	color: rgba(255,255,255,0.4);
}

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

@media (max-width: 960px) {
	.trust-items,
	.service-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
	.about-columns,
	.content-with-sidebar { grid-template-columns: 1fr; }
	.widget-area { position: static; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.about-photos { flex-direction: row; }
}

@media (max-width: 640px) {
	h1 { font-size: 1.6rem; }
	h2 { font-size: 1.35rem; }

	.site-branding { flex-wrap: wrap; align-items: center; }
	.site-title { flex: 1; }
	.menu-toggle { display: block; margin-left: auto; }
	.main-navigation { flex-basis: 100%; flex-direction: column; align-items: stretch; }
	.main-navigation ul { display: none; flex-direction: column; width: 100%; }
	.main-navigation ul.toggled { display: flex; }

.cta-band-inner { flex-direction: column; gap: 1rem; text-align: center; }
	.cta-phone { font-size: 1.4rem; }

	.trust-items { grid-template-columns: repeat(2, 1fr); }
	.service-cards { grid-template-columns: repeat(2, 1fr); }

	.about-photos { flex-direction: column; }
	.footer-grid { grid-template-columns: 1fr; }
}
