/* Alresford Roofing. Colours and layout match the old WordPress (Total theme) site. */
@font-face { font-family: "Rubik"; font-weight: 400; font-display: swap; src: url("/assets/fonts/rubik-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url("/assets/fonts/rubik-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Rubik"; font-weight: 600; font-display: swap; src: url("/assets/fonts/rubik-latin-600-normal.woff2") format("woff2"); }

:root {
  --navy: #031d51;      /* page background */
  --blue: #153568;      /* header and footer */
  --red: #bf2026;       /* buttons */
  --red-hover: #a51b20;
  --pink: #e80045;      /* active / hovered menu link */
  --callout-bg: #f7f7f7;
  --callout-text: #606060;
  --max: 980px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: #fff;
  background: var(--navy);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1.1em; }
.container { width: min(var(--max), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 10px; top: 10px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; }

/* Header */
.site-header { background: var(--blue); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 30px; }
.logo img { width: 250px; height: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 10px; }
.nav a { display: block; padding: 6px 10px; text-decoration: none; font-weight: 500; font-size: 18px; line-height: 1.5; border-radius: 3px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--pink); }
.nav a.button, .nav a.button[aria-current="page"] { background: var(--red); color: #fff; margin-left: 4px; }
.nav a.button:hover { background: var(--red-hover); color: #fff; }

@media (max-width: 700px) {
  .site-header .container { padding-block: 16px; flex-wrap: wrap; justify-content: center; }
  .logo img { width: 210px; }
  .nav a { font-size: 16px; padding: 5px 8px; }
}

/* Headings */
h1, h2, h3 { text-transform: uppercase; line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 4.2vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.75rem); }
h3 { font-size: 1.15rem; font-weight: 400; }
.page-title { text-align: center; padding-top: 34px; margin-bottom: 30px; }

/* Home hero */
.hero {
  min-height: calc(100vh - 123px);
  min-height: calc(100svh - 123px);
  display: grid; place-items: center; text-align: center;
  background: linear-gradient(rgba(3, 29, 81, .55), rgba(3, 29, 81, .55)), url("/assets/img/hero-1920.jpg") center / cover no-repeat;
  padding: 60px 20px;
  margin-bottom: 30px;
}
.hero h1 { margin-bottom: .25em; }
.hero p { text-transform: uppercase; font-size: clamp(1rem, 2vw, 1.1rem); margin: 0; }
@media (max-width: 1200px) { .hero { background-image: linear-gradient(rgba(3, 29, 81, .55), rgba(3, 29, 81, .55)), url("/assets/img/hero-1200.jpg"); } }

.intro { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; margin-bottom: 40px; }
@media (max-width: 800px) { .intro { grid-template-columns: 1fr; } }

/* Masonry photo grid on the home page */
.photo-grid { columns: 3; column-gap: 5px; }
.photo-grid a { display: block; margin-bottom: 5px; break-inside: avoid; }
.photo-grid img { width: 100%; }
@media (max-width: 480px) { .photo-grid { columns: 2; } }

/* Services */
.service { padding-block: 10px 30px; }
.service h3 { margin-bottom: 1.1em; }
.service ul { padding-left: 1.2em; margin: 0 0 1.1em; }
.service li { margin-bottom: .4em; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 40px) / 5); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; margin-top: 10px; }
.strip a { scroll-snap-align: start; }
.strip img { width: 100%; aspect-ratio: 1; object-fit: cover; }
@media (max-width: 800px) { .strip { grid-auto-columns: calc((100% - 20px) / 3); } }
@media (max-width: 480px) { .strip { grid-auto-columns: 45%; } }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding-bottom: 80px; }
@media (max-width: 800px) { .contact { grid-template-columns: 1fr; } }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; gap: 0; } }
label { display: block; margin-bottom: 10px; }
input[type="text"], input[type="email"], textarea {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 16px; color: #222;
  background: #fff; border: 1px solid #ccc; border-radius: 3px; padding: 8px 10px;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--pink); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: 14px 0 6px; min-height: 65px; }
.btn {
  display: inline-block; background: var(--red); color: #fff; border: 0; border-radius: 3px;
  font: inherit; font-size: 17px; padding: 10px 18px; cursor: pointer; text-decoration: none; margin-top: 10px;
}
.btn:hover { background: var(--red-hover); }
.btn[disabled] { opacity: .7; cursor: wait; }
.notice { padding: 12px 16px; border-radius: 3px; margin: 16px 0 0; }
.notice.ok { background: #1e6b3a; }
.notice.err { background: #8c1a1f; }
.email-link { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; text-decoration: none; margin-top: 28px; }
.email-link:hover { text-decoration: underline; }
.email-link svg { flex: none; }

/* Footer */
.callout { background: var(--callout-bg); color: var(--callout-text); padding-block: 30px; }
.callout .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.callout p { margin: 0; font-size: 1.05rem; }
.callout .btn { margin: 0; font-size: 1.25rem; padding: 15px 38px; text-transform: uppercase; }
@media (max-width: 700px) { .callout .container { flex-direction: column; text-align: center; } .callout .btn { width: 100%; text-align: center; } }
.site-footer { background: var(--blue); color: #ededed; font-size: 15px; padding-block: 20px; }
.site-footer a { text-decoration: none; }

/* Lightbox */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 95vw; max-height: 95vh; }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .85); }
dialog.lightbox img { max-width: 95vw; max-height: 90vh; width: auto; }
dialog.lightbox button { position: fixed; top: 10px; right: 14px; background: none; border: 0; color: #fff; font-size: 40px; line-height: 1; cursor: pointer; }

/* Services overview cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; padding-bottom: 50px; }
.card { background: var(--blue); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card h2 { font-size: 1.35rem; margin: 18px 20px 4px; }
.card h2 a { text-decoration: none; }
.card h2 a:hover { color: var(--pink); }
.card .sub { text-transform: uppercase; font-size: .85rem; opacity: .85; margin: 0 20px 12px; }
.card p { margin-inline: 20px; font-size: .95rem; }
.card .btn { margin: auto 20px 20px; align-self: flex-start; font-size: .95rem; }

/* Service pages */
.crumbs { font-size: .9rem; padding-top: 24px; margin-bottom: 18px; opacity: .85; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.service h1 { margin-bottom: .2em; }
.service .lead { text-transform: uppercase; font-size: 1.1rem; margin-bottom: 1.4em; }
.service .more { margin-top: 24px; padding-bottom: 30px; }
.service .more a { color: #fff; }
.service .more a:hover { color: var(--pink); }

/* Home services list */
.home-services { margin: 20px 0 50px; }
.home-services h2 { font-size: 1.5rem; }
.home-services ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.home-services a { display: inline-block; border: 1px solid rgba(255,255,255,.5); border-radius: 3px; padding: 8px 16px; text-decoration: none; }
.home-services a:hover { background: var(--red); border-color: var(--red); }

/* Mobile menu: a hamburger button opens the menu (site.js). Without JavaScript the menu just shows. */
.menu-toggle { display: none; }
@media (max-width: 700px) {
  .js .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0; background: none; border: 0; cursor: pointer; color: inherit; }
  .menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { display: block; width: 26px; height: 3px; border-radius: 2px; background: currentColor; position: relative; transition: transform .2s, background .2s; }
  .menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; }
  .menu-toggle span::before { top: -8px; } .menu-toggle span::after { top: 8px; }
  .menu-toggle[aria-expanded="true"] span { background: transparent; }
  .menu-toggle[aria-expanded="true"] span::before { transform: translateY(8px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span::after { transform: translateY(-8px) rotate(-45deg); }
  .js #menu:not(.open) { display: none; }
}

@media (max-width: 700px) {
  .site-header .container { justify-content: space-between; }
  .nav { flex-basis: 100%; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid rgba(255, 255, 255, .2); }
  .nav a { padding: 12px 4px; font-size: 17px; border-radius: 0; border-bottom: 1px solid rgba(255, 255, 255, .2); }
  .nav a.button { margin: 12px 0 0; text-align: center; border-radius: 3px; border-bottom: 0; }
}
.js .menu-toggle { color: #fff; }
