/*
 * Masa Doors — Blog / Archive / Single Styles
 * masa-blog.css
 */

/* =====================================================================
   CSS VARIABLES
   ===================================================================== */
:root {
  --c-bg:     #F2F5FC;
  --c-bg-alt: #FFFFFF;
  --c-dark:   #0B1D3A;
  --c-mid:    #1A3260;
  --c-sec:    #A5AACD;
  --c-sec-dk: #7278AA;
  --c-gold:   #C8A96E;
  --c-text:   #1C2B45;
  --c-muted:  #6B7899;
  --c-border: rgba(165,170,205,0.22);
  --c-shadow: rgba(11,29,58,0.07);
  --radius:   6px;
  --font:     'Tajawal', sans-serif;
  --max:      1160px;
  --pad-x:    clamp(1.2rem, 5vw, 3rem);
}

/* =====================================================================
   HELLO ELEMENTOR COMPATIBILITY RESETS
   ===================================================================== */
.site-content { padding-top: 0 !important; }
#primary { width: 100% !important; max-width: 100% !important; padding: 0 !important; }
#main { margin: 0 !important; }

/* =====================================================================
   GLOBAL WRAPPER RESETS
   ===================================================================== */
#masa-blog,
#masa-archive,
#masa-single {
  direction: rtl;
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 60vh;
}

/* =====================================================================
   LAYOUT WRAPPER
   ===================================================================== */
.mc-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* =====================================================================
   HERO SECTION
   ===================================================================== */
.mc-hero {
  position: relative;
  background: var(--c-dark);
  padding: 7rem 0 5rem;
  overflow: hidden;
}

/* Dot grid pattern */
.mc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(165,170,205,0.12) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

/* Arabic watermark */
.mc-hero::after {
  content: attr(data-watermark);
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14vw;
  font-family: var(--font);
  font-weight: 900;
  color: var(--c-sec);
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.mc-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

/* =====================================================================
   BREADCRUMB
   ===================================================================== */
.mc-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: rgba(165,170,205,.6);
  flex-wrap: wrap;
}

.mc-breadcrumb a {
  color: rgba(165,170,205,.6);
  text-decoration: none;
  transition: color .3s cubic-bezier(.4,0,.2,1);
}

.mc-breadcrumb a:hover {
  color: var(--c-gold);
}

.mc-breadcrumb .sep {
  color: rgba(165,170,205,.35);
  font-size: .7rem;
  margin: 0 .1rem;
}

/* =====================================================================
   EYEBROW TAG
   ===================================================================== */
.mc-tag {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--c-sec-dk);
  font-size: .72rem;
  letter-spacing: 0;
  font-weight: 600;
  font-family: var(--font);
}

.mc-tag::before {
  content: '';
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--c-sec);
  flex-shrink: 0;
}

/* =====================================================================
   HERO LINE
   ===================================================================== */
.mc-hero-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(to left, #A5AACD, rgba(165,170,205,.3));
  border-radius: 2px;
}

/* =====================================================================
   HERO HEADING
   ===================================================================== */
.mc-hero-h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}

.mc-hero-h1 em {
  font-style: normal;
  color: var(--c-sec);
}

/* =====================================================================
   HERO SUB
   ===================================================================== */
.mc-hero-sub {
  font-size: clamp(.9rem, 1.8vw, 1.05rem);
  color: rgba(165,170,205,.75);
  font-weight: 300;
  line-height: 1.7;
  max-width: 540px;
  margin: 0;
}

/* =====================================================================
   ARCHIVE CATEGORY DESCRIPTION
   ===================================================================== */
.mac-cat-desc {
  font-size: .95rem;
  color: rgba(165,170,205,.65);
  font-weight: 300;
  line-height: 1.7;
  max-width: 580px;
  margin: .25rem 0 0;
}

/* =====================================================================
   POSTS GRID
   ===================================================================== */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* =====================================================================
   CARD
   ===================================================================== */
.mc-card {
  position: relative;
  background: var(--c-bg-alt);
  border-radius: 14px;
  border: 1px solid var(--c-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .38s cubic-bezier(.4,0,.2,1),
              box-shadow .38s cubic-bezier(.4,0,.2,1);
}

.mc-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(to right, #A5AACD, #0B1D3A);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .38s cubic-bezier(.4,0,.2,1);
}

.mc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(11,29,58,.12);
}

.mc-card:hover::after {
  transform: scaleX(1);
}

/* Card image container */
.mc-card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #DDE1F0 0%, #C8CEEA 100%);
  flex-shrink: 0;
}

.mc-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.4,0,.2,1);
}

.mc-card:hover .mc-card-img img {
  transform: scale(1.05);
}

/* Image placeholder */
.mc-img-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #DDE1F0 0%, #C8CEEA 100%);
}

.mc-img-ph svg {
  opacity: .3;
  width: 56px;
  height: 56px;
  color: var(--c-dark);
}

/* Category badge on card */
.mc-cat-badge {
  position: absolute;
  bottom: .75rem;
  right: .75rem;
  background: rgba(11,29,58,.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--c-gold);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: .3rem .75rem;
  border-radius: 99px;
  border: 1px solid rgba(200,169,110,.2);
  text-decoration: none;
  transition: background .25s cubic-bezier(.4,0,.2,1);
}

.mc-cat-badge:hover {
  background: rgba(11,29,58,.9);
  color: var(--c-gold);
}

/* Card body */
.mc-card-body {
  padding: 1.4rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Card meta */
.mc-card-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  color: var(--c-sec-dk);
  margin-bottom: .65rem;
  flex-wrap: wrap;
}

.mc-card-meta .sep {
  color: rgba(114,120,170,.4);
}

/* Card title */
.mc-card-title {
  margin: 0 0 .55rem;
  line-height: 1.45;
}

.mc-card-title a {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--c-dark);
  text-decoration: none;
  transition: color .25s cubic-bezier(.4,0,.2,1);
  display: block;
}

.mc-card-title a:hover {
  color: var(--c-mid);
}

/* Card excerpt */
.mc-card-excerpt {
  font-size: .88rem;
  color: var(--c-muted);
  font-weight: 300;
  line-height: 1.8;
  margin: 0 0 .75rem;
  flex: 1;
}

/* Read more link */
.mc-read-more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--c-dark);
  text-decoration: none;
  margin-top: .5rem;
  transition: color .25s cubic-bezier(.4,0,.2,1),
              gap .25s cubic-bezier(.4,0,.2,1);
}

.mc-read-more:hover {
  color: var(--c-mid);
  gap: .65rem;
}

.mc-read-more::after {
  content: '←';
  font-size: .9rem;
  line-height: 1;
}

/* =====================================================================
   EMPTY STATE
   ===================================================================== */
.mc-empty {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--c-muted);
}

.mc-empty p {
  font-size: 1.1rem;
  font-weight: 300;
}

/* =====================================================================
   PAGINATION
   ===================================================================== */
.mc-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: 3.5rem;
  flex-wrap: wrap;
}

.mc-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: .5rem .9rem;
  border: 1.5px solid rgba(165,170,205,.3);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .85rem;
  color: var(--c-muted);
  text-decoration: none;
  font-family: var(--font);
  background: var(--c-bg-alt);
  transition: all .25s cubic-bezier(.4,0,.2,1);
}

.mc-page-btn:hover {
  border-color: var(--c-sec);
  color: var(--c-dark);
  background: #fff;
}

.mc-page-btn.active,
.mc-page-btn.current {
  background: var(--c-dark);
  color: #fff;
  border-color: var(--c-dark);
}

.mc-page-btn.dots {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

/* =====================================================================
   SCROLL REVEAL
   ===================================================================== */
.rv {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .65s cubic-bezier(.4,0,.2,1),
              transform .65s cubic-bezier(.4,0,.2,1);
}

.rv.in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delay helpers */
.rv-d1 { transition-delay: .1s; }
.rv-d2 { transition-delay: .18s; }
.rv-d3 { transition-delay: .26s; }

/* =====================================================================
   SINGLE POST — HERO
   ===================================================================== */
.ms-hero {
  position: relative;
  background: var(--c-dark);
  padding: 7rem 0 5rem;
  overflow: hidden;
}

.ms-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(165,170,205,0.12) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.ms-hero::after {
  content: attr(data-watermark);
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14vw;
  font-family: var(--font);
  font-weight: 900;
  color: var(--c-sec);
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.ms-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.ms-hero-h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.3;
  margin: 0;
  max-width: 760px;
}

.ms-hero-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .8rem;
  color: rgba(165,170,205,.7);
  flex-wrap: wrap;
}

.ms-hero-meta .sep {
  color: rgba(165,170,205,.35);
}

.ms-hero-cat-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(200,169,110,.15);
  color: var(--c-gold);
  border: 1px solid rgba(200,169,110,.3);
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem .8rem;
  border-radius: 99px;
  text-decoration: none;
  transition: background .25s cubic-bezier(.4,0,.2,1);
}

.ms-hero-cat-badge:hover {
  background: rgba(200,169,110,.25);
  color: var(--c-gold);
}

/* =====================================================================
   SINGLE POST — CONTENT
   ===================================================================== */
.ms-content-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 4rem var(--pad-x) 5rem;
}

/* Featured image */
.ms-featured-img {
  margin-bottom: 3rem;
}

.ms-featured-img img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

/* =====================================================================
   SINGLE POST — PROSE TYPOGRAPHY
   ===================================================================== */
.ms-prose {
  color: var(--c-text);
  font-family: var(--font);
  line-height: 1.95;
}

.ms-prose h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-dark);
  margin: 2.5rem 0 1rem;
  line-height: 1.4;
}

.ms-prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-dark);
  margin: 2rem 0 .75rem;
  line-height: 1.45;
}

.ms-prose h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-mid);
  margin: 1.75rem 0 .6rem;
}

.ms-prose p {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.95;
  margin-bottom: 1.5rem;
  color: var(--c-text);
}

.ms-prose ul,
.ms-prose ol {
  padding-right: 1.5rem;
  padding-left: 0;
  margin-bottom: 1.5rem;
}

.ms-prose ul li {
  list-style: none;
  position: relative;
  padding-right: 1.25rem;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.9;
  color: var(--c-text);
}

.ms-prose ul li::before {
  content: '';
  position: absolute;
  right: 0;
  top: .75em;
  width: 6px;
  height: 6px;
  background: var(--c-gold);
  border-radius: 50%;
}

.ms-prose ol li {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.9;
  color: var(--c-text);
  padding-right: .5rem;
}

.ms-prose blockquote {
  position: relative;
  border-right: 4px solid var(--c-gold);
  border-left: none;
  padding: 1.25rem 1.5rem 1.25rem 1rem;
  margin: 2rem 0;
  background: rgba(200,169,110,.06);
  border-radius: 0 8px 8px 0;
}

.ms-prose blockquote p {
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--c-mid);
  margin: 0;
  line-height: 1.8;
}

.ms-prose blockquote::before {
  content: '"';
  position: absolute;
  top: -.5rem;
  right: 1rem;
  font-size: 4rem;
  color: var(--c-gold);
  opacity: .35;
  font-family: Georgia, serif;
  line-height: 1;
}

.ms-prose img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  margin: 1.5rem 0;
  display: block;
}

.ms-prose a {
  color: var(--c-mid);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s cubic-bezier(.4,0,.2,1);
}

.ms-prose a:hover {
  color: var(--c-gold);
}

.ms-prose strong {
  font-weight: 700;
  color: var(--c-dark);
}

/* =====================================================================
   SINGLE — TAGS
   ===================================================================== */
.ms-tags {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--c-border);
}

.ms-tag-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-muted);
  margin-left: .5rem;
}

.ms-tag-link {
  display: inline-flex;
  align-items: center;
  padding: .3rem .85rem;
  border: 1.5px solid var(--c-border);
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--c-sec-dk);
  text-decoration: none;
  background: var(--c-bg);
  transition: all .25s cubic-bezier(.4,0,.2,1);
}

.ms-tag-link:hover {
  border-color: var(--c-sec);
  background: #fff;
  color: var(--c-dark);
}

/* =====================================================================
   SINGLE — SHARE BOX
   ===================================================================== */
.ms-share {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 1.5rem 2rem;
  margin-top: 3rem;
}

.ms-share-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--c-muted);
  margin: 0 0 1rem;
  letter-spacing: 0;
}

.ms-share-btns {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.ms-share-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1.2rem;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 700;
  font-family: var(--font);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .2s cubic-bezier(.4,0,.2,1),
              transform .2s cubic-bezier(.4,0,.2,1);
}

.ms-share-btn:hover {
  opacity: .88;
  transform: translateY(-1px);
}

.ms-share-btn.wa {
  background: #25D366;
  color: #fff;
}

.ms-share-btn.fb {
  background: #1877F2;
  color: #fff;
}

.ms-share-btn.tw {
  background: #000;
  color: #fff;
}

.ms-share-btn.cp {
  background: var(--c-dark);
  color: #fff;
}

/* =====================================================================
   SINGLE — NAVIGATION
   ===================================================================== */
.ms-nav {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--c-border);
}

.ms-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1rem 1.25rem;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  text-decoration: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
}

.ms-nav-item:hover {
  border-color: var(--c-sec);
  box-shadow: 0 4px 16px var(--c-shadow);
}

.ms-nav-item.prev {
  text-align: right;
}

.ms-nav-item.next {
  text-align: left;
}

.ms-nav-dir {
  font-size: .72rem;
  font-weight: 600;
  color: var(--c-muted);
  letter-spacing: 0;
}

.ms-nav-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--c-dark);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =====================================================================
   SINGLE — RELATED POSTS
   ===================================================================== */
.ms-related {
  background: var(--c-dark);
  padding: 5rem 0;
  overflow: hidden;
}

.ms-related-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 2.5rem;
}

.ms-related-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 900;
  color: #fff;
  margin: 0;
}

.ms-related-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(to left, #A5AACD, rgba(165,170,205,.3));
  border-radius: 2px;
}

/* Dark card variant */
.ms-related .mc-card {
  background: rgba(255,255,255,.06);
  border-color: rgba(165,170,205,.15);
}

.ms-related .mc-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  background: rgba(255,255,255,.09);
}

.ms-related .mc-card-title a {
  color: #fff;
}

.ms-related .mc-card-title a:hover {
  color: var(--c-sec);
}

.ms-related .mc-card-excerpt {
  color: rgba(165,170,205,.7);
}

.ms-related .mc-card-meta {
  color: rgba(165,170,205,.55);
}

.ms-related .mc-read-more {
  color: var(--c-sec);
}

.ms-related .mc-read-more:hover {
  color: #fff;
}

/* Dark placeholder */
.ms-related .mc-img-ph {
  background: linear-gradient(135deg, rgba(165,170,205,.15) 0%, rgba(11,29,58,.3) 100%);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
  .mc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .mc-grid {
    grid-template-columns: 1fr;
  }

  .mc-hero {
    padding: 4.5rem 0 3.5rem;
  }

  .ms-hero {
    padding: 4.5rem 0 3.5rem;
  }

  .ms-content-wrap {
    padding: 2.5rem var(--pad-x) 3rem;
  }

  .ms-share {
    padding: 1.25rem 1.25rem;
  }

  .ms-nav {
    flex-direction: column;
  }

  .ms-share-btns {
    gap: .4rem;
  }

  .ms-share-btn {
    font-size: .75rem;
    padding: .45rem .9rem;
  }
}
