/* Hillel Ontario org chart — brand styles (responsive flow layout) */

@font-face { font-family: "Gilroy"; src: url("fonts/Gilroy-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("fonts/Gilroy-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("fonts/Gilroy-SemiBold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("fonts/Gilroy-ExtraBold.otf") format("opentype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("fonts/Gilroy-Black.otf") format("opentype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "MD Nichrome"; src: url("fonts/MDNichrome-Black.otf") format("opentype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "TT Rationalist"; src: url("fonts/TTRationalist-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TT Rationalist"; src: url("fonts/TTRationalist-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --anemone: #E38CDC;
  --tekhelet-blue: #52A9F9;
  --seasalt: #F8F9FA;
  --shahor: #1E1E1D;
  --yarok: #DBFE87;
  --mint: #31C493;
  --illuminating: #FFE381;
  --kermes: #F46A2A;
  --onyx: #343A40;
  --davys: #58595B;
  --nickel: #6C757D;
  --cultured: #DEE2E6;
  --linen: #F5EAE1;
  --danger: #DE3C4B;
  --radius: 14px;
  --shadow-xs: 0 1px 2px rgba(30, 30, 29, 0.06);
  --shadow-sm: 0 2px 8px rgba(30, 30, 29, 0.10);
  --shadow-md: 0 6px 20px rgba(30, 30, 29, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Gilroy", "Poppins", sans-serif;
  background: var(--seasalt);
  color: var(--shahor);
}

.hidden { display: none !important; }

/* ---------- header ---------- */

.topbar {
  background: var(--tekhelet-blue);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  flex-wrap: wrap;
}

.topbar-logo { height: 38px; width: auto; }

.topbar-title { display: flex; flex-direction: column; gap: 2px; }

.eyebrow {
  font-family: "TT Rationalist", sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--yarok);
}

.topbar-h {
  font-family: "MD Nichrome", "Gilroy", sans-serif;
  font-weight: 900;
  font-size: 20px;
  line-height: 1.05;
  text-transform: uppercase;
  color: #fff;
}

.topbar-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- buttons ---------- */

.btn {
  font-family: "Gilroy", sans-serif;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--cultured);
  background: #fff;
  color: var(--shahor);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 150ms ease-out, transform 80ms ease-out;
}

.btn:hover { background: color-mix(in srgb, #fff 92%, black); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 3px solid var(--tekhelet-blue); outline-offset: 2px; }

.btn-lime { background: var(--yarok); border-color: var(--yarok); color: var(--shahor); }
.btn-lime:hover { background: color-mix(in srgb, var(--yarok) 92%, black); }

.btn-dark { background: var(--shahor); border-color: var(--shahor); color: var(--seasalt); }
.btn-dark:hover { background: #000; }

.btn-ghost { background: transparent; color: inherit; border-color: var(--nickel); }
.btn-ghost:hover { background: rgba(108, 117, 125, 0.12); }

.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(222, 60, 75, 0.08); }

.btn-mini { padding: 4px 12px; font-size: 12px; }

/* ---------- draft banner ---------- */

.draft-banner {
  background: var(--illuminating);
  color: var(--shahor);
  font-size: 13px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.draft-banner code { font-family: inherit; font-weight: 800; }

.draft-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- toolbar ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid var(--cultured);
  flex-wrap: wrap;
}

.toolbar input[type="search"] {
  font-family: "Gilroy", sans-serif;
  font-size: 14px;
  padding: 8px 14px;
  border: 1px solid var(--cultured);
  border-radius: 999px;
  width: min(340px, 100%);
  background: var(--seasalt);
}

.toolbar input[type="search"]:focus-visible { outline: 3px solid var(--tekhelet-blue); outline-offset: 1px; }

.search-count { font-size: 12.5px; color: var(--nickel); }

.sync-status { font-size: 12.5px; color: var(--nickel); }
.sync-status.ok { color: var(--mint); }
.sync-status.err { color: var(--danger); }

.toolbar-group { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* ---------- page ---------- */

#page { display: flex; flex-direction: column; }

.hero {
  padding: 56px 24px 34px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.hero .accent {
  width: 44px;
  height: 6px;
  border-radius: 3px;
  background: var(--yarok);
  margin-bottom: 18px;
}

.hero h1 {
  font-weight: 900;
  font-size: clamp(34px, 5.5vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero p { margin-top: 12px; font-size: 16px; color: var(--davys); }

.band { padding: 26px 24px 44px; }

.band > h2, .band > p.band-sub, .band > div {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.band h2 {
  font-family: "MD Nichrome", sans-serif;
  font-weight: 900;
  font-size: 26px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.band-sub { font-size: 13.5px; color: var(--davys); margin-bottom: 18px; }

.band-warm { background: var(--linen); }

.band-warm h2 { margin-bottom: 4px; }

/* ---------- leadership ---------- */

#leadership { margin-top: 16px; }

.ceo-block { display: flex; flex-direction: column; align-items: center; }

.board-pill {
  font-family: "TT Rationalist", sans-serif;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--davys);
  background: var(--cultured);
  border-radius: 8px;
  padding: 5px 14px;
}

.tick { width: 2px; height: 16px; background: var(--cultured); }

.ceo-block .pcard { min-width: min(320px, 100%); }

.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.dept {
  background: #fff;
  border: 1px solid var(--cultured);
  border-radius: 18px;
  padding: 16px;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.dept::before {
  content: "";
  position: absolute;
  top: -17px;
  left: 50%;
  width: 2px;
  height: 16px;
  background: var(--cultured);
}

/* nested reports */
.node { margin-top: 8px; }

.reports {
  margin: 8px 0 0 19px;
  padding-left: 14px;
  border-left: 2px solid var(--cultured);
  display: flex;
  flex-direction: column;
}

.reports .node:first-child { margin-top: 0; }

/* ---------- person cards ---------- */

.pcard {
  background: #fff;
  border: 1px solid var(--cultured);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  position: relative;
  transition: box-shadow 160ms ease-out, transform 160ms ease-out, opacity 160ms ease-out, outline-color 160ms ease-out;
  cursor: pointer;
}

.pcard:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.pcard:focus-visible { outline: 3px solid var(--tekhelet-blue); outline-offset: 2px; }

.pcard.lead {
  background: var(--linen);
  border-color: transparent;
  color: var(--shahor);
}

.pcard.lead .role { color: var(--davys); }

.pcard.hiring {
  background: transparent;
  border: 1.5px dashed var(--nickel);
}

.pcard.dim { opacity: 0.25; }

.pcard.hit { outline: 3px solid var(--yarok); outline-offset: 1px; }

.pcard.drop-target { outline: 3px dashed var(--mint); outline-offset: 2px; }

.pcard.dragging { opacity: 0.45; }

body.edit-mode .pcard { cursor: grab; }

.avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(30, 30, 29, 0.14);
}

.avatar .face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.d-avatar { width: 76px; height: 76px; font-size: 24px; margin-bottom: 12px; }

.pcard.hiring .avatar { background: var(--cultured) !important; color: var(--nickel); font-size: 17px; box-shadow: none; }

.who { min-width: 0; display: flex; flex-direction: column; gap: 1px; flex: 1; }

.who .name {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.who .role {
  font-weight: 500;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--davys);
}

.tag {
  font-family: "TT Rationalist", sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  align-self: center;
  flex: 0 0 auto;
}

.tag.leave { background: var(--illuminating); color: var(--shahor); }
.tag.leave-upcoming { background: var(--linen); color: var(--davys); border: 1px solid var(--cultured); }
.tag.hiring-tag { background: transparent; border: 1px solid var(--cultured); color: var(--nickel); }

.reports-note {
  font-family: "TT Rationalist", sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--nickel);
  margin: 4px 0 0 48px;
}

/* ---------- campus panels ---------- */

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid var(--cultured);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 180ms ease-out, transform 180ms ease-out;
}

.panel:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }

.panel-head {
  padding: 14px 16px 12px;
  border-top: 5px solid var(--cultured);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
}

.panel-count {
  margin-left: auto;
  font-family: "TT Rationalist", sans-serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--nickel);
  white-space: nowrap;
}

.panel-head img { height: 34px; width: auto; max-width: 100%; display: block; }

.panel-head .panel-name {
  font-family: "MD Nichrome", sans-serif;
  font-weight: 900;
  font-size: 19px;
  text-transform: uppercase;
  line-height: 1;
}

.panel-body { padding: 0 14px 14px; }

.panel-body > .node { margin-top: 10px; }

/* ---------- edit hint ---------- */

.edit-hint {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: var(--shahor);
  color: var(--yarok);
  font-size: 12.5px;
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- dialogs ---------- */

dialog {
  border: none;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  padding: 28px;
  width: min(460px, calc(100vw - 40px));
  font-family: "Gilroy", sans-serif;
  color: var(--shahor);
}

dialog::backdrop { background: rgba(30, 30, 29, 0.5); }

dialog h2 {
  font-family: "MD Nichrome", sans-serif;
  font-size: 19px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

dialog p { font-size: 13.5px; color: var(--davys); margin-bottom: 14px; line-height: 1.45; }

dialog label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--davys);
  margin-bottom: 12px;
  flex: 1;
}

dialog input, dialog select {
  font-family: "Gilroy", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--shahor);
  padding: 9px 12px;
  border: 1px solid var(--cultured);
  border-radius: 10px;
  background: var(--seasalt);
  width: 100%;
}

dialog input:focus-visible, dialog select:focus-visible { outline: 3px solid var(--tekhelet-blue); outline-offset: 1px; }

.form-row { display: flex; gap: 12px; }

.photo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.editor-avatar { width: 56px; height: 56px; font-size: 18px; background: var(--nickel); }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-actions label { margin: 0; display: inline-flex; align-items: center; cursor: pointer; }

.form-error { color: var(--danger); font-size: 12.5px; margin-top: -6px; }

.dlg-actions { display: flex; gap: 10px; margin-top: 8px; align-items: center; }

.dlg-actions .spacer { flex: 1; }

#detail-body .d-name { font-weight: 900; font-size: 20px; margin-bottom: 2px; }
#detail-body .d-role { font-size: 14px; color: var(--davys); margin-bottom: 12px; }
#detail-body .d-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.tag.central { background: var(--shahor); color: var(--yarok); }
#detail-body .d-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; margin-bottom: 14px; }
#detail-body .d-grid dt { font-family: "TT Rationalist", sans-serif; font-size: 11px; letter-spacing: 0.05em; color: var(--nickel); align-self: center; }
#detail-body .d-grid dd { margin: 0; }

/* ---------- footer ---------- */

.foot {
  background: #fff;
  border-top: 1px solid var(--cultured);
  padding: 10px 24px;
  font-size: 11.5px;
  color: var(--nickel);
}

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .topbar { gap: 12px; padding: 12px 16px; }
  .topbar-logo { height: 28px; }
  .topbar-h { font-size: 15px; }
  #meta-updated { display: none; }
  .toolbar { padding: 8px 16px; }
  .toolbar-group { margin-left: 0; }
  .hero { padding: 28px 16px 20px; }
  .band { padding: 20px 16px 32px; }
  .dept::before { display: none; }
}

/* ---------- print ---------- */

@media print {
  .toolbar, .topbar-meta, .draft-banner, .edit-hint, .foot { display: none !important; }
  .band, .hero { padding: 12px 0; }
  .panel, .dept, .pcard { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}
