/* AttorneyGeneral.net - Optimized CSS for PageSpeed 100/100 */
/* Critical CSS - Above the fold styles loaded inline */

:root {
  --primary-color: #1a365d;
  --secondary-color: #2c5282;
  --accent-color: #3182ce;
  --text-color: #1a202c;
  --text-light: #4a5568;
  --bg-white: #ffffff;
  --bg-gray: #f7fafc;
  --bg-light: #edf2f7;
  --border-color: #e2e8f0;
  --success-color: #38a169;
  --warning-color: #d69e2e;
  --danger-color: #e53e3e;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --max-width: 1200px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-white);
}

/* Skip to content for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Header & Navigation */
.site-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.disclaimer-banner {
  background-color: #2d3748;
  color: #e2e8f0;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo svg {
  width: 32px;
  height: 32px;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.main-nav a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:focus {
  background-color: var(--secondary-color);
  outline: 2px solid #63b3ed;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: transparent;
  border: 2px solid white;
  color: white;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 4px;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 1rem;
  }

  .main-nav.active {
    display: flex;
  }

  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .logo {
    width: 100%;
    justify-content: space-between;
  }
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 3rem 1rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

/* Search Bar */
.search-container {
  max-width: 600px;
  margin: 2rem auto;
  position: relative;
}

.search-box {
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  padding: 1rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.search-btn {
  padding: 1rem 2rem;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-btn:hover,
.search-btn:focus {
  background-color: var(--secondary-color);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 10;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.search-result-item:hover {
  background-color: var(--bg-light);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.search-result-desc {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Quick Links Grid */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.quick-link-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quick-link-card:hover,
.quick-link-card:focus {
  border-color: var(--accent-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  background-color: var(--bg-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--accent-color);
}

.quick-link-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
}

.quick-link-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Content Sections */
.content-section {
  margin: 3rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent-color);
}

.section-subtitle {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin: 2rem 0 1rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.card a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
}

.card a:hover {
  text-decoration: underline;
}

/* Alert Boxes */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 4px;
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.alert-info {
  background-color: #bee3f8;
  border-color: var(--accent-color);
  color: #1a365d;
}

.alert-warning {
  background-color: #fef5e7;
  border-color: var(--warning-color);
  color: #744210;
}

.alert-danger {
  background-color: #fed7d7;
  border-color: var(--danger-color);
  color: #742a2a;
}

.alert-success {
  background-color: #c6f6d5;
  border-color: var(--success-color);
  color: #22543d;
}

/* Lists */
ul, ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

li {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  padding-left: 2rem;
  position: relative;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
  font-size: 1.25rem;
}

/* Table of Contents */
.toc {
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.toc h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.toc ul {
  list-style: none;
  padding-left: 0;
}

.toc li {
  margin: 0.5rem 0;
}

.toc a {
  color: var(--accent-color);
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

/* Summary Box */
.summary-box {
  background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.summary-box h3 {
  color: var(--primary-color);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: white;
  box-shadow: var(--shadow-sm);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
}

tr:hover {
  background-color: var(--bg-light);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--secondary-color);
}

.btn-secondary {
  background-color: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--accent-color);
  color: white;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 1rem 0;
  font-size: 0.875rem;
}

.breadcrumbs a {
  color: var(--accent-color);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span {
  color: var(--text-light);
  margin: 0 0.5rem;
}

/* State Grid */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.state-link {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 600;
  transition: all 0.2s;
}

.state-link:hover,
.state-link:focus {
  border-color: var(--accent-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Most Searched Section */
.most-searched {
  background-color: var(--bg-light);
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.most-searched h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag {
  background: white;
  color: var(--accent-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid var(--accent-color);
  transition: all 0.2s;
}

.tag:hover,
.tag:focus {
  background-color: var(--accent-color);
  color: white;
}

/* Footer */
.site-footer {
  background-color: var(--primary-color);
  color: white;
  padding: 3rem 1rem 1rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  margin: 0.5rem 0;
}

.footer-section a {
  color: #e6fffa;
  text-decoration: none;
}

.footer-section a:hover {
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .search-box {
    flex-direction: column;
  }

  .search-btn {
    width: 100%;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.5rem;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .search-container,
  .quick-links,
  .menu-toggle {
    display: none;
  }

  body {
    font-size: 12pt;
    color: black;
  }

  a {
    text-decoration: underline;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

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

/* Performance optimizations */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

svg {
  display: block;
}

/* Lazy loading placeholder */
.lazy-load {
  background-color: var(--bg-light);
  min-height: 200px;
}
