/* ============================================
   PARKFIELD LEGAL GROUP - Base Styles
   Reset, Typography, and Element Defaults
   ============================================ */

/* ========== Modern CSS Reset ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--color-gray-800);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Prevent body scroll when modal/loader is open */
body.no-scroll {
  overflow: hidden;
}

/* ========== Typography ========== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-navy-900);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-tight);
}

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

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

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

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

h6 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
}

/* Responsive heading sizes */
@media (min-width: 768px) {
  h1 {
    font-size: var(--text-5xl);
  }
  h2 {
    font-size: var(--text-4xl);
  }
  h3 {
    font-size: var(--text-3xl);
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: var(--text-6xl);
  }
  h2 {
    font-size: var(--text-5xl);
  }
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-gray-600);
}

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

a {
  color: var(--color-navy-900);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

a:hover {
  color: var(--color-gold-500);
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-gold-500);
  outline-offset: 2px;
}

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

em,
i {
  font-style: italic;
}

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

/* ========== Lists ========== */

ul,
ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

li {
  margin-bottom: var(--space-2);
  color: var(--color-gray-600);
}

/* ========== Images ========== */

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

/* ========== Form Elements ========== */

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--color-gray-800);
  background-color: var(--color-white);
  border: var(--border-width-thin) solid var(--color-gray-300);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  transition:
    border-color var(--duration-fast) var(--ease-default),
    box-shadow var(--duration-fast) var(--ease-default);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-gold-500);
  box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.2);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-gray-400);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

label {
  display: block;
  font-weight: var(--font-medium);
  color: var(--color-navy-900);
  margin-bottom: var(--space-2);
}

/* ========== Tables ========== */

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

th,
td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: var(--border-width-thin) solid var(--color-gray-200);
}

th {
  font-weight: var(--font-semibold);
  color: var(--color-navy-900);
  background-color: var(--color-gray-100);
}

/* ========== Horizontal Rule ========== */

hr {
  border: none;
  border-top: var(--border-width-thin) solid var(--color-gray-200);
  margin: var(--space-8) 0;
}

/* ========== Blockquote ========== */

blockquote {
  border-left: var(--border-width-thick) solid var(--color-gold-500);
  padding-left: var(--space-6);
  margin: var(--space-6) 0;
  font-style: italic;
  color: var(--color-gray-600);
}

/* ========== Code ========== */

code {
  font-family: "Fira Code", "Consolas", monospace;
  font-size: var(--text-sm);
  background-color: var(--color-gray-100);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

pre {
  background-color: var(--color-gray-100);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

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

/* ========== Selection ========== */

::selection {
  background-color: var(--color-gold-500);
  color: var(--color-white);
}

/* ========== Scrollbar Styling ========== */

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

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* ========== Skip to Content (Accessibility) ========== */

.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background-color: var(--color-navy-900);
  color: var(--color-white);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  z-index: var(--z-tooltip);
  transition: top var(--duration-fast) var(--ease-default);
}

.skip-to-content:focus {
  top: var(--space-4);
}

/* ========== Screen Reader Only ========== */

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

/* ========== Utility Classes ========== */

.text-gold {
  color: var(--color-gold-500);
}

.text-navy {
  color: var(--color-navy-900);
}

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

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

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.font-heading {
  font-family: var(--font-heading);
}

.font-body {
  font-family: var(--font-body);
}
