/* ==========================================================================
   Sahurle Encyclopedia — Main Page portal
   Only loaded on /, so none of this touches article pages.
   ========================================================================== */

#content > h1,
#content > .subtitle,
#content > .stats { display: none; }

.mp-wrap a:hover { text-decoration: none; }

@keyframes mp-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mp-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: 14px;
  background-image: radial-gradient(rgba(205, 205, 255, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---------- Boxes ---------- */
.mp-box {
  background: #0d0d1b;
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  animation: mp-rise 0.5s ease both;
}
.mp-wrap > .mp-box:nth-child(2) { animation-delay: 0.08s; }
.mp-wrap > .mp-box:nth-child(3) { animation-delay: 0.16s; }

/* Hero sits above its siblings so its search dropdown is never buried */
.mp-hero { position: relative; z-index: 5; }

.mp-box-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-faded);
}
.mp-box-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-style: italic;
  margin: -0.3rem 0 0.9rem;
}

/* ---------- Hero ---------- */
.mp-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  padding: 2.2rem 1.4rem 1.8rem;
}
.mp-logo { width: min(58%, 260px); }
#slot-content .mp-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  border-bottom: none;
  margin: 0;
  padding-bottom: 0;
}
.mp-stats {
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.mp-stats strong { color: var(--link); font-weight: 700; }

/* Hero search bar */
.mp-hero-search {
  position: relative;
  width: min(100%, 520px);
  margin-top: 0.4rem;
}
.mp-search-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 12px 0 40px;
  background: var(--searchbar-dark);
  border: 1px solid var(--accent);
  border-radius: 10px;
  cursor: text;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.mp-search-box:hover { border-color: var(--link); }
.mp-search-box:focus-within {
  border-color: var(--link);
  box-shadow: 0 0 0 6px rgba(127, 127, 255, 0.08);
}
.mp-search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  pointer-events: none;
}
.mp-search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}
.mp-search-box input::placeholder { color: var(--text-secondary); }

/* Same white ✕ as the topbar search */
#hero-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  cursor: pointer;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
}

/* Dropdown: capped height + scroll, so 17 matches never eat the page */
#hero-search-results {
  max-height: 320px;
  overflow-y: auto;
}

/* ---------- Buttons: pop via the elastic curve ---------- */
.mp-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}
.mp-btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease-pop);
}
.mp-btn:hover { transform: scale(1.05); }
.mp-btn:active { transform: scale(0.96); }
.mp-btn-primary { background: var(--link); color: var(--background); }
.mp-btn-primary:hover { background: var(--link-hover); }
.mp-btn-ghost { background: transparent; color: var(--link); border-color: var(--accent); }
.mp-btn-ghost:hover {
  border-color: var(--link);
  background: rgba(127, 127, 255, 0.08);
}
.mp-btn-small { padding: 6px 14px; font-size: 0.8rem; }

/* ---------- About ---------- */
.mp-about p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ---------- Navigation rows (Fisch-style, smaller type) ---------- */
.mp-nav-rows { display: flex; flex-direction: column; gap: 10px; }
.mp-nav-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  align-items: stretch;
}
.mp-nav-label {
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.mp-nav-links { display: flex; flex-wrap: wrap; gap: 10px; }
.mp-nav-btn {
  flex: 1 1 auto;      /* width follows the label, stretches to fill its line */
  min-width: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--background);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.15s var(--ease-pop);
}
.mp-nav-btn:hover {
  transform: scale(1.05);
  border-color: var(--link);
  color: var(--link-hover);
}
.mp-nav-btn:active { transform: scale(0.96); }

/* Per-group tints, kept inside the palette */
.mp-nav-row:nth-child(1) .mp-nav-btn { background: rgba(127, 127, 255, 0.10); border-color: rgba(127, 127, 255, 0.35); }
.mp-nav-row:nth-child(2) .mp-nav-btn { background: rgba(255, 183, 231, 0.08); border-color: rgba(255, 183, 231, 0.30); }
.mp-nav-row:nth-child(3) .mp-nav-btn { background: rgba(94, 214, 255, 0.08);  border-color: rgba(94, 214, 255, 0.30); }
.mp-nav-row:nth-child(4) .mp-nav-btn { background: rgba(255, 196, 127, 0.08); border-color: rgba(255, 196, 127, 0.30); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .mp-wrap { padding: 10px; }
  .mp-nav-row { grid-template-columns: 1fr; gap: 6px; }
  .mp-nav-label { align-items: flex-start; }
}
@media (max-width: 480px) {
  .mp-nav-btn { white-space: normal; } /* let long labels breathe on tiny screens */
}