/* ==========================================================================
   UniSUS Atenção Básica — CIAP-2
   Baseado no design system UniSUS com accent blue-lavender (#5C7CFA)
   ========================================================================== */

/* ==========================================================================
   2. CSS VARIABLES (light + dark)
   ========================================================================== */

:root {
  /* Alias to @unisus/shared — single source of truth. */
  --white-pure: var(--white);
  --light-gray: var(--border);
  --low-opacity-gray: var(--border-light);
  --highlight-gray: var(--muted-bg);
  --dark-gray: var(--muted-fg);
  --warm-green: var(--green-dark);
  --light-blue: var(--blue-light);
  --blue-warm: var(--blue);
  --blue-warm-vivid-05: var(--accent-light);
  --dark-blue: var(--blue-dark);
  --text-color: var(--text);
  --dark-200: var(--text2);
  --dark-300: var(--text);
  --dark-400: var(--text3);
  --dark-blue-bg: var(--footer-bg);
  --btn-primary-bg: var(--btn-bg);
  --btn-primary-text: var(--btn-text);

  /* Module-specific literals (not in shared) */
  --blue-light-accent: #2670E8;

  /* CIAP-specific blue-lavender tinted shadows (override shared blue defaults) */
  --shadow-blue-sm: rgba(92, 124, 250, 0.04);
  --shadow-blue-md: rgba(92, 124, 250, 0.08);
  --shadow-blue-lg: rgba(92, 124, 250, 0.15);
  --shadow-blue-xl: rgba(92, 124, 250, 0.3);

  /* CIAP brand accent override (blue-lavender) */
  --accent: #5C7CFA;
  --accent-dark: #4263EB;
  --accent-light: rgba(92, 124, 250, 0.08);
}

[data-theme="dark"] {
  --mod-ciap-light: rgba(143, 164, 255, 0.1);

  /* CIAP-specific blue-lavender tinted shadows (override shared green dark defaults) */
  --shadow-blue-sm: rgba(143, 164, 255, 0.06);
  --shadow-blue-md: rgba(143, 164, 255, 0.12);
  --shadow-blue-lg: rgba(143, 164, 255, 0.2);
  --shadow-blue-xl: rgba(143, 164, 255, 0.35);

  /* CIAP brand accent override (blue-lavender) */
  --accent: #8FA4FF;
  --accent-dark: #6B8AFF;
  --accent-light: rgba(143, 164, 255, 0.1);
}

/* ==========================================================================
   3. GLOBAL RESET & BASE
   ========================================================================== */

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

html, body {
  font-family: "Rawline", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-color: var(--white-pure);
  color: var(--text-color);
  transition: background-color 0.2s ease, color 0.2s ease;
}

button, input, textarea, select { font-family: inherit; }
a { text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; padding: 0; margin: 0; }

h1 { font-size: 2.2rem; font-weight: 400; color: var(--dark-300); }
h2 { font-size: 1.5rem; font-weight: 400; }

[id] { scroll-margin-top: 80px; }

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

/* ==========================================================================
   4. LAYOUT
   ========================================================================== */

.main-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  min-height: calc(100vh - 64px - 142px);
  position: relative;
}

/* ==========================================================================
   5. HERO
   ========================================================================== */

/* Search box */
.search-box {
  width: 100%;
  max-width: 540px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1.25rem 0.875rem 3rem;
  border: 2px solid var(--light-gray);
  border-radius: 50px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-color);
  background: var(--white-pure);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input::placeholder { color: var(--gray); }
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--shadow-blue-lg);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  pointer-events: none;
}


/* ==========================================================================
   7. STATS STRIP
   ========================================================================== */

/* ==========================================================================
   8. CHAPTERS GRID
   ========================================================================== */

.chapters-section {
  width: 100%;
  padding: 3rem 2rem;
  background-color: var(--low-opacity-gray);
}

.chapters-inner {
  max-width: 960px;
  margin: 0 auto;
}

.chapters-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark-blue);
  text-align: center;
  margin-bottom: 2rem;
}

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

.chapter-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--white-pure);
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}
.chapter-card:hover {
  box-shadow: 0 4px 12px var(--shadow-lg);
  transform: translateY(-1px);
}

.chapter-letter {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chapter-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.chapter-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark-300);
  line-height: 1.4;
}

.chapter-range {
  font-size: 0.75rem;
  color: var(--dark-200);
  font-family: monospace;
}

@media (max-width: 767px) {
  .chapters-section { padding: 2rem 1rem; }
  .chapters-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   9. ABOUT SECTION
   ========================================================================== */

.about-section {
  width: 100%;
  padding: 3rem 2rem;
}

.about-inner {
  max-width: 760px;
  margin: 0 auto;
}

.about-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 1.5rem;
  text-align: center;
}

.about-text {
  font-size: 1rem;
  color: var(--dark-200);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.about-text strong {
  color: var(--dark-300);
}

.about-highlight {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  border-radius: 0 8px 8px 0;
  margin: 2rem 0;
}

.about-highlight p {
  font-size: 0.9375rem;
  color: var(--dark-300);
  line-height: 1.65;
}

/* ==========================================================================
   10. FOOTER
   ========================================================================== */

.site-footer {
  width: 100%;
  background-color: var(--dark-blue-bg);
  color: var(--on-dark);
}

/* Module-specific mobile override for footer link group */
@media (max-width: 767px) {
  .footer-link-group { flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; }
}

/* ==========================================================================
   11. NAV LIST (header)
   ========================================================================== */

.main-nav { display: flex; align-items: center; }
.nav-list {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-link {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark-300);
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
  text-decoration: none;
}
.nav-link:hover {
  color: var(--accent);
  background-color: var(--accent-light);
}

@media (max-width: 767px) {
  .main-nav { display: none; }
}

/* ==========================================================================
   12. PAGE HEADER (breadcrumb + title)
   ========================================================================== */

.page-header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--low-opacity-gray);
}
.page-header-inner {
  max-width: 960px;
  margin: 0 auto;
}
.page-header-desc {
  font-size: 1rem;
  color: var(--dark-200);
  line-height: 1.65;
  margin-top: 0.75rem;
  max-width: 700px;
}


.chapter-header-badge {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.chapter-letter-lg {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .page-header { padding: 1.5rem 1rem 1rem; }
}

/* ==========================================================================
   13. CHAPTER DESCRIPTION IN GRID
   ========================================================================== */

.chapter-desc {
  font-size: 0.75rem;
  color: var(--dark-200);
  line-height: 1.5;
  margin-top: 0.25rem;
}

/* ==========================================================================
   14. RUBRICS SECTION (chapter detail)
   ========================================================================== */

.rubrics-section {
  padding: 2rem;
}
.rubrics-inner {
  max-width: 960px;
  margin: 0 auto;
}
.rubrics-count {
  font-size: 0.875rem;
  color: var(--dark-200);
  margin-bottom: 1.5rem;
}

.component-group {
  margin-bottom: 2.5rem;
}
.component-group-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark-300);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.component-badge {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--on-dark);
  background: var(--accent);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.component-codes {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--gray);
}

.rubric-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rubric-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: var(--white-pure);
  border: 1px solid var(--low-opacity-gray);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rubric-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--shadow-blue-md);
}

.rubric-code {
  font-family: monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  min-width: 3rem;
  text-align: center;
}

.rubric-name {
  font-size: 0.875rem;
  color: var(--dark-300);
}

.rubric-list-compact .rubric-item {
  padding: 0.5rem 0.75rem;
}

@media (max-width: 767px) {
  .rubrics-section { padding: 1.5rem 1rem; }
}

/* ==========================================================================
   15. RUBRIC DETAIL
   ========================================================================== */

.rubric-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.rubric-code-lg {
  font-family: monospace;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  flex-shrink: 0;
}

.rubric-detail {
  padding: 2rem;
}
.rubric-detail-inner {
  max-width: 960px;
  margin: 0 auto;
}

.rubric-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.rubric-meta-card {
  padding: 1rem 1.25rem;
  background: var(--low-opacity-gray);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
}

.meta-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dark-300);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-link {
  text-decoration: none;
  color: var(--accent);
}
.meta-link:hover { text-decoration: underline; }

.chapter-letter-sm {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.component-badge-sm {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--on-dark);
  background: var(--accent);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rubric-seo-content {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--low-opacity-gray);
}
.rubric-seo-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 1rem;
}
.rubric-seo-content p {
  font-size: 0.9375rem;
  color: var(--dark-200);
  line-height: 1.75;
  margin-bottom: 1rem;
}
.rubric-seo-content strong {
  color: var(--dark-300);
}

/* Related rubrics */
.related-rubrics, .related-chapters {
  padding: 2rem;
  background: var(--low-opacity-gray);
}
.related-inner {
  max-width: 960px;
  margin: 0 auto;
}
.related-inner h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 1rem;
}

.related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.related-chapter-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--white-pure);
  border: 1px solid var(--light-gray);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark-300);
  text-decoration: none;
  transition: border-color 0.2s;
}
.related-chapter-link:hover {
  border-color: var(--accent);
}

@media (max-width: 767px) {
  .rubric-detail { padding: 1.5rem 1rem; }
  .rubric-meta-grid { grid-template-columns: 1fr; }
  .related-rubrics, .related-chapters { padding: 1.5rem 1rem; }
}

/* ==========================================================================
   16. COMPONENTS PAGE
   ========================================================================== */

.components-section {
  padding: 2rem;
}
.components-inner {
  max-width: 960px;
  margin: 0 auto;
}

.component-explanation {
  margin-bottom: 2.5rem;
}
.component-explanation h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 1rem;
}
.component-explanation p {
  font-size: 0.9375rem;
  color: var(--dark-200);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.code-anatomy {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--accent-light);
  border-radius: 8px;
  margin: 1.5rem 0;
}
.code-part {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.code-part-value {
  font-family: monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.code-part-label {
  font-size: 0.8125rem;
  color: var(--dark-200);
}

.component-detail-card {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--white-pure);
  border: 1px solid var(--low-opacity-gray);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
}
.component-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.component-badge-lg {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--on-dark);
  background: var(--accent);
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.component-detail-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-300);
  margin: 0;
}
.component-code-range {
  font-size: 0.8125rem;
  color: var(--gray);
  font-family: monospace;
}
.component-detail-desc {
  font-size: 0.9375rem;
  color: var(--dark-200);
  line-height: 1.65;
  margin-bottom: 1rem;
}
.component-examples h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark-300);
  margin-bottom: 0.5rem;
}

.component-summary {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--accent-light);
  border-radius: 8px;
}
.component-summary h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 1rem;
}
.component-summary p {
  font-size: 0.9375rem;
  color: var(--dark-200);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}
.component-summary ul {
  padding-left: 1.25rem;
  list-style: disc;
}
.component-summary li {
  font-size: 0.9375rem;
  color: var(--dark-200);
  line-height: 1.65;
  margin-bottom: 0.35rem;
}
.component-summary li strong {
  color: var(--dark-300);
}

@media (max-width: 767px) {
  .components-section { padding: 1.5rem 1rem; }
  .code-anatomy { flex-direction: column; gap: 1rem; }
}

/* ==========================================================================
   17. CONTENT SECTION (e-SUS, generic content pages)
   ========================================================================== */

.content-section {
  padding: 2rem;
}
.content-inner {
  max-width: 800px;
  margin: 0 auto;
}
.content-inner h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin: 2rem 0 1rem;
}
.content-inner h2:first-child {
  margin-top: 0;
}
.content-inner p {
  font-size: 0.9375rem;
  color: var(--dark-200);
  line-height: 1.75;
  margin-bottom: 1rem;
}
.content-inner strong {
  color: var(--dark-300);
}
.content-inner a {
  color: var(--accent);
  text-decoration: none;
}
.content-inner a:hover {
  text-decoration: underline;
}

.content-list {
  padding-left: 1.25rem;
  list-style: disc;
  margin-bottom: 1.5rem;
}
.content-list li {
  font-size: 0.9375rem;
  color: var(--dark-200);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}
.content-list li strong {
  color: var(--dark-300);
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.info-card {
  padding: 1.25rem;
  background: var(--low-opacity-gray);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
}
.info-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-300);
  margin-bottom: 0.5rem;
}
.info-card p {
  font-size: 0.875rem;
}
.info-example {
  font-style: italic;
  font-size: 0.8125rem !important;
  color: var(--gray) !important;
}
.info-example a {
  color: var(--accent);
}

.comparison-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.comparison-table th, .comparison-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--low-opacity-gray);
}
.comparison-table th {
  font-weight: 700;
  color: var(--dark-300);
  background: var(--accent-light);
}
.comparison-table td {
  color: var(--dark-200);
}

@media (max-width: 767px) {
  .content-section { padding: 1.5rem 1rem; }
  .info-cards { grid-template-columns: 1fr; }
}

/* ==========================================================================
   18. FAQ
   ========================================================================== */

.faq-section {
  padding: 2rem;
}
.faq-inner {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--white-pure);
  border: 1px solid var(--low-opacity-gray);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
}
.faq-item h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--dark-300);
  margin-bottom: 0.75rem;
}
.faq-item p {
  font-size: 0.9375rem;
  color: var(--dark-200);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}
.faq-item p:last-child { margin-bottom: 0; }
.faq-item a {
  color: var(--accent);
  text-decoration: none;
}
.faq-item a:hover { text-decoration: underline; }

@media (max-width: 767px) {
  .faq-section { padding: 1.5rem 1rem; }
  .faq-item { padding: 1rem; }
}

/* ==========================================================================
   19. LEGAL PAGES
   ========================================================================== */

.legal-page {
  padding: 2rem;
}
.legal-inner {
  max-width: 800px;
  margin: 0 auto;
}
.legal-inner h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 0.5rem;
}
.legal-content h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark-300);
  margin: 1.75rem 0 0.75rem;
}
.legal-content p {
  font-size: 0.9375rem;
  color: var(--dark-200);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}
.legal-content ul {
  padding-left: 1.25rem;
  list-style: disc;
  margin-bottom: 1rem;
}
.legal-content li {
  font-size: 0.9375rem;
  color: var(--dark-200);
  line-height: 1.65;
  margin-bottom: 0.35rem;
}
.legal-content a {
  color: var(--accent);
  text-decoration: none;
}
.legal-content a:hover { text-decoration: underline; }
.legal-content strong {
  color: var(--dark-300);
}

@media (max-width: 767px) {
  .legal-page { padding: 1.5rem 1rem; }
}

/* ==========================================================================
   20. SEARCH RESULTS DROPDOWN
   ========================================================================== */

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white-pure);
  border: 1px solid var(--light-gray);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 50;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--low-opacity-gray);
  transition: background-color 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover {
  background-color: var(--accent-light);
}

.search-result-code {
  font-family: monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  min-width: 3rem;
  text-align: center;
}
.search-result-name {
  font-size: 0.875rem;
  color: var(--dark-300);
}

.search-no-results {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--gray);
  text-align: center;
}

/* ==========================================================================
   21. ABOUT SUBTITLE
   ========================================================================== */

.about-subtitle {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin: 2rem 0 1rem;
}

/* ==========================================================================
   22. TOP CODES (MAIS USADOS) SECTION
   ========================================================================== */

.top-codes-section {
  width: 100%;
  padding: 3rem 2rem;
}

.top-codes-inner {
  max-width: 960px;
  margin: 0 auto;
}

.top-codes-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark-blue);
  text-align: center;
  margin-bottom: 0.75rem;
}

.top-codes-desc {
  font-size: 0.9375rem;
  color: var(--dark-200);
  text-align: center;
  line-height: 1.65;
  max-width: 640px;
  margin: 0 auto 2rem;
}

.top-codes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.top-code-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--white-pure);
  border: 1px solid var(--low-opacity-gray);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}
.top-code-card:hover {
  box-shadow: 0 4px 12px var(--shadow-lg);
  transform: translateY(-1px);
}

.top-code-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.top-code-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark-300);
}

.top-code-cid {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
  border-top: 1px solid var(--low-opacity-gray);
}

.top-code-cid-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
}

.top-code-cid-value {
  font-family: monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--warm-green);
  background: var(--success-bg);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.top-code-cid-name {
  font-size: 0.75rem;
  color: var(--dark-200);
}

@media (max-width: 767px) {
  .top-codes-section { padding: 2rem 1rem; }
  .top-codes-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   23. COMPONENTS OVERVIEW (homepage)
   ========================================================================== */

.components-overview {
  width: 100%;
  padding: 3rem 2rem;
  background-color: var(--low-opacity-gray);
}

.components-overview-inner {
  max-width: 960px;
  margin: 0 auto;
}

.components-overview-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark-blue);
  text-align: center;
  margin-bottom: 0.75rem;
}

.components-overview-desc {
  font-size: 0.9375rem;
  color: var(--dark-200);
  text-align: center;
  line-height: 1.65;
  max-width: 600px;
  margin: 0 auto 2rem;
}
.components-overview-desc strong {
  color: var(--dark-300);
}

.components-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.comp-overview-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--white-pure);
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.comp-overview-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--shadow-blue-md);
}

.comp-overview-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.comp-overview-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark-300);
}

.comp-overview-codes {
  font-size: 0.75rem;
  color: var(--gray);
  font-family: monospace;
}

.components-overview-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
}
.components-overview-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.components-overview-link a:hover {
  text-decoration: underline;
}

@media (max-width: 767px) {
  .components-overview { padding: 2rem 1rem; }
  .components-overview-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   24. CID-10 MAPPING CARD (rubric detail)
   ========================================================================== */

.cid-mapping-card {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 8px;
}

.cid-mapping-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 1rem;
}

.cid-mapping-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cid-mapping-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.cid-mapping-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
  min-width: 42px;
}

.cid-mapping-code {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--white-pure);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.cid-mapping-code-alt {
  color: var(--warm-green);
}

.cid-mapping-name {
  font-size: 0.875rem;
  color: var(--dark-300);
}

.cid-mapping-arrow {
  color: var(--gray);
  flex-shrink: 0;
}

.cid-mapping-note {
  font-size: 0.8125rem;
  color: var(--dark-200);
  line-height: 1.55;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(92, 124, 250, 0.15);
}

@media (max-width: 767px) {
  .cid-mapping-content { flex-direction: column; gap: 0.75rem; }
  .cid-mapping-arrow { transform: rotate(90deg); }
  .cid-mapping-item { min-width: auto; }
}

/* ==========================================================================
   25. COMPONENT USAGE TIP (components page)
   ========================================================================== */

.component-usage-tip {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: var(--accent-light);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.component-usage-tip h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--dark-300);
  margin-bottom: 0.5rem;
}

.component-usage-tip p {
  font-size: 0.875rem;
  color: var(--dark-200);
  line-height: 1.65;
  margin: 0;
}

.component-usage-tip a {
  color: var(--accent);
  text-decoration: none;
}
.component-usage-tip a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   26. PRINT-FRIENDLY STYLES
   ========================================================================== */

@media print {
  /* Hide interactive/navigation elements */
  .site-header,
  .site-footer,
  .theme-toggle,
  .nav-button,
  .search-box,
  .search-results,
  #search-container,
  .hero-badge {
    display: none !important;
  }

  /* Reset colors for print */
  :root,
  [data-theme="dark"] {
    --white-pure: #ffffff;
    --text-color: #000000;
    --dark-300: #000000;
    --dark-200: #333333;
    --dark-blue: #000000;
    --accent: #333333;
    --accent-light: #f0f0f0;
    --low-opacity-gray: #eeeeee;
    --light-gray: #cccccc;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  .main-content {
    min-height: auto;
  }

  /* Ensure links show URLs */
  .rubric-seo-content a::after,
  .content-inner a::after,
  .about-text a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  /* Page breaks */
  .component-group,
  .component-detail-card,
  .faq-item {
    break-inside: avoid;
  }

  h1, h2, h3 {
    break-after: avoid;
  }

  /* Simplify cards for print */
  .chapter-card,
  .rubric-item,
  .top-code-card,
  .comp-overview-card,
  .rubric-meta-card,
  .info-card,
  .faq-item {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  .stats-strip {
    background: #333 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Remove hover effects */
  .chapter-card:hover,
  .rubric-item:hover,
  .top-code-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* Ensure all content is visible */
  .hero {
    padding: 1rem 0;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .chapters-grid,
  .top-codes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .rubric-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Comparison table print */
  .comparison-table th,
  .comparison-table td {
    border: 1px solid #ccc;
  }
  .comparison-table th {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* CID mapping print */
  .cid-mapping-card {
    border: 2px solid #333;
    background: #f9f9f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .component-badge,
  .component-badge-lg,
  .component-badge-sm {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ==========================================================================
   PEC GUIDE PAGE
   ========================================================================== */

.pec-guide-section {
  padding: 3rem 2rem;
}
.pec-guide-inner {
  max-width: 900px;
  margin: 0 auto;
}

.pec-intro {
  margin-bottom: 3rem;
}

.pec-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.pec-step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--white-pure);
  border: 1px solid var(--light-gray);
  border-radius: 12px;
  padding: 1.5rem;
}

.pec-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--mod-accent, #5C7CFA);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
}

.pec-step-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
}

.pec-step-content p {
  margin: 0;
  color: var(--gray);
  font-size: 0.9375rem;
}

.pec-example {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--highlight-gray);
  border-radius: 6px;
  font-size: 0.875rem;
}
.pec-example-label {
  font-weight: 600;
  color: var(--mod-accent, #5C7CFA);
}
.pec-example a {
  color: var(--mod-accent, #5C7CFA);
  text-decoration: none;
  font-weight: 600;
}
.pec-example a:hover {
  text-decoration: underline;
}

.pec-cat-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--mod-accent, #5C7CFA);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--highlight-gray);
}

.pec-codes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pec-code-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: var(--white-pure);
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pec-code-card:hover {
  border-color: var(--mod-accent, #5C7CFA);
  box-shadow: 0 2px 6px var(--shadow-md);
}

.pec-code {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--mod-accent, #5C7CFA);
}

.pec-code-name {
  font-size: 0.8125rem;
  color: var(--text-color);
  line-height: 1.3;
}

.pec-code-hint {
  font-size: 0.75rem;
  color: var(--gray);
}

.pec-tips {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pec-tip {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  background: var(--highlight-gray);
  border-radius: 10px;
}

.pec-tip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--mod-accent, #5C7CFA);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

.pec-tip h4 {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  color: var(--text-color);
}

.pec-tip p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--gray);
  line-height: 1.5;
}

/* PEC CTA on homepage */
.pec-cta-section {
  padding: 2rem;
}
.pec-cta-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--highlight-gray);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  border-left: 4px solid var(--mod-accent, #5C7CFA);
}
.pec-cta-inner svg {
  flex-shrink: 0;
  stroke: var(--mod-accent, #5C7CFA);
}
.pec-cta-text h2 {
  font-size: 1.125rem;
  margin: 0 0 0.25rem;
  color: var(--text-color);
}
.pec-cta-text p {
  font-size: 0.875rem;
  color: var(--gray);
  margin: 0;
}
.pec-cta-button {
  flex-shrink: 0;
  display: inline-block;
  background: var(--mod-accent, #5C7CFA);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: opacity 0.15s;
}
.pec-cta-button:hover {
  opacity: 0.85;
}
@media (max-width: 640px) {
  .pec-cta-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Cross-reference links */
.cid-mapping-link {
  margin-top: 1rem;
  text-align: right;
}
.cross-ref-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--accent, #5C7CFA);
  text-decoration: none;
  transition: opacity 0.15s;
}
.cross-ref-link:hover {
  opacity: 0.75;
  text-decoration: underline;
}
.cross-ref-section {
  padding: 2.5rem 1rem;
}
.cross-ref-inner {
  max-width: 900px;
  margin: 0 auto;
}
.cross-ref-title {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}
.cross-ref-desc {
  color: var(--text-muted, #666);
  margin-bottom: 1.25rem;
}
.cross-ref-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cross-ref-card-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  background: var(--surface-2, #f8f9fa);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s;
}
.cross-ref-card-link:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.cross-ref-card-link strong {
  display: block;
  margin-bottom: 0.2rem;
}
.cross-ref-card-link span {
  font-size: 0.88rem;
  color: var(--text-muted, #666);
}

/* ==========================================================================
   Shared Contact Form (from @unisus/shared ContactForm.astro)
   ========================================================================== */
.contact-info-row { display: flex; gap: 2rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.contact-info-item { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.contact-info-item strong { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text2, var(--gray, #999)); }
.contact-info-item a,
.contact-info-item span { font-size: 0.875rem; color: var(--text, var(--dark-300, #495057)); }
.contact-info-item a { color: var(--accent, var(--blue-warm, #1351B4)); text-decoration: none; }
.contact-info-item a:hover { opacity: 0.75; }
.contact-system-badge { margin-bottom: 1.5rem; padding: 1rem; border-radius: 8px; background: var(--card-bg, #f8f9fa); border: 1px solid var(--border, #dee2e6); }
@media (max-width: 767px) {
  .contact-info-row { flex-direction: column; align-items: center; }
}


/* ==========================================================================
   Page Section (shared layout)
   ========================================================================== */
.page-section { padding: 3rem 2rem; }
.page-inner { max-width: 760px; margin: 0 auto; }
.page-inner h1 { font-size: 1.75rem; font-weight: 700; color: var(--dark-blue, #071D41); margin-bottom: 0.5rem; }
.page-inner h2 { font-size: 1.25rem; font-weight: 700; color: var(--dark-blue, #071D41); margin-bottom: 1.25rem; }
.section-inner { max-width: 760px; margin: 0 auto; }
@media (max-width: 767px) {
  .page-section { padding: 2rem 1rem; }
}
