/*
  KörperRein Website - Global Styles
  Typography, base elements, and utility classes
*/

/* ================================
   GOOGLE FONTS IMPORT
   Montserrat (Headings) + Open Sans (Body)
   ================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Open+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* ================================
   BASE STYLES
   ================================ */

html {
  font-size: 16px; /* Base font size for rem calculations */
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-md); /* 18px for easy reading */
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-relaxed); /* 1.6 */
  color: var(--color-text-dark);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================
   TYPOGRAPHY - HEADINGS
   Following CLAUDE.md guidelines
   ================================ */

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  color: var(--color-secondary);
  margin-bottom: var(--spacing-md);
}

h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--font-size-4xl); /* 48px */
  line-height: 1.1;
}

h2 {
  font-size: var(--font-size-2xl); /* 32px */
  font-weight: var(--font-weight-semibold);
}

h3 {
  font-size: var(--font-size-xl); /* 24px */
  font-weight: var(--font-weight-semibold);
}

h4 {
  font-size: var(--font-size-lg); /* 20px */
  font-weight: var(--font-weight-semibold);
}

h5 {
  font-size: var(--font-size-md); /* 18px */
  font-weight: var(--font-weight-semibold);
}

h6 {
  font-size: var(--font-size-base); /* 16px */
  font-weight: var(--font-weight-semibold);
}

/* Responsive Typography - Larger H1 on desktop */
@media (min-width: 768px) {
  h1 {
    font-size: 3.5rem;
  }
}

/* ================================
   TYPOGRAPHY - PARAGRAPHS & TEXT
   ================================ */

p {
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-relaxed); /* 1.6 */
}

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

strong, b {
  font-weight: var(--font-weight-semibold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--font-size-sm);
}

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

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

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

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

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

ul, ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin-bottom: var(--spacing-sm);
  line-height: var(--line-height-relaxed);
}

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

/* Unstyled lists (for navigation, etc.) */
.list-none {
  list-style: none;
  padding-left: 0;
}

.list-none li {
  margin-bottom: 0;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: 0;
}

figcaption {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin-top: var(--spacing-sm);
  text-align: center;
}

/* ================================
   UTILITY CLASSES
   ================================ */

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Section Spacing */
.section {
  padding-top: var(--spacing-3xl);
  padding-bottom: var(--spacing-3xl);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.section-sm {
  padding-top: var(--spacing-2xl);
  padding-bottom: var(--spacing-2xl);
}

.section-lg {
  padding-top: calc(var(--spacing-3xl) * 1.5);
  padding-bottom: calc(var(--spacing-3xl) * 1.5);
}

/* Responsive padding on mobile */
@media (max-width: 768px) {
  .section {
    padding-top: var(--spacing-2xl);
    padding-bottom: var(--spacing-2xl);
  }

  .section-lg {
    padding-top: var(--spacing-3xl);
    padding-bottom: var(--spacing-3xl);
  }
}

/* Text Alignment */
.text-left {
  text-align: left;
}

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

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

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

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

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

/* Display Utilities */
.block {
  display: block;
}

.inline {
  display: inline;
}

.inline-block {
  display: inline-block;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

.hidden {
  display: none !important;
}

/* Spacing Utilities */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.pt-sm { padding-top: var(--spacing-sm); }
.pt-md { padding-top: var(--spacing-md); }
.pt-lg { padding-top: var(--spacing-lg); }
.pt-xl { padding-top: var(--spacing-xl); }

.pb-sm { padding-bottom: var(--spacing-sm); }
.pb-md { padding-bottom: var(--spacing-md); }
.pb-lg { padding-bottom: var(--spacing-lg); }
.pb-xl { padding-bottom: var(--spacing-xl); }

/* Flexbox Utilities */
.flex-row {
  flex-direction: row;
}

.flex-column {
  flex-direction: column;
}

.justify-start {
  justify-content: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.align-start {
  align-items: flex-start;
}

.align-center {
  align-items: center;
}

.align-end {
  align-items: flex-end;
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

/* Grid Utilities */
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3 {
    grid-template-columns: 1fr;
  }
}

/* ================================
   ACCESSIBILITY
   ================================ */

/* Skip to main content link (for keyboard users) */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  z-index: 9999;
}

.skip-to-main:focus {
  top: 0;
}

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

/* ================================
   RESPONSIVE UTILITIES
   ================================ */

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

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