html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  background: #f8f7fb;
  color: #243042;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header .navbar {
  min-height: 42px;
}

.site-header__inner {
  gap: 0.65rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #4450a8;
}

.site-brand__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #d8def8;
  padding: 1px;
  background: #fff;
}

.site-nav .nav-link {
  color: #5561b6;
  font-weight: 500;
  padding: 0.15rem 0.4rem;
}

.site-nav .nav-link:hover {
  color: #6270d4;
}

.site-account-link {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-account-link svg {
  width: 16px;
  height: 16px;
}

.site-account-link:hover {
  background: #f1f3ff;
}

main {
  padding-top: 0.45rem;
  padding-bottom: 1.25rem;
}

.home-shell {
  max-width: 1220px;
  margin: 0 auto;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}

.home-grid--content {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.home-sidebar,
.home-main {
  min-width: 0;
}

.side-panel {
  background: #fff;
  border: 1px solid #e5e8f4;
  border-radius: 18px;
  padding: 0.8rem;
  box-shadow: 0 10px 28px rgba(119, 131, 186, 0.08);
}

.content-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e6e8f5;
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(117, 128, 180, 0.08);
}

.featured-wrap {
  margin-top: -0.15rem;
}

.ad-banner__inner {
  background: linear-gradient(135deg, #fbfcff 0%, #f2f5fb 100%);
  border: 1px solid #e6eaf3;
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
}

.ad-banner__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.08em;
}

.ad-banner__title {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 700;
  color: #111827;
}

.ad-banner__text {
  color: #475569;
  font-size: 0.92rem;
}

.featured-carousel {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #e6e8f5;
  background: #fff;
  box-shadow: 0 14px 36px rgba(117, 128, 180, 0.12);
}

.featured-carousel__link,
.featured-carousel__image {
  display: block;
  width: 100%;
}

.featured-carousel__image {
  aspect-ratio: 21/6.2;
  object-fit: cover;
}

.featured-carousel .carousel-indicators [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.featured-carousel .carousel-control-prev-icon,
.featured-carousel .carousel-control-next-icon {
  width: 1.4rem;
  height: 1.4rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.section-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #5e69c8;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #d7ddfb;
  background: #f4f6ff;
  line-height: 1;
}

.section-action svg {
  width: 13px;
  height: 13px;
}

.section-action:hover {
  color: #4e5ab7;
  border-color: #c6cff6;
}

.section-action--compact {
  padding-inline: 0.58rem;
  font-size: 0.78rem;
}

.section-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #27314f;
}

.section-head--sidebar {
  align-items: center;
  flex-wrap: nowrap;
}

.section-head--sidebar .section-title {
  white-space: nowrap;
}

.section-head--stack-sm {
  align-items: flex-start;
}

.category-panel {
  background: #fff;
  border: 1px solid #e6e8f5;
  border-radius: 18px;
  padding: 0.8rem;
}

.category-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.category-scroll {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.category-scroll::-webkit-scrollbar {
  height: 6px;
}

.category-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: #fbfcff;
  border: 1px solid #e0e5f7;
  color: #47559e;
  border-radius: 14px;
  padding: 0.62rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.category-pill--block {
  width: 100%;
}

.category-pill__content {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 auto;
}

.category-pill__icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  flex: 0 0 auto;
}

.category-pill__icon svg {
  width: 100%;
  height: 100%;
}

.category-pill__label {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.category-pill:hover {
  border-color: #c7cff4;
  background: #f6f8ff;
}

.category-pill.is-active {
  background: linear-gradient(135deg, #7b84df 0%, #6673d1 100%);
  color: #fff;
  border-color: #6d78d7;
}

.category-pill__count {
  font-size: 0.75rem;
  opacity: 0.85;
  min-width: 1.8rem;
  padding: 0.18rem 0.42rem;
  text-align: center;
  border-radius: 999px;
  background: rgba(112, 125, 211, 0.1);
  color: inherit;
  flex: 0 0 auto;
}

.post-toolbar {
  margin-top: 0.2rem;
}

.post-card {
  background: #fff;
  border: 1px solid #e6e8f5;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(117, 128, 180, 0.08);
  position: relative;
}

.post-card--interactive {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.post-card--interactive:hover {
  transform: translateY(-2px);
  border-color: #d6ddfb;
  box-shadow: 0 14px 32px rgba(117, 128, 180, 0.12);
}

.post-card__stretched-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.post-card--grid {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card--list {
  display: grid;
  grid-template-columns: 240px 1fr;
}

.post-card__thumb {
  width: 100%;
  display: block;
  object-fit: cover;
}

.post-card--grid .post-card__thumb {
  aspect-ratio: 16/9;
}

.post-card--list .post-card__thumb {
  height: 100%;
  min-height: 150px;
}

.post-card__thumb--placeholder {
  background: linear-gradient(135deg, #facc15 0%, #fb923c 45%, #f97316 100%);
}

.post-card__body {
  padding: 0.8rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.post-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  color: #7a8296;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.post-card__meta-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
}

.post-card__meta-category {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  border: 1px solid #dde4fb;
  background: #f6f8ff;
  color: #6673cb;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}

.post-card__meta-category:hover {
  color: #5562c0;
  border-color: #cfd8fb;
  background: #eef2ff;
}

.post-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: #253150;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1em * 1.4 * 2);
}

.post-card__summary {
  color: #627084;
  line-height: 1.55;
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(0.88rem * 1.55 * 3);
}

.post-card__footer {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin-top: auto;
  min-width: 0;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.post-card__tag {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  border: 1px solid #dce3fb;
  background: #f5f7ff;
  color: #6370c4;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
}

.post-card__tag--more {
  background: #f8f9fc;
  border-color: #e6ebf6;
  color: #7d879e;
}

.post-card__footer .post-card__tag:first-child:last-child {
  margin-top: auto;
}

.blog-empty {
  border-radius: 16px;
  border: 1px solid #d9dff8;
  background: #f4f6ff;
}

.category-hero {
  padding: 1.2rem 1.25rem;
  background: linear-gradient(135deg, #fcfcff 0%, #f4f6fd 100%);
}

.category-hero__eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7f88a4;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.category-hero__title {
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  color: #27314f;
  font-weight: 800;
}

.category-hero__text {
  color: #64748b;
  max-width: 720px;
  line-height: 1.65;
}

.category-hero__meta {
  color: #7f88a4;
  font-size: 0.92rem;
  line-height: 1.6;
}

.listing-page-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.listing-hero {
  padding: 1.25rem 1.3rem;
  background: linear-gradient(135deg, #fcfdff 0%, #f5f7ff 100%);
}

.listing-hero__eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7f88a4;
  font-weight: 700;
}

.listing-hero__title {
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  color: #27314f;
  font-weight: 800;
}

.listing-hero__text {
  color: #64748b;
  max-width: 760px;
  line-height: 1.7;
}

.admin-body {
  background: #f5f6fb;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  background: #1f2a44;
  color: #fff;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
}

.admin-sidebar__brand {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.admin-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-sidebar__link {
  display: block;
  padding: 0.72rem 0.85rem;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.86);
}

.admin-sidebar__link:hover,
.admin-sidebar__link.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.admin-main {
  padding: 1.25rem;
}

.admin-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-page__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #243042;
  margin: 0;
}

.admin-page__desc {
  color: #667085;
  line-height: 1.6;
}

.admin-image-preview {
  display: block;
  width: min(100%, 320px);
  border-radius: 14px;
  border: 1px solid #dde3f5;
}

.admin-slide-card {
  border: 1px solid #e1e7f6;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.admin-slide-card__image,
.admin-table-thumb {
  display: block;
  width: 100%;
  object-fit: cover;
}

.admin-slide-card__image {
  aspect-ratio: 16/8;
}

.admin-slide-card__body {
  padding: 0.85rem;
}

.admin-table-thumb {
  width: 110px;
  height: 62px;
  border-radius: 10px;
}

.category-card {
  padding: 0;
  overflow: hidden;
}

.category-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem;
}

.category-card__meta {
  display: flex;
  justify-content: flex-start;
}

.category-card__title {
  font-size: 1.08rem;
  font-weight: 800;
  color: #253150;
}

.category-card__text {
  color: #627084;
  line-height: 1.65;
  font-size: 0.92rem;
  flex: 1 1 auto;
}

.category-card__action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #5f6cc7;
  font-size: 0.88rem;
  font-weight: 700;
}

.category-card__action svg {
  width: 14px;
  height: 14px;
}

.post-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  border: 1px solid #dbe1f8;
  background: #f6f8ff;
  color: #5c68bf;
  font-size: 0.8rem;
  font-weight: 700;
}

.post-page {
  max-width: 1220px;
  margin: 0 auto;
}

.post-layout,
.post-reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}

.post-layout__main,
.post-reading-layout__main,
.post-layout__sidebar,
.post-reading-layout__sidebar {
  min-width: 0;
}

.post-reading-layout__main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-reading-layout__sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 84px);
}

.post-detail {
  padding: 1.35rem 1.4rem;
}

.post-detail__hero {
  margin-bottom: 1.15rem;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #e6e8f5;
}

.post-detail__hero-image {
  width: 100%;
  display: block;
  aspect-ratio: 16/7;
  object-fit: cover;
}

.post-detail__header {
  margin-bottom: 1.1rem;
}

.post-detail__category {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.85rem;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  border: 1px solid #d9e0fb;
  background: linear-gradient(135deg, #f6f8ff 0%, #eef2ff 100%);
  color: #5f6cc7;
  font-size: 0.82rem;
  font-weight: 700;
}

.post-detail__category:hover {
  color: #4e5bb8;
  border-color: #cfd8fb;
}

.post-detail__back {
  width: fit-content;
  margin-bottom: 1rem;
}

.post-detail__title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.2;
  color: #253150;
  margin-bottom: 0.85rem;
}

.post-detail__meta {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
  color: #7a8296;
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.post-detail__summary {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #607089;
  margin-bottom: 1.1rem;
}

.post-detail__content {
  color: #334155;
  line-height: 1.82;
  font-size: 1rem;
}

.post-detail__content :is(h1, h2, h3) {
  color: #22345e;
  font-weight: 800;
  line-height: 1.3;
  margin-top: 1.6rem;
  margin-bottom: 0.85rem;
  scroll-margin-top: 90px;
}

.post-detail__content h1 {
  font-size: 1.5rem;
}

.post-detail__content h2 {
  font-size: 1.26rem;
}

.post-detail__content h3 {
  font-size: 1.08rem;
}

.post-detail__content p {
  margin-bottom: 1rem;
}

.post-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.post-detail__tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.68rem;
  border-radius: 999px;
  background: #f4f6ff;
  border: 1px solid #dbe1f8;
  color: #5c68bf;
  font-size: 0.8rem;
  font-weight: 600;
}

.post-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.toc-panel {
  height: 100%;
  overflow: auto;
}

.toc-panel__nav {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.toc-panel__link {
  display: block;
  padding: 0.42rem 0.58rem;
  border-radius: 12px;
  color: #67748f;
  font-size: 0.85rem;
  line-height: 1.4;
  transition: background 0.18s ease, color 0.18s ease;
}

.toc-panel__link:hover,
.toc-panel__link.is-active {
  background: #f4f6ff;
  color: #5663c0;
}

.toc-panel__link--h2 {
  padding-left: 0.9rem;
}

.toc-panel__link--h3 {
  padding-left: 1.25rem;
  font-size: 0.8rem;
}

.toc-panel__empty {
  color: #7b879d;
  font-size: 0.85rem;
  line-height: 1.55;
}

.post-recommendations {
  margin-top: 1rem;
}

.post-recommendations__title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #27314f;
}

.post-recommendations__list--stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.post-recommendations__item {
  width: 100%;
}

.post-card--recommended {
  box-shadow: 0 8px 20px rgba(117, 128, 180, 0.06);
}

.post-card--recommended.post-card--list {
  grid-template-columns: 260px minmax(0, 1fr);
}

.post-card__thumb--recommended {
  height: 100%;
  min-height: 180px;
}

.post-card--recommended .post-card__body {
  padding: 0.8rem 0.95rem 0.9rem;
}

.post-card--recommended .post-card__title {
  -webkit-line-clamp: 2;
  min-height: auto;
}

.post-card--recommended .post-card__summary {
  -webkit-line-clamp: 2;
  min-height: auto;
  margin-bottom: 0.5rem;
}

.post-recommendations__status {
  text-align: center;
  color: #7a8498;
  font-size: 0.86rem;
  padding-top: 0.9rem;
}

.post-recommendations__sentinel {
  width: 100%;
  height: 1px;
}

.hot-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hot-list__item {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 0.5rem;
  background: #f8faff;
  border: 1px solid #dbe4ff;
  border-radius: 10px;
  padding: 0.36rem;
}

.hot-list__thumb {
  width: 100%;
  height: 100%;
  max-height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.hot-list__body {
  min-width: 0;
}

.hot-list__meta {
  font-size: 0.72rem;
  color: #6b7280;
}

.hot-list__title {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  color: #1f2342;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.site-footer {
  background: #fff;
}

.site-footer__inner {
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #788295;
  font-size: 0.88rem;
}

.site-footer__links {
  display: inline-flex;
  gap: 1rem;
}

.site-footer__links a:hover {
  color: #0ea5a4;
}

@media (max-width: 767.98px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-main {
    padding: 0.85rem;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-grid--content {
    grid-template-columns: 1fr;
  }

  .home-main {
    order: 1;
  }

  .home-sidebar--right {
    order: 3;
  }

  .site-brand {
    font-size: 0.95rem;
  }

  .site-brand__avatar {
    width: 22px;
    height: 22px;
  }

  .featured-carousel__image {
    aspect-ratio: 16/8.4;
  }

  .section-head {
    gap: 0.45rem;
    flex-wrap: wrap;
  }

  .section-action {
    font-size: 0.78rem;
    padding: 0.2rem 0.48rem;
  }

  .content-panel,
  .side-panel,
  .category-panel {
    border-radius: 16px;
    padding: 0.85rem;
  }

  .category-pill {
    padding: 0.58rem 0.72rem;
  }

  .post-count-badge {
    font-size: 0.76rem;
  }

  .post-detail {
    padding: 1rem;
  }

  .post-layout,
  .post-reading-layout {
    grid-template-columns: 1fr;
  }

  .post-layout__sidebar,
  .post-reading-layout__sidebar {
    order: 2;
    position: static;
    max-height: none;
  }

  .toc-panel {
    overflow: visible;
  }

  .post-detail__title {
    font-size: 1.55rem;
  }

  .post-card--list {
    grid-template-columns: 1fr;
  }

  .post-card--list .post-card__thumb {
    aspect-ratio: 16/9;
    min-height: 0;
  }

  .post-card--recommended.post-card--list {
    grid-template-columns: 1fr;
  }

  .site-footer__inner {
    min-height: auto;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .home-grid,
  .home-grid--content {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .home-sidebar--right {
    grid-column: auto;
  }
}