/* ═══════════════════════════════════════════════════════════
   RepublicMC — Layout & Structural Grid System
   ═══════════════════════════════════════════════════════════ */

/* ── Page Shell & Containers ────────────────────────────── */
.page-shell {
  position: relative;
}

.page-shell::before {
  display: none;
}

.container {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

.section {
  padding: 80px 0;
}

.section--store-top {
  padding-top: 40px;
}

.section--store-top + .section {
  padding-top: 24px;
}

.grid {
  display: grid;
  gap: 16px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  z-index: 9999;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
}

.skip-link:focus {
  left: 16px;
}

/* ── Content Grids ──────────────────────────────────────── */
.features-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.store-grid,
.vote-grid,
.rules-grid,
.support-grid,
.leaderboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.panel--padded {
  padding: 24px;
  border-radius: var(--radius-lg);
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 24px 0 16px;
}

.hero-shell {
  position: relative;
  display: grid;
  gap: 16px;
}

.hero-banner {
  position: relative;
  min-height: 520px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.hero-banner::before,
.hero-banner::after {
  display: none;
}

.hero-banner__content {
  position: absolute;
  z-index: 2;
  left: 44px;
  top: 88px;
  width: min(50%, 520px);
  color: var(--text);
}

.hero-brand-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-mini-mark {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
}

.hero-mini-mark img {
  display: block;
  width: 72%;
  height: 72%;
  object-fit: contain;
  margin: 10px;
  transform: translateY(19%);
}

.hero-brand-row strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hero-brand-row span {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.hero-banner .kicker {
  color: var(--text-muted);
  background: var(--surface);
  border-color: var(--border);
  margin-bottom: 14px;
}

.hero-banner .title {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text);
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.95;
}

.hero-banner .subtitle {
  max-width: 34ch;
  color: var(--text-muted);
  margin-bottom: 22px;
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.55;
}

.hero-banner .hero-actions {
  margin: 0;
}

.hero-banner .btn-secondary,
.hero-banner .btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--border);
}

.hero-banner .btn-gold {
  color: var(--text);
}

.hero-banner__art {
  position: absolute;
  inset: 0;
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}

/* ── Hero Status Card ───────────────────────────────────── */
.hero-status-card {
  position: absolute;
  z-index: 3;
  right: 20px;
  bottom: 20px;
  width: min(440px, calc(100% - 40px));
  padding: 20px 22px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: var(--glass-border);
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: grid;
  grid-template-columns: 68px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 16px;
  row-gap: 0;
  align-items: center;
  transition: box-shadow 150ms var(--ease);
}

.status-icon {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: var(--accent-light);
  border: 1px solid rgba(14, 165, 201, 0.18);
  align-self: center;
}

.status-icon img {
  width: 36px;
  height: 36px;
}

.status-copy {
  grid-column: 2;
  grid-row: 1;
  padding-top: 2px;
}

.status-copy strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.status-copy span {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.status-copy span b {
  color: var(--text);
}

.status-ip {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: var(--glass-border);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.status-bar {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 14px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.status-bar span {
  display: block;
  width: 36%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.contact-staff-btn {
  display: none;
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  margin-top: 8px;
  padding: 5px 14px;
  font-size: 0.76rem;
  border-radius: 999px;
  white-space: nowrap;
}

.hero-status-card.is-offline .status-ip,
.hero-status-card.is-offline .status-bar {
  display: none;
}

.hero-status-card.is-offline .contact-staff-btn {
  display: inline-flex;
}

/* ── Hero Join Strip ────────────────────────────────────── */
.hero-join-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.join-strip__left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.join-strip__avatar {
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.join-strip__left h2 {
  margin: 0 0 5px;
  font-size: clamp(1.1rem, 2vw, 1.65rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.join-strip__left p {
  margin: 0;
  color: var(--text-muted);
  max-width: 42ch;
  line-height: 1.5;
  font-size: 0.9rem;
}

.join-strip__right {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.join-version {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.join-server-btn {
  min-width: 180px;
  padding-inline: 22px;
}

.bedrock-btn {
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
}

.bedrock-btn:hover {
  background: var(--accent-light);
  border-color: rgba(14, 165, 201, 0.3);
  color: var(--accent-dark);
}

/* ── Hero Stat Rows & Compatibility Layout ──────────────── */
.hero-live-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hero-live-row .stat-card {
  margin-top: 0;
}

.hero-grid {
  position: relative;
  z-index: 2;
  width: min(100% - 32px, var(--max));
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
}

.hero-copy {
  padding: 20px 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.hero-actions--compact {
  margin: 0;
}

.hero-panel {
  position: relative;
  min-height: 460px;
  border-radius: var(--radius-xl);
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.hero-panel::before {
  display: none;
}

.hero-figure {
  position: absolute;
  inset: 44px 20px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}

.hero-figure svg,
.hero-figure .bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-figure .floating-logo {
  position: absolute;
  left: 50%;
  top: 18%;
  width: min(62vw, 340px);
  transform: translateX(-50%);
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.12));
  animation: float 7s ease-in-out infinite;
}

.floating-note {
  position: absolute;
  left: 20px;
  bottom: 20px;
  right: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.note {
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 14px;
}

.note span {
  display: block;
  color: var(--text-muted);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.note strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
  color: var(--text);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

/* ── Gallery Layout ─────────────────────────────────────── */
.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-chip {
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}

.filter-chip[aria-pressed="true"],
.filter-chip:hover {
  color: var(--text);
  background: var(--accent-light);
  border-color: rgba(14, 165, 201, 0.28);
}

.gallery-grid {
  columns: 3 280px;
  column-gap: 14px;
}

.gallery-card {
  break-inside: avoid;
  margin-bottom: 14px;
  padding: 0;
  cursor: zoom-in;
  transition: border-color 150ms var(--ease);
}

.gallery-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.gallery-copy {
  padding: 14px 16px 16px;
}

/* ── Layout Responsive ──────────────────────────────────── */
@media (max-width: 1180px) {
  .hero-grid,
  .store-grid,
  .vote-grid,
  .rules-grid,
  .support-grid,
  .leaderboard-grid,
  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stats,
  .stats-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-banner__content {
    width: min(56%, 500px);
  }

  .hero-status-card {
    position: relative;
    right: auto;
    bottom: auto;
    width: auto;
    margin: 0 16px 16px;
  }

  .hero-live-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .hero-grid,
  .store-grid,
  .vote-grid,
  .rules-grid,
  .support-grid,
  .leaderboard-grid,
  .features-grid,
  .hero-stats,
  .stats-strip {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 16px;
  }

  .hero-panel {
    min-height: 380px;
  }

  .floating-note {
    grid-template-columns: 1fr;
  }

  .hero-banner__content {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    padding: 24px 18px 0;
  }

  .hero-banner__art {
    display: none;
  }

  .hero-art {
    object-position: center center;
  }

  .hero-status-card {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    right: auto;
    width: min(380px, calc(100% - 40px));
    margin: 0;
    grid-template-columns: 68px 1fr;
  }

  .status-ip {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .status-bar {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .hero-join-strip {
    grid-template-columns: 1fr;
  }

  .join-strip__left {
    align-items: flex-start;
  }

  .join-strip__avatar {
    width: 90px;
    height: 90px;
  }

  .join-strip__right {
    justify-items: start;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 18px, var(--max));
  }

  .section--store-top + .section {
    padding-top: 8px;
  }

  .section {
    padding: 60px 0;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-live-row {
    grid-template-columns: 1fr;
  }

  .hero-status-card {
    position: relative;
    left: auto;
    transform: none;
    bottom: auto;
    width: 100%;
    margin: 12px 0 0;
    grid-template-columns: 56px 1fr;
  }

  .hero-banner {
    min-height: 0;
  }

  .join-server-btn {
    min-width: 0;
    width: 100%;
  }

  .hero-banner__content {
    padding-inline: 16px;
  }

  .status-icon {
    width: 56px;
    height: 56px;
  }

  .hero-join-strip {
    padding: 14px;
  }
}

