/* ============================================================
   BASE STYLES — Reset, Typography, Utilities
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-cream);
  color: var(--text-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

ul, ol { list-style: none; }

input, textarea, select, button {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

/* ---- Container ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--secondary);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl), 3vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { margin-bottom: var(--space-4); color: var(--text-body); }
p:last-child { margin-bottom: 0; }

/* ---- Section Heading ---- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--space-3);
}

.section-label::before,
.section-label::after {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.section-title {
  font-family: var(--font-heading);
  color: var(--secondary);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: var(--text-lg);
  max-width: 600px;
}

.text-center { text-align: center; }
.text-center .section-subtitle { margin: 0 auto; }

/* ---- Section Padding ---- */
.section {
  padding: var(--space-20) 0;
}

.section-sm {
  padding: var(--space-12) 0;
}

/* ---- Grid utilities ---- */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Flex 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; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--space-4) 0;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }

/* ---- Page header band ---- */
.page-header {
  background: linear-gradient(135deg, var(--secondary) 0%, #2C1A0E 100%);
  padding: var(--space-16) 0 var(--space-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-header h1 {
  color: #ffffff;
  position: relative;
  z-index: 1;
}

.page-header p {
  color: var(--accent-light);
  font-size: var(--text-lg);
  position: relative;
  z-index: 1;
  margin-top: var(--space-3);
}

.page-header .breadcrumb {
  justify-content: center;
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-4);
}

.page-header .breadcrumb { color: rgba(255,255,255,0.6); }
.page-header .breadcrumb a { color: var(--accent); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-cream); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---- Selection ---- */
::selection { background: var(--accent); color: var(--secondary); }

/* ---- Loading skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-warm) 25%, #f5e6cc 50%, var(--bg-warm) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Spinner ---- */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .section { padding: var(--space-12) 0; }
  .section-sm { padding: var(--space-8) 0; }
}
