/* ============================================================
   board_docs.css
   U of T Physics — PERC board documentation pages
   Shared stylesheet for phyduino_pico and analog_shield docs
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ── */
:root {
  /* U of T official brand colours */
  --uot-blue:       #1E3765;   /* Pantone PMS 655 – official U of T Blue */
  --uot-blue-dark:  #152849;   /* header / footer */
  --uot-blue-mid:   #25355A;   /* hover states */
  --uot-cyan:       #007FA3;   /* "Boundless Blue" secondary accent */

  /* page palette */
  --bg:         #F7F6F2;
  --surface:    #FFFFFF;
  --border:     #E0DDD6;
  --border-med: #C8C5BC;
  --text:       #1A1917;
  --text-2:     #5C5A55;
  --text-3:     #9B9890;

  /* semantic colours */
  --accent:     var(--uot-cyan);
  --accent-bg:  #E3F4F9;
  --green:      #0F6E56;
  --green-bg:   #E3F4EE;
  --amber:      #885010;
  --amber-bg:   #FDF0DC;
  --red:        #A32D2D;
  --red-bg:     #FCEBEB;

  /* typography */
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;

  /* radii */
  --r:    8px;
  --r-lg: 12px;
}

/* ── Base ── */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Site header ── */
.site-header {
  background: var(--uot-blue-dark);
  border-bottom: 3px solid var(--uot-cyan);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 120px;
}

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo-img {
  height: 100px;
  width: auto;
}

.header-board-title {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* ── Breadcrumb bar ── */
.breadcrumb-bar {
  background: var(--uot-blue);
  padding: 0 1.5rem;
}

.breadcrumb-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}

.breadcrumb-inner a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color 0.1s;
}

.breadcrumb-inner a:hover { color: #fff; }

.breadcrumb-inner .sep   { color: rgba(255, 255, 255, 0.35); }

.breadcrumb-inner .current {
  color: rgba(255, 255, 255, 0.90);
  font-weight: 500;
}

/* ── Page wrap ── */
.page-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ── Board hero ── */
.board-hero {
  display: block;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: stretch;
  margin-bottom: 2.5rem;
}

/*@media (max-width: 600px) {*/
/*  !* .board-hero { grid-template-columns: 1fr; } *!*/
/*  .board-img-panel { order: -1; }*/
/*}*/

.board-hero-text {
  display: flex;
  flex-direction: column;
}

.board-hero-text .board-desc {
  flex: 1;
}


.board-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 16px;
  background: #E3F4F9;
  color: #005F7A;
  border: 1px solid #A8D8E8;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-align: center;
}

.board-tag a {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
  cursor: default;
}

h1 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.2;
  color: var(--uot-blue);
}

.board-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  margin-left: 5px;
  margin-right: 5px;
  /* max-width: 52ch; */
}

.spec-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spec-pill {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.board-img-panel {
  height: 350px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 1 / 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.board-img-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 4px;
  border-radius: var(--r-lg);
}

/* ── Section headers ── */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  margin-top: 2rem;
}

.section-head h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

.section-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Resource card grid ── */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.res-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.res-card:hover {
  border-color: var(--border-med);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.res-card:focus-visible {
  outline: 2px solid var(--uot-cyan);
  outline-offset: 2px;
}

.res-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.res-icon.img { 
  width: 18px;
  height: 18px;
  fill: none;
}

.res-icon.blue  { background: var(--accent-bg); color: #005F7A; }
.res-icon.green { background: var(--green-bg);  color: var(--green); }
.res-icon.amber { background: var(--amber-bg);  color: var(--amber); }
.res-icon.red   { background: var(--red-bg);    color: var(--red); }

.res-label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.res-desc  { font-size: 12px; color: var(--text-2); line-height: 1.45; }

.res-ext {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Resource card sub-links ── */
.res-sublinks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.res-sublink {
  font-family: var(--mono);
  font-size: 11px;
  color: #005F7A;
  background: var(--accent-bg);
  border: 1px solid #A8D8E8;
  border-radius: 4px;
  padding: 2px 8px;
  text-decoration: none;
  transition: background 0.1s;
}

.res-sublink:hover { background: #C8ECF5; }
.res-file-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}
 
.res-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.1s;
}
 
.res-file-row:last-child { border-bottom: none; }
 
.res-file-row:hover { color: var(--text-2); }
 
.res-file-tag {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text-3);
}

/* ── Datasheet table ── */
.ds-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.ds-table tr              { border-bottom: 1px solid var(--border); }
.ds-table tr:last-child   { border-bottom: none; }
.ds-table td              { padding: 10px 14px; vertical-align: middle; }

.ds-table td:first-child {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--uot-blue);
  width: 30%;
}

.ds-table td:nth-child(2) { color: var(--text-2); font-size: 13px; }
.ds-table td:last-child   { text-align: right; white-space: nowrap; }

.ds-link {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #005F7A;
  text-decoration: none;
  border: 1px solid #A8D8E8;
  background: var(--accent-bg);
  border-radius: 4px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.1s;
}

.ds-link:hover { background: #C8ECF5; }

/* ── Assembly steps ── */
.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 16px;
}

.step-num {
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #E3F4F9;
  color: #005F7A;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-body          { font-size: 13.5px; line-height: 1.55; color: var(--text); }
.step-body strong   { font-weight: 500; }

.step-body code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}

/* ── Repository links ── */
.repo-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.repo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 14px;
  text-decoration: none;
  color: inherit;
  font-size: 13.5px;
  transition: border-color 0.12s;
}

.repo-row:hover      { border-color: var(--border-med); }
.repo-row-label      { color: var(--text-2); font-size: 12.5px; }
.repo-row-name       { font-family: var(--mono); font-size: 13px; color: #005F7A; }
.repo-row-arrow      { margin-left: auto; color: var(--text-3); }

/* ── Site footer ── */
.site-footer {
  background: var(--uot-blue-dark);
  border-top: 3px solid var(--uot-cyan);
  margin-top: 3rem;
  padding: 1.5rem;
}

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-logo {
  height: 50px;
  width: auto;
}

.footer-social-media-list {
  display: flex;
  align-items: center;
  list-style-type: none;
  padding: 0;
  margin: 0;
  gap: 20px;
}

.footer-inner p {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.70);
}

.footer-inner a       { font-family: Arial, Helvetica, sans-serif; color: rgba(255, 255, 255, 0.70); text-decoration: underline; }
.footer-inner a:hover { color: rgba(255, 255, 255, 1); }

/* ── Mobile responsive ── */
@media (max-width: 600px) {

  /* Header: stack logo and title vertically */
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 0.5rem;
    text-align: center;
  }

  .header-logo-img {
    height: 70px;
  }

  .header-board-title {
    margin-left: 0;
    font-size: 22px;
  }

  /* Breadcrumb: allow wrapping */
  .breadcrumb-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0.5rem 0;
  }

  /* Page padding */
  .page-wrap {
    padding: 1.5rem 1rem 3rem;
  }

  /* Board tag: center it */
  .board-tag {
    align-self: center;
    font-size: 13px;
  }

  /* Make board-tag link active on mobile only */
  .board-tag a {
    text-decoration: underline;
    text-decoration-color: rgba(0, 95, 122, 0.4);
    pointer-events: auto;
    cursor: pointer;
  }

  .board-tag a:hover {
    text-decoration-color: #005F7A;
  }

  /* Image panel: shrink to fit */
  .board-img-panel {
    order: 0;
    height: 220px;
  }

  /* Resource grid: single column */
  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Datasheet table: let description column compress */
  .ds-table td:first-child {
    width: 25%;
    font-size: 11px;
  }

  .ds-table td:nth-child(2) {
    font-size: 11.5px;
  }

  /* Footer: stack logo and social icons */
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .breadcrumb-inner a:last-of-type,
  .breadcrumb-inner .sep:last-of-type {
    display: none;
  }

}