/*
Theme Name: Saniyh Shop
Theme URI: https://shop.saniyh.com
Description: ثيم متجر سنيح — ثيم ابن لـTwenty Twenty-Five، مبنيّ على دليل هوية سنيح الرسمي (أسود · ذهب · عاجي · كحلي)، عربيّ RTL أصيل بخطوط مستضافة ذاتياً، ووضعان فاتح وغامق.
Author: شركة سنيح
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 8.1
Text Domain: saniyh-shop
*/

/* =========================================================
   رموز الهوية — موروثة حرفاً بحرف من saniyh.com فتظلّ الواجهتان عائلةً واحدة.
   الفرق الوحيد المقصود: المتجر افتراضه **فاتح**، والموقع افتراضه غامق —
   لأن صور المنتجات خلفياتها بيضاء، فالأرضية الغامقة تجعلها مربّعات مضيئة ناشزة.
   ========================================================= */
:root {
  --gold:  #C9952E;
  --ink:   #111214;
  --ivory: #F8F5EE;
  --navy:  #071827;

  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s6:24px; --s8:32px; --s12:48px; --s16:64px;
  --radius: 12px;
  --radius-sm: 8px;

  /* الوضع الفاتح — الافتراضي في المتجر */
  --bg: var(--ivory);
  --fg: var(--ink);
  --muted: #5C5E63;                    /* 6.1:1 على العاجي — يتجاوز 4.5 بأمان */
  --surface: #FFFFFF;                  /* بطاقة المنتج بيضاء: تتّصل بخلفية صور الكتالوج */
  --surface-2: #F1ECE0;
  --line: #E2DCCE;
  --line-strong: #CFC6B2;
  --shadow-card:   0 1px 2px rgba(17,18,20,.05), 0 6px 16px -8px rgba(17,18,20,.14);
  --shadow-raised: 0 2px 4px rgba(17,18,20,.06), 0 14px 32px -12px rgba(17,18,20,.22);
  --badge-bg: var(--gold);
  --badge-fg: var(--ink);              /* أسود على ذهب = 6.4:1 */
  --sel-bg: rgba(201,149,46,.30);
  --scroll-thumb: #CFC6B2;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--navy);
    --fg: var(--ivory);
    --muted: rgba(248,245,238,.72);
    --surface: #0D2233;
    --surface-2: #12293C;
    --line: rgba(248,245,238,.14);
    --line-strong: rgba(248,245,238,.26);
    --shadow-card:   0 1px 2px rgba(0,0,0,.4), 0 6px 16px -8px rgba(0,0,0,.6);
    --shadow-raised: 0 2px 4px rgba(0,0,0,.45), 0 14px 32px -12px rgba(0,0,0,.7);
    --badge-bg: var(--gold);
    --badge-fg: var(--ink);
    --sel-bg: rgba(201,149,46,.38);
    --scroll-thumb: rgba(248,245,238,.28);
  }
}
:root[data-theme="dark"] {
  --bg: var(--navy);
  --fg: var(--ivory);
  --muted: rgba(248,245,238,.72);
  --surface: #0D2233;
  --surface-2: #12293C;
  --line: rgba(248,245,238,.14);
  --line-strong: rgba(248,245,238,.26);
  --shadow-card:   0 1px 2px rgba(0,0,0,.4), 0 6px 16px -8px rgba(0,0,0,.6);
  --shadow-raised: 0 2px 4px rgba(0,0,0,.45), 0 14px 32px -12px rgba(0,0,0,.7);
  --sel-bg: rgba(201,149,46,.38);
  --scroll-thumb: rgba(248,245,238,.28);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* الجسر بين رموزنا ولوحة ووردبريس: كتلٌ لم نكتبها تتبع الوضع تلقائياً */
body {
  --wp--preset--color--base: var(--bg);
  --wp--preset--color--contrast: var(--fg);
  --wp--preset--color--surface: var(--surface);
  --wp--preset--color--line: var(--line);
  --wp--preset--color--muted: var(--muted);
  background: var(--bg);
  color: var(--fg);
}

/* =========================================================
   أسطح المتصفّح — الأجزاء التي لم نرسمها تحمل التصميم أيضاً
   ========================================================= */
::selection { background: var(--sel-bg); color: var(--fg); }
:where(html) { scrollbar-color: var(--scroll-thumb) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 99px; border: 2px solid var(--bg); }
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:where(input, textarea) { caret-color: var(--gold); }
:where(a) { text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

/* الأرقام في السياق العربي: تبقى غربية ومتساوية العرض حتى تصطفّ الأسعار عمودياً */
.sny-num, .price, .amount, .woocommerce-Price-amount, bdi {
  font-family: Inter, "Noto Sans Arabic", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  direction: ltr;
  unicode-bidi: isolate;
}

/* قياس القراءة: الوصف الطويل لا يتجاوز ٧٥ محرفاً في السطر */
.entry-content > p,
.woocommerce-product-details__short-description p,
.wc-block-product-details p { max-width: 72ch; }

/* الرأس المؤسسي: مسافة فوق العنوان أكثر مما تحته */
:where(h1, h2, h3) { margin-block-start: var(--s8); margin-block-end: var(--s3); }
:where(h1:first-child, h2:first-child, h3:first-child) { margin-block-start: 0; }

/* الحركة: لحظة واحدة مؤلَّفة لا تأثيرات متناثرة */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
