:root {
  --bg:      #FFF8F0;
  --white:   #FFFFFF;
  --copper:  #C4702A;
  --copper-l:#FDEEDD;
  --copper-d:#9A4F12;
  --ink:     #2C1A0A;
  --muted:   #8A6A50;
  --border:  rgba(196,112,42,.15);
  --sage:    #5A7A5C;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.85;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(196,112,42,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196,112,42,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}


/* HERO */
.page-hero {
  position: relative; z-index: 1;
  text-align: center;
  padding: 4.5rem 6vw 5rem;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 65% 55% at 50% 20%, var(--copper-l) 0%, var(--bg) 70%);
  z-index: 0;
}
.page-hero::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 60px; background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 1;
}
.hero-inner { position: relative; z-index: 2; max-width: 620px; margin: 0 auto; }

.page-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--copper-l); border: 1.5px solid var(--border);
  color: var(--copper-d); font-size: .78rem; font-weight: 700;
  padding: .28rem .9rem; border-radius: 50px; margin-bottom: 1.2rem;
  animation: fadeUp .4s ease both;
}
h1 {
  font-family: 'Baloo Bhaijaan 2', cursive;
  font-size: clamp(2rem, 4vw, 3rem); color: var(--ink);
  margin-bottom: .8rem;
  animation: fadeUp .45s ease .08s both;
}
.update-note {
  font-size: .82rem; color: var(--muted);
  animation: fadeUp .45s ease .14s both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* LAYOUT */
.doc-layout {
  position: relative; z-index: 1;
  max-width: 1020px; margin: 0 auto;
  padding: 2.5rem 5vw 5rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* TABLE OF CONTENTS */
.toc {
  position: sticky; top: 90px;
  background: var(--white);
  border-radius: 20px;
  padding: 1.4rem 1.2rem;
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 20px rgba(196,112,42,.07);
}
.toc-title {
  font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--copper); margin-bottom: 1rem;
  display: block;
}
.toc ol { list-style: none; counter-reset: toc-counter; }
.toc li { counter-increment: toc-counter; margin-bottom: .5rem; }
.toc a {
  text-decoration: none; font-size: .83rem;
  font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .5rem; border-radius: 8px;
  transition: color .2s, background .2s;
}
.toc a::before {
  content: counter(toc-counter);
  min-width: 20px; height: 20px;
  border-radius: 6px;
  background: var(--copper-l);
  color: var(--copper-d);
  font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.toc a:hover { color: var(--copper); background: var(--copper-l); }

/* DOCUMENT */
.doc-content { display: flex; flex-direction: column; gap: 0; }

.doc-section {
  background: var(--white);
  border-radius: 22px;
  padding: 2rem 2.2rem;
  border: 1.5px solid var(--border);
  margin-bottom: 1.2rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s;
}
.doc-section:hover { box-shadow: 0 6px 24px rgba(196,112,42,.08); }
.doc-section::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 4px; height: 100%;
  background: linear-gradient(to bottom, var(--copper), #e8a060);
  border-radius: 0 22px 22px 0;
}

.section-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 10px;
  background: var(--copper-l);
  color: var(--copper-d);
  font-size: .8rem; font-weight: 800;
  margin-bottom: .7rem;
}
.doc-section h2 {
  font-family: 'Baloo Bhaijaan 2', cursive;
  font-size: 1.25rem; color: var(--ink);
  margin-bottom: .9rem;
}
.doc-section p {
  font-size: .96rem; color: #4a3020; line-height: 1.95;
  margin-bottom: .8rem;
}
.doc-section p:last-child { margin-bottom: 0; }
.doc-section ul {
  list-style: none; margin: .5rem 0 .8rem; padding: 0;
  display: flex; flex-direction: column; gap: .45rem;
}
.doc-section ul li {
  display: flex; align-items: flex-start; gap: .7rem;
  font-size: .93rem; color: #4a3020; line-height: 1.75;
}
.doc-section ul li::before {
  content: '✦';
  color: var(--copper); font-size: .65rem;
  margin-top: .35rem; flex-shrink: 0;
}
.doc-section strong { color: var(--copper-d); }

.highlight-box {
  background: var(--copper-l);
  border-radius: 14px;
  padding: 1rem 1.3rem;
  margin: .8rem 0;
  font-size: .9rem; color: var(--copper-d);
  border: 1px solid rgba(196,112,42,.2);
  line-height: 1.85;
}

.allowed-box {
  background: rgba(90,122,92,.08);
  border: 1px solid rgba(90,122,92,.2);
  border-radius: 14px;
  padding: 1rem 1.3rem;
  margin: .6rem 0;
}
.allowed-box .box-title {
  font-size: .82rem; font-weight: 700;
  color: var(--sage); margin-bottom: .5rem;
  display: flex; align-items: center; gap: .4rem;
}
.allowed-box ul li::before { color: var(--sage); }

.forbidden-box {
  background: rgba(196,90,90,.07);
  border: 1px solid rgba(196,90,90,.18);
  border-radius: 14px;
  padding: 1rem 1.3rem;
  margin: .6rem 0;
}
.forbidden-box .box-title {
  font-size: .82rem; font-weight: 700;
  color: #a03030; margin-bottom: .5rem;
  display: flex; align-items: center; gap: .4rem;
}
.forbidden-box ul li::before { color: #a03030; }


@media (max-width: 760px) {
  .doc-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
}
@media (max-width: 500px) {
  nav { padding: 1rem 1.2rem; }
  .nav-links { display: none; }
}
