/* ============================================================
   dikr — ad & promotion formats (rendered by blog/_private/lib/ads.php)
   banner (page.top) · card (home.between, blog.end, page.bottom)
   inline (blog.in_article) · bar (site.bar) · code (ad networks)
   Fixed shapes so nothing jumps while the page loads.
   ============================================================ */
.dkad { --ad-bg: linear-gradient(135deg, #0b1220 0%, #0f1b30 55%, #15284a 100%);
  --ad-ink: #fff; --ad-sub: rgba(255,255,255,.74); --ad-acc: #e9c27a; --ad-acc-ink: #2a1d05;
  --ad-cta-bg: #fff; --ad-cta-ink: #0d1b33; --ad-glow1: rgba(233,194,122,.38); --ad-glow2: rgba(70,191,255,.30); --ad-glow3: rgba(255,255,255,.10);
  --ad-chip: rgba(255,255,255,.12); --ad-chip-ink: rgba(255,255,255,.86);
  position: relative; box-sizing: border-box; direction: rtl; text-align: right; font-family: var(--font-ui, 'Amiri', serif); }
.dkad *, .dkad *::before, .dkad *::after { box-sizing: border-box; }
.dkad[hidden] { display: none !important; }

/* Themes */
.dkad.t-blue    { --ad-bg: linear-gradient(135deg, #0a6fa8 0%, #1497d6 45%, #46bfff 100%); --ad-acc: #fff3c4; --ad-acc-ink: #0d3b58;
  --ad-cta-ink: #0b6aa0; --ad-glow1: rgba(255,255,255,.35); --ad-glow2: rgba(255,255,255,.22); }
.dkad.t-emerald { --ad-bg: linear-gradient(135deg, #04261f 0%, #073d32 55%, #0d5c49 100%); --ad-acc: #e9c27a;
  --ad-cta-ink: #06392e; --ad-glow1: rgba(233,194,122,.32); --ad-glow2: rgba(52,211,162,.28); }
.dkad.t-violet  { --ad-bg: linear-gradient(135deg, #171236 0%, #231a52 55%, #352472 100%); --ad-acc: #ffb4d6; --ad-acc-ink: #3b0d27;
  --ad-cta-ink: #231a52; --ad-glow1: rgba(255,140,200,.30); --ad-glow2: rgba(120,140,255,.30); }
.dkad.t-sand    { --ad-bg: linear-gradient(135deg, #fffaf0 0%, #f8eedb 55%, #f1e1c0 100%); --ad-ink: #2b2112; --ad-sub: rgba(43,33,18,.72);
  --ad-acc: #0d1b33; --ad-acc-ink: #fff; --ad-cta-bg: #0d1b33; --ad-cta-ink: #fff; --ad-glow1: rgba(214,166,72,.35); --ad-glow2: rgba(70,191,255,.18);
  --ad-glow3: rgba(255,255,255,.6); --ad-chip: rgba(43,33,18,.08); --ad-chip-ink: rgba(43,33,18,.75); }
body.dark .dkad.t-sand, .dkad-dark .dkad.t-sand { --ad-bg: linear-gradient(135deg, #2a2316 0%, #241d12 60%, #1d170e 100%); --ad-ink: #f7ecd4;
  --ad-sub: rgba(247,236,212,.72); --ad-acc: #e9c27a; --ad-acc-ink: #2a1d05; --ad-cta-bg: #e9c27a; --ad-cta-ink: #2a1d05;
  --ad-chip: rgba(255,255,255,.08); --ad-chip-ink: rgba(247,236,212,.8); --ad-glow3: rgba(255,255,255,.06); }

/* Shared pieces */
.dkad-label { display: inline-flex; align-items: center; gap: 5px; font-family: -apple-system, 'Segoe UI', Tahoma, sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1; padding: 5px 9px; border-radius: 999px;
  background: var(--ad-chip); color: var(--ad-chip-ink); }
.dkad-badge { display: inline-flex; align-items: center; font-family: -apple-system, 'Segoe UI', Tahoma, sans-serif; font-size: 11.5px; font-weight: 700;
  line-height: 1; padding: 5px 10px; border-radius: 999px; background: var(--ad-acc); color: var(--ad-acc-ink); }
.dkad-x { position: absolute; top: 12px; left: 12px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--ad-chip); color: var(--ad-ink); opacity: .8; transition: opacity .2s, transform .2s; }
.dkad-x:hover { opacity: 1; transform: scale(1.06); }
.dkad-x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.dkad-cta { display: inline-flex; align-items: center; gap: 8px; text-decoration: none !important; font-weight: 700; white-space: nowrap; }

/* ── Banner & card ─────────────────────────────────────────── */
.dkad-banner, .dkad-card { overflow: hidden; border-radius: 26px; background: var(--ad-bg); color: var(--ad-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 18px 46px -18px rgba(8, 20, 40, .45); isolation: isolate; }
.dkad-glow { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.dkad-glow i { position: absolute; border-radius: 50%; filter: blur(44px); }
.dkad-glow i:nth-child(1) { width: 260px; height: 260px; left: 8%; top: -120px; background: var(--ad-glow1); }
.dkad-glow i:nth-child(2) { width: 300px; height: 300px; right: -120px; bottom: -170px; background: var(--ad-glow2); }
.dkad-glow i:nth-child(3) { width: 140px; height: 140px; left: 40%; bottom: -60px; background: var(--ad-glow3); }
.dkad-banner::before, .dkad-card::before { /* faint star lattice */ content: ""; position: absolute; inset: 0; z-index: -1; opacity: .07; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23fff' stroke-width='.8'%3E%3Crect x='19' y='19' width='26' height='26'/%3E%3Crect x='19' y='19' width='26' height='26' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 64px; mask-image: linear-gradient(90deg, #000, transparent 70%); -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%); }
.dkad.t-sand::before { filter: invert(1); opacity: .06; }

.dkad-banner .dkad-in, .dkad-card .dkad-in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 28px; padding: 30px 38px 30px 44px; min-height: 196px; }
.dkad-text { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.dkad-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dkad-banner .dkad-title, .dkad-card .dkad-title { margin: 2px 0 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.35; font-weight: 700; color: var(--ad-ink); }
.dkad-banner .dkad-sub, .dkad-card .dkad-sub { margin: 0; font-size: 16.5px; line-height: 1.75; color: var(--ad-sub); max-width: 60ch; }
.dkad-banner .dkad-cta, .dkad-card .dkad-cta { margin-top: 6px; padding: 11px 20px; border-radius: 14px; font-size: 16px;
  background: var(--ad-cta-bg); color: var(--ad-cta-ink) !important; box-shadow: 0 8px 22px -10px rgba(0,0,0,.45); transition: transform .25s, box-shadow .25s; }
.dkad-banner .dkad-cta:hover, .dkad-card .dkad-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(0,0,0,.5); }

.dkad-visual { display: block; text-decoration: none; }
.dkad-vis { display: grid; place-items: center; width: 200px; height: 170px; }
.dkad-vis img { display: block; max-width: 100%; max-height: 100%; }
.dkad-vis.is-book img { width: auto; height: 168px; border-radius: 4px 10px 10px 4px; transform: perspective(700px) rotateY(-14deg) rotate(-3deg);
  box-shadow: -14px 18px 30px -8px rgba(0,0,0,.5), inset 3px 0 0 rgba(255,255,255,.2); transition: transform .4s cubic-bezier(.4,0,.2,1); }
.dkad:hover .dkad-vis.is-book img { transform: perspective(700px) rotateY(-6deg) rotate(-1deg) translateY(-4px); }
.dkad-vis.is-phone img { height: 170px; width: auto; border-radius: 20px; border: 4px solid #0b0b0f; box-shadow: 0 16px 34px -10px rgba(0,0,0,.55); transform: rotate(-4deg); }
.dkad-vis.is-photo img { border-radius: 18px; max-height: 160px; object-fit: cover; box-shadow: 0 16px 34px -12px rgba(0,0,0,.5); }
.dkad-vis.is-icon img { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 14px 30px -10px rgba(0,0,0,.45); }
.dkad-vis.is-orn { color: var(--ad-acc); }
.dkad-orn { width: 150px; height: 150px; opacity: .9; animation: dkad-spin 60s linear infinite; }
@keyframes dkad-spin { to { transform: rotate(360deg); } }

/* card = the larger in-flow version (home sections, end of articles) */
.dkad-card .dkad-in { min-height: 230px; padding: 36px 44px 36px 48px; }
.dkad-card .dkad-vis { width: 240px; height: 200px; }
.dkad-card .dkad-vis.is-book img { height: 196px; }

/* ── Inline (inside articles) ──────────────────────────────── */
.dkad-inline { margin: 28px 0; }
.dkad-inline .dkad-in { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 18px; text-decoration: none !important;
  background: linear-gradient(135deg, rgba(70,191,255,.07), rgba(233,194,122,.08)); border: 1px solid rgba(70,191,255,.22); color: inherit; transition: border-color .2s, transform .2s; }
.dkad-inline .dkad-in:hover { border-color: rgba(70,191,255,.5); transform: translateY(-1px); }
.dkad-inline .dkad-vis { width: 68px; height: 84px; flex-shrink: 0; }
.dkad-inline .dkad-vis.is-book img { height: 84px; transform: rotate(-4deg); box-shadow: -6px 8px 16px -6px rgba(0,0,0,.4); border-radius: 2px 6px 6px 2px; }
.dkad-inline .dkad-vis.is-icon img { width: 60px; height: 60px; border-radius: 16px; }
.dkad-inline .dkad-vis.is-phone img { height: 84px; border-width: 2px; border-radius: 12px; }
.dkad-inline .dkad-vis.is-orn { color: #c9a24d; }
.dkad-inline .dkad-orn { width: 64px; height: 64px; }
.dkad-inline .dkad-text { gap: 4px; flex: 1; }
.dkad-inline .dkad-label { background: rgba(70,191,255,.12); color: #0d88c4; }
.dkad-inline .dkad-title { font-size: 18px; line-height: 1.45; font-weight: 700; color: var(--page-text, #1c1c1e); }
.dkad-inline .dkad-sub { font-size: 14.5px; line-height: 1.6; color: var(--text-sec, #6e6e73); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dkad-inline .dkad-cta { padding: 9px 14px; border-radius: 12px; font-size: 14.5px; color: #fff; background: linear-gradient(135deg, #1aaae8, #0d88c4); }
body.dark .dkad-inline .dkad-in, .dkad-dark .dkad-inline .dkad-in { background: linear-gradient(135deg, rgba(70,191,255,.08), rgba(233,194,122,.06)); border-color: rgba(70,191,255,.2); }
body.dark .dkad-inline .dkad-title, .dkad-dark .dkad-inline .dkad-title { color: #f2f2f7; }
body.dark .dkad-inline .dkad-sub, .dkad-dark .dkad-inline .dkad-sub { color: #aeaeb2; }
body.dark .dkad-inline .dkad-label, .dkad-dark .dkad-inline .dkad-label { color: #46bfff; }

/* ── Bar (top of the site) ─────────────────────────────────── */
.dkad-bar { background: var(--ad-bg); color: var(--ad-ink); overflow: hidden; }
.dkad-bar .dkad-in { position: relative; max-width: 1100px; margin: 0 auto; min-height: 42px; padding: 7px 52px 7px 52px; display: flex; align-items: center;
  justify-content: center; gap: 12px; flex-wrap: wrap; font-size: 15px; line-height: 1.5; text-align: center; }
.dkad-bar .dkad-title { font-weight: 700; }
.dkad-bar .dkad-sub { color: var(--ad-sub); }
.dkad-bar .dkad-badge { font-size: 10.5px; padding: 4px 8px; }
.dkad-bar .dkad-cta { color: var(--ad-acc) !important; border-bottom: 1px solid currentColor; padding-bottom: 1px; font-size: 14.5px; }
.dkad-bar .dkad-x { top: 50%; transform: translateY(-50%); width: 26px; height: 26px; left: 12px; }
.dkad-bar .dkad-x:hover { transform: translateY(-50%) scale(1.06); }

/* ── Code (ad networks, partners) ──────────────────────────── */
.dkad-code { padding: 10px 0; text-align: center; }
.dkad-code .dkad-label { background: transparent; color: var(--text-ter, #aeaeb2); padding: 0 0 6px; }
.dkad-code-in { min-height: 90px; display: flex; justify-content: center; }
.dkad-code-ph { display: grid; place-items: center; width: 100%; min-height: 110px; border-radius: 16px; border: 2px dashed rgba(70,191,255,.35);
  color: #0d88c4; font-family: -apple-system, 'Segoe UI', Tahoma, sans-serif; font-size: 14px; }

/* ── Slot wrappers (spacing per place) ─────────────────────── */
.dkad-slot-page-top, .dkad-slot-home-between, .dkad-slot-page-bottom { max-width: 1100px; margin: 16px auto 8px; padding: 0 16px; }
.dkad-slot-home-between { margin: 8px auto 44px; }
.dkad-slot-page-bottom { margin: 36px auto 30px; }
.dkad-slot-blog-end { margin: 34px 0 6px; }
.dkad-slot-site-bar { margin: 0; }

/* ── Small screens ─────────────────────────────────────────── */
@media (max-width: 680px) {
  .dkad-banner, .dkad-card { border-radius: 20px; }
  .dkad-banner .dkad-in, .dkad-card .dkad-in { grid-template-columns: minmax(0, 1fr) 92px; gap: 14px; padding: 20px 18px 20px 20px; min-height: 0; }
  .dkad-banner .dkad-title, .dkad-card .dkad-title { font-size: 20px; }
  .dkad-banner .dkad-sub, .dkad-card .dkad-sub { font-size: 14.5px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .dkad-text { gap: 7px; }
  .dkad-banner .dkad-cta, .dkad-card .dkad-cta { padding: 9px 15px; font-size: 14.5px; border-radius: 12px; }
  .dkad-vis, .dkad-card .dkad-vis { width: 92px; height: 120px; }
  .dkad-vis.is-book img, .dkad-card .dkad-vis.is-book img { height: 118px; }
  .dkad-vis.is-phone img { height: 120px; border-width: 3px; border-radius: 14px; }
  .dkad-vis.is-icon img { width: 64px; height: 64px; border-radius: 16px; }
  .dkad-orn { width: 86px; height: 86px; }
  .dkad-x { top: 8px; left: 8px; width: 26px; height: 26px; }
  .dkad-slot-page-top { margin-top: 12px; padding: 0 10px; }
  .dkad-slot-home-between, .dkad-slot-page-bottom { padding: 0 12px; }
  .dkad-inline .dkad-in { flex-wrap: wrap; }
  .dkad-inline .dkad-text { flex-basis: calc(100% - 90px); }
  .dkad-inline .dkad-cta { margin-inline-start: 84px; }
  .dkad-bar .dkad-in { padding: 7px 42px 7px 14px; gap: 6px 10px; font-size: 14px; justify-content: flex-start; text-align: right; }
  .dkad-bar .dkad-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dkad-orn { animation: none; }
  .dkad *, .dkad { transition: none !important; }
}
@media print { .dkad, .dkad-slot { display: none !important; } }

.dkad-slot:has(> .dkad[hidden]) { display: none; }
