/* ==========================================================================
   momenmedhat.com — site.css  (blog index, articles, legal pages, 404)
   Recreates the original inner-page theme: navy canvas, floating header with the
   gold social block, gold accents, Roboto + display faces (Agbalumo / Akaya Kanadaka / Rochester).
   ========================================================================== */

body.site {
  display: flex; flex-direction: column;
  background: var(--site-bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.6;
}
.site main { flex: 1 0 auto; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.wrap--wide { width: min(1360px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: relative; z-index: var(--z-nav);
  display: grid; grid-template-columns: 110px 1fr auto 392px;
  width: min(1120px, 100% - 32px); margin: 10px auto 20px;
  box-shadow: 0 4px 10px #000; border-radius: 0 15px 15px 0;
}
.site-header > * { background: var(--site-panel); }
.brand { display: grid; place-items: center; padding: 14px 0; }
.brand img { width: 56px; height: auto; }
.site-nav { display: flex; align-items: center; padding-inline: 20px; }
.site-nav ul { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; }
.site-nav a {
  display: block; padding: 10px 20px; color: var(--gold); text-decoration: none;
  font-weight: 600; font-size: 16px; line-height: 20px; text-transform: uppercase; letter-spacing: .01em;
  transition: color var(--dur);
}
:lang(ar) .site-nav a { text-transform: none; font-weight: 500; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--gold); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.site-lang { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 60px 8px 20px; font-family: var(--font-ar); }
[dir="rtl"] .site-lang { padding: 8px 20px 8px 60px; }
.site-lang a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 16px; line-height: 26px; opacity: .8; }
.site-lang a:hover, .site-lang a[aria-current="true"] { opacity: 1; }
.site-lang img { width: 18px; height: 12px; }
.site-social { display: flex; align-items: center; justify-content: center; background: var(--gold) !important; border-radius: 0 15px 15px 0; padding: 10px 16px; }
[dir="rtl"] .site-social { border-radius: 15px 0 0 15px; }
[dir="rtl"] .site-header { border-radius: 15px 0 0 15px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; list-style: none; padding: 0; margin: 0; }
.chips a {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--site-bg); color: var(--gold); border-radius: 0 0 15px 0;
  transition: background-color var(--dur), color var(--dur);
}
[dir="rtl"] .chips a { border-radius: 0 0 0 15px; }
.chips a:hover { background: #0e1016; color: #fff; }
.chips .icon { width: 17px; height: 17px; }
.menu-btn { display: none; }

@media (max-width: 960px) {
  .site-header { grid-template-columns: auto 1fr auto auto; border-radius: 0; margin-bottom: 14px; }
  [dir="rtl"] .site-header { border-radius: 0; }
  .brand { padding: 10px 14px; }
  .brand img { width: 44px; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; padding: 0; }
  .site-nav ul { flex-direction: column; width: 100%; gap: 0; padding: 6px 0 10px; }
  .site-nav a { padding: 12px 20px; }
  .js .site-nav { display: none; }
  .js .site-header.is-open .site-nav { display: flex; }
  .site-lang { padding: 6px 12px; grid-column: 3; }
  [dir="rtl"] .site-lang { padding: 6px 12px; }
  .site-lang a { font-size: 14px; line-height: 22px; }
  .menu-btn {
    display: grid; place-items: center; grid-column: 4; width: 52px; min-height: 52px; border: 0;
    background: var(--gold) !important; color: var(--on-gold);
  }
  .menu-btn .icon { width: 24px; height: 24px; }
  .menu-btn .icon-close { display: none; }
  .is-open .menu-btn .icon-menu { display: none; }
  .is-open .menu-btn .icon-close { display: block; }
  .site-social { grid-column: 1 / -1; grid-row: 3; border-radius: 0 !important; padding: 8px; }
}

/* ---------- footer ---------- */
.site-footer { margin-top: 64px; background: var(--site-footer); }
.site-footer__grid { display: grid; grid-template-columns: auto 1fr 1fr 432px; align-items: center; gap: 40px; padding: 40px 0 40px 60px; }
[dir="rtl"] .site-footer__grid { padding: 40px 60px 40px 0; }
.site-footer__logo img { width: 98px; height: auto; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-nav a { color: var(--gold); text-decoration: none; font-size: 16px; line-height: 28px; text-transform: uppercase; transition: color var(--dur); }
:lang(ar) .footer-nav a { text-transform: none; }
.footer-nav a:hover, .footer-nav a[aria-current="page"] { color: var(--text); }
.footer-mail { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-size: 16px; }
.footer-mail .icon { width: 20px; height: 20px; color: var(--gold); }
.footer-mail:hover span { color: var(--gold); }
.follow { align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 34px 20px; background: var(--gold); border-radius: 30px 0 0 30px; color: var(--site-bg); }
[dir="rtl"] .follow { border-radius: 0 30px 30px 0; }
.follow__title { font-family: var(--font-sign); font-size: 28px; line-height: 1.2; font-weight: 400; }
.follow .chips a { width: 40px; height: 40px; }
.follow .chips .icon { width: 19px; height: 19px; }
.site-footer__legal { padding: 14px 16px 18px; border-top: 1px solid rgb(255 255 255 / 6%); color: var(--muted-2); font-size: 13px; text-align: center; }
.site-footer__legal p + p { margin-top: 4px; }
.site-footer__legal a { color: inherit; }

@media (max-width: 1100px) {
  .site-footer__grid { grid-template-columns: auto 1fr 1fr; padding: 36px 24px 0; gap: 28px; }
  [dir="rtl"] .site-footer__grid { padding: 36px 24px 0; }
  .follow { grid-column: 1 / -1; border-radius: 30px 30px 0 0 !important; margin-inline: -24px; }
}
@media (max-width: 640px) {
  .site-footer__grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer-nav ul { justify-items: center; }
}

/* ---------- shared ---------- */
.page-title { margin-block: 44px 20px; color: var(--gold); text-align: center; font-weight: 700; font-size: clamp(32px, 5vw, 48px); line-height: 1.15; text-transform: uppercase; }
:lang(ar) .page-title { text-transform: none; }
.breadcrumbs { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-inline-end: 6px; opacity: .5; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--gold); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 22px;
  border: 1px solid var(--gold); border-radius: 0 0 15px 0; background: var(--gold); color: var(--on-gold);
  font-weight: 700; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; text-decoration: none;
  transition: background-color var(--dur), color var(--dur);
}
:lang(ar) .btn { text-transform: none; }
.btn:hover { background: transparent; color: var(--gold); }
.btn--ghost { background: transparent; color: var(--gold); }
.btn--ghost:hover { background: var(--gold); color: var(--on-gold); }
.btn .icon { width: 18px; height: 18px; }

/* ---------- blog index ---------- */
.blog-hero { padding: 6px 0 34px; text-align: center; }
.blog-hero__title { color: var(--gold); font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 6vw, 60px); line-height: 1.15; }
.blog-hero__sub { margin-top: 10px; font-family: var(--font-script); font-weight: 400; font-size: clamp(22px, 3vw, 30px); line-height: 1.3; }
.blog-hero__text { max-width: 1110px; margin: 16px auto 0; font-family: var(--font-verdana); font-size: 17px; line-height: 24px; }
:lang(ar) .blog-hero__title { font-weight: 700; }
:lang(ar) .blog-hero__sub { font-weight: 500; }

.featured { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.tv-box { min-height: 600px; background: rgb(0 0 0 / 12%); }
.ticker { margin: 40px 0 60px; border-block: 1px solid var(--gold-50); min-height: 74px; }

.post-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--gold-50); background: var(--site-panel);
  transition: box-shadow var(--dur), border-color var(--dur);
}
.post-card:hover { border-color: var(--gold); box-shadow: 0 0 10px 0 rgb(225 180 6 / 55%); }
.post-card__media { position: relative; display: block; aspect-ratio: 1200 / 630; overflow: hidden; background: var(--site-deep); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease-out); }
.post-card:hover .post-card__media img { transform: scale(1.03); }
.post-card__cat {
  position: absolute; top: 16px; inset-inline-end: 16px;
  padding: 3px 14px; border-radius: 50px; background: var(--gold); color: var(--on-gold);
  font-size: 12px; line-height: 18px; font-weight: 600; text-transform: uppercase;
}
:lang(ar) .post-card__cat { text-transform: none; }
.post-card__body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 26px 30px 24px; }
.post-card__title { font-size: 21px; line-height: 1.3; font-weight: 600; }
.post-card__title a { color: var(--gold); text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.post-card__title a:focus-visible { outline: none; }
.post-card:has(.post-card__title a:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }
.post-card__excerpt { color: var(--text); font-size: 14px; line-height: 1.55; }
.post-card__more { margin-top: auto; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
:lang(ar) .post-card__more { text-transform: none; }
.post-card__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 13px 30px; border-top: 1px solid rgb(255 255 255 / 55%); color: var(--text); font-size: 12px; font-weight: 500; }
.post-card__meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-card__meta .icon { width: 14px; height: 14px; color: var(--gold); }
.post-card--compact .post-card__body { padding: 20px 22px 18px; gap: 10px; }
.post-card--compact .post-card__title { font-size: 18px; }
.post-card--compact .post-card__meta { padding: 11px 22px; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.col-head {
  display: grid; place-items: center; min-height: 66px; margin-bottom: 20px; padding: 6px 16px;
  background: var(--gold); color: var(--site-bg); font-family: var(--font-script); font-weight: 400;
  font-size: clamp(26px, 3vw, 36px); line-height: 1.2; text-align: center;
}
:lang(ar) .col-head { font-weight: 700; font-size: clamp(22px, 2.4vw, 28px); }
.col-list { display: grid; gap: 20px; list-style: none; padding: 0; margin: 0; }
.col-more { display: flex; justify-content: center; margin-top: 22px; }

.archive { margin-top: 70px; }
.archive__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.archive__title { color: var(--gold); font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4vw, 44px); line-height: 1.15; }
:lang(ar) .archive__title { font-weight: 700; }
.archive__count { color: var(--muted); font-size: 14px; }
.archive__tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search { position: relative; }
.search input {
  width: min(320px, 78vw); min-height: 44px; padding: 10px 14px; padding-inline-start: 42px;
  border: 1px solid var(--gold-50); border-radius: 0 0 15px 0; background: var(--site-panel); color: var(--text); font-size: 15px;
}
.search input::placeholder { color: #9aa0a8; }
.search input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgb(225 180 6 / 25%); }
.search .icon { position: absolute; top: 50%; inset-inline-start: 14px; width: 18px; height: 18px; transform: translateY(-50%); color: var(--gold); pointer-events: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  min-height: 44px; padding: 8px 18px; border: 1px solid var(--gold-50); border-radius: 50px; background: transparent;
  color: var(--text); font-size: 14px; font-weight: 500; transition: background-color var(--dur), color var(--dur), border-color var(--dur);
}
.filter:hover { border-color: var(--gold); }
.filter[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; }
.grid > li { min-width: 0; }
.archive__empty { padding: 40px 0; text-align: center; color: var(--muted); }
.archive__more { display: flex; justify-content: center; margin-top: 28px; }

.tools-banner {
  display: grid; place-items: center; min-height: 156px; margin-top: 80px; padding: 30px 16px;
  background: #0d1020 url("../images/brand/analysis-tools-bg.webp") center / cover no-repeat;
}
.tools-banner h2 { color: var(--gold); font-family: var(--font-display); font-weight: 400; font-size: clamp(32px, 4vw, 44px); line-height: 1.2; text-align: center; }
:lang(ar) .tools-banner h2 { font-weight: 700; }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding-top: 50px; }
.tools h3 { margin-bottom: 20px; color: var(--gold); font-family: var(--font-script); font-weight: 400; font-size: clamp(28px, 3vw, 36px); line-height: 1.2; text-align: center; }
:lang(ar) .tools h3 { font-weight: 700; font-size: clamp(22px, 2.4vw, 28px); }
.tools .tv-box { min-height: 550px; }
/* TradingView iframes declare no color-scheme; matching it keeps their transparent background
   (with the page's color-scheme:dark, browsers paint an opaque white backdrop behind them) */
.tv-box { position: relative; color-scheme: light; }
.tv-box--ticker { min-height: 74px !important; background: transparent; }
.ticker .tradingview-widget-copyright { display: none; }
.tv-box__fallback { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 .3em; padding: 20px; color: var(--muted); font-size: 14px; text-align: center; }
.tv-box__fallback a { color: var(--gold); }
.tv-box.is-loaded .tv-box__fallback { display: none; }
.tradingview-widget-copyright { font-size: 12px; color: var(--muted); text-align: center; padding-top: 6px; }
.tradingview-widget-copyright a { color: var(--muted); }

@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .featured, .cols, .tools { grid-template-columns: 1fr; }
  .tv-box { min-height: 480px; }
  .cols { gap: 40px; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .post-card__body { padding: 20px 20px 18px; }
  .post-card__meta { padding: 12px 20px; }
  .archive__tools, .search, .search input { width: 100%; }
}

/* ---------- article ---------- */
.post-hero { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 4px; text-align: center; }
.post-hero__img { width: min(672px, 100%); height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.post-hero__title { max-width: 1100px; margin-top: 6px; color: #FAFEFF; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.25; font-weight: 700; }
.post-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: var(--muted); font-size: 14px; }
.post-meta span, .post-meta a { display: inline-flex; align-items: center; gap: 7px; }
.post-meta a { color: var(--gold); text-decoration: none; }
.post-meta .icon { width: 16px; height: 16px; color: var(--gold); }
.post-alt { font-size: 14px; }
.post-alt a { color: var(--gold); }

.prose { width: min(760px, 100% - 32px); margin: 44px auto 0; font-size: 17px; line-height: 1.75; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { margin-top: 1.7em; font-size: clamp(23px, 2.4vw, 28px); line-height: 1.3; font-weight: 600; }
.prose h3 { margin-top: 1.5em; font-size: clamp(19px, 2vw, 22px); line-height: 1.35; font-weight: 600; }
.prose h4, .prose h5, .prose h6 { margin-top: 1.4em; font-size: 18px; line-height: 1.4; font-weight: 600; color: var(--gold); }
.prose hr { height: 1px; margin: 1.8em 0 0; border: 0; background: rgb(255 255 255 / 45%); }
.prose hr + h2, .prose hr + h3 { margin-top: .7em; }
.prose ul, .prose ol { padding-inline-start: 1.5em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--gold); }
.prose a { color: var(--gold); text-underline-offset: 3px; }
.prose a:hover { color: #fff; }
.prose strong { font-weight: 700; color: #fff; }
.prose blockquote { padding: 12px 20px; border-inline-start: 3px solid var(--gold); background: rgb(255 255 255 / 4%); }
.prose figure { margin-block: 1.6em; }
.prose figure img { margin-inline: auto; }
.prose code { padding: 1px 6px; border-radius: 4px; background: rgb(255 255 255 / 8%); font-size: .92em; }
.table-wrap { overflow-x: auto; margin-block: 1.4em; border: 1px solid var(--gold-50); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid rgb(255 255 255 / 12%); text-align: start; vertical-align: top; }
.prose th { background: rgb(225 180 6 / 12%); color: var(--gold); font-weight: 600; }
.prose .yt { margin-block: 1.6em; }

.note {
  width: min(760px, 100% - 32px); margin: 48px auto 0; padding: 16px 20px;
  border: 1px solid var(--gold-50); border-inline-start-width: 4px; background: var(--site-panel);
  color: var(--text-2); font-size: 14px; line-height: 1.6;
}
.note a { color: var(--gold); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: min(760px, 100% - 32px); margin: 36px auto 0; }
.post-nav a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--gold-50); color: var(--text); text-decoration: none; transition: border-color var(--dur); }
.post-nav a:hover { border-color: var(--gold); }
.post-nav small { color: var(--gold); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
:lang(ar) .post-nav small { text-transform: none; }
.post-nav span { font-size: 15px; line-height: 1.45; }
.post-nav .next { text-align: end; grid-column: 2; }
.related { margin-top: 70px; }
.related h2 { margin-bottom: 22px; }
@media (max-width: 600px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: auto; }
  .prose { font-size: 16.5px; }
}

/* ---------- legal ---------- */
.legal { width: min(900px, 100% - 32px); margin: 0 auto; font-size: 17px; line-height: 1.6; }
.legal h2 { margin-top: 1.6em; color: var(--gold); font-size: 18px; line-height: 1.4; font-weight: 600; }
.legal h2:first-child { margin-top: .4em; }
.legal h2 + p { margin-top: .35em; }
.legal p + p, .legal ul, .legal ol { margin-top: .9em; }
.legal ul, .legal ol { padding-inline-start: 1.4em; }
.legal a { color: var(--gold); }
.legal__updated { margin-top: 36px; color: var(--muted); font-size: 14px; }
.lang-note { width: min(900px, 100% - 32px); margin: 0 auto 18px; padding: 10px 16px; border: 1px dashed var(--gold-50); color: var(--text-2); font-size: 15px; text-align: center; }

/* ---------- 404 ---------- */
.error { display: grid; place-items: center; gap: 14px; padding: 40px 0 10px; text-align: center; }
.error .error__code { color: var(--gold); font-family: var(--font-display); font-size: clamp(90px, 16vw, 150px); line-height: 1; }
.error h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.3; }
.error p { color: var(--text-2); }
.error__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }
.error [lang="ar"] { font-family: var(--font-ar); }

@media print {
  .site-header, .site-footer, .ticker, .tools-banner, .tools, .archive__tools, .post-nav, .related { display: none !important; }
  body.site { background: #fff; color: #000; }
  .prose, .prose strong, .post-hero__title { color: #000; }
}
