/* layout.css — structural layout styles for MarketPilot app
 * Contains layout primitives: sticky header, container, main, footer.
 * Component-scoped styles live in components.css; design tokens in tokens.css.
 * Story 8.1: sticky header chrome per UX skeleton §10.1.
 *
 * Do NOT add component-scoped styles here — they belong in components.css.
 */

/* ── Container ───────────────────────────────────────────────────────────── */

.mp-container {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ── Sticky header — backdrop-filter: blur(12px) + 92% page-bg tint ───────
 * Aligned to Pedro's header-pure.html ground truth (2026-05-19): 92% opacity
 * of the page background colour (#f5f7fa), not 85% white. Pedro provided
 * header-pure.html as the explicit design override after the 85%-vs-92%
 * deferred reconciliation was raised. The test at
 * tests/app/routes/dashboard/index.test.js:489-492 pins this rule. */

.mp-sticky-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(245, 247, 250, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--mp-line-soft, var(--mp-line, oklch(88% 0.01 255)));
}

.mp-header-inner {
  /* header-pure.html: max-width 1400px, padding 14px 32px, gap 24px,
   * justify-content: space-between (left group + right group). Overrides
   * .mp-container's max-width 1280px and 24px padding inside the header. */
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.mp-header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.mp-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── Logo ─────────────────────────────────────────────────────────────────── */
/* Design bundle (`dashboard-shared.jsx` Logo, 2026-05-18 alignment):
 * Rounded square primary-color mark with a white triangle (clip-path) inside,
 * beside the "MarketPilot" wordmark in Manrope 22px / weight 800.
 */

.mp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.mp-logo-mark {
  /* header-pure.html: triangle is a ::before pseudo (no inner span). The
   * pseudo's content is inscribed via clip-path + rotated 15deg. */
  width: 28px;
  height: 28px;
  background: var(--mp-primary, oklch(38% 0.14 255));
  border-radius: 6px;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}

.mp-logo-mark::before {
  content: '';
  width: 12px;
  height: 12px;
  background: #ffffff;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(15deg);
}

.mp-logo-text {
  /* Exact design-spec values (2026-05-18 inspector): Manrope 22px / 800 /
   * #1a2233 / line-height 1.40 / tracking -0.7px. */
  font-family: var(--mp-font-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.40;
  letter-spacing: -0.7px;
  color: var(--mp-primary, oklch(38% 0.14 255));
}

/* ── Header nav ──────────────────────────────────────────────────────────── */
/* header-pure.html: gap 20px (was 8px), no margin-inline-start (left/right
 * grouping handles positioning), color transition 0.15s on links. */

.mp-header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.mp-header-nav-link {
  /* header-pure.html exact values: 13px / weight 500 / #8590a3 / no padding.
   * Plain text element with colour-shift on hover (0.15s transition).
   * Accessibility note: 17px-tall click target is below the 44px touch
   * recommendation; accept per design.
   */
  font-size: 13px;
  font-weight: 500;
  color: var(--mp-ink-3, #8590a3);
  text-decoration: none;
  padding: 0;
  border-radius: 0;
  transition: color 0.15s;
}

.mp-header-nav-link--active {
  font-weight: 600;
  color: var(--mp-primary, oklch(38% 0.14 255));
}

.mp-header-nav-link:hover {
  color: var(--mp-primary, oklch(38% 0.14 255));
}

/* ── Session avatar ──────────────────────────────────────────────────────── */

.mp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mp-primary, oklch(38% 0.14 255));
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
}

.mp-avatar-initials {
  /* Exact design-spec values (2026-05-18 inspector): 12px / weight 700 /
   * #ffffff / line-height 1.40. Avatar container is 32×32 with #1a2233 fill
   * (--mp-primary) and 50% border-radius (already matches). */
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.40;
}

/* ── Banner zone ─────────────────────────────────────────────────────────── */

/* Banner zone is a structural slot above the main content. No declarations
 * needed today — Story 8.8 will populate visual rules when banners.eta lands.
 * The empty class is intentional so the HTML hook is stable across stories. */

/* ── Main body slot ──────────────────────────────────────────────────────── */

.mp-main {
  /* flex: 1 so the body's flex-column layout (set in tokens.css .mp-body)
   * pushes the footer to the bottom of the viewport when content is short.
   * This used to live in tokens.css alongside a broken display:flex rule
   * that turned .mp-main into a horizontal flex row — removed 2026-05-15.
   */
  flex: 1;
  padding-block: 32px;
  min-height: calc(100vh - 56px - 48px); /* viewport minus header and footer */
  position: relative; /* for mp-dry-run-badge absolute positioning */
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.mp-footer {
  border-top: 1px solid var(--mp-line, oklch(88% 0.01 255));
  padding: var(--mp-spacing-md) var(--mp-spacing-lg);
  text-align: center;
}

.mp-footer .mp-container {
  height: 48px;
  display: flex;
  align-items: center;
}

.mp-footer-copy {
  margin: 0;
  font-size: 12px;
  color: var(--mp-ink-3, oklch(48% 0.02 255));
}
