/* ========================================
   DARE Lab - Base Styles
   Reset, Typography, and Global Styles
   ======================================== */

/* ===================
   CSS RESET
   Modern reset based on Josh Comeau's approach
   =================== */

*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: linear-gradient(135deg, var(--color-bg-warm) 0%, var(--color-nature-sky-light) 50%, var(--color-bg) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Remove default focus outline, add custom one */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===================
   TYPOGRAPHY
   =================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-bold);
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

h4 {
  font-size: var(--font-size-h4);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

/* Lead paragraph */
.lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
}

/* Small text */
small, .text-sm {
  font-size: var(--font-size-sm);
}

.text-xs {
  font-size: var(--font-size-xs);
}

.text-lg {
  font-size: var(--font-size-lg);
}

/* Text colors */
.text-primary {
  color: var(--color-primary);
}

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

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

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

/* Text alignment */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* Font weights */
.font-normal {
  font-weight: var(--font-weight-normal);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

/* ===================
   LINKS
   =================== */

a {
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

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

/* Styled link with underline effect */
.link {
  color: var(--color-primary);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size var(--transition-normal);
}

.link:hover {
  background-size: 100% 1px;
}

/* External link indicator */
.link-external::after {
  content: ' ↗';
  font-size: 0.8em;
}

/* ===================
   LISTS
   =================== */

.list {
  padding-left: var(--space-6);
}

.list li {
  margin-bottom: var(--space-2);
  position: relative;
}

.list-disc {
  list-style-type: disc;
}

.list-decimal {
  list-style-type: decimal;
}

/* Custom bullet list */
.list-custom li::before {
  content: '→';
  position: absolute;
  left: calc(-1 * var(--space-5));
  color: var(--color-accent);
}

/* ===================
   SELECTION
   =================== */

::selection {
  background-color: var(--color-primary-100);
  color: var(--color-primary-dark);
}

/* ===================
   SCROLLBAR (for webkit browsers)
   =================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-warm);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-warm);
}

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

/* ===================
   IMAGES
   =================== */

img {
  object-fit: cover;
}

.img-rounded {
  border-radius: var(--radius-md);
}

.img-circle {
  border-radius: var(--radius-full);
}

/* ===================
   VISIBILITY UTILITIES
   =================== */

.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;
}

.hidden {
  display: none !important;
}

.visible {
  visibility: visible;
}

.invisible {
  visibility: hidden;
}

/* Show/hide based on screen size */
@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ===================
   SPACING UTILITIES
   =================== */

/* Margin utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* ===================
   HORIZONTAL RULE
   =================== */

hr {
  border: none;
  height: 1px;
  background-color: var(--color-border);
  margin: var(--space-8) 0;
}

/* ===================
   BLOCKQUOTE
   =================== */

blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-6);
  margin: var(--space-6) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

blockquote cite {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  font-style: normal;
  color: var(--color-text-muted);
}

/* ===================
   CODE
   =================== */

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--color-bg-warm);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  background-color: var(--color-bg-warm);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

/* ===================
   TABLES
   =================== */

table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
}

th, td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  background-color: var(--color-bg-warm);
}

tr:hover {
  background-color: var(--color-bg-warm);
}

/* ===================
   PRINT STYLES
   =================== */

@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .no-print {
    display: none !important;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}
