/* Texas AI Law — design system per brief sections 2 and 3.
   Paper #F7F6F1, Ink #202925, Forest #233C36, Sage #DDE5DF,
   White #FFFFFF, Link #294C40, Muted #5B665F, Rule #CAD2CB.
   Poppins Medium headings and navigation, Poppins Light body. */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/assets/fonts/poppins-light.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/poppins-medium.woff2") format("woff2");
}

:root {
  --paper: #F7F6F1;
  --ink: #202925;
  --forest: #233C36;
  --sage: #DDE5DF;
  --white: #FFFFFF;
  --link: #294C40;
  --muted: #5B665F;
  --rule: #CAD2CB;
  --max: 1200px;
  --prose: 680px;
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--ink);
}

h1.article-title { font-size: 54px; }
h2 { font-size: 34px; margin-top: 48px; }
h3 { font-size: 24px; margin-top: 32px; }

p { margin: 0 0 16px; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--forest); }

:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 200;
  background: var(--forest);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 4px;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus { top: 12px; color: var(--white); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 88px;
}

.brand { flex: 0 0 auto; line-height: 0; }
.brand img { height: 44px; width: auto; }

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 2px;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover { color: var(--forest); border-bottom-color: var(--sage); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--forest); }

.header-actions { display: none; }

.menu-button {
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 16px;
  background: var(--forest);
  color: var(--white);
  border: 1px solid var(--forest);
  border-radius: 4px;
  cursor: pointer;
}

.mobile-menu {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.mobile-menu nav { padding: 16px 0 24px; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu li { border-top: 1px solid var(--rule); }
.mobile-menu a {
  display: block;
  padding: 14px 4px;
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}
.mobile-menu a[aria-current="page"] { color: var(--forest); }

.menu-close-row { display: flex; justify-content: flex-end; padding-top: 8px; }
.menu-close {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  min-height: 44px;
  padding: 8px 16px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
}

/* ---------- Breadcrumb ---------- */

.breadcrumb { padding: 24px 0 0; font-size: 15px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.breadcrumb li { display: inline; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--muted); }
.breadcrumb a { color: var(--link); }
.breadcrumb [aria-current="page"] { color: var(--muted); }

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

.article-head { max-width: var(--prose); padding: 24px 0 8px; }
.kicker {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 0 0 12px;
}
.deck { font-size: 20px; line-height: 1.55; color: var(--ink); }

.date-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 15px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  margin: 24px 0 32px;
}
.date-row .sep { color: var(--rule); }

/* ---------- Prose ---------- */

.prose { max-width: var(--prose); }
.prose ul, .prose ol { padding-left: 28px; }
.prose li { margin-bottom: 8px; }

.spacer { height: 48px; }

/* ---------- Homepage hero / slideshow ---------- */

.hero {
  background: var(--forest);
  padding: 48px 0 40px;
  color: var(--white);
}

.slideshow { max-width: 1000px; margin: 0 auto; }

.slide { margin: 0; }
.slide[hidden] { display: none; }

.slide-link { display: block; text-decoration: none; color: var(--ink); }
.slide-link:hover { color: var(--ink); }

.slide-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sage);
  border-radius: 6px 6px 0 0;
}

.slide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-caption {
  background: var(--paper);
  color: var(--ink);
  padding: 24px 28px;
  border-radius: 0 0 6px 6px;
}

.slide-title {
  display: block;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.slide-link:hover .slide-title, .slide-link:focus-visible .slide-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.slide-text { display: block; font-size: 17px; color: var(--ink); }

.slide-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.slide-controls button {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 18px;
  border-radius: 4px;
  border: 1px solid var(--white);
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.slide-controls button:hover { background: rgba(255, 255, 255, 0.14); }
.slide-controls button:focus-visible { outline-color: var(--white); }

.slide-dots { display: flex; gap: 8px; margin-left: auto; }
.slide-dots button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 15px;
}
.slide-dots button[aria-current="true"] { background: var(--white); color: var(--forest); }

/* ---------- Homepage sections ---------- */

.home-section { padding: 56px 0; }
.home-section + .home-section { border-top: 1px solid var(--rule); }
.home-section h2 { margin-top: 0; }
.section-lede { max-width: var(--prose); font-size: 19px; }

.question-list { list-style: none; margin: 0; padding: 0; max-width: var(--prose); }
.question-list li { border-bottom: 1px solid var(--rule); }
.question-list a {
  display: block;
  padding: 16px 4px;
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}
.question-list a:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.card h3 { font-size: 22px; margin: 0 0 12px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.card p { font-size: 16px; margin: 0 0 12px; }
.card .card-meta { font-size: 14px; color: var(--muted); margin-top: auto; padding-top: 8px; }
.card .card-link { font-weight: 500; margin-top: 8px; }

.link-more { display: inline-block; margin-top: 24px; font-weight: 500; }

/* ---------- Contents nav ---------- */

.contents {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 20px 24px;
  margin: 0 0 32px;
  max-width: var(--prose);
}
.contents h2 { font-size: 20px; margin: 0 0 12px; }
.contents ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.contents li { margin-bottom: 6px; break-inside: avoid; }
.contents a { font-size: 16px; }

/* ---------- Key authorities ---------- */

.authority-group { margin-bottom: 24px; }
.authority-group h3 { font-size: 20px; margin-bottom: 8px; }

/* ---------- Sources ---------- */

.source-list { list-style: none; margin: 0; padding: 0; max-width: var(--prose); }
.source-list li {
  border-top: 1px solid var(--rule);
  padding: 14px 0;
  font-size: 16px;
}
.source-list .source-title { font-weight: 500; }
.source-list .source-meta { color: var(--muted); font-size: 15px; }

/* ---------- Related reading ---------- */

.related-list { list-style: none; margin: 0; padding: 0; max-width: var(--prose); }
.related-list li { margin-bottom: 10px; font-size: 17px; }

/* ---------- Tracker ---------- */

.tracker-filters {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 24px;
  margin: 24px 0 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.field label { display: block; font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.field input[type="search"], .field select {
  width: 100%;
  min-height: 44px;
  font-family: var(--font);
  font-size: 16px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
}

.button {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  min-height: 44px;
  padding: 8px 20px;
  border-radius: 4px;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: var(--white);
  cursor: pointer;
}
.button.secondary { background: transparent; color: var(--forest); }

.filter-status { font-size: 15px; color: var(--muted); margin: 0 0 16px; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--white);
  margin-bottom: 48px;
}

table.tracker { border-collapse: collapse; width: 100%; min-width: 1100px; font-size: 15px; }
table.tracker caption { text-align: left; padding: 16px; font-weight: 500; font-size: 17px; }
table.tracker th, table.tracker td {
  text-align: left;
  vertical-align: top;
  padding: 14px 16px;
  border-top: 1px solid var(--rule);
}
table.tracker thead th {
  background: var(--sage);
  font-weight: 500;
  white-space: nowrap;
  border-top: 0;
}
table.tracker tbody tr:hover { background: var(--paper); }
table.tracker .rec-title { font-weight: 500; }
table.tracker .rec-id { color: var(--muted); font-size: 13px; }

.empty-row td { text-align: center; padding: 32px; font-size: 17px; }

/* ---------- Definitions ---------- */

.def-list { max-width: var(--prose); }
.def-list dt { font-weight: 500; font-size: 20px; margin: 32px 0 4px; }
.def-list dd { margin: 0 0 8px; }
.def-list .def-applies { font-size: 15px; color: var(--muted); }

/* ---------- Search ---------- */

.search-form { max-width: var(--prose); margin: 24px 0; }
.search-row { display: flex; gap: 12px; }
.search-row input[type="search"] {
  flex: 1;
  min-height: 48px;
  font-family: var(--font);
  font-size: 17px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
}
.search-results { list-style: none; margin: 24px 0; padding: 0; max-width: var(--prose); }
.search-results li { border-top: 1px solid var(--rule); padding: 16px 0; }
.search-results .result-title { font-weight: 500; font-size: 19px; }
.search-results .result-url { font-size: 14px; color: var(--muted); }
.search-results .result-excerpt { font-size: 16px; margin-top: 4px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--forest);
  color: var(--white);
  padding: 48px 0 32px;
  margin-top: 64px;
}

.site-footer .footer-note { font-size: 19px; font-weight: 500; margin-bottom: 24px; }

.footer-links { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-bottom: 32px; }
.footer-links a { color: var(--white); font-size: 16px; }
.footer-links a:hover { color: var(--sage); }
.footer-links .footer-group-label { width: 100%; font-size: 14px; color: var(--sage); margin: 16px 0 0; }

.footer-copy { font-size: 14px; color: var(--sage); border-top: 1px solid rgba(255,255,255,0.25); padding-top: 24px; }
.site-footer :focus-visible { outline-color: var(--white); }

/* ---------- Tablet ---------- */

@media (max-width: 1099px) {
  .wrap { padding-left: 32px; padding-right: 32px; }
  .header-inner { min-height: 76px; }
  .site-nav { display: none; }
  .header-actions { display: block; margin-left: auto; }
  h1.article-title { font-size: 44px; }
  h2 { font-size: 30px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .tracker-filters { grid-template-columns: 1fr 1fr; }
}

/* ---------- Mobile ---------- */

@media (max-width: 699px) {
  body { font-size: 17px; }
  .wrap { padding-left: 20px; padding-right: 20px; }
  .header-inner { min-height: 68px; gap: 16px; }
  .brand img { height: 36px; }
  h1.article-title { font-size: 34px; }
  h2 { font-size: 28px; }
  .hero { padding: 32px 0 28px; }
  .slide-title { font-size: 22px; }
  .slide-caption { padding: 20px; }
  .card-grid { grid-template-columns: 1fr; }
  .contents ul { columns: 1; }
  .tracker-filters { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; }
  .slide-dots { margin-left: 0; }
}

/* ---------- Back to top ---------- */

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 16px;
  background: var(--forest);
  color: var(--white);
  border: 1px solid var(--forest);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(32, 41, 37, 0.25);
}

.to-top:hover,
.to-top:focus-visible {
  background: var(--link);
  border-color: var(--link);
}
