/* Clara public docs, aligned with clara-portal branding */
@font-face {
  font-family: "Cooper BT Regular";
  src: url("fonts/CooperLtBTW08-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Match clara-portal globals.css */
  --bg: #fbf9f6;
  --surface: #ffffff;
  --text: #2d2926;
  --muted: #6b6560;
  --border: #edeae4;
  --clara-orange: #f8781d;
  --clara-orange-hover: #e06a0a;
  --link: #b8550f;
  --max: 42rem;
  --wide: 52rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

.doc-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.doc-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1.25rem;
}

.doc-header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

/* Overview (home): logo only, flush left within the content column */
.doc-header-inner--overview {
  justify-content: flex-start;
}

.doc-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.doc-logo img {
  height: 40px;
  width: auto;
  display: block;
}

@media (min-width: 640px) {
  .doc-logo img {
    height: 48px;
  }
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.doc-nav a {
  color: var(--text);
  text-decoration: none;
}

.doc-nav a:hover {
  color: var(--clara-orange);
}

.doc-nav a[aria-current="page"] {
  color: var(--clara-orange);
}

main {
  flex: 1;
  padding: 2rem 1.25rem 3rem;
}

/* Long-form policy pages: sidebar TOC + article */
.doc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 900px) {
  .doc-layout {
    grid-template-columns: minmax(13.75rem, 16.5rem) minmax(0, 1fr);
    gap: 2.75rem;
    align-items: start;
  }

  .doc-sidebar {
    position: sticky;
    top: 1.25rem;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    box-sizing: border-box;
  }

  .doc-sidebar::-webkit-scrollbar {
    width: 6px;
  }

  .doc-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
  }
}

.doc-sidebar-title {
  font-family: "Cooper BT Regular", Georgia, serif;
  font-weight: normal;
  font-size: 1.05rem;
  margin: 0 0 0.85rem;
  color: var(--text);
  line-height: 1.25;
}

.doc-sidebar-nav ol {
  margin: 0;
  /* Enough space for two-digit list markers (10–14) so they are not clipped by overflow */
  padding-inline-start: 2.65rem;
  list-style-type: decimal;
  list-style-position: outside;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.doc-sidebar-nav li {
  margin: 0 0 0.5rem;
  padding-left: 0.15rem;
}

.doc-sidebar-nav li::marker {
  color: var(--muted);
  font-weight: 500;
}

.doc-sidebar-nav a {
  color: var(--text);
  text-decoration: none;
  display: inline;
  transition: color 0.12s ease;
}

.doc-sidebar-nav a:hover {
  color: var(--clara-orange);
}

.doc-sidebar-nav a.is-active,
.doc-sidebar-nav a[aria-current="location"] {
  color: var(--clara-orange);
  font-weight: 600;
}

.doc-layout__main {
  min-width: 0;
}

.doc-layout__main .doc-article {
  max-width: 48rem;
}

.doc-article h2[id] {
  scroll-margin-top: 1.25rem;
}

/* Fixed orange reading progress (bottom of viewport) */
.doc-scroll-track {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 200;
  background: rgba(45, 41, 38, 0.08);
  pointer-events: none;
}

.doc-scroll-fill {
  height: 100%;
  width: 0%;
  background: var(--clara-orange);
  transition: width 0.04s linear;
}

@media (prefers-reduced-motion: reduce) {
  .doc-scroll-fill {
    transition: none;
  }
}

.doc-main-narrow {
  max-width: var(--max);
  margin: 0 auto;
}

.doc-main-wide {
  max-width: var(--wide);
  margin: 0 auto;
}

.doc-overview {
  text-align: left;
  padding-top: 0.5rem;
}

.doc-overview-title {
  font-family: "Cooper BT Regular", Georgia, serif;
  font-weight: normal;
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 1rem;
  color: var(--text);
}

.doc-overview-lead {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 38rem;
}

.doc-toc-heading {
  font-family: "Cooper BT Regular", Georgia, serif;
  font-weight: normal;
  font-size: 1.35rem;
  margin: 0 0 0.85rem;
  color: var(--text);
}

.doc-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.doc-cards--toc {
  margin: 0;
}

.doc-card {
  display: block;
  padding: 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(45, 41, 38, 0.04);
}

.doc-card:hover {
  border-color: rgba(248, 120, 29, 0.35);
  box-shadow: 0 4px 20px rgba(45, 41, 38, 0.08);
}

.doc-card h2 {
  font-family: "Cooper BT Regular", Georgia, serif;
  font-size: 1.25rem;
  font-weight: normal;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.doc-card:hover h2 {
  color: var(--clara-orange);
}

.doc-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Overview TOC rows: thin bar, title + language pill + View (Clara orange accent) */
.doc-card--toc-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.5rem 1rem;
  min-height: unset;
  flex-wrap: wrap;
}

.doc-card--toc-title {
  font-family: "Cooper BT Regular", Georgia, serif;
  font-size: 1.05rem;
  font-weight: normal;
  color: var(--text);
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 12rem;
}

.doc-card--toc-trailing {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.doc-lang-pill {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  line-height: 1;
}

.doc-view-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.4rem 0.9rem 0.4rem 0.95rem;
  border-radius: 999px;
  background: rgba(248, 120, 29, 0.12);
  border: 1px solid rgba(248, 120, 29, 0.38);
  line-height: 1;
}

.doc-view-pill__icon {
  flex-shrink: 0;
  margin-left: 0.05rem;
}

.doc-card--toc-row:hover .doc-card--toc-title {
  color: var(--clara-orange);
}

.doc-card--toc-row:hover .doc-view-pill {
  background: rgba(248, 120, 29, 0.2);
  border-color: var(--clara-orange);
  color: var(--text);
}

@media (max-width: 520px) {
  .doc-card--toc-row .doc-card--toc-trailing {
    width: 100%;
    justify-content: flex-end;
  }
}

.doc-article h1 {
  font-family: "Cooper BT Regular", Georgia, serif;
  font-weight: normal;
  font-size: clamp(1.55rem, 3.5vw, 1.95rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.doc-meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.doc-article h2 {
  font-family: "Cooper BT Regular", Georgia, serif;
  font-weight: normal;
  font-size: 1.25rem;
  margin: 2rem 0 0.65rem;
  color: var(--text);
}

.doc-article h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.35rem 0 0.5rem;
}

.doc-article p,
.doc-article li {
  margin: 0 0 0.75rem;
}

.doc-article ul,
.doc-article ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.doc-article li {
  margin-bottom: 0.4rem;
}

.doc-article a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.doc-article a:hover {
  color: var(--clara-orange-hover);
}

.doc-contact-block {
  margin: 0.5rem 0 0;
  line-height: 1.6;
}

.doc-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: 1rem 0 1.25rem;
}

.doc-article th,
.doc-article td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.doc-article th {
  background: var(--bg);
  font-weight: 600;
}

.doc-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--clara-orange);
  border-radius: 0 0.375rem 0.375rem 0;
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.doc-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
}

.doc-footer a {
  color: var(--link);
  text-decoration: underline;
}

.doc-footer a:hover {
  color: var(--clara-orange);
}
