/* Homepage-specific polish and responsive guardrails. */

.home-highlight-slide:focus-visible,
.home-highlight-step:focus-visible,
.home-latest-messages a:focus-visible,
.home-mod-mini:focus-visible,
.home-test-row:focus-visible,
.home-video-card:focus-visible {
  outline: 2px solid #ed2c29;
  outline-offset: 3px;
}

.home-highlight-title,
.home-story-card-title,
.home-mod-mini-title,
.home-test-row-title,
.home-forum-card-title {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.home-story-meta,
.home-test-row-meta,
.vgnw-article-meta.home-highlight-meta {
  min-width: 0;
  flex-wrap: wrap;
}

.home-story-card-content,
.home-mod-feature-body,
.home-mod-mini-body,
.home-test-row-body {
  min-width: 0;
}

.home-latest-scroll {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  scrollbar-gutter: stable;
}

.home-latest-messages:hover .home-latest-scroll,
.home-latest-messages:focus-within .home-latest-scroll {
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.home-latest-scroll::-webkit-scrollbar {
  width: 3px;
}

.home-latest-messages:hover .home-latest-scroll::-webkit-scrollbar,
.home-latest-messages:focus-within .home-latest-scroll::-webkit-scrollbar {
  width: 3px;
}

.home-latest-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.home-latest-scroll::-webkit-scrollbar-thumb {
  background: transparent;
}

.home-latest-messages:hover .home-latest-scroll::-webkit-scrollbar-thumb,
.home-latest-messages:focus-within .home-latest-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
}

.home-forum-card,
.home-story-card,
.home-mod-feature,
.home-mod-mini,
.home-test-row,
.home-video-card,
.server-card {
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.home-forum-card:hover,
.home-story-card:hover,
.home-mod-feature:hover,
.home-mod-mini:hover,
.home-test-row:hover,
.home-video-card:hover,
.server-card:hover {
  filter: brightness(1.06);
}

.home-forum-card {
  box-shadow: inset -4px 4px 0 rgba(255, 255, 255, 0.1), inset 4px -4px 0 #000, inset 0 -5px 0 rgba(0, 0, 0, 0.15);
}

.home-forum-card::before {
  z-index: 1;
}

.home-forum-card::after {
  z-index: 5;
  background: radial-gradient(circle at 50% 55%, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 58%);
  box-shadow: inset -4px 4px 0 rgba(255, 255, 255, 0.15), inset 4px -4px 0 #000, inset 0 -5px 0 rgba(0, 0, 0, 0.15);
}

.home-forum-card-content {
  z-index: 6;
}

.home-forum-card-image {
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 175px;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.15);
}

.home-forum-card-image img {
  position: absolute;
  top: var(--home-forum-image-top, 0);
  left: var(--home-forum-image-left, 0);
  width: var(--home-forum-image-width, 100%);
  height: var(--home-forum-image-height, 207.65%);
  max-width: none;
  object-fit: cover;
  object-position: center;
  transform: translateX(var(--home-forum-image-shift-x, 0));
}

.home-forum-card--chest {
  --home-forum-image-width: 104%;
  --home-forum-image-left: 50%;
  --home-forum-image-height: 207.65%;
  --home-forum-image-shift-x: -50%;
}

.home-forum-card:hover .home-forum-card-title {
  color: #ed2c29;
}

.home-server-showcase-section {
  width: 100%;
  background: #171615;
  padding: 60px 16px 78px;
}

.home-server-showcase-inner {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.home-server-showcase-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 72px;
}

.home-server-showcase-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-server-showcase-title h2 {
  margin: 0;
  color: #fff;
  font-family: "Minecraft", "Minecraft Ten v2", monospace;
  font-size: 36px;
  line-height: 36px;
  text-transform: uppercase;
}

.home-server-showcase-title p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-family: "Minecraft Seven v2", "Minecraft Seven", monospace;
  font-size: 16px;
  line-height: 18px;
}

.home-server-showcase-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-server-showcase-add {
  color: #ed2c29;
  font-family: "Minecraft Seven v2", "Minecraft Seven", monospace;
  font-size: 13px;
  line-height: 18px;
}

.home-server-showcase-add:hover,
.home-server-showcase-add:focus-visible {
  color: #fff;
}

.home-server-showcase-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}

.home-server-showcase-card {
  --server-frame: #53c9bd;
  --server-frame-dark: #1d8f86;
  --server-panel: #dffbff;
  --server-bar: #87fff3;
  --server-bar-light: #cbfffa;
  --server-band: #53c9bd;
  --server-text: #171615;
  position: relative;
  display: block;
  min-height: 285px;
  background: var(--server-panel);
  color: var(--server-text);
  box-shadow: inset -5px 5px 0 var(--server-frame), inset 5px -5px 0 var(--server-frame-dark);
  isolation: isolate;
}

.home-server-showcase-card:focus-visible {
  outline: 2px solid #ed2c29;
  outline-offset: 5px;
}

.home-server-showcase-ip {
  position: absolute;
  left: 11px;
  right: 11px;
  top: -29px;
  z-index: 3;
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 10px;
  background: var(--server-bar);
  box-shadow: inset 3px 3px 0 var(--server-bar-light);
  color: #1b1a19;
  font-family: "Minecraft Five", monospace;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-server-showcase-media {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 5px;
  bottom: 24px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(128, 128, 128, 0.18);
}

.home-server-showcase-media img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  opacity: 0.9;
  transition: transform 180ms ease;
}

.home-server-showcase-card:hover .home-server-showcase-media img {
  transform: scale(1.035);
}

.home-server-showcase-band {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  z-index: 2;
  height: 25px;
  background:
    linear-gradient(90deg, transparent 0 12px, #111 12px 19px, transparent 19px 34px, #111 34px 42px, transparent 42px 56px),
    var(--server-band);
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.28);
}

.home-server-showcase-badge {
  position: absolute;
  left: 50%;
  bottom: -15px;
  z-index: 4;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--server-frame);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.32), inset -3px 3px 0 rgba(255, 255, 255, 0.35), inset 3px -3px 0 rgba(0, 0, 0, 0.22);
  transform: translateX(-50%) rotate(45deg);
}

.home-server-showcase-badge img {
  width: 35px;
  height: 35px;
  object-fit: cover;
  image-rendering: pixelated;
  transform: rotate(-45deg);
}

.home-server-showcase-empty {
  grid-column: 1 / -1;
  background: #211f1e;
  padding: 24px;
  color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.32);
}

@media (prefers-reduced-motion: reduce) {
  .home-highlight-slide,
  .home-highlight-content,
  .home-forum-card,
  .home-story-card,
  .home-mod-feature,
  .home-mod-mini,
  .home-test-row,
  .home-video-card,
  .home-server-showcase-card,
  .server-card {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1024px) {
  .home-server-showcase-section {
    padding-inline: 20px !important;
  }

  .section-header-row,
  .home-server-showcase-head {
    width: min(100%, 760px);
    align-items: flex-start !important;
    flex-direction: column;
    gap: 16px;
  }

  .home-server-showcase-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 62px;
  }
}

@media (max-width: 768px) {
  .home-highlight-area {
    height: auto;
    min-height: 420px;
  }

  .home-highlight-main {
    min-height: 360px;
  }

  .home-highlight-content {
    padding: 0 20px 24px;
  }

  .home-highlight-title {
    font-size: clamp(26px, 8vw, 42px);
    line-height: 1.05;
  }

  .home-latest-messages {
    min-height: 0;
  }

  .home-latest-scroll {
    max-height: 440px;
  }

  .home-server-showcase-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: stretch;
    column-gap: 14px !important;
    row-gap: 62px !important;
  }

  .home-story-meta span,
  .home-test-row-meta {
    line-height: 1.25;
  }
}

@media (max-width: 520px) {
  .home-entry-section {
    padding-inline: 12px;
  }

  .home-entry-heading h1,
  .home-story-title h2,
  .home-forum-title h2 {
    font-size: clamp(28px, 10vw, 38px);
    line-height: 1;
  }

  .home-story-head,
  .home-forum-head,
  .home-maptest-head {
    gap: 14px;
  }

  .home-story-link,
  .home-forum-all,
  .home-server-showcase-actions {
    width: 100%;
    justify-content: space-between;
  }

  .home-server-showcase-grid {
    grid-template-columns: 1fr;
    row-gap: 62px !important;
  }

  .home-server-showcase-card {
    min-height: 330px;
  }
}
