/* Advertising slots: neutral by default, they pick up the page's colours through CSS variables. */
.waha-ad-slot{display:flex;flex-direction:column;align-items:center;gap:10px;margin:22px auto;padding:0 clamp(12px,3vw,24px);max-width:100%;direction:ltr}
.waha-ad-slot[hidden]{display:none!important}
.waha-ad{position:relative;width:100%;max-width:var(--w,728px);border-radius:12px;overflow:hidden;background:rgba(127,127,127,.08);box-shadow:0 1px 8px rgba(0,0,0,.08);direction:rtl}
.waha-ad-link{display:block;color:inherit;text-decoration:none}
.waha-ad img{display:block;width:100%;height:auto;aspect-ratio:var(--ar,728/90);object-fit:cover}
.waha-ad-label{position:absolute;z-index:2;top:6px;inset-inline-start:6px;padding:1px 9px;border-radius:999px;background:rgba(0,0,0,.62);color:#fff;font:600 .68rem/1.5 "Noto Kufi Arabic",system-ui,sans-serif;letter-spacing:.02em;pointer-events:none}
.waha-ad-frame{display:block;width:100%;border:0;background:#fff}
.waha-ad-text{padding:26px 22px 18px;display:flex;flex-direction:column;gap:6px;background:linear-gradient(135deg,var(--green,#075844),var(--green2,#0a7157));color:#fff}
.waha-ad-text b{font-size:1.05rem}.waha-ad-text span{opacity:.9;font-size:.9rem;line-height:1.7}
.waha-ad-text em{align-self:flex-start;margin-top:6px;font-style:normal;font-weight:700;font-size:.82rem;padding:6px 16px;border-radius:999px;background:var(--gold,#c8a45b);color:#17342c}
.waha-ad-cta{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;width:100%;max-width:var(--w,728px);padding:22px 16px 14px;border:1.5px dashed var(--gold,#c8a45b);border-radius:12px;color:var(--ink,#17342c);text-decoration:none;text-align:center;direction:rtl;background:rgba(200,164,91,.08)}
.waha-ad-cta b{font-size:.95rem}.waha-ad-cta em{font-style:normal;font-size:.8rem;color:var(--green2,#0a7157);font-weight:700}
.waha-ad-google{min-height:60px}
/* fixed side rails: only on very wide screens, never over the content */
.waha-ad-rail{position:fixed;top:130px;z-index:20;margin:0;padding:0;width:160px;display:none}
.waha-ad-rail-right{inset-inline-end:max(8px,calc((100vw - 1500px) / 2 - 170px))}
.waha-ad-rail-left{inset-inline-start:max(8px,calc((100vw - 1500px) / 2 - 170px))}
@media(min-width:1700px){.waha-ad-rail:not([hidden]){display:flex}}
/* inside dialogs the slot is a little tighter */
dialog .waha-ad-slot{margin:14px auto}
@media(max-width:767px){
  .waha-ad{max-width:var(--mw,var(--w,728px))}
  .waha-ad img{aspect-ratio:var(--mar,var(--ar,728/90))}
  .waha-ad-slot{margin:16px auto}
}
@media print{.waha-ad-slot{display:none!important}}

/* a space cut into a grid of cells: each ad fills exactly its cells */
.waha-ad-cells{display:grid;grid-template-columns:repeat(var(--cols,2),minmax(0,1fr));grid-template-rows:repeat(var(--rows,1),minmax(0,1fr));gap:8px;width:100%;max-width:var(--w,728px);aspect-ratio:var(--ratio,728/90)}
.waha-ad-cell{min-width:0;min-height:0;display:flex}
.waha-ad-cell>.waha-ad,.waha-ad-cell>.waha-ad-cta{max-width:none;width:100%;height:100%}
.waha-ad-cell .waha-ad-link,.waha-ad-cell .waha-ad picture{display:block;height:100%}
.waha-ad-cell .waha-ad img{height:100%;aspect-ratio:auto;object-fit:cover}
.waha-ad-cell .waha-ad-frame{height:100%!important}
.waha-ad-cell .waha-ad-cta{justify-content:center}
@media(max-width:600px){
  .waha-ad-cells{grid-template-columns:1fr;grid-template-rows:none;aspect-ratio:auto}
  .waha-ad-cell{grid-column:auto!important;grid-row:auto!important}
  .waha-ad-empty{display:none}
  .waha-ad-cell .waha-ad img{height:auto}
  .waha-ad-cell .waha-ad-frame{height:100px!important}
}
/* in Arabic pages column 1 is on the right, as the reader counts it */
html[dir=rtl] .waha-ad-cells{direction:rtl}
