/* ============================================================
   مُدرك — Learn page (educational guide)
   Inherits design tokens from landing.css; only adds page-specific
   layout. Keep visual language identical so this feels like part
   of the same site.
   ============================================================ */

.learn-page {
  background: var(--paper);
  color: var(--ink);
}

/* ─── Hero ─── */

.learn-hero {
  padding: 64px 0 48px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-bottom: 1px solid var(--line);
}

.learn-hero-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.learn-hero .eyebrow {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-dark);
  background: var(--green-mist);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.learn-hero h1 {
  font-family: "Tajawal", sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.2;
  margin: 0 0 18px;
  color: var(--ink);
}

.learn-hero .lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 720px;
  margin-bottom: 32px;
}

.learn-toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 28px;
  margin-top: 24px;
}

.learn-toc strong {
  display: block;
  font-family: "Tajawal", sans-serif;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--green-deep);
}

.learn-toc ol {
  list-style: arabic-indic;
  padding-inline-start: 24px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
}

.learn-toc li {
  padding: 4px 0;
}

.learn-toc a {
  color: var(--green-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.learn-toc a:hover {
  border-bottom-color: var(--green-dark);
}

@media (max-width: 640px) {
  .learn-toc ol {
    grid-template-columns: 1fr;
  }
}

/* ─── Section ─── */

.learn-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line-2);
}

.learn-section.alt {
  background: var(--paper-2);
}

.section-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--green-deep);
  color: var(--paper);
  border-radius: 50%;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 18px;
}

.learn-section h2 {
  font-family: "Tajawal", sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.5vw, 36px);
  margin: 0 0 16px;
  color: var(--ink);
}

.learn-section h3 {
  font-family: "Tajawal", sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--green-deep);
}

.learn-section p {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-2);
  margin: 0 0 16px;
  max-width: 720px;
}

.learn-section code {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  background: var(--green-mist);
  color: var(--green-deep);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ─── Callouts ─── */

.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.7;
  border-inline-start: 4px solid;
}

.callout.green {
  background: var(--green-mist);
  border-color: var(--green);
  color: var(--green-night);
}

.callout.amber {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--ink);
}

.callout strong {
  color: inherit;
  font-weight: 700;
}

/* ─── Compare table ─── */

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.compare-table th,
.compare-table td {
  padding: 12px 16px;
  text-align: start;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}

.compare-table th {
  background: var(--green-deep);
  color: var(--paper);
  font-weight: 700;
}

.compare-table tbody tr:last-child td,
.compare-table tbody tr:last-child th {
  border-bottom: none;
}

.compare-table tbody tr:nth-child(even) {
  background: var(--paper-2);
}

.compare-table tbody th {
  background: var(--cream);
  color: var(--ink);
}

/* ─── Step list ─── */

.step-list {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 24px 0;
}

.step-list li {
  counter-increment: step;
  position: relative;
  padding: 20px 24px 20px 72px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 20px;
  top: 18px;
  width: 36px;
  height: 36px;
  background: var(--green);
  color: var(--paper);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 16px;
}

.step-list strong {
  display: block;
  font-family: "Tajawal", sans-serif;
  font-weight: 700;
  color: var(--green-deep);
  margin-bottom: 4px;
  font-size: 16px;
}

.step-list p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.step-list a {
  color: var(--green-dark);
}

/* ─── Service grid ─── */

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-card.high {
  border-color: var(--green);
  border-width: 2px;
}

.service-card .badge {
  display: inline-block;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  background: var(--cream);
  color: var(--ink);
  padding: 3px 10px;
  border-radius: 999px;
  align-self: start;
  font-weight: 600;
}

.service-card.high .badge {
  background: var(--green-mist);
  color: var(--green-deep);
}

.service-card h3 {
  margin: 4px 0 0;
}

.service-card .when {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  font-family: "JetBrains Mono", monospace;
}

.service-card p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0;
}

.service-card code {
  font-size: 11px;
  margin-top: auto;
  align-self: start;
}

/* ─── Plan cards (cloud vs self-hosted) ─── */

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0;
}

@media (max-width: 720px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

.plan-card.free {
  border-color: var(--green);
  border-width: 2px;
  background: linear-gradient(180deg, var(--green-mist) 0%, var(--surface) 35%);
  box-shadow: var(--shadow-sm);
}

.plan-card.self {
  border-style: dashed;
}

.plan-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-tag {
  align-self: flex-start;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
}

.plan-card.free .plan-tag {
  background: var(--green);
  color: var(--paper);
}

.plan-card h3 {
  font-family: "Tajawal", sans-serif;
  font-weight: 800;
  font-size: 22px;
  margin: 4px 0 0;
  color: var(--ink);
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 0;
}

.price-amount {
  font-family: "Tajawal", sans-serif;
  font-weight: 900;
  font-size: 38px;
  color: var(--green-deep);
  line-height: 1;
}

.plan-card.free .price-amount {
  color: var(--green);
}

.price-period {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-features li {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
}

.plan-note {
  font-size: 13px;
  color: var(--muted);
  background: var(--paper-2);
  padding: 12px 14px;
  border-radius: 8px;
  margin: 0;
  line-height: 1.6;
}

.plan-note strong {
  color: var(--ink);
}

.plan-cta {
  margin-top: auto;
  text-align: center;
  width: 100%;
  display: block;
}

/* ─── Day flow ─── */

.day-flow {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.day-flow li {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}

.day-flow li:last-child {
  border-bottom: none;
}

.day-flow .time {
  flex: 0 0 90px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  padding-top: 2px;
}

.day-flow strong {
  display: block;
  font-family: "Tajawal", sans-serif;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  font-size: 16px;
}

.day-flow p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ─── Check list ─── */

.check-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.check-list li {
  position: relative;
  padding: 8px 0 8px 28px;
  font-size: 15px;
  color: var(--ink-2);
}

.check-list li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  color: var(--green);
  font-weight: 700;
  font-size: 16px;
}

.check-list strong {
  color: var(--green-deep);
  font-weight: 700;
}

/* ─── FAQ ─── */

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 0;
}

.faq-item summary {
  cursor: pointer;
  padding: 16px 20px;
  font-family: "Tajawal", sans-serif;
  font-weight: 700;
  color: var(--green-deep);
  font-size: 16px;
  list-style: none;
  position: relative;
  padding-inline-end: 44px;
}

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

.faq-item summary::after {
  content: "+";
  position: absolute;
  inset-inline-end: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--green);
  font-weight: 300;
  transition: transform 200ms;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  padding: 0 20px 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-2);
  margin: 0;
}

.faq-item a {
  color: var(--green-dark);
}

/* ─── Final CTA ─── */

.learn-cta {
  background: var(--green-deep);
  color: var(--paper);
  padding: 64px 0;
  text-align: center;
}

.cta-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.learn-cta h2 {
  font-family: "Tajawal", sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 16px;
  color: var(--paper);
}

.learn-cta p {
  font-size: 17px;
  color: rgba(251, 252, 248, 0.85);
  margin: 0 0 32px;
}

.cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.learn-cta .button.ghost {
  border-color: rgba(251, 252, 248, 0.4);
  color: var(--paper);
  background: transparent;
}

.learn-cta .button.ghost:hover {
  background: rgba(251, 252, 248, 0.1);
  border-color: var(--paper);
}

/* ─── Footer ─── */

.site-footer {
  background: var(--green-night);
  color: rgba(251, 252, 248, 0.7);
  padding: 24px 0;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.footer-inner nav {
  display: flex;
  gap: 20px;
}

.footer-inner a {
  color: rgba(251, 252, 248, 0.7);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-inner a:hover {
  color: var(--paper);
  border-bottom-color: rgba(251, 252, 248, 0.4);
}
