.tg-blog-shell {
  --tg-page-bg: #222831;
  --tg-panel-bg: #2b3138;
  --tg-panel-soft: #303740;
  --tg-border: rgba(255, 255, 255, 0.12);
  --tg-text: #f4f6f8;
  --tg-muted: rgba(244, 246, 248, 0.68);
  --tg-accent: #ff9d2e;
  --tg-accent-strong: #ff8a00;
  --tg-radius: 12px;
  min-height: 60vh;
  background: var(--tg-page-bg);
  color: var(--tg-text);
  font-family: "Open Sans", var(--bs-body-font-family), Arial, Helvetica, sans-serif;
}

.tg-blog-shell .page-content {
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.tg-blog-index-header {
  margin: 0 0 18px;
}

.tg-blog-index-header h1 {
  margin: 0;
  color: #fff;
  font-family: "Roboto Condensed", "Open Sans", Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: 0;
}

.tg-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tg-blog-card {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tg-border);
  border-radius: var(--tg-radius);
  background: var(--tg-panel-bg);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.tg-blog-card-media {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--thumb-bg, #1a1f25);
}

.tg-blog-card-media img,
.tg-sidebar-blog-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.tg-blog-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  padding: 15px;
}

.tg-blog-card-date,
.tg-post-date {
  color: var(--tg-muted);
  font-size: 0.88rem;
}

.tg-blog-card-title {
  margin: 0;
  font-family: "Roboto Condensed", "Open Sans", Arial, sans-serif;
  font-size: 1.16rem;
  line-height: 1.28;
}

.tg-blog-card-title a,
.tg-blog-card-link,
.tg-breadcrumbs a,
.tg-sidebar-blog-card,
.tg-post-bottom-link {
  color: #fff;
  text-decoration: none;
}

.tg-blog-card-title a:hover,
.tg-blog-card-link:hover,
.tg-breadcrumbs a:hover,
.tg-sidebar-blog-card:hover,
.tg-post-bottom-link:hover {
  color: var(--tg-accent);
}

.tg-blog-card-summary {
  margin: 0;
  color: var(--tg-muted);
  line-height: 1.5;
}

.tg-blog-card-link {
  margin-top: auto;
  color: var(--tg-accent);
  font-weight: 700;
}

.tg-blog-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  margin: 30px 0 0;
  color: var(--tg-muted);
}

.tg-blog-pagination a {
  color: var(--tg-accent);
  text-decoration: none;
}

.tg-blog-page {
  max-width: 1260px;
}

.tg-post {
  min-width: 0;
  padding: 14px 0 0;
}

.tg-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 880px) minmax(310px, 330px);
  gap: 28px;
  align-items: start;
}

.tg-post-main,
.tg-post-aside {
  min-width: 0;
}

.tg-breadcrumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  color: var(--tg-muted);
  font-size: 0.92rem;
}

.tg-post-header {
  max-width: 860px;
  margin-bottom: 20px;
}

.tg-post-title {
  max-width: 860px;
  margin: 8px 0 10px;
  color: #fff;
  font-family: "Roboto Condensed", "Open Sans", Arial, sans-serif;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.tg-post-date {
  display: block;
  margin-top: 0;
}

.tg-post-media {
  display: grid;
  gap: 14px;
  margin: 24px 0 30px;
  max-width: 100%;
}

.tg-post-media-item {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--thumb-bg, #111);
  cursor: zoom-in;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.tg-post-media-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-position: center center;
}

.tg-post-media-item--generated-thumb img,
.tg-post-media-item--thumb-cover img {
  object-fit: cover;
}

.tg-post-media-item--fallback-original img,
.tg-post-media-item--thumb-contain img {
  object-fit: contain;
  background: var(--thumb-bg, #111);
}

.tg-post-media-item:focus-visible {
  outline: 2px solid var(--tg-accent);
  outline-offset: 3px;
}

.tg-post-media--count-1 {
  grid-template-columns: 1fr;
  max-width: 760px;
}

.tg-post-media--count-1 .tg-post-media-item {
  height: clamp(230px, 32vw, 340px);
}

.tg-post-media--count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tg-post-media--count-2 .tg-post-media-item {
  height: clamp(220px, 23vw, 250px);
}

.tg-post-media--count-3.tg-post-media--layout-feature-1,
.tg-post-media--count-4.tg-post-media--layout-feature-1 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tg-post-media--count-3.tg-post-media--layout-feature-1 .tg-post-media-item--1,
.tg-post-media--count-4.tg-post-media--layout-feature-1 .tg-post-media-item--1 {
  grid-column: 1 / -1;
  height: clamp(260px, 32vw, 320px);
}

.tg-post-media--count-3.tg-post-media--layout-feature-1 .tg-post-media-item:not(.tg-post-media-item--1),
.tg-post-media--count-4.tg-post-media--layout-feature-1 .tg-post-media-item:not(.tg-post-media-item--1) {
  height: clamp(170px, 17vw, 190px);
}

.tg-post-media--count-3.tg-post-media--layout-balanced {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tg-post-media--count-3.tg-post-media--layout-balanced .tg-post-media-item {
  height: clamp(190px, 20vw, 230px);
}

.tg-post-media--count-4.tg-post-media--layout-balanced {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tg-post-media--count-4.tg-post-media--layout-balanced .tg-post-media-item {
  height: clamp(210px, 23vw, 240px);
}

.tg-post-media--count-5,
.tg-post-media--count-many {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.tg-post-media--count-5 .tg-post-media-item--1,
.tg-post-media--count-5 .tg-post-media-item--2,
.tg-post-media--count-many .tg-post-media-item--1,
.tg-post-media--count-many .tg-post-media-item--2 {
  grid-column: span 3;
  height: clamp(220px, 23vw, 250px);
}

.tg-post-media--count-5 .tg-post-media-item--3,
.tg-post-media--count-5 .tg-post-media-item--4,
.tg-post-media--count-5 .tg-post-media-item--5,
.tg-post-media--count-many .tg-post-media-item:nth-child(n + 3) {
  grid-column: span 2;
  height: clamp(170px, 17vw, 190px);
}

.tg-post-media-item--low-res {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.tg-post-body {
  max-width: 860px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.06rem;
  line-height: 1.72;
}

.tg-post-body p {
  margin: 0 0 1.08rem;
}

.tg-post-body a {
  color: var(--tg-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 157, 46, 0.45);
}

.tg-post-body a:hover {
  color: #fff;
  border-bottom-color: var(--tg-accent);
}

.tg-post-bottom-meta {
  margin-top: 18px;
  color: var(--tg-muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.tg-post-views {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tg-post-cta {
  margin: 28px 0 0;
}

.tg-post-telegram-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.78rem 1.1rem;
  border: 1px solid rgba(255, 157, 46, 0.78);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffad45, var(--tg-accent-strong));
  color: #151515;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(255, 138, 0, 0.18);
}

.tg-post-telegram-cta:hover {
  color: #111;
  background: #ffb85a;
  border-color: #ffc06b;
}

.tg-post-bottom-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0 0;
}

.tg-post-bottom-link {
  display: flex;
  min-width: 0;
  min-height: 108px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--tg-border);
  border-radius: 10px;
  background: rgba(48, 55, 64, 0.76);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.tg-post-bottom-link:hover {
  border-color: rgba(255, 157, 46, 0.65);
  background: rgba(255, 157, 46, 0.08);
  transform: translateY(-1px);
}

.tg-post-bottom-link--next {
  text-align: right;
}

.tg-post-bottom-link__label {
  color: var(--tg-accent);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tg-post-bottom-link__title {
  color: #fff;
  font-family: "Roboto Condensed", "Open Sans", Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 850;
  line-height: 1.18;
}

.tg-post-aside {
  position: sticky;
  top: 88px;
}

.tg-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--tg-border);
  border-radius: var(--tg-radius);
  background: var(--tg-panel-bg);
}

.tg-sidebar-panel h2 {
  margin: 0 0 2px;
  color: #fff;
  font-family: "Roboto Condensed", "Open Sans", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 900;
}

.tg-sidebar-blog-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--tg-border);
  border-radius: 10px;
  background: var(--tg-panel-soft);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.tg-sidebar-blog-card--no-media {
  display: block;
}

.tg-sidebar-blog-card:hover {
  border-color: rgba(255, 157, 46, 0.58);
  transform: translateY(-1px);
}

.tg-sidebar-blog-card__media {
  display: block;
  width: 100%;
  max-height: 122px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--thumb-bg, #171b20);
}

.tg-sidebar-blog-card__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px 10px;
}

.tg-sidebar-blog-card__title {
  color: #fff;
  font-family: "Roboto Condensed", "Open Sans", Arial, sans-serif;
  font-size: 0.96rem;
  font-weight: 850;
  line-height: 1.16;
}

.tg-sidebar-blog-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--tg-muted);
  font-size: 0.85rem;
  line-height: 1.34;
}

.tg-sidebar-blog-card__date {
  margin-top: 5px;
  color: var(--tg-muted);
  font-size: 0.78rem;
}

.tg-lightbox[hidden] {
  display: none !important;
}

.tg-lightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 5000 !important;
  display: grid !important;
  place-items: center !important;
  padding: 24px !important;
  background: rgba(0, 0, 0, 0.88) !important;
}

.tg-lightbox__frame {
  width: min(1040px, 92vw) !important;
  height: min(720px, 84vh) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  background: #111 !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.tg-lightbox__image {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

.tg-lightbox__close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 1120px) {
  .tg-post-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 320px);
    gap: 24px;
  }
}

@media (max-width: 980px) {
  .tg-post-layout {
    display: block;
  }

  .tg-post-aside {
    position: static;
    margin-top: 30px;
  }

  .tg-sidebar-panel--blog-more {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tg-sidebar-panel--blog-more h2 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .tg-post-title {
    font-size: clamp(24px, 7vw, 32px);
    line-height: 1.14;
  }
}

@media (max-width: 720px) {
  .tg-blog-shell .page-content {
    width: min(calc(100% - 18px), 1120px);
    padding-top: 18px;
  }

  .tg-blog-grid {
    grid-template-columns: 1fr;
  }

  .tg-post {
    padding: 10px 0 0;
  }

  .tg-post-media--count-1 {
    max-width: none;
  }

  .tg-post-media--count-2,
  .tg-post-media--count-3,
  .tg-post-media--count-4,
  .tg-post-media--count-5,
  .tg-post-media--count-many {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tg-post-media-item,
  .tg-post-media--count-3.tg-post-media--layout-feature-1 .tg-post-media-item--1,
  .tg-post-media--count-4.tg-post-media--layout-feature-1 .tg-post-media-item--1,
  .tg-post-media--count-5 .tg-post-media-item,
  .tg-post-media--count-many .tg-post-media-item {
    grid-column: auto;
    height: clamp(160px, 46vw, 220px);
  }

  .tg-post-bottom-nav {
    grid-template-columns: 1fr;
  }

  .tg-post-bottom-link--next {
    text-align: left;
  }

  .tg-sidebar-panel--blog-more {
    grid-template-columns: 1fr;
  }

  .tg-lightbox {
    padding: 12px !important;
  }

  .tg-lightbox__frame {
    width: 94vw !important;
    height: 76vh !important;
  }
}
