/* ==========================================================================
   ADHD Parent Resource List - dedicated styles
   Load order: common.css > handbook-parents.css > resources-list.css > sidebar.css > theme-green.css > about-sidebar-layout.css
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f7f5;
  --text: #2c2c2a;
  --text-2: #5f5e5a;
  --text-3: #888780;
  --border: #e4e2dc;
  --blue-100: #e6f1fb;
  --blue-600: #185fa5;
  --blue-800: #0c447c;
  --teal-100: #e1f5ee;
  --teal-600: #0f6e56;
  --teal-800: #085041;
  --amber-100: #faeeda;
  --amber-600: #854f0b;
  --amber-800: #633806;
  --coral-100: #faece7;
  --coral-600: #993c1d;
  --red-100: #fcebeb;
  --red-600: #a32d2d;
  --green-100: #e4f5e4;
  --green-700: #1f7a1f;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

/* The checklist table is wide; allow horizontal scroll in the body card */
.handbook-content.resource-list-main {
  overflow-x: auto;
}

/* ===== Quick-reference card ===== */
.quick-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: linear-gradient(135deg, #e8f7f1 0%, #eef4fb 100%);
  border: 1px solid rgba(15, 110, 86, 0.12);
  border-radius: 16px;
  padding: 24px;
  margin: 28px 0 16px;
}

.quick-card .qc-title {
  grid-column: 1 / -1;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--teal-800);
}

.quick-card .qc-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(15, 110, 86, 0.08);
  box-shadow: 0 1px 2px rgba(15, 110, 86, 0.04);
}

.quick-card .qc-scene {
  font-weight: 700;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}

.quick-card .qc-channel {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ===== Site help section ===== */
.site-help {
  background: var(--teal-100);
  border: 1px solid rgba(15, 110, 86, 0.15);
  border-radius: 16px;
  padding: 24px 26px;
  margin: 20px 0 8px;
}

.site-help .sh-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--teal-800);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-help .sh-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.site-help .sh-item {
  background: #fff;
  border: 1px solid rgba(15, 110, 86, 0.1);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: block;
}

.site-help .sh-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 110, 86, 0.1);
  border-color: rgba(15, 110, 86, 0.22);
}

.site-help .sh-icon {
  font-size: 1.35rem;
  color: var(--teal-600);
  margin-bottom: 8px;
}

.site-help .sh-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text);
}

.site-help .sh-desc {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.55;
}

/* ===== Status labels ===== */
.status {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
}

.status.ok { background: var(--green-100); color: var(--green-700); }
.status.warn { background: var(--amber-100); color: var(--amber-600); }
.status.doubt { background: #f0e8f7; color: #7a4ba0; }
.status.danger { background: var(--red-100); color: var(--red-600); }

/* ===== Cover (layout from handbook-parents.css; checklist only adds metadata) ===== */
.resource-list-main .cover .meta {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.7;
}

/* ===== Callout boxes ===== */
.note-box {
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  font-size: 0.92rem;
  margin: 18px 0;
  line-height: 1.7;
}

.note-box.warn { background: var(--amber-100); border-left: 4px solid var(--amber-600); color: var(--amber-800); }
.note-box.info { background: var(--blue-100); border-left: 4px solid var(--blue-600); color: var(--blue-800); }
.note-box.danger { background: var(--red-100); border-left: 4px solid var(--red-600); color: var(--red-600); }
.note-box b { font-weight: 700; }

/* ===== Chapters ===== */
section.chapter {
  margin-bottom: 56px;
}

section.chapter:has(> .layer-tag):not(:has(.ch-title)) {
  margin-bottom: 16px;
  padding: 4px 0 0;
}

.layer-tag {
  display: inline-block;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
  font-weight: 600;
  background: var(--teal-100);
  color: var(--teal-800);
  letter-spacing: 0.04em;
}

/* Checklist page: drop the default handbook chapter top divider to avoid double lines */
.handbook-content.resource-list-main section.chapter + section.chapter {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.resource-list-main section.chapter:has(.ch-head) + section.chapter:has(.ch-head),
.resource-list-main section.chapter:has(> .ch-num) + section.chapter:has(> .ch-num) {
  margin-top: 2.5rem;
  padding-top: 0;
  border-top: none;
}

/* Level-1 chapter heading row: number and title aligned in one container */
.resource-list-main .ch-head {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0 0 0.95rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.16);
}

.resource-list-main .ch-head .ch-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--teal-800);
  background: var(--teal-100);
  border: 1px solid rgba(15, 110, 86, 0.14);
  box-shadow: none;
}

.channel-resources .resource-list-main .ch-head .ch-num {
  color: #1e40af;
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.22);
}

.resource-list-main .ch-head .ch-title {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.38;
  color: #1f2d28;
  letter-spacing: -0.015em;
  border: none;
  background: none;
}

.channel-resources .resource-list-main .ch-head .ch-title {
  color: #0f172a;
}

/* Legacy structure without ch-head: simple flex fallback */
.resource-list-main section.chapter:has(> .ch-num):not(:has(.ch-head)) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.875rem;
  row-gap: 1rem;
}

.resource-list-main section.chapter:has(> .ch-num):not(:has(.ch-head)) > :not(.ch-num):not(.ch-title) {
  flex: 1 1 100%;
  width: 100%;
}

h2.ch-title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.38;
  color: #1f2d28;
}

@media (max-width: 575.98px) {
  .resource-list-main .ch-head {
    gap: 0.65rem;
    align-items: flex-start;
    padding-bottom: 0.85rem;
  }

  .resource-list-main .ch-head .ch-num {
    min-width: 1.9rem;
    height: 1.9rem;
    font-size: 0.9rem;
    margin-top: 0.15rem;
  }

  .resource-list-main .ch-head .ch-title {
    font-size: 1.2rem;
    line-height: 1.42;
  }
}

.ch-lead {
  color: var(--text-2);
  font-size: 15px;
  margin-bottom: 24px;
}

.resource-list-main code {
  font-size: 0.84em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--teal-800);
}

/* ===== Organization cards ===== */
.org-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal-600);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 14px 0;
  background: var(--bg);
}

.org-card .org-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.5;
}

.org-card ul { margin-bottom: 4px; }
.org-card li { margin-bottom: 4px; font-size: 0.92rem; }

/* ===== Tables ===== */
.handbook-content table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.handbook-content th {
  text-align: left;
  background: var(--bg-soft);
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  color: #3a4440;
  white-space: nowrap;
}

.handbook-content td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.6;
  word-break: break-word;
}

.handbook-content tr:last-child td {
  border-bottom: none;
}

.handbook-content tbody tr:nth-child(even) td {
  background: #fafcfb;
}

.handbook-content td ul {
  padding-left: 18px;
  margin-bottom: 0;
}

.handbook-content td li { margin-bottom: 3px; }

/* ===== Blockquotes ===== */
.quote {
  border-left: 3px solid var(--teal-600);
  padding: 6px 16px;
  color: var(--text-2);
  font-size: 14.5px;
  margin: 18px 0;
  background: var(--teal-100);
  border-radius: 0 8px 8px 0;
}

/* ===== Comparison blocks ===== */
.cmp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.cmp .col {
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 14px;
}

.cmp .no { background: var(--red-100); color: var(--red-600); }
.cmp .yes { background: var(--teal-100); color: var(--teal-800); }

.cmp .col b {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

/* ===== Tool cards ===== */
.tool-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 14px 0;
  background: #fcfdfc;
}

.tool-card .tc-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--blue-800);
}

.tool-card ul,
.tool-card ol { margin-bottom: 4px; }

.tool-card li { margin-bottom: 4px; }

.tool-card p {
  font-size: 0.92rem;
  color: var(--text-2);
  margin-bottom: 0;
}

/* ===== Appendix ===== */
.appendix {
  border-top: 2px solid var(--border);
  padding-top: 28px;
}

.closing {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  color: var(--text-2);
  font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .quick-card { grid-template-columns: 1fr; padding: 18px; }
}

@media (max-width: 767.98px) {
  .cmp { grid-template-columns: 1fr; }
  .site-help .sh-grid { grid-template-columns: 1fr; }
  .resource-list-main table { font-size: 13px; }
  .resource-list-main th,
  .resource-list-main td { padding: 8px 10px; }
}

@media (max-width: 575.98px) {
  .site-help .sh-grid { grid-template-columns: 1fr; }
  .cover .kicker { letter-spacing: 0.08em; }
}
