/* ==========================================================
   SSR Blog — bo cuc hero banner + luoi the 3 cot.
   Dung chung cho index.php (danh sach), archive.php (chuyen muc)
   va single.php (chi tiet bai viet).
   Mau lay theo ssr-panel: navy #11315a tren nen trang.
   ========================================================== */

.ssr-blog {
  --blue:   #11315a;
  --text:   #111111;
  --muted:  #4f5d6d;
  --line:   rgba(5, 5, 5, 0.12);
  --soft:   #f6f8fa;
  --shadow: 0 18px 48px rgba(5, 5, 5, 0.08);
  --max:    1280px;

  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #fff;
}

.ssr-blog *,
.ssr-blog *::before,
.ssr-blog *::after { box-sizing: border-box; }

.ssr-blog-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─────────────── HERO ─────────────── */

.ssr-blog-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--blue);
}

.ssr-blog-hero__bg {
  position: absolute;
  inset: 0;
}

.ssr-blog-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Lop phu navy de chu trang luon du tuong phan du anh nen sang hay toi */
.ssr-blog-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 49, 90, 0.55) 0%, rgba(17, 49, 90, 0.78) 100%);
}

.ssr-blog-hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 72px 24px;
  max-width: 860px;
}

.ssr-blog-hero__inner h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ssr-blog-hero__inner p {
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.7;
  max-width: 680px;
}

.ssr-blog-breadcrumb {
  position: relative;
  z-index: 2;
  margin-bottom: 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.ssr-blog-breadcrumb a { color: rgba(255, 255, 255, 0.9); text-decoration: none; }
.ssr-blog-breadcrumb a:hover { color: #fff; text-decoration: underline; }

/* ─────────────── THANH LOC CHUYEN MUC ─────────────── */

.ssr-blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
}

/* Khoi vuong dac, khong bo goc, khong vien — cung ngon ngu voi nut
   "Explore Collection" cua ssr-panel. */
.ssr-blog-filter__item {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  border: none;
  border-radius: 0;
  background: #eef1f6;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s;
}

.ssr-blog-filter__item:hover {
  background: var(--blue);
  color: #fff;
}

.ssr-blog-filter__item.is-active {
  background: var(--blue);
  color: #fff;
}

/* ─────────────── LUOI THE ─────────────── */

.ssr-blog-list { padding: 72px 0 88px; }

.ssr-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 32px;
}

.ssr-post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

.ssr-post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.ssr-post-card__img {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--soft);
}

.ssr-post-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.ssr-post-card:hover .ssr-post-card__img img { transform: scale(1.05); }

.ssr-post-card__body { padding: 22px 4px 0; }

.ssr-post-card__meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.ssr-post-card__body h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.ssr-post-card__body h3 a {
  color: var(--blue);
  text-decoration: none;
}

.ssr-post-card__body h3 a:hover { text-decoration: underline; }

.ssr-post-card__excerpt {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  /* Gioi han 3 dong de cac the trong mot hang cao bang nhau */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ssr-post-card__more {
  margin-top: 14px;
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.ssr-post-card__more::after {
  content: ' →';
  transition: margin-left .2s ease;
}

.ssr-post-card__more:hover::after { margin-left: 4px; }

/* Trang rong */
.ssr-blog-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
  font-size: 17px;
}

/* ─────────────── PHAN TRANG ─────────────── */

.ssr-blog-pagination {
  margin-top: 56px;
  display: flex;
  justify-content: center;
}

.ssr-blog-pagination .wp-pagenavi,
.ssr-blog-pagination .nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* assets/css/styles.css dat ".wp-pagenavi span, .wp-pagenavi a" voi
   !important tren TUNG thuoc tinh (ke ca border-radius: 100%), va do la
   style dung chung cho phan trang toan site. De ep khoi vuong chi rieng
   blog, can dong thoi: nang do dac hieu bang ".ssr-blog" phia truoc
   (0,2,1 > 0,1,1) VA dung !important. Thieu mot trong hai la thua. */
.ssr-blog .ssr-blog-pagination a,
.ssr-blog .ssr-blog-pagination span {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 44px;
  height: 44px !important;
  line-height: 1 !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: #eef1f6;
  color: var(--blue) !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, color .2s;
}

/* styles.css an ".pages" ("Page 1 of 12") bang display:none !important.
   Rule tren co do dac hieu cao hon nen se vo tinh hien lai -> an lai. */
.ssr-blog .ssr-blog-pagination .pages {
  display: none !important;
}

.ssr-blog .ssr-blog-pagination a:hover {
  background: var(--blue) !important;
  color: #fff !important;
}

/* styles.css cung dat ".wp-pagenavi span:hover" -> dau "..." se doi mau
   khi ro chuot du no khong bam duoc. Tra ve nguyen trang. */
.ssr-blog .ssr-blog-pagination span:hover {
  background: #eef1f6 !important;
  color: var(--blue) !important;
}

/* Dat cuoi cung va co ca :hover de thang rule span:hover ngay tren */
.ssr-blog .ssr-blog-pagination .current,
.ssr-blog .ssr-blog-pagination .current:hover {
  background: var(--blue) !important;
  color: #fff !important;
}

/* ─────────────── CHI TIET BAI VIET ─────────────── */

.ssr-article { padding: 64px 0 80px; }

.ssr-article__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: start;
}

/* Khong co sidebar -> mot cot, gioi han be ngang cho de doc */
.ssr-article__layout.is-full {
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
  margin: 0 auto;
}

/* Bai viet thuong dai hon sidebar nhieu -> ghim lai de khong bo trong
   ca mot cot khi cuon xuong. */
.ssr-article__aside { position: sticky; top: 24px; }

.ssr-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
  padding-bottom: 18px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.ssr-article__content {
  font-size: 17px;
  line-height: 1.8;
  color: #2b3440;
}

.ssr-article__content > * + * { margin-top: 20px; }

.ssr-article__content h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--blue);
  margin-top: 40px;
  line-height: 1.3;
}

.ssr-article__content h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--blue);
  margin-top: 32px;
  line-height: 1.35;
}

.ssr-article__content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.ssr-article__content ul,
.ssr-article__content ol { padding-left: 22px; }

.ssr-article__content li + li { margin-top: 8px; }

.ssr-article__content blockquote {
  border-left: 3px solid var(--blue);
  padding: 6px 0 6px 22px;
  color: var(--muted);
  font-style: italic;
}

.ssr-article__content a { color: var(--blue); }

/* Bang trong bai phai cuon rieng, khong lam vo trang */
.ssr-article__content table { width: 100%; border-collapse: collapse; }
.ssr-article__content table td,
.ssr-article__content table th { border: 1px solid var(--line); padding: 10px 12px; }

.ssr-article__share {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--muted);
}

.ssr-article__share a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  transition: opacity .2s;
}

.ssr-article__share a:hover { opacity: .82; }

/* ─────────────── SIDEBAR ─────────────── */

.ssr-aside__block > h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding-bottom: 12px;
  margin: 0 0 20px;
  border-bottom: 2px solid var(--blue);
}

.ssr-aside__item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.ssr-aside__item + .ssr-aside__item {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ssr-aside__item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.ssr-aside__item h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.ssr-aside__item h4 a { color: var(--text); text-decoration: none; }
.ssr-aside__item h4 a:hover { color: var(--blue); }

.ssr-aside__item .date { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ─────────────── BAI LIEN QUAN ─────────────── */

.ssr-related { background: var(--soft); padding: 72px 0 80px; }

.ssr-related__head {
  text-align: center;
  margin-bottom: 44px;
}

.ssr-related__head h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.01em;
}

.ssr-related .ssr-post-card { background: transparent; }

/* ─────────────── RESPONSIVE ─────────────── */

@media (max-width: 1100px) {
  .ssr-article__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  /* Xuong mot cot thi sidebar nam duoi bai viet, khong ghim nua */
  .ssr-article__aside { position: static; }
}

@media (max-width: 1024px) {
  .ssr-blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ssr-blog-hero { min-height: 340px; }
  .ssr-blog-list { padding: 56px 0 64px; }
}

@media (max-width: 640px) {
  /* Nhieu chuyen muc se xuong rat nhieu hang tren mobile -> cho cuon ngang */
  .ssr-blog-filter {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    margin-bottom: 32px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .ssr-blog-filter::-webkit-scrollbar { display: none; }

  .ssr-blog-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .ssr-blog-hero { min-height: 260px; }
  .ssr-blog-hero__inner { padding: 48px 16px; }
  .ssr-blog-wrap { padding: 0 16px; }
  .ssr-blog-list { padding: 40px 0 52px; }
  .ssr-article { padding: 40px 0 56px; }
  .ssr-article__content { font-size: 16px; }
  .ssr-related { padding: 48px 0 56px; }
}
