/* Bedrock Monitoring — Dedicated Server News Page Styles */

:root, .news-page, .news-page * {
  --pixel-cut: 2px;
  --page-cut: polygon(
    var(--pixel-cut, 2px) 0, calc(100% - var(--pixel-cut, 2px)) 0,
    calc(100% - var(--pixel-cut, 2px)) var(--pixel-cut, 2px), 100% var(--pixel-cut, 2px),
    100% calc(100% - var(--pixel-cut, 2px)), calc(100% - var(--pixel-cut, 2px)) calc(100% - var(--pixel-cut, 2px)),
    calc(100% - var(--pixel-cut, 2px)) 100%, var(--pixel-cut, 2px) 100%,
    var(--pixel-cut, 2px) calc(100% - var(--pixel-cut, 2px)), 0 calc(100% - var(--pixel-cut, 2px)),
    0 var(--pixel-cut, 2px), var(--pixel-cut, 2px) var(--pixel-cut, 2px)
  );
}

.news-page {
  background: #090e0b;
  color: #c9dbcc;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
  font-family: var(--site-font, "Minecraft Rus", sans-serif);
}

.news-page,
.news-page *,
.news-page *::before,
.news-page *::after {
  font-family: var(--site-font, "Minecraft Rus", sans-serif);
}

html:not([data-site-font="modern"]) :is(.news-page, .news-page *, .news-page *::before, .news-page *::after) {
  font-family: "Minecraft Rus", sans-serif !important;
}

.news-page :is(button, input, a, p, span, strong, b, small, time, h1, h2, h3, h4, div, li, ul, ol, blockquote, code, pre, table, th, td, summary, details) {
  font-family: inherit;
}

html[data-site-font="modern"] .news-page,
html[data-site-font="modern"] .news-page * {
  font-family: var(--site-font, "Inter", sans-serif);
}

html[data-site-font="modern"] .news-page :is(h1, h2, h3, h4, .news-kicker, .news-brand strong, .news-stat-value, .news-post-tag) {
  font-family: var(--site-font-heading, "Montserrat", sans-serif);
}

html[data-site-font="modern"] .news-page :is(p, li, dd, time, .markdown-body, .news-post-body, .news-hero-desc) {
  font-size: 13px !important;
  line-height: 1.65 !important;
}

.news-page.news-intro {
  animation: profile-page-enter .58s cubic-bezier(.22, 1, .36, 1) both;
}

.news-page.news-leaving {
  animation: profile-page-exit .58s cubic-bezier(.65, 0, .35, 1) both;
  pointer-events: none;
}

.news-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  position: relative;
  z-index: 1;
}

/* Topbar */
.news-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.news-back {
  --pixel-cut: 3px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #141c16;
  border: 0 !important;
  color: #c9dbcc;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  clip-path: var(--page-cut);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.news-back:hover {
  background: #202d24;
  color: #a8ff78;
  transform: translateX(-2px);
}

.news-back-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: currentColor;
  mask: url("/assets/icons/ui/arrow-left.svg") center/contain no-repeat;
  -webkit-mask: url("/assets/icons/ui/arrow-left.svg") center/contain no-repeat;
}

.news-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.news-brand strong {
  font-size: 15px;
  letter-spacing: 1px;
  color: #a8ff78;
}

.news-brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #8c9e90;
}

.news-server-chip {
  --pixel-cut: 3px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #141c16;
  border: 0 !important;
  color: #edf2ee;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  clip-path: var(--page-cut);
  transition: all 0.2s ease;
}

.news-server-chip:hover {
  background: #202d24;
  color: #a8ff78;
}

.news-server-chip img {
  --pixel-cut: 2px;
  width: 24px;
  height: 24px;
  clip-path: var(--page-cut);
  object-fit: cover;
  border: 0 !important;
}

/* Hero */
.news-hero {
  --pixel-cut: 6px;
  background: #101612;
  border: 0 !important;
  padding: 24px;
  margin-bottom: 20px;
  clip-path: var(--page-cut);
  position: relative;
  overflow: hidden;
}

.news-hero-header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.news-avatar-frame {
  --pixel-cut: 4px;
  width: 58px;
  height: 58px;
  overflow: hidden;
  background: #090e0b;
  flex-shrink: 0;
  clip-path: var(--page-cut);
  border: 0 !important;
}

.news-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #8c9e90;
  text-transform: uppercase;
  margin: 0 0 4px;
}

#newsHeroTitle {
  font-size: 25px;
  font-weight: 700;
  margin: 0;
  color: #e5ede7;
  line-height: 1.25;
}

.news-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.news-channel-badge {
  --pixel-cut: 2px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: #152219;
  border: 0 !important;
  font-size: 11px;
  font-weight: 600;
  color: #6ed6fc;
  clip-path: var(--page-cut);
}

.news-subs {
  color: #8c9e90;
  font-weight: 400;
  font-size: 11px;
}

.news-tg-visit {
  --pixel-cut: 3px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: #1c271f;
  border: 0 !important;
  color: #a8ff78;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  clip-path: var(--page-cut);
  transition: all 0.2s ease;
  margin-left: auto;
}

.news-tg-visit:hover {
  background: rgba(97, 214, 77, 0.18);
  color: #baff99;
  transform: translateY(-1px);
}

.news-icon-ext {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: currentColor;
  mask: url("/assets/icons/ui/external-link.svg") center/contain no-repeat;
  -webkit-mask: url("/assets/icons/ui/external-link.svg") center/contain no-repeat;
}

/* Filter Bar */
.news-filter-bar {
  --pixel-cut: 3px;
  position: relative;
  display: inline-flex;
  align-items: stretch;
  gap: 3px;
  padding: 3px;
  background: #141c16;
  clip-path: var(--page-cut);
  margin-bottom: 20px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.news-filter-bar::-webkit-scrollbar {
  display: none;
}

.news-filter-indicator {
  --pixel-cut: 2px;
  position: absolute;
  top: 3px;
  left: 0;
  height: calc(100% - 6px);
  width: 0;
  background: rgba(168, 255, 120, 0.16);
  clip-path: var(--page-cut);
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1), width 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  will-change: transform, width;
  z-index: 1;
}

.news-filter-btn {
  --pixel-cut: 2px;
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent !important;
  border: 0 !important;
  color: #8c9e90;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  clip-path: var(--page-cut);
  transition: color 0.2s ease;
}

.news-filter-btn:hover {
  color: #edf2ee;
}

.news-filter-btn.is-active {
  color: #a8ff78;
}

.news-filter-count {
  --pixel-cut: 2px;
  display: inline-block;
  padding: 1px 6px;
  background: #0d130f;
  clip-path: var(--page-cut);
  font-size: 9px;
  line-height: 1.4;
  color: #8c9e90;
  transition: background 0.2s ease, color 0.2s ease;
}

.news-filter-btn.is-active .news-filter-count {
  background: rgba(0, 0, 0, 0.45);
  color: #a8ff78;
}

/* News Feed */
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-post-card {
  --pixel-cut: 5px;
  background: #101612;
  border: 0 !important;
  padding: 20px;
  clip-path: var(--page-cut);
  display: flex;
  flex-direction: column;
  gap: 14px;
  --markdown-accent: #a8ff78;
}

.news-post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.news-post-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.news-post-tag {
  --pixel-cut: 2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--tag-color, #c1cfca) 18%, #17201a);
  border: 0 !important;
  color: var(--tag-color, #c1cfca);
  clip-path: var(--page-cut);
}

.news-post-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #8c9e90;
}

/* Forwarded message */
.news-post-forwarded {
  --pixel-cut: 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  margin-bottom: 6px;
  background: #142019;
  border: 0 !important;
  color: #6ed6fc;
  font-size: 11px;
  font-weight: 500;
  clip-path: var(--page-cut);
  max-width: 100%;
}

.news-forward-avatar {
  --pixel-cut: 2px;
  width: 20px;
  height: 20px;
  border-radius: 0;
  object-fit: cover;
  flex: 0 0 20px;
  clip-path: var(--page-cut);
  border: 0 !important;
  background: #090e0b;
}

.news-post-forwarded a {
  color: #6ed6fc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.news-forward-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: #6ed6fc;
}

/* Media / Carousel */
.news-post-media {
  --pixel-cut: 4px;
  position: relative;
  width: 100%;
  aspect-ratio: var(--news-media-ratio, 16 / 9);
  height: var(--news-media-height, auto);
  transition: height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  background: #141c16;
  border: 0 !important;
  clip-path: var(--page-cut);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 6px;
}

.news-post-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .news-post-media, .news-post-track { transition: none; }
}

.news-post-slide {
  flex: 0 0 100%;
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #141c16;
}

.news-post-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.news-post-nav-btn {
  --pixel-cut: 3px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(12, 18, 14, 0.85);
  border: 0 !important;
  color: #c9dbcc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 4;
  clip-path: var(--page-cut);
}

.news-post-media:hover .news-post-nav-btn {
  opacity: 1;
  pointer-events: auto;
}

.news-post-nav-btn.prev { left: 10px; }
.news-post-nav-btn.next { right: 10px; }

.news-post-nav-btn:hover {
  background: #25392a;
  color: #a8ff78;
}

.news-post-counter {
  --pixel-cut: 2px;
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  background: rgba(8, 12, 9, 0.85);
  border: 0 !important;
  font-size: 8px;
  font-weight: 700;
  color: #c9dbcc;
  z-index: 3;
  clip-path: var(--page-cut);
}

.news-post-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 3;
}

.news-post-dot {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.news-post-dot.is-active {
  background: #a8ff78;
  width: 14px;
}

/* Post Content & Clamping */
.news-post-body-wrap {
  position: relative;
}

.news-post-body-container {
  overflow: hidden;
  transition: max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: max-height;
}

.news-post-body-wrap.is-clamped .news-post-body-container {
  max-height: 220px;
}

.news-post-fade-mask {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  height: 56px;
  background: linear-gradient(to bottom, transparent, #101612);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.news-post-body-wrap.is-clamped .news-post-fade-mask {
  opacity: 1;
}

.news-post-body-wrap.is-expanded .news-post-fade-mask {
  opacity: 0;
}

.news-post-body {
  font-size: 12px;
  line-height: 1.65;
  color: #c9dbcc;
  font-weight: 400 !important;
}

.news-post-body p,
.news-post-body li,
.news-post-body div {
  font-weight: 400 !important;
}

.news-post-body strong,
.news-post-body b {
  font-weight: 700 !important;
  color: #e5ede7;
}

.tg-emoji {
  display: inline-block;
  margin: 0 3px;
  vertical-align: -0.1em;
  font-style: normal;
  font-weight: 400;
}

.tg-emoji + .tg-emoji {
  margin-left: 1px;
}

.news-post-toggle-btn {
  --pixel-cut: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 14px;
  background: #17241c;
  border: 0 !important;
  color: #a8ff78;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  clip-path: var(--page-cut);
  transition: background 0.15s ease, color 0.15s ease;
}

.news-post-toggle-btn:hover {
  background: #223528;
  color: #baff99;
}

.news-post-toggle-btn[hidden] {
  display: none !important;
}

.news-post-toggle-btn svg {
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.news-post-toggle-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Footer */
.news-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.news-post-source {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #8c9e90;
}

.news-post-link {
  --pixel-cut: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #17241c;
  border: 0 !important;
  color: #a8ff78;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  clip-path: var(--page-cut);
  transition: all 0.15s ease;
}

.news-post-link:hover {
  background: #233527;
  color: #baff99;
}

/* Empty State */
.news-empty {
  --pixel-cut: 6px;
  text-align: center;
  padding: 50px 24px;
  background: #101612;
  border: 0 !important;
  clip-path: var(--page-cut);
}

.news-empty-icon {
  margin-bottom: 14px;
  opacity: 0.6;
}

.news-empty h3 {
  font-size: 17px;
  margin: 0 0 6px;
  color: #e5ede7;
}

.news-empty p {
  color: #8c9e90;
  font-size: 12px;
  margin: 0 0 16px;
}

.news-empty-tg-link {
  --pixel-cut: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: #1c271f;
  border: 0 !important;
  color: #a8ff78;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  clip-path: var(--page-cut);
  transition: all 0.2s ease;
}

.news-empty-tg-link:hover {
  background: rgba(97, 214, 77, 0.18);
  color: #baff99;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .news-shell {
    padding: 16px 12px 60px;
  }

  .news-hero {
    padding: 18px 16px;
  }

  .news-hero-header {
    gap: 12px;
  }

  .news-avatar-frame {
    width: 48px;
    height: 48px;
  }

  #newsHeroTitle {
    font-size: 18px;
  }

  .news-hero-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .news-tg-visit {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .news-post-card {
    padding: 14px;
  }

  .news-post-nav-btn {
    opacity: 0.85;
    pointer-events: auto;
  }
}
