/* ============================================================
   HTG — Sidebar Portal Buttons (Restored Vibrant Colors)
   Clean, grouped layout. Drawer width: 270px.
   ============================================================ */

/* --- Portal Stack Section --- */
.htg-portals-stack {
  margin: 0.9rem 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}
:root[data-theme="light"] .htg-portals-stack,
:root:not([data-theme]) .htg-portals-stack {
  border-top-color: rgba(34, 85, 41, 0.14);
}

.htg-portals-stack__eyebrow {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.50;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
  color: inherit;
}

.htg-portals-stack__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.htg-portals-stack__item {
  margin: 0;
  padding: 0;
}

.htg-portals-stack__form {
  margin: 0;
  display: block;
}

/* ----- BUTTON BASE ----- */
.htg-pbtn {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #FFFFFF;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 250ms ease,
    border-color 250ms ease;
  text-align: left;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.htg-pbtn::before {
  /* VIBRANT color layer — restored to full opacity */
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  opacity: 0.92;
  z-index: 0;
  pointer-events: none;
}

.htg-pbtn::after {
  /* Glass sheen on top */
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.20) 0%,
    rgba(255,255,255,0) 40%,
    rgba(0,0,0,0.08) 100%);
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.htg-pbtn > * { position: relative; z-index: 2; }

.htg-pbtn:hover,
.htg-pbtn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.45);
  outline: none;
  border-color: rgba(255, 255, 255, 0.30);
}

.htg-pbtn:active { transform: translateY(0); }

/* ----- ICON ----- */
.htg-pbtn__icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, 0.30),
    inset -1px -1px 2px rgba(0, 0, 0, 0.15);
}

.htg-pbtn__icon svg {
  width: 15px; height: 15px;
  color: currentColor;
}

/* ----- BODY ----- */
.htg-pbtn__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.htg-pbtn__label {
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.15;
}

.htg-pbtn__desc {
  font-size: 0.65rem;
  opacity: 0.78;
  line-height: 1.25;
}

/* ----- ARROW ----- */
.htg-pbtn__arrow {
  flex-shrink: 0;
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.htg-pbtn:hover .htg-pbtn__arrow {
  transform: translateX(3px);
  opacity: 1;
}

.htg-pbtn__arrow svg { width: 13px; height: 13px; }

/* ============================================================
   PALETTES — Restored original vibrant gradients
   ============================================================ */
.htg-pbtn[data-htg-palette="teal"]::before {
  background: linear-gradient(135deg, #00C2CB 0%, #008B91 100%);
}
.htg-pbtn[data-htg-palette="orange"]::before {
  background: linear-gradient(135deg, #EF9623 0%, #B2580F 100%);
}
.htg-pbtn[data-htg-palette="green"]::before {
  background: linear-gradient(135deg, #4AAB48 0%, #225529 100%);
}
.htg-pbtn[data-htg-palette="amber"]::before {
  background: linear-gradient(135deg, #F4A522 0%, #D87A16 100%);
}
.htg-pbtn[data-htg-palette="forest"]::before {
  background: linear-gradient(135deg, #225529 0%, #0E2A14 55%, #EF9623 130%);
}
.htg-pbtn[data-htg-palette="teal-green"]::before {
  background: linear-gradient(135deg, #00C2CB 0%, #4AAB48 100%);
}
.htg-pbtn[data-htg-palette="gold"]::before {
  background: linear-gradient(135deg, #FFD302 0%, #EF9623 100%);
}
.htg-pbtn[data-htg-palette="gold"] { color: #0E2A14; }
.htg-pbtn[data-htg-palette="gold"] .htg-pbtn__icon {
  background: rgba(14, 42, 20, 0.15);
}
.htg-pbtn[data-htg-palette="solid-green"]::before {
  background: linear-gradient(135deg, #4AAB48 0%, #2E7D2D 100%);
}
.htg-pbtn[data-htg-palette="muted-red"]::before {
  background: linear-gradient(135deg, rgba(190, 70, 60, 0.65) 0%, rgba(140, 40, 40, 0.65) 100%);
}
.htg-pbtn[data-htg-palette="muted-red"] {
  border-color: rgba(255, 255, 255, 0.10);
  opacity: 0.88;
}

/* Light mode */
:root[data-theme="light"] .htg-pbtn,
:root:not([data-theme]) .htg-pbtn {
  color: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.07);
}
:root[data-theme="light"] .htg-pbtn[data-htg-palette="gold"] { color: #0E2A14; }

/* Light mode gold contrast fix */
[data-theme="light"] .htg-pbtn[data-htg-palette="gold"] { color: #0E2A14; }
[data-theme="light"] .htg-pbtn[data-htg-palette="gold"] .htg-pbtn__icon {
  background: rgba(14, 42, 20, 0.12);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .htg-pbtn { transition: none; }
  .htg-pbtn:hover { transform: none; }
  .htg-pbtn__arrow { transition: none; }
}

/* Narrow phones */
@media (max-width: 360px) {
  .htg-pbtn { padding: 0.38rem 0.5rem; gap: 0.4rem; }
  .htg-pbtn__icon { width: 26px; height: 26px; }
  .htg-pbtn__label { font-size: 0.74rem; }
  .htg-pbtn__desc { font-size: 0.62rem; }
}
