/*
Theme Name: W&S Civils and Engineering
Description: Custom theme for W&S Civils and Engineering. Creates the Home, Our standards, Work with us and Get a quote pages when activated. Contact details are set under Settings > W&S details.
Version: 1.0.1
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Author: W&S Civils and Engineering
Text Domain: ws-civils
*/

:root {
  --ink: #1e1e1e;
  --paper: #f7f7f7;
  --stone: #ededed;
  --muted: #6a6a6a;
  --rule: #d2d2d2;
  --orange: #dc6330; /* rules and small details only: too low in contrast for small text */
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
}

h1, h2 {
  margin: 0 0 0.6em;
  font-weight: bold;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
h1 { font-size: clamp(2.5rem, 4.6vw, 3.75rem); text-transform: uppercase; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); }
h3 { margin: 0 0 0.3em; font-size: 1.05rem; }

p { margin: 0 0 1em; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}
.wrap.narrow { max-width: 820px; }

/* Header */
.site-header { background: var(--ink); color: var(--paper); border-bottom: 3px solid var(--orange); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  min-height: 116px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.site-header .logo { margin: 0; }
.site-header .logo img { width: auto; height: 92px; }

.site-nav .wp-block-navigation__container { gap: 30px; align-items: center; }
.site-nav .wp-block-navigation-item__content {
  font-size: 0.92rem;
  text-decoration: none;
}
.site-nav .wp-block-navigation-item__content:hover,
.site-nav .current-menu-item > .wp-block-navigation-item__content { text-decoration: underline; text-underline-offset: 4px; }
.site-nav .nav-contact > .wp-block-navigation-item__content {
  display: block;
  padding: 9px 18px;
  background: #c4531f;
  color: #fff;
  text-decoration: none;
}
.site-nav .nav-contact > .wp-block-navigation-item__content:hover { background: #a8451a; text-decoration: none; }
.site-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 32px 22px; }
.site-nav .is-menu-open .wp-block-navigation__container { gap: 18px; }
.site-nav .is-menu-open .wp-block-navigation-item__content { font-size: 1.15rem; }

/* Hero: charcoal copy panel, photo running to the page edge */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--ink);
  color: var(--paper);
}
.hero-copy {
  align-self: center;
  padding: 72px 56px 72px max(32px, calc((100vw - 1180px) / 2 + 32px));
}
.hero-copy p { max-width: 26em; color: var(--rule); font-size: 1.1rem; }
.hero-copy .wp-block-buttons { margin-top: 8px; }
.hero-copy h1::after,
.section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 18px;
  background: var(--orange);
}

/* Project photographs */
.wp-block-image.photo { display: block; width: 100%; margin: 0; overflow: hidden; background: var(--rule); }
.wp-block-image.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-hero { height: 100%; min-height: 460px; }
.photo-tile, .photo-story { aspect-ratio: 4 / 3; }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--rule); }
.section-stone { background: var(--stone); border-top: 0; }
.section-ink { background: var(--ink); color: var(--paper); border-top: 0; }
.section-ink .service-names li { border-color: var(--muted); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 56px;
}
.lead { max-width: 34em; font-size: 1.15rem; }

/* Our work carousel: the script builds the tabs from each slide's heading */
.work-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin: 0 0 24px;
  padding: 0;
  border-bottom: 1px solid var(--rule);
  list-style: none;
}
.work-tabs button {
  padding: 8px 0;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.work-tabs button:hover { color: var(--ink); }
.work-tabs button[aria-pressed="true"] {
  border-bottom-color: var(--orange);
  color: var(--ink);
  font-weight: bold;
}
.work-track {
  position: relative;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.work-track::-webkit-scrollbar { display: none; }
.work-slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
}
.work-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.work-slide h3 { margin-top: 4px; font-size: 1.15rem; }
.work-slide p { margin: 0; color: var(--muted); }
.work-controls { display: flex; gap: 10px; margin-top: 24px; }
.work-controls button {
  padding: 9px 20px;
  background: none;
  border: 1px solid var(--ink);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.work-controls button:hover { background: var(--ink); color: var(--paper); }

/* Services */
.service-names {
  columns: 2;
  column-gap: 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.service-names li {
  padding: 12px 0;
  border-top: 1px solid #b9b8b8;
  break-inside: avoid;
}

/* Story */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.story p { max-width: 30em; }

/* Footer */
.site-footer {
  padding: 56px 0 28px;
  border-top: 3px solid var(--orange);
  background: var(--ink);
  color: var(--paper);
}
.footer-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.footer-main h2 { font-size: 1.6rem; }
.site-footer .footer-logo { margin: 0 0 20px; }
.site-footer .footer-logo img { width: auto; height: 100px; }
.contact-list {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 12px;
  margin: 0;
}
.contact-list dd { margin: 0; }
.legal {
  margin: 40px 0 0;
  padding-top: 18px;
  border-top: 1px solid #555;
  font-size: 0.85rem;
}

/* Buttons */
.button {
  display: inline-block;
  padding: 12px 24px;
  background: #c4531f; /* darker than --orange so white text stays readable */
  border: 0;
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #a8451a; }

/* Inner pages */
.page-title { padding: 44px 0; background: var(--ink); color: var(--paper); }
.page-title h1 { margin: 0; font-size: clamp(2.1rem, 3.6vw, 3rem); }

/* Posts, if W&S add news later */
.post-list { margin: 0; padding: 0; list-style: none; }
.post-list > li { padding: 24px 0; border-top: 1px solid var(--rule); }
.wp-block-post-date { margin-bottom: 1em; color: var(--muted); font-size: 0.9rem; }

/* Our standards */
.standards-intro { max-width: 44em; margin-bottom: 32px; }
.standards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 40px;
}
.standards-list { margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.95rem; line-height: 1.45; }
.standards-list li { padding: 10px 0; border-top: 1px solid #b9b8b8; }
.form-note-pale { background: var(--paper); max-width: 44em; }
.faq h3 { margin-top: 1.2em; }
.faq h3:first-child { margin-top: 0; }

/* Forms */
.form-section { border-top: 0; }
.form-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 56px;
  align-items: start;
}
.form-layout .contact-list { margin-top: 20px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin-bottom: 24px;
}
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 5px; font-size: 0.95rem; font-weight: bold; }
.optional { color: var(--muted); font-weight: normal; }
.field input, .field select, .field textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #8f8a83;
  border-radius: 0;
  color: inherit;
  font: inherit;
}
.form-note {
  margin-bottom: 22px;
  padding: 10px 14px;
  background: var(--stone);
  border-left: 3px solid var(--orange);
  font-size: 0.95rem;
}
.form-status { margin: 0 0 22px; padding: 12px 16px; font-weight: bold; border-left: 3px solid var(--orange); background: var(--stone); }
.form-sent { border-left-color: #2e7d32; }
.form-privacy { color: var(--muted); font-size: 0.9rem; }
.ws-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.footer-links { margin: 16px 0 0; }
.footer-links a { margin-right: 20px; }

@media (max-width: 1040px) {
  .site-header .wrap { min-height: 72px; }
  .site-nav .wp-block-navigation__container { gap: 8px 22px; }
}

@media (max-width: 860px) {
  .wrap { padding: 0 22px; }
  .site-header .logo img { height: 68px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 44px 22px; }
  .photo-hero { height: auto; min-height: 0; aspect-ratio: 4 / 3; }
  .section { padding: 48px 0; }
  .two-col, .story, .footer-main { grid-template-columns: 1fr; gap: 24px; }
  .work-photos { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 0; }
  .work-photos .photo:first-child { grid-column: 1 / -1; }
  .work-slide h3 { margin-top: 14px; }
  .form-layout, .form-grid, .standards-grid { grid-template-columns: 1fr; }
  .form-layout { gap: 28px; }
  .service-names { columns: 1; }
}
