/* Collins Electrical - Beckenham
   Stylesheet. Single file, no framework, no build step. */

:root {
    --cream: #f4ede1;
    --cream-deep: #ece2cf;
    --ink: #1a1a1a;
    --ink-soft: #3a3a3a;
    --navy: #13294b;
    --navy-deep: #0c1c36;
    --brick: #9b3a1f;
    --rule: #cdbfa7;
    --rule-soft: #e2d6bc;
    --max-content: 1120px;
    --max-prose: 64ch;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
    color: var(--navy);
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.18;
    margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); }
h3 { font-size: 1.25rem; color: var(--ink); }
h4 { font-size: 1.05rem; color: var(--ink); margin-bottom: 0.3em; }

p { margin: 0 0 1em; max-width: var(--max-prose); }

a {
    color: var(--navy);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
a:hover { color: var(--brick); }

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

hr {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 3rem 0;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--rule);
    background: var(--cream);
}
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.75rem 0;
}
.wordmark {
    display: block;
    text-decoration: none;
    color: var(--navy);
    line-height: 0;
}
.wordmark img {
    display: block;
    width: auto;
    height: clamp(54px, 5.4vw, 76px);
    max-width: min(360px, 45vw);
    object-fit: contain;
}
.wordmark:hover { opacity: 0.88; }

.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a {
    text-decoration: none;
    color: var(--ink);
    font-size: 0.95rem;
}
.nav a[aria-current="page"] {
    color: var(--brick);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}
.nav a:hover { color: var(--brick); }
.nav .nav-phone {
    color: var(--navy);
    font-weight: 600;
}
@media (max-width: 640px) {
    .site-header-inner { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .wordmark img {
        width: min(300px, 88vw);
        height: auto;
        max-height: 78px;
    }
    .nav { flex-wrap: wrap; gap: 0.9rem 1.1rem; }
}

/* Hero */
.hero {
    padding: 4.5rem 0 4rem;
    border-bottom: 1px solid var(--rule);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 3rem;
    align-items: center;
}
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
    .hero { padding: 2.5rem 0 2.5rem; }
}
@media (max-width: 520px) {
    .hero { padding: 2rem 0 2.2rem; }
    .hero-actions { gap: 0.45rem; }
    .hero-actions .btn {
        padding: 0.72rem 0.78rem;
        font-size: 0.94rem;
    }
}
.hero h1 .lede-line {
    display: block;
    font-style: italic;
    color: var(--brick);
    font-size: 0.55em;
    font-weight: 400;
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}
.hero .summary {
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: 38ch;
}
.hero-actions {
    margin-top: 1.6rem;
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.85rem 1.4rem;
    background: var(--navy);
    color: var(--cream);
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--navy);
    border-radius: 2px;
    transition: background 120ms ease, color 120ms ease;
    font-size: 0.98rem;
}
.btn:hover { background: var(--navy-deep); color: var(--cream); }
.btn-secondary {
    background: transparent;
    color: var(--navy);
    border-color: var(--navy);
}
.btn-secondary:hover { background: var(--navy); color: var(--cream); }

/* Hero illustration - a hand-built CSS schematic, not stock imagery */
.hero-illustration {
    background: var(--cream-deep);
    border: 1px solid var(--rule);
    padding: 1.6rem;
    position: relative;
    aspect-ratio: 4 / 3;
}
.hero-illustration svg { width: 100%; height: 100%; display: block; }
.hero-illustration .caption {
    position: absolute;
    bottom: 0.6rem;
    right: 0.9rem;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

/* Sections */
section { padding: 4rem 0; }
@media (max-width: 720px) { section { padding: 2.6rem 0; } }
.section-title {
    margin-bottom: 2rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.8rem;
}
.section-title h2 { margin: 0; }
.section-title .meta {
    font-family: Georgia, serif;
    font-style: italic;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* Services overview on home */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--rule);
}
@media (max-width: 860px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .services-grid { grid-template-columns: 1fr; } }

.service-item {
    padding: 1.6rem 1.4rem 1.8rem;
    border-bottom: 1px solid var(--rule);
    border-right: 1px solid var(--rule);
}
.service-item:nth-child(3n) { border-right: 0; }
@media (max-width: 860px) {
    .service-item { border-right: 1px solid var(--rule); }
    .service-item:nth-child(3n) { border-right: 1px solid var(--rule); }
    .service-item:nth-child(2n) { border-right: 0; }
}
@media (max-width: 560px) {
    .service-item { border-right: 0 !important; }
}
.service-item .num {
    font-family: Georgia, serif;
    font-style: italic;
    color: var(--brick);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.4rem;
}
.service-item h3 { margin-bottom: 0.45rem; color: var(--navy); }
.service-item p { font-size: 0.96rem; color: var(--ink-soft); margin-bottom: 0.8rem; }
.service-item a.more {
    font-size: 0.92rem;
    color: var(--navy);
}

/* Trust strip */
.trust {
    background: var(--cream-deep);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}
@media (max-width: 860px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .trust-grid { grid-template-columns: 1fr; } }
.trust-item h4 {
    font-family: Georgia, serif;
    font-style: italic;
    font-weight: 400;
    color: var(--brick);
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
}
.trust-item p {
    margin: 0;
    font-size: 0.98rem;
    color: var(--ink);
}

/* About strip */
.about-strip {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 3rem;
    align-items: start;
}
@media (max-width: 860px) { .about-strip { grid-template-columns: 1fr; gap: 1.5rem; } }
.about-strip blockquote {
    margin: 0;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--ink);
    border-left: 3px solid var(--brick);
    padding-left: 1.2rem;
}
.about-strip blockquote cite {
    display: block;
    margin-top: 0.8rem;
    font-style: normal;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
@media (max-width: 860px) { .testimonials-grid { grid-template-columns: 1fr; gap: 1.5rem; } }
.testimonial {
    padding: 1.6rem 0 0;
    border-top: 2px solid var(--navy);
}
.testimonial p {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}
.testimonial footer {
    font-size: 0.9rem;
    color: var(--ink-soft);
}
.testimonial footer .who {
    color: var(--ink);
    font-weight: 600;
}

/* CTA strip */
.cta-strip {
    background: var(--navy);
    color: var(--cream);
    padding: 3rem 0;
}
.cta-strip h2 { color: var(--cream); margin-bottom: 0.4rem; }
.cta-strip p { color: var(--cream); opacity: 0.85; margin-bottom: 0; }
.cta-strip-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.cta-strip a.btn {
    background: var(--cream);
    color: var(--navy);
    border-color: var(--cream);
}
.cta-strip a.btn:hover { background: var(--brick); color: var(--cream); border-color: var(--brick); }

/* Services page */
.page-header {
    padding: 3.5rem 0 2.5rem;
    border-bottom: 1px solid var(--rule);
}
.page-header .crumb {
    font-family: Georgia, serif;
    font-style: italic;
    color: var(--ink-soft);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}
.page-header p.intro {
    font-size: 1.15rem;
    color: var(--ink-soft);
    max-width: 56ch;
}

.service-detail {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    padding: 2.6rem 0;
    border-bottom: 1px solid var(--rule);
    align-items: start;
}
.service-detail:last-of-type { border-bottom: 0; }
@media (max-width: 720px) {
    .service-detail { grid-template-columns: 1fr; gap: 0.6rem; }
}
.service-detail .label {
    font-family: Georgia, serif;
    font-style: italic;
    color: var(--brick);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}
.service-detail h2 {
    font-size: 1.6rem;
    margin: 0 0 0.6rem;
}
.service-detail ul {
    margin: 0.6rem 0 0;
    padding: 0;
    list-style: none;
}
.service-detail ul li {
    padding: 0.45rem 0;
    border-bottom: 1px dotted var(--rule);
    font-size: 0.97rem;
}
.service-detail ul li:last-child { border-bottom: 0; }
.service-detail .aside-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--ink-soft);
    font-style: italic;
}

/* Area list */
.area-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem 1.5rem;
    font-size: 0.97rem;
}
@media (max-width: 720px) { .area-grid { grid-template-columns: repeat(2, 1fr); } }

/* Contact page */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3.5rem;
    padding: 3rem 0 4rem;
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 2rem; } }

.contact-details dl {
    margin: 0;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.6rem 1.2rem;
}
.contact-details dt {
    font-family: Georgia, serif;
    font-style: italic;
    color: var(--ink-soft);
    font-size: 0.95rem;
}
.contact-details dd {
    margin: 0;
    font-size: 1rem;
}
.contact-details dd a { color: var(--navy); }

.contact-form {
    background: var(--cream-deep);
    border: 1px solid var(--rule);
    padding: 1.8rem;
}
.contact-form h2 { margin-top: 0; font-size: 1.4rem; }
.contact-form label {
    display: block;
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin: 0.9rem 0 0.3rem;
    font-family: Georgia, serif;
    font-style: italic;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--rule);
    background: var(--cream);
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    border-radius: 2px;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--navy);
    outline-offset: 1px;
    border-color: var(--navy);
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 560px) { .contact-form .form-row { grid-template-columns: 1fr; } }
.contact-form .submit-row {
    margin-top: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.contact-form .privacy {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 0.6rem;
}
.contact-form .req { color: var(--brick); }

.coverage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
    gap: 2rem;
    align-items: start;
}
.coverage-map {
    border: 1px solid var(--rule);
    background: var(--cream);
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.coverage-copy h3 {
    font-family: Georgia, serif;
    color: var(--navy);
    margin-top: 0;
}
.coverage-list {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
    border-top: 1px solid var(--rule);
}
.coverage-list li {
    border-bottom: 1px dotted var(--rule);
    padding: 0.55rem 0;
    font-size: 0.95rem;
}
@media (max-width: 860px) {
    .coverage-grid { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
    background: var(--cream-deep);
    border-top: 1px solid var(--rule);
    padding: 2.6rem 0 1.4rem;
    margin-top: 4rem;
    font-size: 0.94rem;
    color: var(--ink-soft);
}
.site-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
@media (max-width: 720px) { .site-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .site-footer-grid { grid-template-columns: 1fr; } }

.site-footer h4 {
    font-family: Georgia, serif;
    font-style: italic;
    font-weight: 400;
    color: var(--brick);
    font-size: 0.92rem;
    margin: 0 0 0.7rem;
}
.footer-logo {
    display: block;
    width: min(210px, 100%);
    height: auto;
    margin: -0.8rem 0 0.9rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 0.35rem; }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--brick); }
.site-footer .colophon {
    border-top: 1px solid var(--rule);
    padding-top: 1.2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.86rem;
}

/* Photo slots
   Designed so the page looks intentional whether the photo loads or not.
   When no image is present, the <figure> falls back to a captioned placeholder
   via the data-fallback attribute. */
.photo {
    background: var(--cream-deep);
    border: 1px solid var(--rule);
    position: relative;
    overflow: hidden;
    margin: 0;
}
.photo.is-4-3 { aspect-ratio: 4 / 3; }
.photo.is-3-2 { aspect-ratio: 3 / 2; }
.photo.is-1-1 { aspect-ratio: 1 / 1; }
.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hero-photo img {
    object-position: 50% 42%;
}
.photo figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(19, 41, 75, 0.86);
    color: var(--cream);
    padding: 0.55rem 0.85rem;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.3;
}
.photo .placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.2rem;
    color: var(--ink-soft);
    background: var(--cream-deep);
    background-image:
        repeating-linear-gradient(45deg,
            transparent 0,
            transparent 14px,
            rgba(19,41,75,0.045) 14px,
            rgba(19,41,75,0.045) 15px);
}
.photo .placeholder .label {
    font-family: Georgia, serif;
    font-style: italic;
    color: var(--brick);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.3rem;
}
.photo .placeholder .what {
    font-family: Georgia, serif;
    color: var(--navy);
    font-size: 1.05rem;
    margin: 0;
}
.photo .placeholder .note {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-top: 0.6rem;
    font-style: italic;
}
/* When a real <img> exists inside .photo, hide the placeholder.
   :has() is well-supported (Safari 15.4+, Chrome 105+, Firefox 121+). */
.photo:has(img) .placeholder { display: none; }
.photo:has(img) .hero-illustration-fallback { display: none; }
/* And if the image fails to load, the onerror handler removes the img,
   so the placeholder shows again naturally. */

/* Home: recent-work strip */
.recent-work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
@media (max-width: 720px) {
    .recent-work-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .recent-work-grid { grid-template-columns: 1fr; }
}

/* Home: restrained video evidence band */
.project-footage {
    background: var(--cream-deep);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.footage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 1.2rem;
    align-items: start;
}
.video-panel {
    margin: 0;
    border-top: 2px solid var(--navy);
    padding-top: 0.85rem;
}
.video-panel video {
    width: 100%;
    aspect-ratio: 16 / 10;
    display: block;
    object-fit: cover;
    background: var(--navy-deep);
    border: 1px solid var(--rule);
}
.video-panel figcaption {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 1rem;
    padding-top: 0.75rem;
    color: var(--ink-soft);
}
.video-panel figcaption span {
    font-family: Georgia, serif;
    font-style: italic;
    color: var(--navy);
    line-height: 1.35;
}
.video-panel figcaption small {
    font-size: 0.88rem;
    line-height: 1.45;
}
@media (max-width: 820px) {
    .footage-grid { grid-template-columns: 1fr; }
    .video-panel figcaption { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* Services page: photo+text pairing */
.service-photo {
    margin-top: 1.2rem;
    max-width: 460px;
}

/* Utilities */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: -10000px; top: auto;
    background: var(--navy); color: var(--cream);
    padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }
