/* Teacher Tools — Professional Hub
   Refined, calm, publisher-grade layout scoped entirely to `.tools-page`.
   Warm ivory canvas, serif display headings, hairline flat cards, a single
   clay accent. No nested boxes, no chip clutter, responsive grids that never
   overflow. Search/filter contract (data-tool-*) is preserved for tools.js. */

.tools-page {
  --tt-ivory: #f7f5ef;
  --tt-paper: #fffdf8;
  --tt-ink: #201d17;
  --tt-muted: #6b6455;
  --tt-faint: #928b7a;
  --tt-line: #e7e2d4;
  --tt-line-soft: #efebdf;
  --tt-clay: #b1543a;
  --tt-clay-dark: #96442d;
  --tt-clay-soft: #f4e9e2;
  --tt-sage: #4a7a6f;
  --tt-radius: 16px;
  --tt-serif:
    "Tiempos Text", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
}

/* Calm the busy global gradient down to a warm ivory wash for this page only. */
body.tools-page {
  background: var(--tt-ivory);
}

.tools-page .page-shell {
  width: min(100% - 40px, 1180px);
  gap: clamp(38px, 6vw, 64px);
  padding-block: clamp(28px, 5vw, 52px) 40px;
  color: var(--tt-ink);
}

.tools-page h1,
.tools-page h2,
.tools-page h3 {
  font-family: var(--tt-serif);
  letter-spacing: -0.01em;
  color: var(--tt-ink);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: -999px;
  z-index: 30;
  padding: 10px 16px;
  background: var(--tt-ink);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  inset-inline-start: 12px;
}

/* ---------- Breadcrumb ---------- */
.tools-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
  color: var(--tt-faint);
}
.tools-breadcrumb a {
  text-decoration: none;
  color: var(--tt-muted);
}
.tools-breadcrumb a:hover {
  color: var(--tt-clay);
}
.tools-breadcrumb li + li::before {
  content: "/";
  margin-inline-end: 8px;
  color: var(--tt-line);
}
.tools-breadcrumb [aria-current="page"] {
  color: var(--tt-ink);
  font-weight: 600;
}

/* ---------- Hero ---------- */
.tools-page .tools-hero {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  display: grid;
  gap: 22px;
  max-width: 940px;
}
.tools-page .tools-hero .eyebrow {
  color: var(--tt-clay);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
}
.tools-page .tools-hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6.4vw, 4.4rem);
  line-height: 1.02;
  font-weight: 500;
}
.tools-hero .hero-copy {
  max-width: 660px;
  margin: 0;
  color: var(--tt-muted);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  line-height: 1.5;
}

/* Plan → Teach → Review workflow ribbon (replaces the old duplicate card wall) */
.workflow-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.workflow-ribbon li {
  flex: 1 1 200px;
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  background: var(--tt-paper);
  border: 1px solid var(--tt-line);
  border-radius: 14px;
}
.workflow-ribbon .step {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-faint);
}
.workflow-ribbon a {
  font-family: var(--tt-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tt-ink);
  text-decoration: none;
}
.workflow-ribbon a:hover,
.workflow-ribbon a:focus-visible {
  color: var(--tt-clay);
}
.workflow-ribbon small {
  color: var(--tt-muted);
  font-size: 0.86rem;
}

/* ---------- Search + filter bar ---------- */
.section-heading h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
}
.tools-page .eyebrow {
  color: var(--tt-clay);
}
.tools-section-intro {
  max-width: 640px;
  margin: 8px 0 0;
  color: var(--tt-muted);
}

.tool-filter-panel {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 16px 24px;
  align-items: end;
  margin: 22px 0 4px;
  padding: 16px 0;
  background: var(--tt-ivory);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--tt-line);
}
.tool-search label {
  display: grid;
  gap: 6px;
  color: var(--tt-faint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tool-search input {
  width: 100%;
  padding: 12px 15px;
  background: var(--tt-paper);
  border: 1px solid var(--tt-line);
  border-radius: 12px;
  color: var(--tt-ink);
  font: inherit;
}
.tool-search input::placeholder {
  color: var(--tt-faint);
}
.tool-shortcut {
  margin: 7px 0 0;
  color: var(--tt-faint);
  font-size: 0.8rem;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.filter-chips button {
  padding: 8px 15px;
  border: 1px solid var(--tt-line);
  border-radius: 999px;
  background: var(--tt-paper);
  color: var(--tt-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}
.filter-chips button:hover {
  border-color: var(--tt-clay);
  color: var(--tt-clay);
}
.filter-chips button[aria-pressed="true"] {
  background: var(--tt-ink);
  color: #fff;
  border-color: var(--tt-ink);
}

.result-status {
  margin: 14px 0 0;
  color: var(--tt-faint);
  font-size: 0.9rem;
  font-weight: 600;
}
.empty-state {
  padding: 26px;
  margin-top: 18px;
  background: var(--tt-paper);
  border: 1px dashed var(--tt-line);
  border-radius: var(--tt-radius);
}
.empty-state h3 {
  margin: 0 0 6px;
}
.empty-state p {
  margin: 0;
  color: var(--tt-muted);
}

/* ---------- Tool groups (flat on the page — no nested boxes) ---------- */
.tool-group {
  display: grid;
  gap: 18px;
  margin-top: clamp(32px, 5vw, 52px);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.tool-group-header {
  display: grid;
  gap: 6px;
  max-width: 720px;
}
.tool-group-header .eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
}
.tool-group-header h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 500;
}
.tool-group-header p {
  margin: 0;
  color: var(--tt-muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 288px), 1fr));
  gap: 16px;
}

/* ---------- Cards ---------- */
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
  padding: 22px 22px 20px;
  background: var(--tt-paper);
  border: 1px solid var(--tt-line);
  border-radius: var(--tt-radius);
  color: inherit;
  text-decoration: none;
  box-shadow: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}
.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--tt-clay);
  box-shadow: 0 18px 40px rgba(32, 29, 23, 0.1);
}
.tool-kind {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-faint);
}
.tool-card h4 {
  margin: 0;
  font-family: var(--tt-serif);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.18;
  color: var(--tt-ink);
}
.tool-card p {
  margin: 0;
  color: var(--tt-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
.tool-card p strong {
  color: var(--tt-ink);
  font-weight: 650;
}
.tool-cta {
  margin-top: auto;
  padding-top: 6px;
  color: var(--tt-clay-dark);
  font-weight: 700;
  font-size: 0.92rem;
}
.tool-cta::after {
  content: " →";
}
.tool-card:hover .tool-cta,
.tool-card:focus-visible .tool-cta {
  color: var(--tt-clay);
}
/* Deploy card holds inner links, so it isn't a full-card anchor. */
.tool-card--rich {
  gap: 12px;
}
.tool-card--rich a.tool-cta {
  text-decoration: none;
}
.tool-card--rich .inline-note {
  font-size: 0.85rem;
  color: var(--tt-faint);
}
.tool-card--rich .inline-note a {
  color: var(--tt-clay-dark);
  font-weight: 600;
}

.local-use {
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #eef4f1;
  color: var(--tt-sage);
  border: 1px solid rgba(74, 122, 111, 0.2);
}

/* ---------- Focus + footer ---------- */
.tool-card:focus-visible,
.filter-chips button:focus-visible,
.tool-search input:focus-visible,
.workflow-ribbon a:focus-visible,
.tools-breadcrumb a:focus-visible {
  outline: 3px solid rgba(177, 84, 58, 0.4);
  outline-offset: 3px;
}

.tools-page .site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 22px;
  border-top: 1px solid var(--tt-line);
  color: var(--tt-faint);
  font-size: 0.86rem;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .tool-filter-panel {
    position: static;
    grid-template-columns: 1fr;
  }
  .filter-chips {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tools-page *,
  .tools-page *::before,
  .tools-page *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
