/*
 * Modern Faceted Search - Base Styles
 * CSS reset, typography, and foundational styles
 */

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate-800);
  background-color: var(--background-color);
}

/* Ensure UTF-8 character support for special symbols */
html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--slate-900);
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.1rem;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* ---------- Links ---------- */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--indigo-700);
  text-decoration: none;
}

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

/* ---------- Lists ---------- */
ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

ol {
  padding-left: 1.5rem;
  margin: 0;
}

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

/* ---------- Buttons ---------- */
button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  padding: 0;
}

button:focus-visible {
  outline: 2px solid var(--indigo-700);
  outline-offset: 2px;
}

/* ---------- Forms ---------- */
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--indigo-700);
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.15);
}

/* Enhanced focus-visible for keyboard users */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--indigo-600);
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.2), 0 0 0 1px var(--indigo-600);
}

/* ---------- Tables ---------- */
table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 1.5rem 0;
}

.main-content > .container {
  position: relative;
}

.content-area {
  width: 100%;
  background-color: transparent;
}

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

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--indigo-700);
  color: var(--white-color);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: 100;
}

.skip-link:focus {
  top: 10px;
  left: 10px;
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--indigo-700);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- Utility Classes ---------- */
.hidden {
  display: none !important;
}

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

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

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

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

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