/* Daneshgaran Blog — Phase 4
   Page-specific styles only. Global theme comes from /style.min.css. */

body.page-blog {
  display: block !important;
}

.page-blog main {
  direction: ltr;
  text-align: left;
  font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.dg-blog-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 0 20px;
}

.blog-hero {
  padding: 34px 0 24px;
  position: relative;
  overflow: visible;
}

.blog-hero::before,
.blog-hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(54px);
  opacity: .34;
  pointer-events: none;
}

.blog-hero::before {
  inset-inline-start: -160px;
  inset-block-start: -140px;
  background: rgba(126, 34, 206, .9);
}

.blog-hero::after {
  inset-inline-end: -160px;
  inset-block-end: -180px;
  background: rgba(20, 184, 166, .72);
}

.blog-hero-panel {
  position: relative;
  overflow: visible;
  border-radius: 30px;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.16);
  background:
    radial-gradient(circle at 8% 0%, rgba(124, 58, 237, .28), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(45, 212, 191, .18), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  box-shadow: 0 28px 80px rgba(0,0,0,.30);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.blog-hero-panel::before {
  content: "";
  position: absolute;
  inset-inline: 22px;
  inset-block-start: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.46), transparent);
}

.blog-hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}


.blog-h1 {
  margin: 16px 0 0;
  color: #fff;
  font-size: clamp(36px, 5vw, 72px);
  line-height: .98;
  letter-spacing: -.02em;
  max-width: 15ch;
  text-wrap: balance;
}

.blog-sub {
  margin: 18px 0 0;
  color: rgba(255,255,255,.84);
  line-height: 1.85;
  max-width: 76ch;
  font-size: 16px;
}


.blog-toolbar {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  margin-top: 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 190px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(11, 19, 43, .32);
}

.blog-input,
.blog-select,
.blog-filter-toggle {
  min-height: 52px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.94);
  padding: 13px 16px;
  outline: none;
  font-size: 15px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.blog-input:focus,
.blog-select:focus,
.blog-filter-toggle:focus-visible {
  border-color: rgba(45, 212, 191, .78);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, .16);
}

.blog-select {
  color-scheme: dark;
}

.blog-select option {
  background-color: #0b132b;
  color: #fff;
}

.blog-input::placeholder {
  color: rgba(255,255,255,.55);
}

.blog-filter {
  position: relative;
  min-width: 0;
}

.blog-filter-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: rgba(255,255,255,.94);
  text-align: left;
}

.blog-filter-chevron {
  font-size: 18px;
  line-height: 1;
  color: rgba(255,255,255,.68);
  transition: transform .18s ease;
}

.blog-filter.is-open .blog-filter-chevron {
  transform: rotate(180deg);
}

.blog-filter-panel {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(100% + 8px);
  z-index: 20;
  display: none;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(16, 20, 39, .96);
  box-shadow: 0 18px 48px rgba(0,0,0,.34);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.blog-filter.is-open .blog-filter-panel {
  display: grid;
  gap: 6px;
}

.blog-filter-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 12px;
  color: rgba(255,255,255,.86);
  cursor: pointer;
  user-select: none;
}

.blog-filter-option:hover {
  background: rgba(255,255,255,.07);
}

.blog-filter-option input {
  width: 16px;
  height: 16px;
  accent-color: #2dd4bf;
}

.blog-filter-clear {
  margin-top: 4px;
  width: 100%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.82);
  padding: 9px 10px;
  cursor: pointer;
  font: inherit;
}

.blog-filter-clear:hover,
.blog-filter-clear:focus-visible {
  border-color: rgba(45, 212, 191, .55);
  color: #fff;
  outline: none;
}


.blog-section {
  padding: 20px 0 56px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.blog-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 60px rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.22);
}

.thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 120 / 63;
  min-height: 190px;
  max-height: 320px;
  overflow: hidden;
  background-color: rgba(0,0,0,.18);
  background-image: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
}

.thumb-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--thumb-bg);
  background-size: cover;
  background-position: center;
  filter: blur(18px);
  transform: scale(1.12);
  opacity: .62;
}

.thumb-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 70% at 50% 50%, rgba(0,0,0,.12), rgba(0,0,0,.42));
  pointer-events: none;
}

.blog-thumb {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  z-index: 1;
}

.thumb-wrap.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.7);
  font-weight: 600;
}

.thumb-wrap.empty::before,
.thumb-wrap.empty::after {
  display: none;
}

.blog-body {
  padding: 14px 15px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-title {
  margin: 0 0 10px;
  color: #fff;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.55em * 2);
  overflow-wrap: anywhere;
}

.blog-title a {
  color: inherit;
  text-decoration: none;
}

.blog-title a:hover,
.blog-title a:focus-visible {
  text-decoration: underline;
}

.blog-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  margin-bottom: 10px;
}

.blog-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.12);
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-summary {
  margin: 0;
  color: rgba(255,255,255,.86);
  font-size: 14px;
  line-height: 1.85;
  text-align: justify !important;
  text-align-last: left;
  text-justify: inter-word;
  hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
  display: block;
  max-height: calc(1.85em * 4);
  min-height: calc(1.85em * 3);
  overflow: hidden;
}

.blog-summary.is-muted {
  text-align: left;
  hyphens: none;
  color: rgba(255,255,255,.62);
}


.admin-badge {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(180, 65, 65, .22);
  color: rgba(255,255,255,.92);
  z-index: 2;
}

.admin-action {
  display: inline-flex;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
  text-decoration: none;
}

.admin-action:hover {
  border-color: rgba(255,255,255,.26);
}

.empty-state {
  border: 1px dashed rgba(255,255,255,.22);
  border-radius: 18px;
  padding: 18px;
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.04);
  line-height: 1.9;
}

.no-results {
  display: none;
  margin-top: 18px;
}

.no-results.is-visible {
  display: block;
}


@media (max-width: 980px) {
  .blog-hero-panel {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .blog-h1 {
    max-width: 100%;
  }
}

@media (max-width: 1180px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .blog-toolbar {
    grid-template-columns: 1fr;
  }

  .blog-hero {
    padding-top: 24px;
  }
}

/* Hotfix p4h — compact modern hero + dropdown layering */
.blog-hero {
  position: relative;
  z-index: 50;
  padding: 18px 0 14px;
  overflow: visible;
}

.blog-hero::before,
.blog-hero::after {
  width: 360px;
  height: 300px;
  filter: blur(46px);
  opacity: .26;
}

.blog-hero::before {
  inset-inline-start: -130px;
  inset-block-start: -120px;
}

.blog-hero::after {
  inset-inline-end: -120px;
  inset-block-end: -120px;
}

.blog-hero-panel {
  overflow: visible;
  border-radius: 26px;
  padding: 22px;
  gap: 16px;
  background:
    linear-gradient(118deg, rgba(124, 58, 237, .20) 0%, rgba(255,255,255,.055) 38%, rgba(20, 184, 166, .16) 100%),
    radial-gradient(circle at 0% 0%, rgba(167, 139, 250, .18), transparent 30%),
    radial-gradient(circle at 100% 40%, rgba(45, 212, 191, .13), transparent 34%),
    rgba(255,255,255,.045);
  box-shadow: 0 20px 54px rgba(0,0,0,.24);
}

.blog-hero-panel::before {
  inset-inline: 24px;
  background: linear-gradient(90deg, rgba(45, 212, 191, .55), rgba(167, 139, 250, .45), transparent);
}

.blog-hero-copy {
  max-width: 1040px;
}

.blog-h1 {
  margin-top: 13px;
  max-width: 1000px;
  font-size: clamp(34px, 3.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -.018em;
}

.blog-sub {
  margin-top: 12px;
  max-width: 980px;
  font-size: 15.5px;
  line-height: 1.62;
}

.blog-toolbar {
  position: relative;
  z-index: 60;
  margin-top: 18px;
  padding: 10px;
  border-radius: 20px;
  grid-template-columns: minmax(0, 1fr) 210px 180px;
  background: rgba(8, 13, 30, .36);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 36px rgba(0,0,0,.14);
}

.blog-input,
.blog-select,
.blog-filter-toggle {
  min-height: 48px;
  border-radius: 15px;
  padding: 12px 15px;
}

.blog-filter {
  position: relative;
  z-index: 70;
}

.blog-filter.is-open {
  z-index: 9999;
}

.blog-filter-panel {
  z-index: 10000;
  max-height: 310px;
  overflow: auto;
  overscroll-behavior: contain;
}

.blog-section {
  position: relative;
  z-index: 1;
  padding-top: 12px;
}

.blog-grid,
.blog-card {
  position: relative;
  z-index: 1;
}

@media (max-width: 980px) {
  .blog-hero-panel {
    padding: 20px;
  }

  .blog-h1 {
    max-width: 100%;
    font-size: clamp(34px, 7vw, 54px);
  }
}

@media (max-width: 720px) {
  .blog-hero {
    padding-top: 14px;
  }

  .blog-hero-panel {
    border-radius: 22px;
    padding: 18px;
  }

  .blog-h1 {
    font-size: clamp(32px, 10vw, 46px);
  }

  .blog-sub {
    font-size: 14.5px;
    line-height: 1.7;
  }

  .blog-toolbar {
    margin-top: 14px;
    grid-template-columns: 1fr;
  }
}
