/* ============================================================
   ArtPartner Anti-Bullying Training Programme
   Handbook-specific Stylesheet
   ============================================================ */

/* ----- Table of Contents ----- */
.handbook-toc {
  background: var(--color-off-white);
  border: 2px solid var(--color-grey-300);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  margin: 2rem 0;
  counter-reset: toc-counter;
}

.handbook-toc h2 {
  text-align: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.handbook-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc-counter;
}

.handbook-toc ol li {
  counter-increment: toc-counter;
  padding: .65rem 0;
  border-bottom: 2px dotted var(--color-grey-300);
  font-size: 1rem;
  line-height: 1.5;
}

.handbook-toc ol li:last-child {
  border-bottom: none;
}

.handbook-toc ol li::before {
  content: counter(toc-counter) ".";
  display: inline-block;
  width: 2em;
  font-weight: 700;
  color: var(--color-accent);
}

.handbook-toc ol li a {
  font-weight: 500;
}


/* ----- Facing-Page Bilingual Layout ----- */
.facing-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 1.5rem 0;
  border: 1px solid var(--color-grey-300);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-legal-bg);
}

.facing-page .fr-col {
  padding: 1.5rem 1.75rem;
  border-right: 2px solid var(--color-legal-border);
}

.facing-page .en-col {
  padding: 1.5rem 1.75rem;
}

.facing-page .fr-col p:last-child,
.facing-page .en-col p:last-child {
  margin-bottom: 0;
}

.col-label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-white);
  background: var(--color-legal-border);
  padding: .15rem .5rem;
  border-radius: var(--radius-sm);
  margin-bottom: .75rem;
}


/* ----- Penalty Table ----- */
.penalty-table {
  margin: 1.5rem 0;
}

.penalty-table thead th {
  background: var(--color-primary);
  color: var(--color-white);
}

.penalty-table .penalty-amount {
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 700;
}

.penalty-table .penalty-severe {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

.penalty-table td {
  font-size: .9rem;
}


/* ----- Contact Card ----- */
.contact-card {
  background: var(--color-white);
  border: 1px solid var(--color-grey-300);
  border-left: 5px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  box-shadow: var(--shadow-sm);
}

.contact-card h4 {
  color: var(--color-accent);
  margin-bottom: .4em;
  font-size: 1rem;
}

.contact-card p {
  margin-bottom: .3em;
  font-size: .92rem;
  color: var(--color-text-light);
}

.contact-card .contact-detail {
  display: flex;
  align-items: baseline;
  gap: .5em;
  font-size: .9rem;
}

.contact-card .contact-detail strong {
  min-width: 5em;
  color: var(--color-text);
}


/* ----- Step List ----- */
.step-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  counter-reset: step-counter;
}

.step-list > li {
  counter-increment: step-counter;
  position: relative;
  padding: 1.5rem 1.5rem 1.5rem 4.5rem;
  margin-bottom: 1.25rem;
  background: var(--color-white);
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.step-list > li::before {
  content: counter(step-counter);
  position: absolute;
  left: 1rem;
  top: 1.35rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.step-list > li h3 {
  margin-bottom: .5em;
  font-size: 1.15rem;
}

.step-list > li p {
  font-size: .95rem;
  color: var(--color-text-light);
}


/* ----- Chapter Headings ----- */
.chapter-heading {
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: .5rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}

.chapter-number {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-accent);
  margin-bottom: .25rem;
}


/* ----- FAQ Section ----- */
.faq-item {
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--color-grey-100);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .75em;
  transition: background var(--transition);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item[open] summary::before {
  content: '\2212';
  transform: rotate(180deg);
}

.faq-item summary:hover {
  background: var(--color-grey-200);
}

.faq-item .faq-answer {
  padding: 1rem 1.5rem 1.25rem;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--color-text-light);
}

.faq-item .faq-answer p:last-child {
  margin-bottom: 0;
}


/* ----- Example Boxes ----- */
.example-box {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-left: 5px solid #f59e0b;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}

.example-box h4 {
  color: #b45309;
  margin-bottom: .4em;
  font-size: .95rem;
}

.example-box p {
  font-size: .92rem;
  margin-bottom: .5em;
}

.example-box p:last-child {
  margin-bottom: 0;
}


/* ----- Summary Box ----- */
.summary-box {
  background: #f0fdf4;
  border: 1px solid #22c55e;
  border-left: 5px solid #22c55e;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}

.summary-box h4 {
  color: #15803d;
  margin-bottom: .5em;
}

.summary-box ul {
  margin: 0;
  padding-left: 1.4em;
}

.summary-box li {
  font-size: .95rem;
  padding: .2em 0;
}


/* ----- Appendix ----- */
.appendix-article {
  background: var(--color-legal-bg);
  border: 1px solid var(--color-legal-border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 1.25rem 0;
  font-size: .92rem;
  line-height: 1.8;
}

.appendix-article h4 {
  color: var(--color-legal-border);
  margin-bottom: .75em;
}


/* ----- Handbook Max Width ----- */
.handbook-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}


/* ============================================================
   Print Overrides
   ============================================================ */
@media print {
  .facing-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-size: 9pt;
    break-inside: avoid;
  }

  h2.chapter-heading {
    page-break-before: always;
  }

  .handbook-toc {
    page-break-after: always;
  }

  .step-list > li {
    break-inside: avoid;
  }

  .example-box,
  .contact-card,
  .summary-box,
  .faq-item {
    break-inside: avoid;
  }

  .penalty-table {
    break-inside: avoid;
  }

  .appendix-article {
    break-inside: avoid;
  }

  .handbook-body {
    max-width: 100%;
    padding: 0;
  }

  .facing-page .fr-col {
    border-right: 1px solid #999;
  }
}


/* ============================================================
   Responsive — Mobile
   ============================================================ */
@media (max-width: 768px) {
  .facing-page {
    grid-template-columns: 1fr;
  }

  .facing-page .fr-col {
    border-right: none;
    border-bottom: 2px solid var(--color-legal-border);
  }

  .facing-page .en-col {
    padding-top: 1rem;
  }

  .handbook-toc {
    padding: 1.25rem 1.5rem;
  }

  .handbook-toc ol li::before {
    width: 1.5em;
  }

  .step-list > li {
    padding-left: 3.5rem;
  }

  .step-list > li::before {
    width: 2rem;
    height: 2rem;
    font-size: .9rem;
  }

  .handbook-body {
    padding: 0 1rem 2rem;
  }

  .penalty-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .contact-card {
    padding: 1rem 1.25rem;
  }
}
