/* =====================================================================
   HM STEK Blog — تنسيقات المدونة فوق ملف الموقع الأصلي (site.css)
   كل الألوان والخطوط من متغيرات الموقع: --red / --paper / --charcoal ...
   ===================================================================== */

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
body.admin-bar .nav { top: 32px; }
@media (max-width: 782px) { body.admin-bar .nav { top: 46px; } }

.nav-links a.is-current { color: var(--red); }

/* ---------- Reading progress ---------- */
.hb-progress { position: fixed; top: 0; right: 0; left: 0; height: 3px; z-index: 1100; pointer-events: none; }
.hb-progress span { display: block; height: 100%; width: 0; background: var(--red); transition: width .1s linear; }
body.admin-bar .hb-progress { top: 32px; }

.hb-ico { flex: none; }
html[dir="rtl"] .hb-ico { transform: none; }

/* ---------- Hero ---------- */
.hb-hero { padding-bottom: 64px; }
.hb-hero__inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 40px; }
.hb-hero__text { flex: 1 1 520px; text-align: right; }
.hb-hero .breadcrumb { justify-content: flex-start; }
.hb-hero p { margin-right: 0; }
.hb-hero .eyebrow { margin-bottom: 10px; font-weight: 700; }
.hb-hero h1 { margin-bottom: 14px; line-height: 1.3; }
.hb-hero p { line-height: 1.85; }

/* ---------- Search ---------- */
.hb-search { position: relative; flex: 0 1 400px; width: 100%; }
.hb-search__label { display: block; margin-bottom: 8px; font-size: .9rem; color: var(--mute); }
.hb-search__box {
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 0 18px 0 6px;
  background: var(--charcoal-2);
  border: 1px solid rgba(244, 242, 238, .1);
  border-radius: 50px;
  transition: border-color .25s var(--ease);
}
.hb-search__box:focus-within { border-color: var(--red); }
.hb-search__box > .hb-ico { color: var(--mute); }
.hb-search__box input {
  flex: 1; min-width: 0; min-height: 50px;
  background: transparent; border: 0; outline: 0;
  color: var(--paper); font: inherit; font-size: .95rem;
}
.hb-search__box input::placeholder { color: var(--mute-2); }
.hb-search__box input::-webkit-search-cancel-button { filter: invert(1); }
.hb-search__go {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  transition: background .25s;
}
.hb-search__go:hover { background: #ff2c30; }
.hb-search__results {
  position: absolute; top: calc(100% + 8px); right: 0; left: 0; z-index: 50;
  background: var(--charcoal-2);
  border: 1px solid rgba(244, 242, 238, .1);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  padding: 8px; max-height: 420px; overflow-y: auto;
}
.hb-search__results a {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  color: var(--paper);
}
.hb-search__results a:hover,
.hb-search__results a:focus-visible,
.hb-search__results a.is-active { background: rgba(244, 242, 238, .06); outline: none; }
.hb-search__results b { font-family: var(--font-head); font-weight: 700; font-size: .98rem; line-height: 1.5; }
.hb-search__results small { color: var(--mute); font-size: .8rem; }
.hb-search__results small em { color: var(--red-text, #ff4d55); font-style: normal; }
.hb-search__results mark { background: transparent; color: var(--red-text, #ff4d55); }
.hb-search__results .hb-search__all { flex-direction: row; justify-content: center; color: var(--red-text, #ff4d55); font-weight: 700; border-top: 1px solid rgba(244, 242, 238, .07); border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 4px; }
.hb-search__empty { padding: 14px; color: var(--mute); font-size: .9rem; text-align: center; }

/* ---------- Layout ---------- */
.hb-wrap { padding-top: 56px; display: flex; flex-direction: column; gap: 64px; }

/* ---------- Tags / chips ---------- */
.hb-tag {
  display: inline-flex; align-items: center;
  padding: 5px 14px; border-radius: 50px;
  font-family: var(--font-head); font-weight: 700; font-size: .82rem;
  background: var(--charcoal-2); color: var(--paper);
  border: 1px solid rgba(244, 242, 238, .1);
}
.hb-tag--over { position: absolute; top: 14px; right: 14px; z-index: 1; background: rgba(10, 10, 11, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hb-tag--red { position: absolute; top: 20px; right: 20px; z-index: 1; background: var(--red); border-color: var(--red); color: #fff; }

.hb-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.hb-chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border-radius: 50px; border: 1.5px solid rgba(244, 242, 238, .18);
  font-family: var(--font-head); font-weight: 700; font-size: .9rem; color: var(--paper);
  transition: all .25s var(--ease);
}
.hb-chip:hover { border-color: var(--red); color: var(--red); }
.hb-chip.is-active { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Meta ---------- */
.hb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: .88rem; color: var(--mute); }
.hb-meta--center { justify-content: center; }
.hb-author { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); }
.hb-avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--charcoal-2); border: 1px solid rgba(228, 31, 38, .5); color: var(--red-text, #ff4d55); font-family: var(--font-head); font-weight: 800; font-size: .85rem; }
.hb-more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--red-text, #ff4d55); font-family: var(--font-head); font-weight: 700; }
.hb-more:hover { color: var(--paper); }

/* ---------- Featured ---------- */
.hb-featured {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  background: var(--charcoal); border: 1px solid rgba(244, 242, 238, .08);
  border-radius: calc(var(--radius) + 4px); overflow: hidden;
  transition: border-color .3s var(--ease);
}
.hb-featured:hover { border-color: rgba(228, 31, 38, .45); }
.hb-featured__media { position: relative; min-height: 380px; background: var(--charcoal-2); overflow: hidden; }
.hb-featured__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.hb-featured:hover .hb-featured__media img { transform: scale(1.04); }
.hb-featured__body { padding: clamp(28px, 4vw, 52px); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.hb-featured__title { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); line-height: 1.4; }
.hb-featured__title a:hover { color: var(--red); }
.hb-featured__body > p { color: var(--mute); line-height: 1.9; }
.hb-featured__btn { align-self: flex-start; }

/* ---------- List ---------- */
.hb-list { display: flex; flex-direction: column; gap: 28px; }
.hb-list__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.hb-list__head h2 { font-size: clamp(1.4rem, 1.1rem + 1.25vw, 2rem); }
.hb-count { color: var(--mute); font-size: .9rem; }

.hb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.hb-card {
  display: flex; flex-direction: column;
  background: var(--charcoal); border: 1px solid rgba(244, 242, 238, .08);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease);
}
.hb-card:hover { transform: translateY(-4px); border-color: rgba(228, 31, 38, .45); }
.hb-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--charcoal-2); overflow: hidden; display: block; }
.hb-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.hb-card:hover .hb-card__media img { transform: scale(1.05); }
.hb-card__body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 8px; }
.hb-card__title { font-size: 1.15rem; line-height: 1.6; font-weight: 800; }
.hb-card__title a:hover { color: var(--red); }
.hb-card__excerpt { flex: 1; color: var(--mute); font-size: .93rem; line-height: 1.85; }
.hb-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; border-top: 1px solid rgba(244, 242, 238, .07); font-size: .84rem; color: var(--mute); }

/* ---------- Pagination ---------- */
.hb-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 12px; }
.hb-pagination .page-numbers {
  min-width: 46px; height: 46px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50px; border: 1.5px solid rgba(244, 242, 238, .18);
  font-family: var(--font-head); font-weight: 700; color: var(--paper);
  transition: all .25s var(--ease);
}
.hb-pagination a.page-numbers:hover { border-color: var(--red); color: var(--red); }
.hb-pagination .page-numbers.current { background: var(--red); border-color: var(--red); color: #fff; }
.hb-pagination .page-numbers.dots { border-color: transparent; }

/* ---------- Empty ---------- */
.hb-empty { text-align: center; padding: 56px 24px; background: var(--charcoal); border: 1px solid rgba(244, 242, 238, .08); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hb-empty p { color: var(--mute); }

/* ---------- CTA band ---------- */
.hb-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(244, 242, 238, .08);
  background-color: var(--charcoal);
  background-image: radial-gradient(ellipse 600px 300px at 0% 100%, rgba(228, 31, 38, .16), transparent 70%);
}
.hb-cta__text { flex: 1 1 380px; }
.hb-cta__text h2 { font-size: clamp(1.4rem, 1.1rem + 1.25vw, 2rem); margin-bottom: 10px; }
.hb-cta__text p { color: var(--mute); line-height: 1.85; }
.hb-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hb-cta__newsletter { flex: 1 1 100%; }

/* ---------- Single: hero ---------- */
.hb-post-hero { padding-bottom: 48px; text-align: center; }
.hb-post-hero__inner { max-width: 900px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hb-post-hero .breadcrumb { margin-bottom: 0; flex-wrap: wrap; justify-content: center; }
.hb-post-hero h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.4; }
.hb-post-hero__lead { color: var(--mute); font-size: 1.08rem; line-height: 1.9; max-width: 720px !important; }
.hb-post-hero .hb-tag { color: var(--red-text, #ff4d55); }

.hb-cover { margin: 0 0 56px; border-radius: calc(var(--radius) + 4px); overflow: hidden; aspect-ratio: 21 / 9; background: var(--charcoal-2); border: 1px solid rgba(244, 242, 238, .08); }
.hb-cover img { width: 100%; height: 100%; object-fit: cover; }

.hb-post { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 4vw, 56px); align-items: start; }
.hb-post__main { min-width: 0; max-width: 780px; }
.hb-post__side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: calc(var(--nav-height) + 24px); }

/* ---------- TOC ---------- */
.hb-toc { background: var(--charcoal); border: 1px solid rgba(244, 242, 238, .08); border-radius: var(--radius); padding: 22px 20px; }
.hb-toc__title { font-size: 1rem; margin-bottom: 12px; }
.hb-toc__list { list-style: none; display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.hb-toc__list a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--mute); font-size: .9rem; line-height: 1.55; border-right: 2px solid transparent; transition: all .2s; }
.hb-toc__item--h3 a { padding-right: 26px; font-size: .85rem; }
.hb-toc__list a:hover { background: rgba(244, 242, 238, .05); color: var(--paper); }
.hb-toc__list a.is-active { color: var(--paper); background: rgba(228, 31, 38, .08); border-right-color: var(--red); }
.hb-toc--mobile { display: none; margin-bottom: 28px; }
.hb-toc--mobile summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; min-height: 28px; font-family: var(--font-head); font-weight: 800; }
.hb-toc--mobile summary::-webkit-details-marker { display: none; }
.hb-toc--mobile[open] summary { margin-bottom: 12px; }

/* ---------- Service card + share ---------- */
.hb-service { background: var(--charcoal); border: 1px solid rgba(244, 242, 238, .08); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.hb-service h2 { font-size: 1.25rem; line-height: 1.5; }
.hb-service p { color: var(--mute); font-size: .9rem; margin-bottom: 6px; }
.hb-share > span { display: block; color: var(--mute); font-size: .9rem; margin-bottom: 10px; }
.hb-share > div { display: flex; gap: 10px; }
.hb-share a, .hb-share button {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(244, 242, 238, .18); color: var(--paper);
  transition: all .25s var(--ease); position: relative;
}
.hb-share a:hover, .hb-share button:hover { border-color: var(--red); color: var(--red); }
.hb-share button.is-copied::after {
  content: attr(data-msg); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; background: var(--paper); color: var(--ink); font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 6px;
}

/* ---------- Article content (Gutenberg) ---------- */
.hb-content { font-size: 1.08rem; line-height: 2; color: #dcdad5; }
.hb-content > * + * { margin-top: 1.2em; }
.hb-content h2, .hb-content h3, .hb-content h4 { color: var(--paper); line-height: 1.5; scroll-margin-top: calc(var(--nav-height) + 28px); }
.hb-content h2 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem); margin-top: 1.9em; }
.hb-content h3 { font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem); margin-top: 1.6em; }
.hb-content h4 { font-size: 1.1rem; margin-top: 1.4em; }
.hb-content a { color: var(--red-text, #ff4d55); text-decoration: underline; text-underline-offset: 4px; }
.hb-content a:hover { color: var(--paper); }
.hb-content strong { color: var(--paper); }
.hb-content ul, .hb-content ol { padding-right: 1.4em; }
.hb-content ul { list-style: disc; }
.hb-content ol { list-style: decimal; }
.hb-content li + li { margin-top: .45em; }
.hb-content li::marker { color: var(--red); }
.hb-content img { max-width: 100%; height: auto; border-radius: var(--radius); }
.hb-content figure { margin-right: 0; margin-left: 0; }
.hb-content figcaption { text-align: center; color: var(--mute); font-size: .88rem; margin-top: 10px; }
.hb-content blockquote, .hb-content .wp-block-quote, .hb-content .wp-block-pullquote {
  background: var(--charcoal); border: 1px solid rgba(244, 242, 238, .08); border-radius: var(--radius);
  padding: 26px 30px; color: var(--paper); font-size: 1.18rem; line-height: 1.85; font-weight: 500;
  position: relative;
}
.hb-content blockquote::before { content: "”"; position: absolute; top: -6px; right: 18px; font-family: var(--font-head); font-size: 4rem; color: var(--red); line-height: 1; }
.hb-content blockquote p { margin: 0; padding-top: 14px; }
.hb-content blockquote cite { display: block; margin-top: 10px; font-size: .9rem; color: var(--mute); font-style: normal; }
.hb-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hb-content .wp-block-table { overflow-x: auto; }
.hb-content th, .hb-content td { padding: 12px 14px; border: 1px solid rgba(244, 242, 238, .1); text-align: right; }
.hb-content th { background: var(--charcoal-2); font-family: var(--font-head); color: var(--paper); }
.hb-content hr { border: 0; border-top: 1px solid rgba(244, 242, 238, .1); }
.hb-content code { background: var(--charcoal-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.hb-content details, .hb-content .wp-block-details {
  background: var(--charcoal); border: 1px solid rgba(244, 242, 238, .08); border-radius: 14px; padding: 6px 22px;
}
.hb-content details + details { margin-top: 12px; }
.hb-content summary { cursor: pointer; padding: 14px 0; font-family: var(--font-head); font-weight: 700; color: var(--paper); font-size: 1.02rem; }
.hb-content details[open] summary { color: var(--red-text, #ff4d55); }
.hb-content details > :not(summary) { color: var(--mute); padding-bottom: 14px; }
.hb-content .wp-block-button__link { background: var(--red); color: #fff; border-radius: 50px; text-decoration: none; font-family: var(--font-head); font-weight: 700; padding: 13px 30px; }
.hb-content .has-stek-red-color { color: var(--red) !important; }
.hb-content .has-stek-red-background-color { background-color: var(--red) !important; }
.hb-content .has-paper-color { color: var(--paper) !important; }
.hb-content .has-charcoal-background-color { background-color: var(--charcoal) !important; }
.hb-content .alignwide { margin-right: -60px; margin-left: -60px; max-width: none; }
.hb-content--page { max-width: 820px; }

.hb-inline-cta {
  margin-top: 48px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  padding: 26px 30px; border-radius: var(--radius);
  background: var(--red-soft); border: 1px solid rgba(228, 31, 38, .4);
}
.hb-inline-cta div { display: flex; flex-direction: column; gap: 4px; }
.hb-inline-cta strong { font-family: var(--font-head); font-size: 1.2rem; }
.hb-inline-cta span { color: var(--mute); font-size: .95rem; }

.hb-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(244, 242, 238, .07); }
.hb-tags span { color: var(--mute); font-size: .9rem; }
.hb-tags a { padding: 6px 14px; border-radius: 50px; border: 1px solid rgba(244, 242, 238, .14); font-size: .88rem; }
.hb-tags a:hover { border-color: var(--red); color: var(--red); }

.hb-related { padding: 88px 0 0; display: flex; flex-direction: column; gap: 28px; }

/* ---------- Search results ---------- */
.hb-results { display: flex; flex-direction: column; gap: 18px; }
.hb-result {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: center;
  background: var(--charcoal); border: 1px solid rgba(244, 242, 238, .08); border-radius: var(--radius);
  padding: 14px; transition: border-color .3s var(--ease);
}
.hb-result:hover { border-color: rgba(228, 31, 38, .45); }
.hb-result__media { aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; background: var(--charcoal-2); }
.hb-result__media img { width: 100%; height: 100%; object-fit: cover; }
.hb-result__body { display: flex; flex-direction: column; gap: 8px; padding-left: 10px; }
.hb-result__body h2 { font-size: 1.25rem; line-height: 1.55; }
.hb-result__body h2 a:hover { color: var(--red); }
.hb-result__body p { color: var(--mute); font-size: .93rem; line-height: 1.8; }
.hb-result__match span { color: var(--red-text, #ff4d55); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hb-post { grid-template-columns: minmax(0, 1fr) 280px; }
  .hb-content .alignwide { margin-right: 0; margin-left: 0; }
}
@media (max-width: 980px) {
  .hb-featured { grid-template-columns: 1fr; }
  .hb-featured__media { min-height: 0; aspect-ratio: 16 / 10; }
  .hb-post { grid-template-columns: 1fr; }
  .hb-post__main { max-width: none; }
  .hb-post__side { position: static; }
  .hb-toc--side { display: none; }
  .hb-toc--mobile { display: block; }
  .hb-cover { aspect-ratio: 16 / 9; margin-bottom: 36px; }
}
@media (max-width: 640px) {
  .hb-hero { padding-bottom: 40px; }
  .hb-search { flex-basis: 100%; }
  .hb-wrap { padding-top: 36px; gap: 48px; }
  .hb-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0; padding: 0 0 6px; scrollbar-width: none; }
  .hb-chips::-webkit-scrollbar { display: none; }
  .hb-chip { flex: none; }
  .hb-grid { grid-template-columns: 1fr; gap: 20px; }
  .hb-result { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 10px; }
  .hb-result__body h2 { font-size: 1.02rem; }
  .hb-result__body > p:not(.hb-result__match) { display: none; }
  .hb-content { font-size: 1.02rem; }
  .hb-cta__actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .hb-card, .hb-card__media img, .hb-featured__media img { transition: none; }
}
