/* ====================================================================
 * _brand.css — shared brand for the AEC template library
 *
 * Single source of truth for the Lavender look across all 10 templates.
 * Every template links this file. Per-template styles can override or
 * extend in a <style> block in the page itself.
 * ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,800;0,9..144,900;1,9..144,300;1,9..144,400;1,9..144,700&family=Inter+Tight:wght@300;400;500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  --ink:     #2E1840;
  --ink-2:   #1a0d24;
  --paper:   #F3ECFA;
  --cream:   #FFF8F0;
  --bone:    #F2E9D8;
  --purple:  #A752AA;
  --purple-d:#7d3c80;
  --orange:  #FF692A;
  --orange-d:#d44f0f;
  --lilac:   #EAB7FE;
  --lilac-d: #c98bef;
  --blush:   #F8D4EB;
  --blush-d: #e89bc2;
  --periw:   #B8C5FF;
  --periw-d: #8a9aff;
  --teal:    #5E7E80;
  --teal-d:  #3d5859;
  --red:     #B01212;
  --green:   #5F8F37;
  --amber:   #C68A0A;
  --line:    rgba(46, 24, 64, 0.10);
  --line-2:  rgba(46, 24, 64, 0.05);
  --line-strong: rgba(46, 24, 64, 0.18);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter Tight', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 13px;
  padding: 32px 24px 60px;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--paper); }
a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--orange); }
img { max-width: 100%; display: block; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(46, 24, 64, 0.06);
}

/* ====================================================================
 * DOC HEADER — every template starts with this band
 * ==================================================================== */
.doc-head {
  background: var(--ink);
  color: var(--paper);
  padding: 28px 36px 22px;
  position: relative;
  overflow: hidden;
  border-top: 4px solid var(--orange);
}
.doc-head::after {
  content: '';
  position: absolute;
  right: -80px; bottom: -80px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 212, 235, 0.16), transparent 70%);
  pointer-events: none;
}
.doc-head-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: flex-start;
}
.doc-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--lilac);
  margin-bottom: 10px;
}
.doc-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--paper);
  margin-bottom: 10px;
}
.doc-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--lilac);
}
.doc-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  color: var(--paper);
  opacity: 0.85;
  max-width: 56ch;
}
.doc-id {
  background: rgba(248, 212, 235, 0.12);
  border: 1px solid rgba(248, 212, 235, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lilac);
  text-align: right;
  min-width: 160px;
  position: relative;
  z-index: 1;
}
.doc-id strong {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--paper);
  letter-spacing: 0.02em;
  text-transform: none;
  margin-bottom: 4px;
}

/* Meta strip under header */
.doc-meta {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 14px 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px;
  font-size: 12px;
}
.meta-cell .meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-d);
  margin-bottom: 2px;
}
.meta-cell .meta-value {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}

/* ====================================================================
 * BODY SECTIONS
 * ==================================================================== */
.doc-body { padding: 28px 36px 36px; }

.section {
  margin-bottom: 28px;
}
.section:last-child { margin-bottom: 0; }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.15;
}
.section-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--purple);
}
.section-deck {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink);
  opacity: 0.7;
  margin-bottom: 14px;
  line-height: 1.4;
}

p, ul, ol { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 4px; }

strong { font-weight: 700; color: var(--ink); }
em { font-style: italic; }

/* ====================================================================
 * TABLES — used in registers, RACIs, trackers
 * ==================================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}
thead th {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  padding: 9px 11px;
  border-right: 1px solid rgba(255,255,255,0.1);
}
thead th:last-child { border-right: 0; }
tbody td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line-2);
  vertical-align: top;
  background: white;
}
tbody td:last-child { border-right: 0; }
tbody tr:nth-child(even) td { background: var(--cream); }
tbody tr:hover td { background: var(--paper); }
tbody td .pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.pill.high, .pill.critical, .pill.red { background: var(--blush); color: var(--red); border: 1px solid rgba(176, 18, 18, 0.2); }
.pill.medium, .pill.amber { background: rgba(198, 138, 10, 0.12); color: var(--amber); border: 1px solid rgba(198, 138, 10, 0.25); }
.pill.low, .pill.green, .pill.closed, .pill.done { background: rgba(95, 143, 55, 0.12); color: var(--green); border: 1px solid rgba(95, 143, 55, 0.25); }
.pill.open, .pill.purple { background: var(--lilac); color: var(--purple-d); }
.pill.review, .pill.periw { background: var(--periw); color: var(--ink); }
.pill.info, .pill.teal { background: rgba(94, 126, 128, 0.12); color: var(--teal-d); border: 1px solid rgba(94, 126, 128, 0.25); }

.pill.raci-r { background: var(--orange); color: white; }
.pill.raci-a { background: var(--purple); color: white; }
.pill.raci-c { background: var(--periw); color: var(--ink); }
.pill.raci-i { background: var(--lilac); color: var(--purple-d); }

td.center { text-align: center; }
td.right, th.right { text-align: right; }
td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ====================================================================
 * STAT CARDS — for project plan, status report
 * ==================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  color: var(--purple);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.stat-num.orange { color: var(--orange); }
.stat-num.teal { color: var(--teal-d); }
.stat-num.green { color: var(--green); }
.stat-num.red { color: var(--red); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-d);
}

/* ====================================================================
 * CALLOUTS
 * ==================================================================== */
.callout {
  background: var(--paper);
  border-left: 4px solid var(--purple);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  line-height: 1.55;
  margin: 14px 0;
}
.callout.warn { border-left-color: var(--orange); background: rgba(255, 105, 42, 0.05); }
.callout.danger { border-left-color: var(--red); background: rgba(176, 18, 18, 0.04); }
.callout.info { border-left-color: var(--teal); background: var(--cream); }
.callout strong { color: var(--ink); }
.callout-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 4px;
}
.callout.warn .callout-label { color: var(--orange-d); }
.callout.danger .callout-label { color: var(--red); }
.callout.info .callout-label { color: var(--teal-d); }

/* ====================================================================
 * SIGNOFF BLOCK
 * ==================================================================== */
.signoff {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.signoff-cell .signoff-line {
  border-bottom: 1.5px solid var(--ink);
  height: 36px;
  margin-bottom: 4px;
}
.signoff-cell .signoff-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-d);
}
.signoff-cell .signoff-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
  margin-top: 2px;
}
.signoff-cell .signoff-role {
  font-size: 11px;
  color: var(--ink);
  opacity: 0.7;
}

/* ====================================================================
 * FOOTER — branded strip so it's clear who made the templates
 * ==================================================================== */
.doc-foot {
  background: var(--ink);
  color: var(--paper);
  padding: 16px 36px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
.doc-foot::before {
  content: '';
  position: absolute;
  left: -60px; top: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 183, 254, 0.12), transparent 70%);
  pointer-events: none;
}
.doc-foot > :first-child {
  color: var(--lilac);
  opacity: 0.85;
  position: relative;
  z-index: 1;
}
.doc-brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
  position: relative;
  z-index: 1;
}
.doc-brand-mark .al-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  color: white;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.doc-brand-mark .who {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.3;
  text-align: right;
  color: var(--lilac);
  opacity: 0.85;
}
.doc-brand-mark .who strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: 16px;
  color: var(--paper);
  letter-spacing: -0.01em;
  text-transform: none;
  line-height: 1;
  margin-bottom: 3px;
}
.doc-brand-mark:hover .al-avatar { transform: scale(1.05); transition: transform 0.15s; }
.doc-brand-mark:hover .who strong { color: var(--lilac); }

/* Also brand the doc-head — add a small AL pill in the top-left
 * via the existing meta zone so every page has a mark even before scroll. */
.doc-head::before {
  content: '';
  display: block;
  position: absolute;
  top: 14px;
  left: 36px;
  width: 32px;
  height: 4px;
  background: linear-gradient(90deg, var(--purple), var(--orange));
  border-radius: 2px;
  z-index: 1;
}

/* ====================================================================
 * CHECKLIST (inspection report, RFI checklist)
 * ==================================================================== */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.check-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  align-items: center;
}
.check-item .check-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  background: white;
}
.check-item.pass .check-box { background: var(--green); border-color: var(--green); color: white; }
.check-item.fail .check-box { background: var(--red); border-color: var(--red); color: white; }
.check-item.na .check-box { background: var(--cream); color: var(--teal-d); border-color: var(--line-strong); }
.check-item .check-text { font-size: 13px; line-height: 1.4; }
.check-item .check-note { font-size: 11px; color: var(--teal-d); margin-top: 2px; }

/* ====================================================================
 * FORM-STYLE (used for blank templates the user fills in)
 * ==================================================================== */
.field-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.field-row:last-child { border-bottom: 0; }
.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-d);
}
.field-value {
  font-size: 13px;
  color: var(--ink);
}
.field-blank {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink);
  opacity: 0.35;
}

/* Blank fillable line (for printed templates) */
.fill-line {
  border-bottom: 1.2px solid var(--ink);
  height: 22px;
  display: block;
  margin-bottom: 12px;
}

/* ====================================================================
 * Kanban-feel column for issue tracker / status
 * ==================================================================== */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.kanban-col {
  background: var(--paper);
  border-radius: 10px;
  padding: 12px;
}
.kanban-col h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--purple-d);
  margin-bottom: 10px;
}
.kanban-card {
  background: white;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.45;
}
.kanban-card-id {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--teal-d);
  margin-bottom: 4px;
}

/* ====================================================================
 * PRINT — clean PDF output
 * ==================================================================== */
@page {
  size: A4;
  margin: 12mm;
}
@media print {
  body { background: white; padding: 0; }
  .page { box-shadow: none; border-radius: 0; border: 0; }
  table, .callout, .stats, .signoff, .check-item, .kanban { page-break-inside: avoid; }
  thead { display: table-header-group; }
  .doc-foot, .no-print { /* leave footer in print */ }
}
