/* Rewired Education Group — internal link directory
   Palette sampled directly from the Rewired logo and district catalog:
   deep teal-navy (#10515f), warm orange accent (#da7f26), mint tint (#cfe3e2),
   cream page background, on a clean editorial layout matching the handbook site. */

:root {
  --ink: #10515f;
  --ink-deep: #0b3944;
  --teal-mid: #1f7a83;
  --orange: #da7f26;
  --orange-deep: #c76c17;
  --mint: #cfe3e2;
  --mint-soft: #e6f1ef;
  --cream: #f8f5ee;
  --paper: #ffffff;
  --line: #dfe6e2;
  --text: #1f2d2f;
  --muted: #5c7370;
  --radius: 10px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--orange);
  color: #fff;
  padding: 8px 14px;
  z-index: 100;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand img {
  height: 40px;
  width: auto;
  display: block;
}
.topbar .tag {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  font-weight: 500;
}

/* ---------- hero ---------- */
.hero {
  padding: clamp(36px, 7vw, 68px) clamp(20px, 5vw, 56px) 16px;
  position: relative;
}
.hero .eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 14px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.08;
  margin: 0 0 16px;
  max-width: 18ch;
  color: var(--ink);
}
.hero p.lede {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.hero .caution {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  border-radius: 6px;
  background: var(--mint-soft);
  font-size: 0.92rem;
  color: var(--ink);
}

/* ---------- divider ---------- */
.trace {
  position: relative;
  height: 28px;
  margin: 0 clamp(20px, 5vw, 56px);
}
.trace svg { width: 100%; height: 100%; display: block; }

/* ---------- category section ---------- */
.category {
  padding: 10px clamp(20px, 5vw, 56px) 46px;
}
.category-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 6px;
}
.category-head .idx {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--orange);
  border: 1px solid var(--orange);
  border-radius: 20px;
  padding: 3px 10px;
}
.category-head h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}
.category-blurb {
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 60ch;
  font-size: 0.96rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  text-align: left;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  width: 100%;
  font: inherit;
}
.card:hover, .card:focus-visible {
  border-color: var(--orange);
  box-shadow: 0 6px 18px rgba(16,81,95,0.08);
}
.card:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.card[aria-expanded="true"] { border-color: var(--orange); }
.card .node-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card .node-row .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal-mid);
  flex: none;
}
.card.tbd .node-row .dot { background: var(--muted); }
.card .title {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
}
.card .desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.card .kind {
  margin-top: auto;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--orange);
}
.card.tbd .kind { color: var(--muted); }

/* ---------- link action popover ---------- */
.popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 12px;
  right: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(16,81,95,0.18);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.popover.open { display: flex; }
.popover button, .popover a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-family: var(--sans);
  cursor: pointer;
  text-align: left;
}
.popover button:hover, .popover a:hover { background: var(--mint-soft); color: var(--ink); }
.popover button:disabled {
  color: var(--muted);
  cursor: default;
}
.popover button:disabled:hover { background: none; }
.popover .divider { height: 1px; background: var(--line); margin: 4px 2px; }
.popover .icon { font-size: 1rem; width: 18px; text-align: center; flex: none; }
.popover .toast {
  font-size: 0.82rem;
  color: var(--teal-mid);
  padding: 6px 12px 2px;
  display: none;
}
.popover .toast.show { display: block; }

/* ---------- footer ---------- */
footer {
  padding: 30px clamp(20px, 5vw, 56px) 50px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
footer a { color: var(--teal-mid); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- individual landing pages ---------- */
.page-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(46px, 9vw, 88px) 24px 60px;
}
.back-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-mid);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 30px;
}
.back-link:hover { text-decoration: underline; }
.page-wrap .cat-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}
.page-wrap h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 18px;
  color: var(--ink);
}
.page-wrap .desc {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 58ch;
  margin-bottom: 30px;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--orange);
  color: #fff;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.98rem;
  border: none;
  cursor: pointer;
}
.cta:hover { background: var(--orange-deep); }
.cta.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.cta.secondary:hover { border-color: var(--orange); color: var(--orange); background: transparent; }
.cta.disabled {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
  cursor: not-allowed;
}
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.meta-box {
  margin-top: 34px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mint-soft);
  font-size: 0.88rem;
  color: var(--muted);
}
.meta-box code {
  color: var(--teal-mid);
  word-break: break-all;
}

@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
}

/* ---------- District Catalog slideshow ---------- */
.deck-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 48px) 20px 60px;
}
.deck-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.deck-head h1 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  margin: 0;
  color: var(--ink);
}
.deck-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-mid);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 12px;
  background: var(--paper);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--orange); color: var(--orange); }

.deck-stage {
  position: relative;
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: pan-y;
}
.deck-stage img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  box-shadow: 0 12px 34px rgba(16,81,95,0.16);
}
.deck-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.deck-arrow:hover { border-color: var(--orange); color: var(--orange); }
.deck-arrow:disabled { opacity: 0.3; cursor: default; }
.deck-arrow[data-dir="prev"] { left: -14px; }
.deck-arrow[data-dir="next"] { right: -14px; }
@media (max-width: 640px) {
  .deck-arrow[data-dir="prev"] { left: 4px; }
  .deck-arrow[data-dir="next"] { right: 4px; }
}

.deck-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}
.deck-dots { display: flex; gap: 6px; }
.deck-dots button {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: var(--line);
  cursor: pointer;
  padding: 0;
}
.deck-dots button.active { background: var(--orange); }

/* ---------- Bring Rewired template page ---------- */
.tmpl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  gap: 12px;
  flex-wrap: wrap;
  background: var(--paper);
}
.auth-area { display: flex; align-items: center; gap: 10px; }
.auth-area .who {
  font-size: 0.8rem;
  color: var(--teal-mid);
  font-weight: 600;
}
.btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: var(--orange); color: var(--orange); }
.btn.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.btn.primary:hover { background: var(--orange-deep); color: #fff; }
.btn.ghost { border-style: dashed; }
.btn:disabled { opacity: 0.45; cursor: default; }

.tmpl-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(30px, 6vw, 56px) 20px 70px;
}
.tmpl-wrap .eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
}
.tmpl-wrap h1 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 10px;
  color: var(--ink);
}
.tmpl-wrap .lede {
  color: var(--muted);
  margin-bottom: 8px;
}
.howto {
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal-mid);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--ink);
  margin: 18px 0 28px;
}
.tmpl-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.subject-list {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subject-list li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.95rem;
}
.email-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
}
.email-box p { margin: 0 0 16px; }
.email-box p:last-child { margin-bottom: 0; }
.email-box[contenteditable="true"] {
  outline: 2px dashed var(--orange);
  outline-offset: 6px;
}
.placeholder-tag {
  color: var(--orange-deep);
  font-weight: 600;
}
.tmpl-note {
  margin-top: 22px;
  font-size: 0.85rem;
  color: var(--muted);
}
.save-bar {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--orange);
  border-radius: 8px;
  background: var(--mint-soft);
  font-size: 0.85rem;
}
.save-bar.visible { display: flex; }
.status-msg {
  font-size: 0.78rem;
  color: var(--muted);
}
