/**
 * 100x Life Planning System - Base Styles
 * Reset, typography, and common elements
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent page-level horizontal scroll from off-canvas elements (the parking-lot
   drawer slides off the right edge). Clipping at the root doesn't create a new
   scroll container, so the sticky header/nav and the action grid's own
   horizontal scroll are unaffected; it's a no-op when nothing overflows. */
html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: calc(18px + var(--text-bump));
  background: var(--bg-secondary);
  color: var(--text-dark);
  min-height: 100vh;
  position: relative;
  line-height: 1.5;
}

/* Full-width topography background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background-image: url("/assets/topography-teal-7429a986.svg");
  background-size: 900px 900px;
  background-repeat: repeat;
  background-position: center top;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 60%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 60%);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.2;
}

/* Typography - 100x Forum sizes */
h1 {
  font-size: calc(48px + var(--text-bump));
}

h2 {
  font-size: calc(32px + var(--text-bump));
}

h3 {
  font-size: calc(26px + var(--text-bump));
}

h4 {
  font-size: calc(24px + var(--text-bump));
}

h5 {
  font-size: calc(20px + var(--text-bump));
}

h6 {
  font-size: calc(18px + var(--text-bump));
}

p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* Lead text style */
.lead {
  font-size: calc(20px + var(--text-bump));
  font-weight: 400;
  line-height: 1.7;
}

/* UI font utility */
.font-ui {
  font-family: var(--font-ui);
}

/* Links */
a {
  color: var(--teal-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--text-dark);
}

/* Focus states for accessibility */
:focus-visible {
  outline: 2px solid var(--teal-accent);
  outline-offset: 2px;
}

/* Screen reader only - visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -100px; /* fully off-screen until focused (its height exceeded the old -40px) */
  left: 0;
  background: var(--navy-primary);
  color: var(--text-light);
  padding: 8px 16px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 500;
}

.skip-link:focus {
  top: 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Selection */
::selection {
  background: var(--teal-light);
  color: var(--navy-primary);
}

/* Utility classes */
.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-primary {
  color: var(--navy-primary);
}

.text-accent {
  color: var(--teal-accent);
}

.font-heading {
  font-family: var(--font-heading);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Expandable Text - for user content that shouldn't be truncated */
.expandable-text {
  display: inline;
}

.btn-expand-text {
  background: none;
  border: none;
  color: var(--teal-accent);
  cursor: pointer;
  font-size: calc(0.85em + var(--text-bump));
  padding: 0;
  margin-left: 0.25rem;
  font-weight: 500;
}

.btn-expand-text:hover {
  text-decoration: underline;
}
