/* =============================================================
   CRATOORA — App Shell Layout Styles
   File    : styles/appShell.css
   Loaded  : last in cascade (after hero.css)
   ============================================================= */

/* ══════════════════════════════════════════════════════════════
   HEADER — sticky + reset padding-top from old fixed-header rule
   ══════════════════════════════════════════════════════════════ */
cratoora-header {
  display: block;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 900;
}

main,
main#view-master-container {
  padding-top: 0 !important;
}

/* ══════════════════════════════════════════════════════════════
   SPA VIEW CONTAINER — subregions
   ══════════════════════════════════════════════════════════════ */
#view-master-container {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  min-height: 100dvh;
}

#region-hero {
  position: relative;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

#region-hero .hero,
#region-hero #heroSection {
  min-height: 100svh;
}

#region-body {
  display: grid;
  grid-template-columns: 1fr;
  -webkit-flex: 1;
  flex: 1;
  padding: clamp(1.25rem, 3vw, 2rem);
  gap: 1.5rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  #region-body[data-rail-active] {
    grid-template-columns: 1fr var(--rail-w, 320px);
  }
}

#region-main { min-width: 0; }
#region-rail { display: none; }
#region-body[data-rail-active] #region-rail { display: block; }

#region-panel {
  position: fixed;
  top: 64px; right: 0; bottom: 0;
  width: min(400px, 90vw);
  background: var(--c-surface, #111);
  border-left: 1px solid var(--c-border, rgba(255,255,255,0.07));
  -webkit-transform: translateX(100%);
  transform: translateX(100%);
  -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 800;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
#region-panel[data-open] {
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

/* ══════════════════════════════════════════════════════════════
   WEB COMPONENTS — CSS custom property overrides
   CSS vars inherit INTO shadow DOM — kills teal default without
   touching appShell.js on the server.
   ══════════════════════════════════════════════════════════════ */
cratoora-hm-2x2-grid {
  --cr-bg: transparent;
  background: transparent;
  overflow: visible;
}

cratoora-pillar-card {
  --cr-bg: #0e0e0e;
  background: #0e0e0e;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* ══════════════════════════════════════════════════════════════
   MARK GRADIENT — cratoora-hero slot
   ══════════════════════════════════════════════════════════════ */
cratoora-hero mark {
  background: none;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: -webkit-linear-gradient(135deg, #a78bfa 0%, #7c5cdb 50%, #c084fc 100%);
  background-image: linear-gradient(135deg, #a78bfa 0%, #7c5cdb 50%, #c084fc 100%);
}

/* ══════════════════════════════════════════════════════════════
   MERCH NAV LINK — amber accent
   ══════════════════════════════════════════════════════════════ */
li a.nav-link.nav-link--merch,
a.nav-link.nav-link--merch,
.nav-link--merch {
  color: #D97706 !important;
  -webkit-text-fill-color: #D97706 !important;
  background-image: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
}
li a.nav-link.nav-link--merch:hover,
a.nav-link.nav-link--merch:hover,
.nav-link--merch:hover {
  color: #F59E0B !important;
  -webkit-text-fill-color: #F59E0B !important;
  background-color: rgba(217, 119, 6, 0.08) !important;
  background-image: none !important;
}

/* ══════════════════════════════════════════════════════════════
   PRODUCTS DROPDOWN
   ══════════════════════════════════════════════════════════════ */
#productsDropdown {
  position: relative;
  list-style: none;
}

.nav-dropdown-trigger {
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.28rem;
  padding: 0.42rem 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  -webkit-transition: color 0.15s, background 0.15s;
  transition: color 0.15s, background 0.15s;
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger[aria-expanded="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-dd-caret {
  opacity: 0.55;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  -webkit-transition: -webkit-transform 0.22s cubic-bezier(0.23, 1, 0.32, 1);
  transition: transform 0.22s cubic-bezier(0.23, 1, 0.32, 1);
}
.nav-dropdown-trigger[aria-expanded="true"] .nav-dd-caret {
  -webkit-transform: rotate(180deg);
  transform: rotate(180deg);
}

/* ── Panel — hidden by default via HTML `hidden` attribute on the element.
   The `hidden` attr = display:none at UA level. No external CSS can beat it.
   JS toggles removeAttribute/setAttribute('hidden') to open/close.
   CSS here handles positioning, background, and the open animation only.
── */
#productsPanel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 260px;
  background-color: #131313;
  background: #131313;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 2px solid #8B5CF6;
  border-radius: 0 0 16px 16px;
  padding: 0.45rem 0.45rem 0.65rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.95);
  z-index: 950;
  -webkit-transform-origin: top left;
  transform-origin: top left;
}

/* ── Open state — JS removes `hidden`, adds .open for animation ── */
#productsPanel.open {
  opacity: 1;
  -webkit-transform: translateY(0) scale(1);
  transform: translateY(0) scale(1);
  -webkit-animation: ddIn 0.18s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation: ddIn 0.18s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@-webkit-keyframes ddIn {
  from { opacity: 0; -webkit-transform: translateY(-6px) scale(0.97); transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; -webkit-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
@keyframes ddIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dropdown rows */
.dd-link {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  opacity: 1;
  -webkit-transition: background 0.13s;
  transition: background 0.13s;
}
.dd-link:hover { background: rgba(255, 255, 255, 0.07); }

.dd-icon {
  font-size: 1.1rem;
  width: 26px;
  text-align: center;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.dd-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.dd-sub {
  display: block;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.38);
  margin-top: 1px;
}
.dd-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 0.3rem 0.85rem;
}