:root {
  --cream: #faf7f2;
  --dark: #16120e;
  --ink: #2a2118;
  --warm: #8b6f4e;
  --accent: #e85c2d;
  --accent2: #4a7c59;
  --accent3: #3d6b9e;
  --border: #e2d9ce;
  --muted: #9c8878;
  --surface: #f4efe8;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-tap-highlight-color: rgba(232,92,45,0.15);
}
button, a, select, input, textarea, .faq-question { touch-action: manipulation; }
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 900; color: var(--dark); letter-spacing: -0.5px; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { text-decoration: none; color: var(--warm); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--dark); }
.btn-ghost {
  padding: 8px 16px; border-radius: 8px;
  background: none; border: 1px solid var(--border);
  color: var(--ink); font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all 0.2s;
}
.btn-ghost:hover { background: var(--surface); }
.btn-primary {
  padding: 14px 26px; border-radius: 10px;
  background: var(--accent); border: none;
  color: white; font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 14px; font-weight: 700; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.2s;
}
.btn-primary:hover { background: #d04e22; transform: translateY(-1px); }
.hamburger {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px;
  background: none; border: none; cursor: pointer; padding: 0;
  flex-shrink: 0;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: all 0.2s; }

/* Nav layout — center menu, push CTA + lang switcher to right */
@media (min-width: 601px) {
  nav .nav-links {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
  }
  nav > div:has(> .btn-ghost) {
    margin-inline-start: auto;
  }
}

.crumbs { max-width: 780px; margin: 32px auto 0; padding: 0 40px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--accent3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.blog-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 56px 40px 44px; text-align: center; }
.blog-tag { display: inline-block; background: var(--accent); color: white; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 12px; border-radius: 20px; margin-bottom: 18px; }
.blog-hero h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 400; color: var(--dark);
  line-height: 1.2; max-width: 880px; margin: 0 auto 18px;
}
.blog-hero h1 em { font-style: italic; color: var(--accent); }
.blog-meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.blog-meta span { display: flex; align-items: center; gap: 6px; }

.article-wrap { max-width: 780px; margin: 0 auto; padding: 56px 40px 80px; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px; margin-bottom: 48px; }
.toc h2 { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; font-family: 'Cabinet Grotesk', sans-serif; }
.toc ol { padding-left: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.toc li { font-size: 13px; }
.toc a { color: var(--accent3); text-decoration: none; transition: color 0.2s; }
.toc a:hover { color: var(--accent); }

.article-body h2 { font-family: 'Instrument Serif', serif; font-size: clamp(22px, 3vw, 32px); font-weight: 400; color: var(--dark); margin: 52px 0 16px; line-height: 1.25; }
.article-body h3 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 32px 0 10px; }
.article-body p { font-size: 16px; line-height: 1.75; color: var(--ink); margin-bottom: 18px; }
.article-body ul, .article-body ol { padding-left: 22px; margin-bottom: 18px; }
.article-body li { font-size: 16px; line-height: 1.75; color: var(--ink); margin-bottom: 6px; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--dark); }
.article-body strong { font-weight: 700; color: var(--dark); }
.article-body code { background: var(--surface); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; font-size: 14px; font-family: 'SF Mono', Menlo, monospace; }

.callout { border-left: 4px solid var(--accent); background: var(--surface); padding: 16px 22px; margin: 28px 0; border-radius: 0 8px 8px 0; font-size: 15px; }
.callout.green { border-left-color: var(--accent2); }
.callout strong { color: var(--dark); }

.stamp-demo { background: white; border: 1px dashed var(--border); padding: 32px 24px; margin: 24px 0; border-radius: 12px; font-family: 'SF Mono', Menlo, monospace; font-size: 14px; color: var(--warm); position: relative; min-height: 110px; }
.stamp-demo .stamp { position: absolute; bottom: 14px; right: 18px; color: var(--dark); font-weight: 700; letter-spacing: 0.5px; font-size: 12px; }
.stamp-demo .stamp.cf { color: #b94a2c; }
.stamp-demo .label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); margin-bottom: 12px; }

.ref-table { width: 100%; border-collapse: collapse; margin: 24px 0 28px; font-size: 14px; }
.ref-table th, .ref-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.ref-table th { background: var(--surface); font-weight: 700; color: var(--dark); }
.ref-table tr:hover { background: var(--surface); }
/* Mobile: tables become horizontally scrollable so long cell content doesn't blow out the layout */
@media (max-width: 600px) {
  .article-body table,
  .ref-table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

.steps { display: grid; gap: 16px; margin: 24px 0 32px; }
.step { display: flex; gap: 18px; align-items: flex-start; padding: 18px 22px; background: var(--surface); border-radius: 12px; border: 1px solid var(--border); }
.step-no { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.step-body h3 { margin: 0 0 4px; font-size: 16px; color: var(--dark); }
.step-body p { margin: 0; font-size: 15px; color: var(--warm); line-height: 1.55; }

.cta-block { background: linear-gradient(135deg, #fff8f4 0%, #faf7f2 100%); border: 2px solid var(--accent); border-radius: 16px; padding: 40px 36px; margin: 56px 0; text-align: center; }
.cta-block h2 { font-family: 'Instrument Serif', serif; font-size: clamp(22px, 3vw, 30px); font-weight: 400; color: var(--dark); margin: 0 0 12px; }
.cta-block p { font-size: 15px; color: var(--warm); margin-bottom: 22px; }
.article-body .btn-primary,
.article-body .btn-primary:hover { color: #ffffff; text-decoration: none; }

.faq-list { margin: 16px 0 32px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question { width: 100%; padding: 22px 0; background: none; border: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-family: 'Cabinet Grotesk', sans-serif; font-size: 16px; font-weight: 700; color: var(--ink); text-align: left; transition: color 0.2s; }
.faq-question:hover { color: var(--accent); }
.faq-chevron { font-size: 18px; flex-shrink: 0; transition: transform 0.25s; color: var(--muted); }
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--accent); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s; }
.faq-answer p { padding-bottom: 22px; font-size: 15px; color: var(--warm); line-height: 1.65; }
.faq-item.open .faq-answer { max-height: 700px; }

.author-box { display: flex; align-items: center; gap: 16px; padding: 24px 0 8px; margin-top: 40px; border-top: 1px solid var(--border); }
.author-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.author-info { font-size: 13px; }
.author-name { font-weight: 700; color: var(--dark); margin-bottom: 2px; }
.author-line { color: var(--muted); }

footer { background: var(--dark); padding: 60px 40px 40px; color: #6b5f52; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; border-bottom: 1px solid #2a241c; padding-bottom: 48px; }
.footer-brand .logo { color: #f4efe8; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.7; max-width: 260px; }
.footer-col h4 { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: #a89d90; margin-bottom: 16px; font-weight: 700; }
.footer-col a { display: flex; align-items: center; min-height: 44px; font-size: 13px; color: #6b5f52; text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: #f4efe8; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 12px; flex-wrap: wrap; gap: 12px; }

/* RTL adjustments — Arabic */
html[dir="rtl"] .crumbs { text-align: right; }
html[dir="rtl"] .article-body ul,
html[dir="rtl"] .article-body ol { padding-left: 0; padding-right: 22px; }
html[dir="rtl"] .toc ol { padding-left: 0; padding-right: 20px; }
html[dir="rtl"] .stamp-demo .stamp { right: auto; left: 18px; }
html[dir="rtl"] .callout { border-left: none; border-right: 4px solid var(--accent); border-radius: 8px 0 0 8px; }
html[dir="rtl"] .callout.green { border-right-color: var(--accent2); }
html[dir="rtl"] .step-no { margin-right: 0; }
html[dir="rtl"] .article-body code { direction: ltr; display: inline-block; }

@media (max-width: 768px) {
  nav { padding: 0 20px; height: 56px; }
  .nav-links {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start;
    gap: 0; padding: 16px 20px 20px; background: var(--cream); border-bottom: 1px solid var(--border);
  }
  .nav-links.mobile-open { display: flex; }
  .nav-links.mobile-open a { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
  .hamburger { display: flex; }
  nav .btn-ghost { display: none; }
  .crumbs { padding: 0 20px; margin-top: 20px; }
  .blog-hero { padding: 40px 20px 32px; }
  .article-wrap { padding: 32px 20px 60px; }
  .toc ol { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  footer { padding: 40px 20px 28px; }
  .cta-block { padding: 36px 24px; }
  .ref-table { font-size: 13px; }
  .ref-table th, .ref-table td { padding: 10px 8px; }
}
