/*
Theme Name: Riydhif
Theme URI: https://example.com/riydhif
Author: Riydhif
Author URI: https://example.com
Description: قالب شخصي بسيط وأنيق، ثنائي الوضع (نهاري/ليلي)، مصمَّم للمصممين ومنتجي الموسيقى وبُناة براندات الملابس. خط ABC Favorit Arabic، تخطيط RTL، فئات ملوّنة، بحث، وترقيم صفحات بالأرقام العربية.
Version: 1.1.4
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: riydhif
Tags: rtl-language-support, custom-logo, featured-images, blog, two-columns, translation-ready, full-width-template
*/

/* ---- Fonts: ABC Favorit Arabic ---- */
@font-face {
  font-family: "Favorit Arabic";
  src: url("assets/fonts/ABCFavoritArabic-Light.otf") format("opentype");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Favorit Arabic";
  src: url("assets/fonts/ABCFavoritArabic-Book.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Favorit Arabic";
  src: url("assets/fonts/ABCFavoritArabic-Medium.otf") format("opentype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Favorit Arabic";
  src: url("assets/fonts/ABCFavoritArabic-Bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---- Tokens ---- */
:root {
  --bg:        #FFFFFF;
  --bg-elev:   #FAFAF8;
  --ink:       #16130D;
  --ink-soft:  #6E6A62;
  --ink-faint: #A7A299;
  --line:      #ECEAE4;
  --line-soft: #F3F2EE;
  --accent:    #D2703F;
  --accent-soft:#E8C8B4;
  --accent-ink:#FFFFFF;

  --maxw: 1120px;
  --radius: 14px;
  --f-display: clamp(2rem, 4.4vw, 3.1rem);
  --logo-filter: none;
  --shadow-card: 0 1px 0 var(--line), 0 18px 40px -28px rgba(40,30,15,.35);
  --ease: cubic-bezier(.22,.61,.36,1);
}

[data-theme="dark"] {
  --bg:        #000000;
  --bg-elev:   #0C0C0C;
  --ink:       #F4F1EA;
  --ink-soft:  #9A968D;
  --ink-faint: #645F57;
  --line:      #232323;
  --line-soft: #181818;
  --accent:    #E08A5C;
  --accent-soft:#311E14;
  --accent-ink:#140D08;
  --logo-filter: invert(1);
  --shadow-card: 0 1px 0 var(--line), 0 22px 48px -30px rgba(0,0,0,.9);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Favorit Arabic", system-ui, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  text-align: right;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .5s var(--ease), color .5s var(--ease);
  letter-spacing: -.01em;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 28px; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* skip link (a11y) */
.skip-link { position: absolute; inset-inline-start: -9999px; }
.skip-link:focus {
  inset-inline-start: 14px; top: 14px; z-index: 99; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px;
}

/* ---- Header ---- */
.topbar { position: relative; padding-top: 30px; }
.topbar-tools {
  position: absolute; top: 26px; inset-inline-end: 28px;
  display: flex; gap: 10px; align-items: center;
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent; color: var(--ink-soft);
  display: grid; place-items: center; transition: .3s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-faint); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.brand {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding-block: 6px 28px; background: none; border: 0; color: inherit; width: 100%;
}
.brand img { height: 92px; width: auto; filter: var(--logo-filter); transition: filter .4s var(--ease); }
.brand .custom-logo { height: 92px; width: auto; filter: var(--logo-filter); }

/* ---- Nav (wp_nav_menu) ---- */
.nav { padding-block: 22px; }
.nav .menu-list {
  display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(24px, 4vw, 52px);
  list-style: none; margin: 0; padding: 0;
}
.nav .menu-list li { margin: 0; }
.nav .menu-list a {
  position: relative; color: var(--ink-soft); font-size: 1.06rem; font-weight: 500;
  padding: 4px 0; transition: color .25s var(--ease); letter-spacing: -.01em; display: inline-block;
}
.nav .menu-list a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -4px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: center; transition: transform .3s var(--ease);
}
.nav .menu-list a:hover { color: var(--ink); }
.nav .menu-list a:hover::after { transform: scaleX(.5); }
.nav .menu-list .current-menu-item > a,
.nav .menu-list .current-cat > a,
.nav .menu-list .current_page_item > a { color: var(--ink); }
.nav .menu-list .current-menu-item > a::after,
.nav .menu-list .current-cat > a::after,
.nav .menu-list .current_page_item > a::after { transform: scaleX(1); }

/* ---- Store button ---- */
.store-cta { display: flex; justify-content: center; padding-block: 24px 2px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 26px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 500; font-size: 1rem; letter-spacing: -.01em;
  border: 1px solid transparent; transition: .3s var(--ease);
  box-shadow: 0 10px 24px -16px var(--accent);
}
.store-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.store-btn svg { flex: 0 0 auto; }

/* ---- Search ---- */
.search-row { padding-block: 30px; display: flex; justify-content: center; }
.search { position: relative; width: 100%; max-width: 720px; }
.search input {
  width: 100%; height: 58px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-elev);
  color: var(--ink); font-family: inherit; font-size: 1.05rem;
  padding-inline: 56px 26px; outline: none; transition: .3s var(--ease);
}
.search input::placeholder { color: var(--ink-faint); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search .s-icon {
  position: absolute; inset-inline-start: 22px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: var(--ink-faint); pointer-events: none;
}

/* ---- Page intro ---- */
.page-intro { padding-block: 18px 8px; max-width: 760px; }
.page-intro .eyebrow {
  font-size: .82rem; letter-spacing: 0;
  color: var(--accent); font-weight: 600; margin-bottom: 14px;
}
.page-intro h1 {
  font-size: var(--f-display); font-weight: 700; line-height: 1.04;
  margin: 0 0 18px; letter-spacing: -.03em; text-wrap: balance;
}
.page-intro p { font-size: 1.12rem; color: var(--ink-soft); margin: 0; max-width: 56ch; }

/* ---- Articles feed ---- */
.feed { padding-block: 16px 40px; }
.article {
  display: grid; grid-template-columns: 1fr 168px; gap: 30px; padding-block: 40px;
}
.article + .article { border-top: 1px solid var(--line); }
.article .date {
  color: var(--ink-faint); font-size: .92rem; letter-spacing: .06em;
  font-feature-settings: "tnum"; direction: ltr;
}
.art-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.art-cat {
  border: 0; background: var(--accent-soft); color: var(--accent);
  font-family: inherit; font-weight: 600; font-size: .78rem; letter-spacing: -.01em;
  padding: 5px 13px; border-radius: 999px; transition: .25s var(--ease);
}
.art-cat:hover { transform: translateY(-1px); }
.article h3 {
  font-size: 1.5rem; font-weight: 700; margin: 0 0 14px; letter-spacing: -.02em;
  transition: color .25s var(--ease); line-height: 1.25; text-wrap: balance;
}
.article h3 a { color: inherit; }
.article:hover h3 { color: var(--accent); }
.article p {
  color: var(--ink-soft); margin: 0 0 16px; font-size: 1.02rem; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.article .more {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent);
  font-weight: 500; font-size: .96rem;
}
.article .more .arr { transition: transform .3s var(--ease); display: inline-block; }
.article:hover .more .arr { transform: translateX(-5px); }
.thumb {
  border-radius: 12px; overflow: hidden; aspect-ratio: 1; align-self: start;
  background: var(--bg-elev); border: 1px solid var(--line); display: block;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { width: 100%; height: 100%; }

/* striped placeholder */
.ph {
  background-image: repeating-linear-gradient(135deg, var(--line-soft) 0 11px, transparent 11px 22px);
  background-color: var(--bg-elev);
  display: grid; place-items: center; position: relative;
}
.ph span {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .68rem; letter-spacing: .06em; color: var(--ink-faint);
  background: var(--bg); padding: 3px 9px; border-radius: 6px; direction: ltr; max-width: 80%;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}

/* ---- Pagination (السابق ١ ٢ ٣ ٤ التالي) ---- */
.pager {
  display: flex; justify-content: center; align-items: center; gap: 12px;
  padding-block: 30px 8px; flex-wrap: wrap;
}
.pager a, .pager > span {
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; color: var(--ink-soft);
  font-size: 1.02rem; font-weight: 500; transition: .25s var(--ease); font-feature-settings: "tnum";
}
.pager a:hover { color: var(--ink); border-color: var(--line); }
.pager .is-active { background: var(--accent); color: var(--accent-ink); border-radius: 12px; }
.pager .nav-btn { color: var(--ink); }
.pager .is-disabled { opacity: .35; }
.pager .ar-arrow { font-size: 1.05em; line-height: 1; }

/* ---- Single / Page content ---- */
.single { padding-block: 12px 50px; }
.single .page-intro { margin-inline: auto; text-align: center; max-width: 840px; }
.single .page-intro .date { justify-content: center; display: flex; }
.hero-img { margin: 26px auto 42px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.hero-img img { width: 100%; display: block; }
.post-body {
  max-width: 720px; margin-inline: auto; font-size: 1.15rem; line-height: 1.85; color: var(--ink);
}
.post-body > * { margin-block: 0 1.3em; }
.post-body h2 { font-size: 1.7rem; font-weight: 700; margin: 1.6em 0 .5em; letter-spacing: -.02em; }
.post-body h3 { font-size: 1.35rem; font-weight: 700; margin: 1.4em 0 .4em; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body img { border-radius: 12px; height: auto; }
.post-body figure { margin-inline: 0; }
.post-body figure img { width: 100%; }
.post-body .wp-caption, .post-body .wp-block-image { max-width: 100%; }
.post-body blockquote {
  border-inline-start: 3px solid var(--accent); margin: 1.4em 0; padding: .2em 1.2em; color: var(--ink-soft);
}
.post-body ul, .post-body ol { padding-inline-start: 1.4em; }
.post-body code, .post-body pre {
  font-family: ui-monospace, Menlo, monospace; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: 8px;
}
.post-body code { padding: 2px 7px; font-size: .9em; }
.post-body pre { padding: 18px 20px; overflow: auto; }

/* ---- Midjourney styles grid (image-first cards + copy button) ---- */
.mj-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px;
  margin-block: 14px 24px;
  /* break out of the 720px reading column, symmetric, capped ~1080px centered */
  margin-inline: calc(50% - 50vw);
  padding-inline: max(28px, calc(50vw - 540px));
}
.mj-card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .3s var(--ease);
}
.mj-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: var(--ink-faint); }
.mj-img { background: var(--bg); line-height: 0; }
.mj-img img { width: 100%; height: auto; display: block; }
.mj-meta { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.mj-code {
  direction: ltr; text-align: left; font-family: ui-monospace, Menlo, monospace;
  font-size: .82rem; line-height: 1.55; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; word-break: break-word; white-space: pre-wrap;
}
.mj-copy {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink);
  font-family: inherit; font-weight: 500; font-size: .92rem; transition: .25s var(--ease);
}
.mj-copy:hover { filter: brightness(1.05); transform: translateY(-1px); }
.mj-copy:active { transform: translateY(0); }
.mj-copy.is-done { background: #1F8A5B; color: #fff; }
.mj-copy svg { width: 16px; height: 16px; flex: 0 0 auto; }
@media (max-width: 600px) {
  .mj-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; padding-inline: 16px; }
  .mj-meta { padding: 10px 11px 12px; gap: 9px; }
  .mj-code { font-size: .72rem; padding: 8px 9px; border-radius: 8px; }
  .mj-copy { height: 38px; font-size: .82rem; gap: 6px; }
  .mj-copy svg { width: 14px; height: 14px; }
}

/* ---- Footer ---- */
.foot { padding-block: 34px 46px; text-align: center; }
.foot .links {
  display: flex; justify-content: center; gap: 26px; flex-wrap: wrap; margin-bottom: 22px;
  list-style: none; padding: 0;
}
.foot .links li { margin: 0; }
.foot .links a { color: var(--ink-soft); font-size: .96rem; transition: color .25s var(--ease); }
.foot .links a:hover { color: var(--accent); }
.foot .copy { color: var(--ink-faint); font-size: .9rem; letter-spacing: .02em; }
.foot .copy .num { font-feature-settings: "tnum"; }

/* ---- Empty states ---- */
.empty { text-align: center; padding: 70px 0; color: var(--ink-soft); }
.empty .big { font-size: 1.3rem; color: var(--ink); font-weight: 700; margin-bottom: 8px; }

/* ---- WP core alignment helpers ---- */
.alignwide { max-width: var(--maxw); }
.alignfull { max-width: none; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, .gallery-caption { color: var(--ink-soft); font-size: .9rem; text-align: center; }
.sticky, .gallery-caption { display: block; }
.bypostauthor { display: block; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; width: 1px;
  overflow: hidden; position: absolute !important; word-wrap: normal !important;
}

/* ---- Responsive ---- */
@media (max-width: 760px) {
  .article { grid-template-columns: 1fr 116px; gap: 20px; }
  .article .thumb { display: block; }
  .article h3 { font-size: 1.3rem; }
  .article p { font-size: .96rem; }
  .brand img, .brand .custom-logo { height: 70px; }
  .topbar-tools { position: static; justify-content: flex-end; padding: 0 28px; margin-bottom: 6px; }
}
@media (max-width: 600px) {
  .nav .menu-list { flex-wrap: wrap; justify-content: center; gap: 18px; }
  .nav .menu-list a { font-size: .92rem; white-space: nowrap; }
}
