/* =========================================================
   Broughton Community Energy — shared stylesheet
   Edit the variables in :root to re-theme the whole site.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=Public+Sans:wght@400;500;600;700&display=swap');

:root {
  /* -- Color: named tokens, edit here to re-theme -- */
  --ink:      #202B1C;   /* near-black hedgerow green — body text */
  --paper:    #EEECDF;   /* warm chalk paper — page background */
  --paper-2:  #E4E1D1;   /* slightly deeper paper — alternating sections */
  --moss:     #3F5B3A;   /* primary brand green — header, links */
  --moss-dark:#2C4128;   /* darker green — header background */
  --amber:    #C1832C;   /* warm ochre — accents, CTAs, active states */
  --slate:    #566058;   /* muted sage-grey — secondary text, borders */
  --line:     #C9C4AF;   /* hairline rule color */
  --white:    #FBFAF5;

  /* -- Type -- */
  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, Helvetica, Arial, sans-serif;

  /* -- Layout -- */
  --max: 1080px;
  --gap: 2rem;
}

/* -- Reset -- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--moss-dark); text-decoration-color: var(--amber); text-underline-offset: 3px; }
a:hover { color: var(--amber); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--moss-dark);
}
h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); font-weight: 500; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; max-width: 66ch; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.25em; }
li { margin-bottom: 0.4em; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

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

/* -- Skip link -- */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--amber);
  color: var(--ink); padding: 0.6em 1em; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* =========================================================
   Header / navigation
   ========================================================= */
.site-header {
  background: var(--moss-dark);
  color: var(--white);
  border-bottom: 3px solid var(--amber);
}

.site-header .wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0 0.75rem 150px;  /* leftover space for the logo */
  position: relative;
  min-height: 140px;                  /* tall enough to fit the logo */
}

.brand img {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.brand img { width: 130px; height: 130px; border-radius: 50%; }
.brand span {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 500;
  color: var(--white);
}
.brand:hover span { color: var(--amber); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--white);
  color: var(--white);
  padding: 0.4em 0.7em;
  font-size: 1rem;
  cursor: pointer;
}

.main-nav {
  margin-left: 0 px;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
}
.main-nav > ul > li { position: relative; }
.main-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  padding: 0.4em 0.1em;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a:focus,
.main-nav a[aria-current="page"] {
  color: var(--white);
  border-bottom-color: var(--amber);
}
.main-nav .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--moss-dark);
  border: 1px solid var(--moss);
  border-top: 2px solid var(--amber);
  min-width: 180px;
  padding: 0.4em 0;
  z-index: 20;
}
.main-nav li:hover > .submenu,
.main-nav li:focus-within > .submenu {
  display: block;
}
.main-nav .submenu li { width: 100%; }
.main-nav .submenu a {
  display: block;
  padding: 0.5em 1em;
  border-bottom: none;
  white-space: nowrap;
}
.main-nav .submenu a:hover { background: var(--moss); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .main-nav {
    display: none;
    width: 100%;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--moss);
    margin-top: 0.75rem;
  }
  .main-nav > ul > li { border-bottom: 1px solid var(--moss); }
  .main-nav a { display: block; padding: 0.75em 0.2em; }
  .main-nav .submenu {
    position: static;
    border: none;
    background: var(--moss-dark);
    padding-left: 1em;
  }
  .site-header .wrap { flex-wrap: wrap; 
  padding-left: 90px;
  min-height: 80px;
  }
  
  .brand img {
  width: 70px;
  height: 70px;
}
.brand span {
  font-size: 1.05rem;
}
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding: 3.5rem 0 3rem;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--gap);
  align-items: center;
}
.hero-copy .eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--slate);
  margin-bottom: 0.75em;
  font-size: 1.05rem;
}
.hero-copy h1 { max-width: 16ch; }
.hero-image img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  border: 1px solid var(--line);
}
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-image { order: -1; }
  .hero-image img { height: 220px; }
}

/* =========================================================
   Page header (non-home pages)
   ========================================================= */
.page-header {
  padding: 2.75rem 0 2rem;
  border-bottom: 1px solid var(--line);
}
.page-header p { color: var(--slate); }

/* =========================================================
   Sections
   ========================================================= */
.section { padding: 3rem 0; }
.section.alt { background: var(--paper-2); }
.section-head { max-width: 60ch; margin-bottom: 2rem; }
.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* -- Triptych (objectives) -- */
.triptych {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.triptych > div {
  padding: 1.75rem 1.5rem;
  border-left: 1px solid var(--line);
}
.triptych > div:first-child { border-left: none; }
.triptych img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
}
@media (max-width: 700px) {
  .triptych { grid-template-columns: 1fr; }
  .triptych > div { border-left: none; border-top: 1px solid var(--line); }
  .triptych > div:first-child { border-top: none; }
}

/* -- Achievements two-up -- */
.achieve-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem var(--gap);
}
.achieve-grid h3 {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--ink);
}
.achieve-grid img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
@media (max-width: 700px) { .achieve-grid { grid-template-columns: 1fr; } }

/* -- Team grid (About) -- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.team-card img {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  margin-bottom: 1rem; border: 1px solid var(--line);
}
.team-card h3 { margin-bottom: 0.3em; }

/* -- Case studies -- */
.case-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.case-index-card { border-top: 1px solid var(--line); padding-top: 0.9rem; }
.case-index-card img {
  width: 100%; height: 130px; object-fit: cover; margin-bottom: 0.75rem;
}
.case-index-card .num {
  font-family: var(--font-display);
  color: var(--amber);
  font-size: 0.95rem;
}
.case-index-card h3 { font-size: 1.05rem; margin: 0.2em 0 0; }

.case {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
}
.case:first-of-type { border-top: 2px solid var(--moss); }
.case .case-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--amber);
  line-height: 1;
}
.case-media img { border: 1px solid var(--line); margin-bottom: 0.75rem; }
.case-body h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: none;
  color: var(--slate);
  margin: 1.4em 0 0.3em;
}
@media (max-width: 760px) {
  .case { grid-template-columns: 1fr; }
}

/* -- Table (suppliers) -- */
.table-wrap { overflow-x: auto; margin-bottom: 2rem; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
}
th, td {
  text-align: left;
  padding: 0.85em 1em;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.96rem;
}
th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--moss-dark);
  border-bottom: 2px solid var(--moss);
}
tr:hover td { background: var(--paper-2); }

/* -- Document library -- */
.doc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.doc-card {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 1rem;
}
.doc-card img { margin-bottom: 0.75rem; border: 1px solid var(--line); }
.doc-card a { font-weight: 600; }

/* -- Contact -- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.contact-details { border-left: 1px solid var(--line); padding-left: 2rem; }
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-details { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 2rem; }
}
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35em; font-size: 0.95rem; }
.field input, .field textarea {
  width: 100%;
  padding: 0.65em 0.8em;
  border: 1px solid var(--slate);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
button.submit, a.btn {
  display: inline-block;
  background: var(--amber);
  color: var(--ink);
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.7em 1.6em;
  cursor: pointer;
  text-decoration: none;
}
button.submit:hover, a.btn:hover { background: var(--moss); color: var(--white); }

/* -- Callout / links list -- */
.callout {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--moss-dark);
  color: var(--white);
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: 0.9rem;
}
.site-footer a { color: var(--white); }
.site-footer .wrap {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
