/* =======================================================
   דוח הצדק העולמי – Global Justice Report
   Hebrew RTL Stylesheet | Inspired by Original PDF Design
   ======================================================= */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  --navy:           #1e1b4b;
  --navy-mid:       #2d2a6e;
  --orange:         #e05928;
  --orange-light:   #f08060;
  --purple:         #5c4b8a;
  --purple-light:   #7b6fa8;
  --purple-pale:    #ede8f5;
  --purple-mid:     #c8bce8;
  --teal:           #45b8c8;
  --teal-pale:      #e0f4f8;
  --cover-blue1:    #b8dce8;
  --cover-blue2:    #c8eaf5;
  --body-text:      #1f1f2e;
  --text-secondary: #5a5a7a;
  --gray:           #6b7280;
  --gray-light:     #e8e8ee;
  --page-bg:        #f2f1ec;
  --white:          #ffffff;
  --max-w:          920px;
  --font:           'Heebo', 'Arial Hebrew', Arial, sans-serif;
  --shadow:         0 2px 16px rgba(30, 27, 75, 0.08);
  --shadow-md:      0 4px 24px rgba(30, 27, 75, 0.12);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ---- Base ---- */
body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--body-text);
  direction: rtl;
  unicode-bidi: embed;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography Scale ---- */
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; line-height: 1.25; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.3rem); font-weight: 700; line-height: 1.35; }
h4 { font-size: 1rem; font-weight: 700; }
p  { margin-bottom: 1.3rem; }
p:last-child { margin-bottom: 0; }
strong, b { font-weight: 700; }

/* ---- Layout Utilities ---- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem;
}

.page-break { page-break-before: always; break-before: page; }

/* ======================================================
   COVER PAGE
   ====================================================== */
.cover-page {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(155deg, #a8d2e0 0%, #c0e4f0 35%, #cdeaf5 65%, #bce0ea 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  page-break-after: always;
}

/* Decorative chart lines on cover */
.cover-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 55%;
  overflow: hidden;
}

.cover-chart svg {
  width: 100%;
  height: 100%;
}

/* Cover content area */
.cover-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 5rem 0 4rem;
  padding-top: 48%;
}

.cover-title {
  font-size: clamp(4rem, 10vw, 7.5rem);
  font-weight: 900;
  color: var(--navy);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}

.cover-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-weight: 400;
  color: var(--navy);
  opacity: 0.85;
  line-height: 1.6;
  white-space: nowrap;
  margin-bottom: 2rem;
}

.cover-badge {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.5rem 1.4rem;
  border-radius: 2px;
  margin-bottom: 3rem;
}

.cover-footer {
  position: absolute;
  bottom: 2.5rem;
  left: 4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cover-wil {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.5;
}

.cover-wil-line {
  width: 1px;
  height: 30px;
  background: var(--navy);
  opacity: 0.4;
}

.cover-year {
  font-size: 0.8rem;
  color: var(--navy);
  opacity: 0.7;
  font-weight: 500;
}

/* ======================================================
   CREDITS PAGE
   ====================================================== */
.credits-page {
  background: var(--white);
  page-break-after: always;
}

.credits-page .container {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.credits-header-bar {
  width: 48px;
  height: 4px;
  background: var(--orange);
  margin-bottom: 2rem;
}

.credits-page h2 {
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 2rem;
  font-weight: 700;
}

.credits-block {
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--body-text);
  margin-bottom: 1.5rem;
}

.credits-block strong {
  color: var(--navy);
  font-weight: 700;
}

.credits-block a {
  color: var(--purple);
  text-decoration: underline;
}

.credits-original-box {
  margin-top: 3rem;
  border: 1px solid var(--gray-light);
  border-right: 3px solid var(--purple);
  padding: 1.2rem 1.5rem;
  background: var(--purple-pale);
  font-size: 0.83rem;
  line-height: 1.8;
  border-radius: 0 4px 4px 0;
}

.credits-original-box p { margin-bottom: 0.5rem; }
.credits-original-box p:last-child { margin-bottom: 0; }

/* ======================================================
   TABLE OF CONTENTS
   ====================================================== */
.toc-section {
  background: var(--white);
  page-break-after: always;
}

.toc-section .container {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.toc-heading {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0;
}

.toc-rule {
  height: 3px;
  background: linear-gradient(to left, var(--orange), transparent);
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 2.5rem;
}

.toc-list {
  list-style: none;
}

.toc-list li {
  border-bottom: 1px solid var(--gray-light);
}

.toc-list li:first-child {
  border-top: 1px solid var(--gray-light);
}

.toc-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  text-decoration: none;
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.18s;
  gap: 1rem;
}

.toc-entry:hover { color: var(--orange); }

.toc-entry-label {
  flex: 1;
}

.toc-entry-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.toc-entry.toc-main { font-weight: 800; }
.toc-entry.toc-sub { font-weight: 400; padding-right: 1.5rem; color: var(--gray); }

/* ======================================================
   SECTION SHARED STYLES
   ====================================================== */
.content-section {
  background: var(--white);
}

.content-section .container {
  padding-top: 4rem;
  padding-bottom: 4.5rem;
}

.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0;
}

.section-rule {
  height: 3px;
  background: linear-gradient(to left, var(--orange), transparent);
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 2.5rem;
}

.section-text p {
  font-size: 1rem;
  line-height: 1.95;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
  margin-bottom: 1.4rem;
}

/* ======================================================
   EXECUTIVE SUMMARY
   ====================================================== */
.summary-intro {
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 2;
  text-align: justify;
  color: var(--navy);
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--gray-light);
}

/* ======================================================
   FOOTNOTES
   ====================================================== */
.footnote-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-light);
}

.footnote-text {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted, #666);
  text-align: right;
  margin-bottom: 0;
}

.footnote-text sup {
  font-size: 0.7rem;
  vertical-align: super;
  margin-left: 0.15em;
}

/* ======================================================
   INFO BOXES
   ====================================================== */
.info-boxes-zone {
  background: var(--page-bg);
  padding: 3.5rem 0;
}

.info-box-wrap {
  max-width: var(--max-w);
  margin: 0 auto 2.5rem;
  padding: 0 2.5rem;
}

.info-box-wrap:last-child { margin-bottom: 0; }

.info-box {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.info-box-head {
  background: var(--purple);
  color: var(--white);
  padding: 0.65rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.info-box-head-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  white-space: nowrap;
}

.info-box-head-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
}

.info-box-body {
  background: var(--purple-pale);
  padding: 1.6rem 1.8rem;
  font-size: 0.93rem;
  line-height: 1.9;
  text-align: justify;
  color: var(--body-text);
}

.info-box-body p { margin-bottom: 1rem; }
.info-box-body p:last-child { margin-bottom: 0; }

.info-box-footer-bold {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--purple-mid);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.75;
  color: var(--purple);
}

/* ======================================================
   AT A GLANCE SECTION
   ====================================================== */
.glance-section {
  background: var(--white);
  page-break-before: always;
}

.glance-section .container {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.glance-headline {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--navy);
  text-align: right;
  margin-bottom: 0;
  line-height: 1.25;
}

.glance-year {
  text-align: center;
  font-size: 1rem;
  color: var(--gray);
  margin-bottom: 3rem;
}

.glance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--gray-light);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.glance-item {
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--gray-light);
  background: var(--white);
  transition: background 0.18s;
}

.glance-item:hover { background: #fafafa; }

.glance-item:nth-child(odd) {
  border-left: 1px solid var(--gray-light);
}

.glance-item-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: block;
}

.glance-item-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--navy);
  display: block;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.glance-item p {
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ======================================================
   CHAPTER SECTIONS
   ====================================================== */
.chapter-section {
  background: var(--white);
}

.chapter-section .container {
  padding-top: 4.5rem;
  padding-bottom: 5rem;
}

.chapter-meta {
  margin-bottom: 2.5rem;
}

.chapter-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.4rem;
}

.chapter-title {
  color: var(--navy);
  margin-bottom: 0;
}

.chapter-rule {
  height: 3px;
  background: linear-gradient(to left, var(--orange), transparent);
  margin-top: 1rem;
  margin-bottom: 2.5rem;
}

.chapter-body p {
  font-size: 1rem;
  line-height: 1.95;
  text-align: justify;
  margin-bottom: 1.4rem;
}

.chapter-body p:last-child { margin-bottom: 0; }

/* ======================================================
   FIGURES
   ====================================================== */
.figure-block {
  margin: 2.5rem 0;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

.figure-caption-bar {
  padding: 0.75rem 1.3rem;
  background: #f8f8f8;
  border-top: 1px solid var(--gray-light);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--gray);
}

.figure-caption-bar strong {
  color: var(--navy);
  font-weight: 700;
  white-space: nowrap;
}

/* ======================================================
   BACK TO TOC LINK
   ====================================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 3rem;
  padding: 0.45rem 1.1rem;
  border: 1.5px solid var(--purple-light);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--purple);
  text-decoration: none;
  transition: all 0.18s;
}

.back-link:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: var(--white);
}

.back-link::before { content: '↑'; font-size: 0.9rem; }

/* ======================================================
   SECTION SEPARATOR
   ====================================================== */
.sep {
  height: 3px;
  background: linear-gradient(to left, var(--orange), var(--purple), var(--teal));
}

/* ======================================================
   CLOSING STATEMENT
   ====================================================== */
.closing-block {
  margin-top: 2.5rem;
  padding: 1.8rem 2rem;
  background: var(--navy);
  color: var(--white);
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.85;
  text-align: justify;
}

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 700px) {
  .glance-grid {
    grid-template-columns: 1fr;
  }
  .glance-item:nth-child(odd) {
    border-left: none;
  }
  .glance-item-num { font-size: 1.3rem; }
  .cover-body { padding: 45% 2rem 0; }
  .cover-title { font-size: 3rem; }
  .container { padding: 0 1.2rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }
  .chapter-section .container,
  .content-section .container { padding: 2.5rem 1.2rem 3rem; }
  .info-box-wrap { padding: 0 1.2rem; }
}

@media (max-width: 480px) {
  .cover-title { font-size: 2.3rem; }
  .cover-subtitle { font-size: 0.95rem; }
}

/* ======================================================
   PRINT STYLES
   ====================================================== */
@media print {
  @page {
    size: A4;
    margin: 20mm 22mm 20mm 22mm;
  }

  body {
    background: white;
    font-size: 10.5pt;
    line-height: 1.7;
  }

  .cover-page {
    page-break-after: always;
    min-height: 297mm;
    background: #c5e8f2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .credits-page,
  .toc-section,
  .glance-section {
    page-break-before: always;
  }

  .chapter-section {
    page-break-before: always;
  }

  .figure-block {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  h2, h3, .chapter-meta {
    page-break-after: avoid;
  }

  .back-link { display: none; }

  .info-box-head {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .glance-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .chapter-section .container,
  .content-section .container,
  .toc-section .container,
  .credits-page .container {
    padding: 0;
  }

  .sep { display: none; }
}
