/* Engineering Club site styles
   Colours and spacing live in :root so the whole site can be re-themed in one place. */

:root {
  --paper: #F5F7F6;       /* page background */
  --sheet: #FFFFFF;       /* boxes, tables, project sheets */
  --grid: #DCE8ED;        /* minor graph-paper lines */
  --grid-major: #BFD4DD;  /* major graph-paper lines and light dividers */
  --ink: #15233D;         /* text, borders */
  --graphite: #4A5565;    /* secondary text */
  --hivis: #FFC917;       /* Join button and highlights */
  --stamp: #B42318;       /* "Upcoming" stamps */

  --measure: 40rem;
  --wide: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

/* ---------- Base ---------- */

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

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

/* Keep linked sections clear of the sticky header */
[id] { scroll-margin-top: 6rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a {
  color: var(--ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 3px; text-decoration-color: var(--hivis); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-weight: 800;
  line-height: 1.1;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.4rem, 7.5vw, 4.75rem);
  font-stretch: 125%;
  line-height: 0.95;
  letter-spacing: -0.015em;
}
h2 {
  font-size: clamp(1.55rem, 3.2vw, 2.1rem);
  font-stretch: 118%;
}
h3 {
  font-size: 1.2rem;
  font-stretch: 105%;
  font-weight: 750;
}

p, ul, ol, dl { margin: 0 0 1em; }

.lead {
  font-size: clamp(1.15rem, 2vw, 1.3rem);
  line-height: 1.5;
  max-width: 36rem;
}
.prose { max-width: var(--measure); }
.prose > :last-child { margin-bottom: 0; }
.muted { color: var(--graphite); }
.small { font-size: 0.92rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.5rem 1rem;
  background: var(--hivis);
  border: 2px solid var(--ink);
  font-weight: 700;
}
.skip:focus { top: 1rem; }

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

/* Graph paper: used for the home hero and page headers */
.graph {
  background-color: var(--sheet);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  font-weight: 700;
  font-stretch: 110%;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
  background: var(--sheet);
}
.btn-join {
  background: var(--hivis);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn:hover { text-decoration: underline; text-decoration-color: var(--ink); }
.btn-join:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.btn-join:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .btn-join { transition: transform 80ms ease-out, box-shadow 80ms ease-out; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 1.75rem;
}

/* ---------- Header and navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.7rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
  text-decoration: none;
}
.brand img { width: 56px; height: 56px; flex-shrink: 0; object-fit: contain; }
.brand-name {
  display: block;
  font-weight: 800;
  font-stretch: 115%;
  font-size: 1.1rem;
  line-height: 1.1;
}
.brand-school {
  display: block;
  font-size: 0.85rem;
  line-height: 1.25;
  color: var(--graphite);
}

.site-nav ul {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 0.3rem 0;
  border-bottom: 3px solid transparent;
  font-weight: 550;
  font-size: 0.98rem;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { border-bottom-color: var(--grid-major); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--hivis); font-weight: 700; }

.nav-toggle {
  display: none;
  padding: 0.55rem 0.8rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 960px) {
  .header-inner { flex-wrap: wrap; gap: 0.75rem; }
  .site-nav { order: 3; width: 100%; }
  .site-nav ul { flex-wrap: wrap; gap: 0.25rem 1.25rem; }

  /* With JavaScript, the nav collapses behind a Menu button */
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; gap: 0; padding-bottom: 0.5rem; }
  .js .site-nav a { padding: 0.75rem 0 0.75rem 0.75rem; border-bottom: 0; border-left: 4px solid transparent; }
  .js .site-nav li + li a { border-top: 1px solid var(--grid-major); }
  .js .site-nav a[aria-current="page"] { border-left-color: var(--hivis); }
}

@media (max-width: 520px) {
  .header-inner { gap: 0.5rem; }
  .brand { gap: 0.5rem; }
  .brand img { width: 44px; height: 44px; }
  .brand-name { font-size: 1rem; font-stretch: 100%; }
  .brand-school { display: none; }
  .site-header .btn, .nav-toggle { padding: 0.45rem 0.7rem; font-size: 0.95rem; }
  .btn-join .long { display: none; }
}

/* ---------- Page structure ---------- */

.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section + .section { border-top: 1px solid var(--grid-major); }

.page-head {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-bottom: 2px solid var(--ink);
}
.page-head h1 { margin-bottom: 0.35em; }
.page-head .lead { margin-bottom: 0; }

/* Two-column layout: heading on the left, content on the right */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: 1.25rem 3rem;
}
.split-head h2 { margin-bottom: 0.35em; }
.split-head p { color: var(--graphite); font-size: 0.95rem; }

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
}

/* ---------- Home ---------- */

.hero { border-bottom: 2px solid var(--ink); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 2.5rem 4rem;
  align-items: end;
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
.hero h1 { margin-bottom: 0.2em; }
.hero .school {
  margin: 0 0 1.5rem;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-stretch: 110%;
  font-weight: 500;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2rem 3rem;
  align-items: center;
}
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
}

/* ---------- Title block (next meeting, regular schedule) ---------- */

.title-block {
  background: var(--sheet);
  border: 2px solid var(--ink);
}
.title-block > h2 {
  margin: 0;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.05rem;
  font-stretch: 115%;
}
.tb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin: 0;
  background: var(--ink);
}
.tb-cell {
  padding: 0.6rem 1rem 0.7rem;
  background: var(--sheet);
}
.tb-cell.wide { grid-column: 1 / -1; }
.tb-cell dt {
  font-size: 0.8rem;
  font-stretch: 85%;
  font-weight: 600;
  color: var(--graphite);
}
.tb-cell dd {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
}
.tb-cell.headline dd {
  font-size: 1.45rem;
  font-stretch: 112%;
  line-height: 1.15;
}
.tb-cell.note dd {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--graphite);
}

/* ---------- Photos ---------- */

.photo { margin: 0; }
.photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 2px solid var(--ink);
  background: var(--sheet);
}
.photo figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--graphite);
}
.photo-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem 1.25rem;
}

/* ---------- Announcement ---------- */

.notice {
  position: relative;
  max-width: 48rem;
  padding: calc(1.5rem + 10px) clamp(1.25rem, 3vw, 2rem) 1.5rem;
  background: var(--sheet);
  border: 2px solid var(--ink);
}
.notice::before {
  content: "";
  position: absolute;
  top: -2px; left: -2px; right: -2px;
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--hivis) 0 10px, var(--ink) 10px 20px);
}
.notice-date {
  margin-bottom: 0.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--graphite);
}
.notice h3 { font-size: 1.35rem; }
.notice > :last-child { margin-bottom: 0; }

/* ---------- Lists ---------- */

.items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.75rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.items li { padding-top: 0.9rem; border-top: 2px solid var(--ink); }
.items h3 { margin-bottom: 0.3em; }
.items p { margin: 0; color: var(--graphite); }

.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li {
  position: relative;
  padding: 0.6rem 0 0.6rem 2.1rem;
  border-bottom: 1px solid var(--grid-major);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.9rem;
  width: 1.1rem; height: 1.1rem;
  border: 2px solid var(--ink);
  background: var(--sheet);
}
.checklist li.done::before { background: var(--hivis); }

.steps {
  display: grid;
  gap: 1.5rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 3rem; height: 3rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--hivis);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 1.4rem;
}
.steps h3 { margin: 0.55rem 0 0.25rem; }
.steps p { margin: 0; }

.steps .class-code {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin-top: 0.85rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--ink);
  background: var(--sheet);
}
.class-code span { font-size: 0.88rem; font-weight: 600; color: var(--graphite); }
.class-code strong { font-size: 1.5rem; font-stretch: 115%; font-weight: 800; letter-spacing: 0.04em; }

/* Key/value rows: membership details, team list */
.rows {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr);
  margin: 0;
  border-top: 2px solid var(--ink);
}
.rows > dt, .rows > dd {
  margin: 0;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--grid-major);
}
.rows > dt { padding-right: 1.5rem; font-weight: 600; color: var(--graphite); }
.rows strong { display: block; }
@media (max-width: 560px) {
  .rows { grid-template-columns: 1fr; }
  .rows > dt { padding-bottom: 0; border-bottom: 0; }
  .rows > dd { padding-top: 0.15rem; }
}

/* ---------- Tables ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--sheet);
  border: 2px solid var(--ink);
}
.table th, .table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--grid-major);
  text-align: left;
  vertical-align: top;
}
.table thead th {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-stretch: 110%;
}
.table tbody th { font-weight: 700; }
.table .empty { color: var(--graphite); font-style: italic; }

@media (max-width: 640px) {
  .table.stack, .table.stack tbody, .table.stack tr { display: block; }
  .table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.stack tr { padding: 0.5rem 0; border-bottom: 2px solid var(--ink); }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack th, .table.stack td {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.3rem 1rem;
    border: 0;
  }
  .table.stack [data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--graphite);
  }
  .table.stack .empty { display: block; }
}

/* ---------- Projects ---------- */

.project {
  margin: 0 0 3rem;
  background: var(--sheet);
  border: 2px solid var(--ink);
}
.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.25rem clamp(1.25rem, 3vw, 2rem);
  border-bottom: 2px solid var(--ink);
}
.project-head h2 { margin: 0; }
.project-head p { margin: 0.2rem 0 0; color: var(--graphite); font-weight: 600; }

.stamp {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border: 3px solid var(--stamp);
  border-radius: 4px;
  color: var(--stamp);
  font-weight: 800;
  font-stretch: 118%;
  font-size: 1.05rem;
  transform: rotate(-4deg);
}
.stamp.complete { border-color: var(--ink); color: var(--ink); }

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 3rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.project-body > section > :last-child { margin-bottom: 0; }
.project-body .full { grid-column: 1 / -1; }
.project-body h3 { padding-bottom: 0.35rem; border-bottom: 2px solid var(--ink); }
@media (max-width: 760px) {
  .project-body { grid-template-columns: 1fr; }
}

/* ---------- Meetings ---------- */

.recap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1.25rem 2rem;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--grid-major);
}
.recap:last-child { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; }
.recap h3 { margin-bottom: 0.2em; }
@media (max-width: 680px) {
  .recap { grid-template-columns: 1fr; }
}

/* ---------- FAQ ---------- */

.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--grid-major); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
  font-weight: 700;
  font-size: 1.08rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex-shrink: 0;
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { max-width: var(--measure); margin: 0 0 1.1rem; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 3rem 0 2.5rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
}
.site-footer a { color: var(--paper); }
.site-footer a:hover { text-decoration-color: var(--hivis); }
.site-footer :focus-visible { outline-color: var(--hivis); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.5rem 2.5rem;
}
.site-footer p { margin: 0 0 0.4rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 0.3rem; }
.footer-name {
  font-weight: 800;
  font-stretch: 120%;
  font-size: 1.25rem;
}
.footer-dim { color: #B9C3D3; }
