/* Global Styles - Paolo Ventura Inspired */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Colors */
  --color-text-primary: #2f2e2e;
  --color-text-secondary: #605e5e;
  --color-text-muted: #999;
  --color-gray-dark: #333;
  --color-gray-medium: #666;
  --color-gray-light: #888;
  --color-gray-lighter: #ccc;
  --color-gray-lightest: #ddd;
  --color-border: #eee;
  --color-black: #000;
  --color-near-black: #111;
  --color-white: #fff;
  --color-bg-hover: #f8f8f8;
  --color-bg-light: #f5f5f5;
  --color-selection-bg: rgba(0, 0, 0, 0.1);
  --color-overlay: rgba(255, 255, 255, 0.95);
  --color-dropdown-border: rgba(0, 0, 0, 0.08);

  /* Typography Scale */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  --font-size-xs: 0.76rem;
  --font-size-sm: 0.85rem;
  --font-size-base: 1rem;
  --font-size-md: 1.0625rem;
  --font-size-lg: 1.2rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 1.8rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3rem;

  --line-height-tight: 1.4;
  --line-height-normal: 1.8;

  --letter-spacing-tight: 0.01em;
  --letter-spacing-normal: 0.02em;
  --letter-spacing-wide: 0.05em;
  --letter-spacing-wider: 0.15em;

  /* Spacing System */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  /* Container Widths */
  --container-main: 900px; /* Global max-width for all content */
  --container-xs: 686px;
  --container-sm: 800px;
  --container-md: 914px;
  --container-lg: 1000px;
  --container-xl: 1200px;
  --container-2xl: 1400px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
}

/* ============================================
   CSS Reset & Base Styles
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  background: var(--color-white);
  font-weight: var(--font-weight-light);
  font-size: 15px;
  text-transform: uppercase;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-normal);
  margin-bottom: var(--spacing-md);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--font-size-3xl);
  letter-spacing: var(--letter-spacing-wide);
}

h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-regular);
}

h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-regular);
}

p {
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-normal);
  color: var(--color-text-secondary);
  font-size: var(--font-size-md);
}

/* Typography Utilities */
.text-muted {
  color: var(--color-text-muted);
}

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

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

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

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

/* ============================================
   Links
   ============================================ */
a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.7;
}

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

img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* ============================================
   Buttons
   ============================================ */
button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-xl);
  background: var(--color-near-black);
  color: var(--color-white);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-transform: uppercase;
}

.btn:hover {
  background: var(--color-black);
  opacity: 1;
}

/* ============================================
   Forms
   ============================================ */
input,
textarea,
select {
  font: inherit;
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-gray-lightest);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background: var(--color-white);
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-gray-medium);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

/* ============================================
   Layout Utilities
   ============================================ */
.container {
  max-width: var(--container-2xl);
  margin: 0 auto;
  padding: 0 var(--spacing-2xl);
}

.container-xs {
  max-width: var(--container-xs);
  margin: 0 auto;
}

.container-sm {
  max-width: var(--container-sm);
  margin: 0 auto;
}

.container-md {
  max-width: var(--container-md);
  margin: 0 auto;
}

.container-lg {
  max-width: var(--container-lg);
  margin: 0 auto;
}

.container-xl {
  max-width: var(--container-xl);
  margin: 0 auto;
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

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

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

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

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

/* Grid Utilities */
.grid {
  display: grid;
}

/* Spacing Utilities */
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-lg); }
.gap-lg { gap: var(--spacing-xl); }
.gap-xl { gap: var(--spacing-2xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-md); }
.mb-2 { margin-bottom: var(--spacing-lg); }
.mb-3 { margin-bottom: var(--spacing-xl); }
.mb-4 { margin-bottom: var(--spacing-2xl); }

.mt-1 { margin-top: var(--spacing-md); }
.mt-2 { margin-top: var(--spacing-lg); }
.mt-3 { margin-top: var(--spacing-xl); }
.mt-4 { margin-top: var(--spacing-2xl); }

/* ============================================
   Common Layout Patterns
   ============================================ */
/*
 * IMPORTANT: BaseLayout now provides centralized content container
 * - Use fullWidth={true} prop for pages needing custom full-width layouts (hero, work viewer)
 * - Use default (fullWidth={false}) for standard pages (bio, contact) - gets .page-content container
 * - .page-content provides consistent max-width and centering across all standard pages
 */

/* Full-width container */
.full-width {
  width: 100%;
}

/* Flex centering */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Flex column centering */
.flex-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Image Utilities
   ============================================ */
/* Standard contained image (used in hero, item view) */
.image-contained {
  max-width: 85%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Responsive full image */
.image-responsive {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

/* ============================================
   Navigation & Interactive Elements
   ============================================ */
/* Arrow buttons (used in work viewer) */
.arrow-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-gray-medium);
  cursor: pointer;
  padding: var(--spacing-md);
  transition: color var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arrow-btn:hover {
  color: var(--color-near-black);
  transform: translateY(-50%) scale(1.1);
  opacity: 1;
}

.arrow-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.arrow-prev {
  left: var(--spacing-lg);
}

.arrow-next {
  right: var(--spacing-lg);
}

@media (max-width: 768px) {
  .arrow-btn svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .arrow-prev {
    left: var(--spacing-xs);
  }

  .arrow-next {
    right: var(--spacing-xs);
  }

  .arrow-btn {
    padding: var(--spacing-xs);
  }
}

/* ============================================
   Lists & Data Display
   ============================================ */
/* Standard list reset */
.list-reset {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Grid list item (used in bio CV, exhibitions) */
.grid-list-item {
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--color-border);
}

/* Two-column grid layout */
.grid-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-3xl);
}

@media (max-width: 768px) {
  .grid-two-cols {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }
}

/* ============================================
   Section Utilities
   ============================================ */
/* Page section */
.page-section {
  margin-top: var(--spacing-2xl);
}

/* Content section with normal line height */
.content-section {
  line-height: var(--line-height-normal);
  color: var(--color-gray-dark);
}

/* ============================================
   Misc Utilities
   ============================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   Selection
   ============================================ */
::selection {
  background: var(--color-selection-bg);
  color: inherit;
}

::-moz-selection {
  background: var(--color-selection-bg);
  color: inherit;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--color-gray-lighter);
  border-radius: var(--radius-sm);
}

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-xl);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 var(--spacing-lg);
  }

  h1 {
    font-size: var(--font-size-4xl);
  }

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

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

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  h1 {
    font-size: var(--font-size-3xl);
  }

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