/* ============================================================
   styles.css — الثوب النجدي (خلفية طينيّة داكنة + نقش الباب)
   مستلهم من الأبواب النجدية وأشرطة الزخرفة والورديات.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Reem+Kufi:wght@500;600;700&display=swap');

/* خط «أضواء السلف» — لعناوين المقاطع (أوضح على الشاشات الصغيرة) */
@font-face {
  font-family: "Adwa al-Salaf";
  src: url("fonts/adwa-assalaf.ttf") format("truetype");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Adwa al-Salaf";
  src: url("fonts/adwa-assalaf-bold.ttf") format("truetype");
  font-weight: 700; font-display: swap;
}

:root {
  --bg:      #261a11;   /* طين داكن */
  --surface: #34251a;   /* بطاقات */
  --surface-2:#41301f;  /* أزرار */
  --cream:   #f1e4cb;   /* لون الجص — للعناوين والنص الفاتح */
  --paper:   #e6d7bc;   /* نص أساسي */
  --muted:   #ad9678;   /* نص ثانوي */
  --terra:   #c8553a;   /* أحمر طوبي */
  --teal:    #3a9d8f;   /* فيروزي الأبواب */
  --ochre:   #d8a53e;   /* خردلي */
  --line:    #4a3625;   /* خط فاصل دافئ */
  --radius:  14px;
  --band: url("door.svg");
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(900px 520px at 85% -8%, rgba(200,85,58,.10), transparent 60%),
    radial-gradient(700px 400px at 10% 0%, rgba(58,157,143,.06), transparent 55%),
    var(--bg);
  color: var(--paper);
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  direction: rtl; min-height: 100vh; line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }

/* ---- الشريط العلوي ---- */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 30px; margin-bottom: 6px; position: relative;
}
.site-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22px;
  background: var(--band) repeat-x; background-size: auto 22px;
  border-radius: 3px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; font-family: "Reem Kufi", sans-serif; color: var(--cream); }
.brand .dot { width: 12px; height: 12px; background: var(--terra); display: inline-block; transform: rotate(45deg); }
.nav { display: flex; gap: 6px; }
.nav a {
  padding: 7px 15px; border-radius: 99px; font-size: 14px; font-weight: 600;
  color: var(--muted); transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface); color: var(--cream); }
.nav a.active { background: var(--terra); color: var(--cream); }

/* ---- صفحة البداية ---- */
.hero { padding: 50px 0 30px; text-align: center; }
.hero .eyebrow { color: var(--ochre); font-weight: 700; letter-spacing: .12em; font-size: 13px; margin-bottom: 14px; }
.hero h1 {
  font-family: "Reem Kufi", sans-serif; font-weight: 700; color: var(--cream);
  font-size: clamp(38px, 6.5vw, 60px); line-height: 1.1; margin: 0 0 14px;
}
.hero p { color: var(--muted); font-size: 17px; max-width: 520px; margin: 0 auto; }
.hero::after {
  content: ""; display: block; width: 280px; max-width: 80%; height: 48px;
  margin: 24px auto 0; background: url("ornament.svg") no-repeat center / contain;
}

.sections { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-bottom: 56px; }
.section-card {
  position: relative; overflow: hidden; display: block;
  padding: 46px 28px 30px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.section-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 22px;
  background: var(--band) repeat-x; background-size: auto 22px;
}
.section-card:hover {
  transform: translateY(-4px); border-color: var(--terra);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.6);
}
.section-card .ic {
  width: 52px; height: 52px; border-radius: 12px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(58,157,143,.16); color: var(--teal);
}
.section-card .ic svg { width: 26px; height: 26px; fill: currentColor; }
.section-card h2 { font-family: "Reem Kufi", sans-serif; font-size: 26px; margin: 0 0 6px; color: var(--cream); }
.section-card p { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.section-card .count { color: var(--ochre); font-weight: 700; font-size: 14px; }

/* ---- صفحة القائمة ---- */
.page-title { padding: 34px 0 6px; }
.page-title .eyebrow { color: var(--ochre); font-weight: 700; font-size: 13px; letter-spacing: .08em; }
.page-title h1 { font-family: "Reem Kufi", sans-serif; font-size: clamp(32px, 5.5vw, 46px); margin: 4px 0 0; color: var(--cream); }
.page-title .page-note { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
.list { display: grid; gap: 12px; padding: 22px 0 56px; }
.card {
  display: flex; align-items: center; gap: 16px; padding: 14px;
  border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); border-inline-start: 4px solid var(--terra);
  transition: background .15s, border-color .15s, transform .12s;
}
.card:hover { background: #3d2c1d; border-inline-start-color: var(--teal); transform: translateX(-3px); }
.card .thumb { border-radius: 8px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.card.audio .thumb { width: 60px; height: 60px; }
.card.video .thumb { width: 96px; height: 54px; }
.card .info { flex: 1; min-width: 0; }
.card .info h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--cream); }
.card .info .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card .chev { color: var(--terra); flex-shrink: 0; }
.card .chev svg { width: 20px; height: 20px; fill: currentColor; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---- أدوات القائمة: بحث + تصفية ---- */
.list-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 22px 0 4px; }
.search { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; transition: border-color .15s; }
.search:focus-within { border-color: var(--terra); }
.search svg { width: 18px; height: 18px; fill: var(--muted); flex-shrink: 0; }
.search input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--paper); font-family: inherit; font-size: 15px; }
.search input::placeholder { color: #7e6b52; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 99px; font-family: inherit; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { color: var(--cream); border-color: var(--terra); }
.chip.active { background: var(--terra); border-color: var(--terra); color: var(--cream); }

/* ---- شبكة البطاقات ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; padding: 18px 0 56px; }
.grid .empty { grid-column: 1 / -1; }
.grid:has(+ .more-wrap:not(:empty)) { padding-bottom: 8px; }
.more-wrap { display: flex; justify-content: center; padding: 8px 0 56px; }
.more-wrap:empty { display: none; }
.more-btn { padding: 12px 28px; border-radius: 99px; font-family: inherit; font-size: 15px; font-weight: 600; background: var(--surface); border: 1px solid var(--terra); color: var(--cream); cursor: pointer; transition: background .15s; }
.more-btn:hover { background: var(--terra); }
.more-btn span { color: var(--muted); font-weight: 500; font-size: 13px; }
.more-btn:hover span { color: var(--cream); }
.gcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, border-color .15s, box-shadow .2s; }
.gcard:hover { transform: translateY(-3px); border-color: var(--terra); box-shadow: 0 16px 36px -22px rgba(0,0,0,.6); }
.gthumb { position: relative; display: block; background: #1d150d; overflow: hidden; }
.grid.video .gthumb { aspect-ratio: 16/9; }
.grid.audio .gthumb { aspect-ratio: 1/1; }
.gthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gplay { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(200,85,58,.92); display: flex; align-items: center; justify-content: center; transition: transform .15s, background .2s; }
.gcard:hover .gplay { transform: translate(-50%,-50%) scale(1.08); background: var(--terra); }
.gplay svg { width: 20px; height: 20px; fill: var(--cream); margin-right: -2px; }
.ginfo { padding: 12px 13px 14px; flex: 1; }
.ginfo h3 { font-family: "Adwa al-Salaf", "Reem Kufi", sans-serif; font-weight: 700; font-size: 16px; line-height: 1.4; margin: 0; color: var(--cream); }
.ginfo .sub { color: var(--muted); font-size: 12px; margin-top: 4px; display: block; }

/* ---- صفحة المشغّل ---- */
.back { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; font-weight: 600; margin: 26px 0 16px; }
.back:hover { color: var(--terra); }
.back svg { width: 16px; height: 16px; fill: currentColor; transform: scaleX(-1); }

.player {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 42px 24px 24px; margin-bottom: 56px;
  box-shadow: 0 22px 54px -28px rgba(0,0,0,.6);
}
.player::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 22px;
  background: var(--band) repeat-x; background-size: auto 22px;
}
.p-kicker { color: var(--ochre); font-size: 12px; font-weight: 700; letter-spacing: .08em; display: flex; align-items: center; gap: 8px; }
.eq { display: inline-flex; gap: 2px; height: 12px; align-items: flex-end; opacity: 0; transition: opacity .3s; }
.is-playing .eq { opacity: 1; }
.eq span { width: 3px; height: 100%; background: var(--terra); border-radius: 2px; transform-origin: bottom; animation: bounce 1s ease-in-out infinite; }
.eq span:nth-child(2){ animation-delay:.2s } .eq span:nth-child(3){ animation-delay:.4s }
@keyframes bounce { 0%,100%{ transform: scaleY(.35) } 50%{ transform: scaleY(1) } }
.p-title { font-family: "Adwa al-Salaf", "Reem Kufi", sans-serif; font-weight: 700; font-size: 30px; line-height: 1.25; margin: 6px 0 2px; color: var(--cream); }
.p-author { color: var(--muted); font-size: 14px; margin: 0; }

.audio-stage { display: flex; gap: 20px; align-items: center; }
.audio-cover { width: 130px; height: 130px; flex: 0 0 130px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 3px solid var(--surface-2); box-shadow: 0 8px 22px -10px rgba(0,0,0,.6); }
.video-stage { position: relative; width: 100%; aspect-ratio: 16/9; background: #18120c; border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.video-stage video { width: 100%; height: 100%; object-fit: contain; background: #18120c; display: block; }
.video-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(rgba(0,0,0,.1), rgba(0,0,0,.35)); cursor: pointer; transition: opacity .25s; }
.is-playing .video-overlay { opacity: 0; pointer-events: none; }
.bigplay { width: 72px; height: 72px; border-radius: 50%; background: var(--terra); color: var(--cream); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 20px -4px rgba(0,0,0,.5); transition: transform .15s, background .2s; }
.bigplay:hover { background: #d4604a; transform: scale(1.05); }
.bigplay svg { width: 30px; height: 30px; fill: currentColor; margin-right: -3px; }

.progress { margin: 18px 0 6px; }
.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 99px; background: var(--line); cursor: pointer; direction: ltr; }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--terra); box-shadow: 0 0 0 4px rgba(200,85,58,.22); cursor: pointer; }
.seek::-moz-range-thumb { width: 15px; height: 15px; border: none; border-radius: 50%; background: var(--terra); cursor: pointer; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr; }

.controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; }
.btn { background: var(--surface-2); border: 1px solid var(--line); color: var(--paper); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; width: 44px; height: 44px; transition: background .2s, transform .1s, border-color .2s; }
.btn:hover { background: #4d3923; border-color: var(--terra); }
.btn:active { transform: scale(.94); }
.btn svg { width: 19px; height: 19px; fill: currentColor; }
.skip { position: relative; }
.skip .lbl { position: absolute; font-size: 9px; font-weight: 700; color: var(--muted); pointer-events: none; }
.play { width: 56px; height: 56px; background: var(--terra); border-color: var(--terra); color: var(--cream); }
.play:hover { background: #d4604a; border-color: #d4604a; }
.play svg { width: 24px; height: 24px; }
.speed { width: auto; padding: 0 13px; height: 44px; border-radius: 99px; font-family: inherit; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.download { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 18px; width: 100%; padding: 14px; border-radius: 11px; background: var(--teal); border: 1px solid var(--teal); color: #14241f; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .2s; }
.download:hover { background: #44ab9c; }
.download svg { width: 18px; height: 18px; fill: currentColor; }

.share { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 12px; width: 100%; padding: 13px; border-radius: 11px; background: transparent; border: 1.5px solid var(--terra); color: var(--cream); font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.share svg { width: 19px; height: 19px; fill: var(--terra); transition: fill .2s; }
.share:hover { background: var(--terra); color: var(--cream); }
.share:hover svg { fill: var(--cream); }
.share:active { transform: scale(.99); }
.share.done { border-color: var(--teal); color: var(--teal); background: rgba(58,157,143,.10); }
.share.done svg { fill: var(--teal); }

.hint { color: var(--muted); font-size: 12px; text-align: center; margin-top: 10px; }

/* تذييل */
.site-foot { position: relative; padding: 32px 0 24px; margin-top: 10px; color: var(--muted); font-size: 13px; text-align: center; }
.site-foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22px; background: var(--band) repeat-x; background-size: auto 22px; }
.site-foot .foot-txt { display: block; }
.site-foot .visits { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 9px; padding: 6px 16px; border-radius: 99px; background: rgba(58,157,143,.10); border: 1px solid rgba(58,157,143,.22); color: var(--muted); font-size: 13px; }
.site-foot .visits[hidden] { display: none; }
.site-foot .visits b { color: var(--cream); font-family: "Reem Kufi", sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.site-foot .visits svg { width: 15px; height: 15px; fill: var(--teal); flex-shrink: 0; }

:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }

@media (max-width: 620px) {
  .sections { grid-template-columns: 1fr; }
  .audio-stage { flex-direction: column; text-align: center; }
  .controls { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .eq span { animation: none; }
  .section-card, .card, .bigplay { transition: none; }
}
