/* zakat.css — shared, mobile-first, RTL-aware (logical properties). Brand: zakathisab.com */
:root {
  --cream: #f8f7f4; --panel: #ffffff; --ink: #212529; --muted: #5f6b66;
  --green: #2d6a4f; --teal: #1b4332; --gold: #d4af37; --gold-soft: #fbf5e2;
  --line: #e5e1d8; --danger: #b42318; --ok: #1f7a4d;
  --radius: 14px; --shadow: 0 6px 24px rgba(27, 67, 50, .08);
  --font-body: 'Inter', system-ui, sans-serif; /* overridden per language in <head> */
  --lh: 1.7;
  --font-ur: var(--font-body);
  --font-num: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: var(--lh); -webkit-font-smoothing: antialiased; }
.site-footer ul.langs { display: flex; flex-wrap: wrap; gap: 4px 14px; }
[dir="rtl"] body, body[dir="rtl"] { text-align: start; }
a { color: var(--green); }
h1, h2, h3 { color: var(--green); line-height: 1.9; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: clamp(1.5rem, 4.5vw, 2.2rem); }
h2 { font-size: clamp(1.2rem, 3.5vw, 1.55rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .9em; }
.num, input[type=number], input[type=date], select, .money { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.site-header { background: var(--panel); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--teal); font-weight: 700; font-family: var(--font-num); font-size: 1.05rem; }
.brand svg { width: 38px; height: 38px; }
.nav { display: none; gap: 4px; }
.nav a { text-decoration: none; padding: 4px 10px; border-radius: 8px; font-size: .95rem; color: var(--teal); white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--gold-soft); color: var(--green); }
.nav-toggle { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-family: var(--font-ur); font-size: 1rem; }
.nav.open { display: flex; flex-direction: column; position: absolute; inset-inline: 0; top: 64px; background: var(--panel); padding: 10px 16px 16px; border-bottom: 3px solid var(--gold); box-shadow: var(--shadow); }
@media (min-width: 900px) { .nav { display: flex; } .nav-toggle { display: none; } .nav.open { position: static; flex-direction: row; box-shadow: none; border: 0; padding: 0; } }

.hero { text-align: center; padding: 28px 0 8px; }
.hero .badge { display: inline-flex; align-items: center; gap: 6px; background: var(--gold); color: var(--teal); border-radius: 999px; padding: 2px 12px; font-size: .9rem; font-weight: 700; margin-bottom: 8px; }
.hero .badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.lead { color: var(--muted); font-size: 1.02rem; max-width: 640px; margin: 0 auto 8px; }

.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; margin: 16px 0; }
@media (min-width: 640px) { .card { padding: 26px 28px; } }
.card.gold-top { border-top: 6px solid var(--gold); }
.card.soft { background: var(--gold-soft); box-shadow: none; border: 1px solid #efe4bf; }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.four { grid-template-columns: repeat(4, 1fr); } }
.field label { display: block; font-weight: 700; margin-bottom: 2px; font-size: .98rem; }
.field .help { color: var(--muted); font-size: .88rem; line-height: 1.8; margin: 0; }
.control { width: 100%; height: 52px; border: 2px solid var(--gold); border-radius: 10px; padding: 8px 14px; font-size: 1.05rem; background: #fff; color: var(--ink); direction: ltr; text-align: left; }
.control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(45, 106, 79, .18); }
select.control { direction: rtl; text-align: start; font-family: var(--font-ur); font-size: .95rem; }
.control[readonly] { background: #f3f1ec; }
.with-suffix { position: relative; }
.with-suffix .control { padding-right: 120px; }
.with-suffix .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; font-family: var(--font-num); pointer-events: none; direction: rtl; }
.seg { display: inline-flex; border: 2px solid var(--gold); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 16px; font-family: var(--font-ur); font-size: 1rem; cursor: pointer; }
.seg button.active { background: var(--green); color: #fff; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin-top: 12px; accent-color: var(--green); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 22px; font-family: var(--font-ur); font-size: 1.1rem; font-weight: 700; cursor: pointer; text-decoration: none; transition: .2s; }
.btn.primary { background: var(--green); color: #fff; width: 100%; box-shadow: 0 6px 16px rgba(45, 106, 79, .28); }
.btn.primary:hover { background: var(--teal); }
.btn.ghost { background: #fff; color: var(--green); border: 2px solid var(--green); }
.btn.wa { background: #25d366; color: #fff; }
.btn.pdf { background: var(--teal); color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn svg { width: 22px; height: 22px; fill: currentColor; }
.actions { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 640px) { .actions { grid-template-columns: 1fr 1fr; } }

.status { font-size: .9rem; margin: 6px 0 0; line-height: 1.8; }
.status.ok { color: var(--ok); } .status.warn { color: #8a5a00; } .status.err { color: var(--danger); }
.nisab-box { margin-top: 14px; background: var(--cream); border-inline-start: 5px solid var(--gold); border-radius: 10px; padding: 10px 16px; }
.nisab-box .big { font-size: 1.5rem; font-weight: 700; color: var(--green); font-family: var(--font-num); direction: ltr; display: inline-block; }
.nisab-box small { display: block; color: var(--muted); }

.result { display: none; }
.result.show { display: block; }
.result .amount { font-family: var(--font-num); font-size: clamp(2rem, 8vw, 3.2rem); font-weight: 800; color: var(--gold); text-align: center; direction: ltr; margin: 6px 0; }
.result .sub { text-align: center; color: var(--muted); }
.breakdown { background: var(--cream); border-radius: 10px; padding: 10px 16px; margin-top: 12px; }
.breakdown .row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.breakdown .row:last-child { border-bottom: 0; }
.breakdown .row.total { font-weight: 700; color: var(--green); border-top: 2px solid var(--gold); margin-top: 4px; padding-top: 8px; }
.breakdown .money { direction: ltr; white-space: nowrap; }

details.acc { border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 10px; }
details.acc summary { cursor: pointer; padding: 10px 16px; font-weight: 700; color: var(--green); list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: '﹀'; font-size: .8rem; transition: .2s; color: var(--muted); }
details[open].acc summary::after { transform: rotate(180deg); }
details.acc .body { padding: 0 16px 12px; }
details.acc.section { background: var(--cream); }
details.acc.section summary { font-size: 1.1rem; }
details.acc.section .body { padding-top: 6px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.tbl th, table.tbl td { border: 1px solid var(--line); padding: 6px 10px; text-align: center; }
table.tbl th { background: var(--gold-soft); color: var(--teal); }
table.tbl td.num { direction: ltr; }
.scroll-x { overflow-x: auto; }

.hawl-panel .dates { display: grid; gap: 8px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 640px) { .hawl-panel .dates { grid-template-columns: 1fr 1fr; } }
.hawl-panel .date { background: var(--cream); border-radius: 10px; padding: 8px 14px; }
.hawl-panel .date b { display: block; color: var(--green); font-family: var(--font-num); font-size: 1.05rem; direction: ltr; }
.pill { display: inline-block; border-radius: 999px; padding: 0 12px; font-size: .9rem; background: var(--gold-soft); color: var(--teal); }
.pill.due { background: #fde8e6; color: var(--danger); }
.pill.ok { background: #e6f4ec; color: var(--ok); }

.content p, .content li { font-size: 1rem; }
.content ul { padding-inline-start: 22px; }
.callout { background: var(--gold-soft); border-inline-start: 5px solid var(--green); border-radius: 10px; padding: 8px 16px; margin: 12px 0; }
.cite { font-size: .9rem; color: var(--muted); }
.siblings { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .siblings { grid-template-columns: repeat(3, 1fr); } }
.siblings a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; text-decoration: none; font-weight: 700; color: var(--teal); text-align: center; }
.siblings a:hover { border-color: var(--gold); background: var(--gold-soft); }
.breadcrumb { font-size: .9rem; color: var(--muted); padding-top: 10px; }
.breadcrumb a { color: var(--green); text-decoration: none; }

.site-footer { background: var(--green); color: var(--cream); margin-top: 40px; }
#price-bar { min-height: 72px; }
.site-footer .cols { display: grid; gap: 20px; grid-template-columns: 1fr; padding: 32px 0; }
@media (min-width: 640px) { #price-bar { min-height: 72px; }
.site-footer .cols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { #price-bar { min-height: 72px; }
.site-footer .cols { grid-template-columns: repeat(4, 1fr); } }
.site-footer h4, .site-footer .ftr-title { font-weight: 700; font-size: 1rem; margin: 0 0 8px; border-bottom: 2px solid var(--gold); display: inline-block; padding-bottom: 4px; color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--cream); opacity: .85; text-decoration: none; }
.site-footer a:hover { opacity: 1; color: var(--gold); }
.site-footer .bottom { background: var(--teal); text-align: center; font-size: .9rem; padding: 14px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hidden { display: none !important; }

/* PDF report DOM (rendered offscreen by report.js) */
.zr { width: 794px; padding: 40px 48px; background: #fff; color: #212529; font-family: var(--font-ur); line-height: 2; }
.zr .zr-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 4px solid var(--gold); padding-bottom: 10px; margin-bottom: 14px; }
.zr .zr-head .b { font-family: var(--font-num); font-weight: 800; color: var(--green); font-size: 22px; }
.zr h1 { font-size: 26px; margin: 0; }
.zr h2 { font-size: 18px; margin: 16px 0 6px; }
.zr table { width: 100%; border-collapse: collapse; }
.zr td { padding: 6px 10px; border-bottom: 1px solid #eee; }
.zr td.v { font-family: var(--font-num); direction: ltr; text-align: left; white-space: nowrap; }
.zr .zr-total { background: var(--gold-soft); font-weight: 800; color: var(--green); font-size: 20px; }
.zr .zr-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; background: #f8f7f4; border-radius: 10px; padding: 8px 16px; font-size: 14px; }
.zr .zr-foot { margin-top: 18px; border-top: 1px solid #ddd; padding-top: 8px; font-size: 13px; color: #666; }
