/* Extracted from blogecss/app.css and adapted for Bootstrap project */

/* Brand variables */
:root {
  /* Identity colors */
  --color-black: #172526; /* الأسود */
  --color-beige: #FCF9F5; /* البيج */
  --color-orange: #E75724; /* البرتقالي الأساسي */
  --color-turquoise: #76C4CB; /* التركوازي */
  --color-green: #28B16F; /* الأخضر */
  --color-white: #FCF9F4; /* الأبيض */

  /* Text tokens */
  --Neutral-950: #0E121B;
  --Netural-950: #0E121B; /* alias */
  --text-strong-950: #0E121B;

  /* Sans family fallback (moved from @theme) */
  --font-sans: 'Somar Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

/* Load Somar Sans */
@font-face { font-family: 'Somar Sans'; src: url('https://cdn.wdeftksa.com/sa/newidentity/font/SomarSans/SomarSans-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Somar Sans'; src: url('https://cdn.wdeftksa.com/sa/newidentity/font/SomarSans/SomarSans-Medium.woff2') format('woff2');  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Somar Sans'; src: url('https://cdn.wdeftksa.com/sa/newidentity/font/SomarSans/SomarSans-Bold.woff2')    format('woff2');  font-weight: 700; font-style: normal; font-display: swap; }

/* Base */
html[dir="rtl"] body { text-align: right; }
html[dir="ltr"] body { text-align: left; }
body { background-color: var(--color-beige); color: var(--text-strong-950); font-family: var(--font-sans); }

/* Scoped Blog overrides for higher specificity */
.blog-scope h1 { color: var(--Neutral-950); font-family: 'Somar Sans', var(--font-sans); font-size: 22px; font-weight: 700; line-height: normal; }
.blog-scope h2 { color: var(--text-strong-950); font-family: 'Somar Sans', var(--font-sans); font-size: 22px; font-weight: 700; line-height: normal; }
.blog-scope h3 { color: var(--Netural-950, #0E121B); font-family: 'Somar Sans', var(--font-sans); font-size: 19px; font-weight: 500; line-height: normal; font-synthesis: none; }

/* Apply same heading design globally on blog pages */
h1 { color: var(--Neutral-950); font-family: 'Somar Sans', var(--font-sans); font-size: 22px; font-weight: 700; line-height: normal; }
h2 { color: var(--text-strong-950); font-family: 'Somar Sans', var(--font-sans); font-size: 22px; font-weight: 700; line-height: normal; }
h3 { color: var(--Netural-950, #0E121B); font-family: 'Somar Sans', var(--font-sans); font-size: 19px; font-weight: 500; line-height: normal; font-synthesis: none; }

/* Card styling to match design */
.blog-card { background:#fff; border:1px solid rgba(0,0,0,.06); border-radius:14px; box-shadow:0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06); overflow: hidden; }
.blog-card .card-img-top { border-bottom: 1px solid rgba(0,0,0,.04); object-fit: cover; width: 100%; display:block; aspect-ratio: 64/27; height: auto; }
.blog-card .card-body { padding: 1rem; display:flex; flex-direction: column; }
.blog-card .card-body .h6, .blog-card .card-body h3 { font-family: 'Somar Sans', var(--font-sans); font-weight: 700; }
/* Ensure blog card titles are black per identity */
.blog-card .card-body h3 a,
.blog-card .card-body .h6 a,
.blog-card .title-clamp a {
  color: var(--Neutral-950) !important;
  text-decoration: none;
}
.blog-card .card-body h3 a:hover,
.blog-card .card-body .h6 a:hover,
.blog-card .title-clamp a:hover {
  color: var(--Neutral-950) !important;
  text-decoration: underline;
}
.blog-card .card-body p { color: #374151; }
.blog-card .meta { color: var(--Neutral-950); font-size: 10px; display:flex; align-items:center; flex-wrap: wrap; }
.blog-card .meta > * + * { display: inline-flex; align-items: center; }
.blog-card .meta > * + *::before { content: '•'; color: #9ca3af; margin-inline: .35rem; }

/* Grid tuning: gutters and rhythm */
.blog-grid { --bs-gutter-x: 1rem; --bs-gutter-y: 1.1rem; }
@media (min-width: 576px) { .blog-grid { --bs-gutter-x: 1.1rem; --bs-gutter-y: 1.2rem; } }
@media (min-width: 992px) { .blog-grid { --bs-gutter-x: 1.25rem; --bs-gutter-y: 1.25rem; } }

/* Clamp title and excerpt */
.blog-card .title-clamp { display:-webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow:hidden; min-height: 2.6em; }
.blog-card .excerpt-clamp { display:-webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow:hidden; min-height: 3.9em; }

/* Compact badges */
.blog-card .badge { padding: .2rem .45rem; font-size: 10px; line-height: 1; border-radius: .5rem; }

/* Hover polish */
.blog-card { transition: box-shadow .2s ease, transform .2s ease; margin-bottom: 16px; }
.blog-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 10px 28px rgba(0,0,0,0.08); transform: translateY(-3px); }
.blog-card:hover .card-img-top { filter: brightness(0.98); }
@media (prefers-reduced-motion: reduce) { .blog-card, .blog-card .card-img-top { transition: none !important; transform: none !important; } }

/* Post (show) hero image constraints */
.post-hero { border-radius: 14px; overflow: hidden; background:#fff; border:1px solid rgba(0,0,0,.06); }
.post-hero img { display:block; width: 100%; height: auto; aspect-ratio: 64/27; object-fit: cover; }
@media (min-width: 576px) { .post-hero img { aspect-ratio: 64/27; } }
@media (min-width: 992px) { .post-hero img { aspect-ratio: 64/27; } }

/* Hero section */
.blog-hero { background:#fff; border:1px solid rgba(0,0,0,.06); border-radius:16px; box-shadow:0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06); padding: 1rem; }
@media (min-width: 768px) { .blog-hero { padding: 1.5rem; } }
.blog-chip { display:inline-flex; align-items:center; gap:.4rem; padding:.35rem .7rem; border-radius:9999px; background: var(--color-beige); border:1px solid rgba(0,0,0,.08); font-size:.82rem; }
.blog-chip-dot { width:.5rem; height:.5rem; background: var(--color-orange); border-radius:50%; display:inline-block; }
.blog-chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem .5rem; align-items: center; }
.blog-chip-item { list-style: none; display: inline-flex; }

/* Meta row */
.blog-meta { color:#6b7280; font-size:.85rem; display: flex; align-items: center; flex-wrap: wrap; }
.blog-meta > * + * { display: inline-flex; align-items: center; }
.blog-meta > * + *::before { content: '•'; color: #9ca3af; margin-inline: .35rem; }

/* Share buttons (already present; reinforce spacing) */
.share-buttons { margin-top: .75rem; }

/* Author box tweaks */
.author-box { margin-top: 1rem; }

/* Headings */
h1 { color: var(--Neutral-950); font-family: 'Somar Sans', var(--font-sans); font-size: 22px; font-weight: 700; line-height: normal; }
h2 { color: var(--text-strong-950); font-family: 'Somar Sans', var(--font-sans); font-size: 22px; font-weight: 700; line-height: normal; }
h3 { color: var(--Netural-950, #0E121B); font-family: 'Somar Sans', var(--font-sans); font-size: 19px; font-weight: 500; line-height: normal; font-synthesis: none; }

/* Article content */
.post-content { color: var(--Netural-950, #0E121B); font-family: 'Somar Sans', var(--font-sans); font-size: var(--post-font-size, 16px); font-weight: 500; line-height: var(--post-line-height, 1.9); background: #fff; padding: 1.25rem; border-radius: 14px; border:1px solid rgba(0,0,0,.06); box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.post-content.post-size-small  { --post-font-size: 15px; --post-line-height: 1.85; }
.post-content.post-size-normal { --post-font-size: 16px; --post-line-height: 1.9; }
.post-content.post-size-large  { --post-font-size: 18px; --post-line-height: 2; }

/* Post toolbar */
.post-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.5rem .75rem; background:#ffffffcc; border:1px solid rgba(0,0,0,.06); border-radius:12px; }
.post-toolbar .controls button { padding:.35rem .6rem; border:1px solid rgba(0,0,0,.12); background:#fff; border-radius:8px; font-family:'Somar Sans', var(--font-sans); font-size:14px; }
.post-toolbar .controls button[aria-pressed="true"] { background: var(--color-beige); border-color: rgba(0,0,0,.2); }

/* Author box */
.author-box { display:grid; grid-template-columns: 48px 1fr; gap:.75rem; padding:.9rem 1rem; background:#fff; border:1px solid rgba(0,0,0,.06); border-radius:12px; }
.author-avatar { width:48px; height:48px; border-radius:9999px; display:inline-flex; align-items:center; justify-content:center; background: var(--color-turquoise); color: var(--color-black); font-weight:700; }
.author-meta { font-size:14px; color:#374151; }
.author-name { font-weight:700; color: var(--Netural-950); }

/* Share buttons */
.share-buttons { display:flex; align-items:center; gap:.35rem; flex-wrap:wrap; }
.share-buttons a { display:inline-flex; align-items:center; gap:.25rem; padding:.25rem .45rem; border:1px solid var(--color-orange); border-radius:8px; background: var(--color-orange); color:#fff; font-size:11px; line-height:1; }
.share-buttons a:hover { filter: brightness(0.95); color:#fff; }
.share-buttons svg { width:12px; height:12px; }

/* Utilities */
.text-brand { color: var(--Neutral-950); }
.bg-brand { background-color: var(--color-beige); }
.btn-primary { background-color: var(--color-orange); color:#fff; }
.badge-turquoise { background-color: var(--color-turquoise); color: var(--color-black); }
.badge-green { background-color: var(--color-green); color:#fff; }
.font-brand { font-family: 'Somar Sans', var(--font-sans); }
.font-brand-condensed { font-family: 'Somar Sans Condensed', 'Somar Sans', var(--font-sans); }
.heading-3 { color: var(--Netural-950, #0E121B); text-align: right; font-family: 'Somar Sans', var(--font-sans); font-size: 19px; font-weight: 500; line-height: normal; font-synthesis: none; }
.ar-large-body-bold { color: var(--Netural-950, #0E121B); text-align: right; font-family: 'Somar Sans', var(--font-sans); font-size: 16px; font-weight: 700; line-height: normal; }
.typo-semi-19 { color: var(--Netural-950, #0E121B); text-align: right; font-family: 'Somar Sans', var(--font-sans); font-size: 19px; font-weight: 500; line-height: normal; }

/* Typography inside post-content */
.post-content h2 { margin: 1.25rem 0 .5rem; font-weight:700; font-size: 1.25rem; }
.post-content h3 { margin: 1rem 0 .5rem; font-weight:600; font-size: 1.1rem; }
.post-content p { margin: .75rem 0; }
.post-content ul, .post-content ol { padding-inline-start: 1.25rem; margin: .75rem 0; }
.post-content li { margin: .35rem 0; }
.post-content blockquote { margin: 1rem 0; padding: .75rem 1rem; border-inline-start: 4px solid var(--color-turquoise); background:#fff; border-radius: 10px; }
.post-content pre { background:#0f172a; color:#e2e8f0; padding: .75rem 1rem; border-radius: 10px; overflow:auto; }
.post-content code { background: rgba(0,0,0,.05); padding: .1rem .3rem; border-radius: 4px; }
.post-content img { max-width: 100%; height: auto; border-radius: 10px; }
.post-content table { width:100%; border-collapse: collapse; margin: 1rem 0; }
.post-content th, .post-content td { border:1px solid rgba(0,0,0,.08); padding:.5rem .6rem; }

/* Table of contents (new) */
.toc-card { background:#fff; border:1px solid rgba(0,0,0,.06); border-radius: 14px; padding: .9rem 1rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.toc-head { display:flex; align-items:center; gap:.5rem; margin-bottom: .5rem; }
.toc-head .dot { width:.5rem; height:.5rem; background: var(--color-orange); border-radius: 50%; display:inline-block; }
.toc-head .title { font-weight:700; font-size: 1rem; }
.toc-body ul { list-style: none; padding: 0; margin: 0; }
.toc-body li { margin: .3rem 0; }
.toc-body a { color: var(--Neutral-950); text-decoration: none; }
.toc-body a:hover { text-decoration: underline; }

/* Toolbar and progress */
.post-toolbar { margin: .75rem 0; }
# Reduce controls size for a more compact look
.post-toolbar .controls { display: inline-flex; align-items: center; gap: .25rem; }
.post-toolbar .controls button {
  font-size: 12px;
  padding: .25rem .55rem;
  line-height: 1;
  border-radius: 6px;
  background: var(--color-orange);
  color: #fff;
  border: 1px solid var(--color-orange);
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.post-toolbar .controls button:hover { background: #cf471f; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.post-toolbar .controls button:active { transform: translateY(1px); }
#readingProgress { position: fixed; top: 0; inset-inline: 0; height: 3px; background: linear-gradient(90deg, var(--color-orange), var(--color-turquoise)); width: 0%; z-index: 1000; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* Prev/Next navigation */
.post-nav { display:flex; justify-content: space-between; gap: .75rem; margin-top: 1.25rem; }
.post-nav a { flex: 1 1 0; display:block; background:#fff; border:1px solid rgba(0,0,0,.06); border-radius: 10px; padding: .75rem .9rem; color: var(--Neutral-950); text-decoration: none; }
.post-nav a:hover { background: var(--color-beige); }

/* Suggested list */
.suggest-list { list-style:none; padding:0; margin:0; }
.suggest-list li { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.5rem .75rem; border:1px solid rgba(0,0,0,.06); border-radius:10px; background:#fff; }
.suggest-list li + li { margin-top:.5rem; }
.suggest-list a { color: var(--Neutral-950); text-decoration:none; font-size:.95rem; }
.suggest-list a:hover { text-decoration:underline; }
.suggest-list .date { color:#6b7280; font-size:.8rem; }

/* Blog breadcrumbs (custom names to avoid conflicts) */
.blog-breadcrumbs { margin-bottom: .5rem; }
.blog-breadcrumbs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.blog-breadcrumbs-item { color: #6b7280; font-size: .85rem; }
.blog-breadcrumbs-item a { color: var(--Neutral-950); text-decoration: none; }
.blog-breadcrumbs-item a:hover { text-decoration: underline; }
.blog-breadcrumbs-item + .blog-breadcrumbs-item::before { content: '/'; color: #9ca3af; margin-inline: .25rem; }

/* Category badge brand color */
.blog-card .meta a.badge,
.blog-meta a.badge {
  background: var(--color-turquoise) !important;
  color: var(--color-black) !important;
  border-color: var(--color-turquoise) !important;
  border-radius: 7px !important;
}
.blog-card .meta a.badge:hover,
.blog-meta a.badge:hover { filter: brightness(.95); text-decoration: none; }

/* Utilities */
.mb-13 { margin-bottom: 13px !important; }
.share-buttons { margin-bottom: 12px; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.author-box { margin-bottom: 13px; }
