/* ── Hub: «Три портала» (index.html) ── */

.hub {
  width: 100%;
  max-width: var(--page-width);
}

/* Hub fills the viewport; `safe` keeps the top reachable when content is taller */
body.hub-page #main-content {
  flex: 1;
  justify-content: safe center;
}

body.hub-page .site-footer {
  margin-top: 1.5rem;
}

/* ── Masthead (title + edition, no stat ribbon) ── */
.hub .site-header {
  margin-bottom: 1.1rem;
}

.hub h1 {
  font-size: clamp(2.2rem, 3.8vw, 2.9rem);
}

.hub .subtitle {
  margin-top: 0.5rem;
}

.hub .divider {
  max-width: 100%;
  margin: 0 0 1.9rem;
}


/* ── Three pillars ── */
.hub-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
  margin-bottom: 2rem;
  padding-inline: var(--card-ring);
}

/* Portals are shared .art-card (style.css), just bigger */
.art-card--portal {
  min-height: 208px;
  padding: 1.6rem 1.6rem 1.25rem;
}

.pillar-play { --art: url('../img/hub/play.webp'); }
.pillar-characters { --art: url('../img/hub/characters.webp'); }
.pillar-knowledge { --art: url('../img/hub/knowledge.webp'); }

.pillar-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: #7a1515;
  margin-bottom: 0.55rem;
}

.pillar-desc {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.45;
  color: #4a3010;
  max-width: 25ch;
  text-wrap: balance;
}

.pillar-go {
  margin-top: auto;
  padding-top: 1.1rem;
  align-self: flex-start;
  font-family: var(--font-heading-sm);
  font-size: 1.2rem;
  line-height: 1;
  color: #8b1a1a;
  transition: transform 0.15s ease;
}

.art-card:hover .pillar-go {
  transform: translateX(4px);
}

.hub-tool:focus-visible,
.hub-index a:focus-visible {
  outline: 2px solid var(--gold-lt);
  outline-offset: 3px;
}

/* ── Bottom band: tools + index ── */
.hub-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 1.35rem;
  align-items: stretch;
  text-align: left;
}

.hub-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(184, 134, 11, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  padding: 1.15rem 1.35rem 1.25rem;
}

.hub-section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  font-family: var(--font-heading-sm);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.hub-section-label a {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: none;
  font-style: italic;
  color: var(--subtitle-color);
  text-decoration: none;
  white-space: nowrap;
}

.hub-section-label a:hover {
  color: var(--gold-lt);
}

/* Tools list */
.hub-tool {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.15rem;
  border-top: 1px solid rgba(184, 134, 11, 0.13);
  text-decoration: none;
  color: var(--tab-color);
  transition: background 0.15s, color 0.15s;
}

.hub-tool:first-of-type {
  border-top: none;
}

.hub-tool:hover {
  color: var(--tab-color-hover);
}

.hub-tool-glyph {
  width: 26px;
  flex-shrink: 0;
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--gold-lt);
  transition: transform 0.15s;
}

.hub-tool:hover .hub-tool-glyph {
  transform: scale(1.12);
}

.hub-tool-body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.hub-tool-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--gold-lt);
  line-height: 1.2;
}

.hub-tool-desc {
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-style: italic;
  line-height: 1.35;
  color: var(--tab-color);
  opacity: 0.72;
}

/* Knowledge index */
.hub-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.4rem;
}

.hub-index a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.44rem 0.1rem;
  border-bottom: 1px dotted rgba(184, 134, 11, 0.2);
  text-decoration: none;
  color: var(--tab-color);
  font-family: var(--font-body);
  font-size: 0.86rem;
  transition: color 0.15s;
}

.hub-index a:hover {
  color: var(--gold-lt);
}

.hub-index b {
  font-family: var(--font-heading-sm);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--subtitle-color);
  opacity: 0.8;
}

/* ── Light theme ── */
[data-theme="light"] .hub-panel {
  border-color: rgba(139, 90, 20, 0.28);
  background: rgba(139, 90, 20, 0.04);
}

[data-theme="light"] .hub-tool {
  border-top-color: rgba(139, 90, 20, 0.18);
}

[data-theme="light"] .hub-tool-desc {
  opacity: 0.85;
}

[data-theme="light"] .hub-index a {
  border-bottom-color: rgba(139, 90, 20, 0.25);
}

/* ── Bonus: the topbar's long guest hint overflows below ~1400px ── */
@media (max-width: 1400px) {
  .auth-hint { display: none; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hub-pillars {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .art-card--portal {
    min-height: 0;
  }

  .pillar-desc {
    max-width: 34ch;
  }

  .hub-band {
    grid-template-columns: 1fr;
  }

  .hub-tool {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  /* Compact rows: all three portals stay within one thumb-scroll */
  .art-card--portal {
    min-height: 0;
    padding: 1rem 1.1rem;
  }

  .pillar-title {
    font-size: 1.35rem;
  }

  .pillar-desc {
    max-width: 26ch;
    font-size: 0.86rem;
  }

  .pillar-go {
    padding-top: 0.7rem;
    font-size: 1.1rem;
  }

  .hub-index {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-tool,
  .hub-tool-glyph,
  .pillar-go {
    transition: none;
  }
}
