/* ============================================================
   GLOBAL STYLES — Chhabra Lawyers Associates
   Reset, base typography, containers, utilities, print.
   ============================================================ */

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--clr-text-primary);
  background-color: var(--clr-ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
  min-height: 100vh;
  position: relative;
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--clr-midnight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-4xl); letter-spacing: var(--ls-tight); }
h2 { font-size: var(--fs-3xl); letter-spacing: var(--ls-tight); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

@media (max-width: 768px) {
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-xl); }
  h4 { font-size: var(--fs-lg); }
}

p {
  max-width: 72ch;
  text-wrap: pretty;
}

a {
  color: var(--clr-link);
  text-decoration: none;
  transition: var(--transition-colors);
}

a:hover {
  color: var(--clr-link-hover);
}

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

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

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

fieldset {
  border: none;
}

strong, b { font-weight: var(--fw-semibold); }
em, i { font-style: italic; }

blockquote {
  border-left: 3px solid var(--clr-gold);
  padding-left: var(--sp-6);
  font-family: var(--ff-display);
  font-size: var(--fs-lg);
  font-style: italic;
  color: var(--clr-text-secondary);
}

hr {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: var(--sp-8) 0;
}

::selection {
  background-color: var(--clr-gold);
  color: var(--clr-midnight);
}

/* ── Skip to Content ──────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  background: var(--clr-midnight);
  color: var(--clr-white);
  padding: var(--sp-3) var(--sp-6);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: var(--fw-semibold);
  z-index: var(--z-toast);
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: 0;
  color: var(--clr-white);
}

/* ── Container System ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--content-padding);
}

.container--narrow {
  max-width: var(--content-narrow);
}

.container--wide {
  max-width: var(--content-wide);
}

/* ── Section Spacing ──────────────────────────────────────── */
.section {
  padding-block: var(--sp-16);
}

.section--sm {
  padding-block: var(--sp-10);
}

.section--lg {
  padding-block: var(--sp-20);
}

.section--dark {
  background-color: var(--clr-midnight);
  color: var(--clr-text-on-dark);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--clr-white);
}

.section--cream {
  background-color: var(--clr-cream);
}

.section--sand {
  background-color: var(--clr-sand);
}

/* ── Section Header ───────────────────────────────────────── */
.section-header {
  text-align: center;
  max-width: 700px;
  margin-inline: auto;
  margin-bottom: var(--sp-12);
}

.section-header__eyebrow {
  font-family: var(--ff-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--clr-gold);
  margin-bottom: var(--sp-3);
  display: block;
}

.section-header__title {
  margin-bottom: var(--sp-4);
}

.section-header__divider {
  width: 60px;
  height: 2px;
  background: var(--clr-gold);
  margin: var(--sp-4) auto;
  border: none;
}

.section-header__desc {
  color: var(--clr-text-secondary);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  margin-inline: auto;
}

/* ── Gold Double Rule (decorative divider) ────────────────── */
.gold-rule {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-8) auto;
  max-width: 200px;
}

.gold-rule::before,
.gold-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--clr-gold);
}

.gold-rule__diamond {
  width: 8px;
  height: 8px;
  background: var(--clr-gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* ── Utility Classes ──────────────────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

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

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

.fs-sm       { font-size: var(--fs-sm); }
.fs-lg       { font-size: var(--fs-lg); }
.fs-xl       { font-size: var(--fs-xl); }

.mt-0  { margin-top: 0; }
.mt-4  { margin-top: var(--sp-4); }
.mt-6  { margin-top: var(--sp-6); }
.mt-8  { margin-top: var(--sp-8); }
.mt-12 { margin-top: var(--sp-12); }
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-6  { margin-bottom: var(--sp-6); }
.mb-8  { margin-bottom: var(--sp-8); }

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* ── Grid System ──────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--sp-8);
}

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

@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-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
}

/* ── Content Prose ────────────────────────────────────────── */
.prose p {
  margin-bottom: var(--sp-4);
  line-height: var(--lh-relaxed);
}

.prose h2 {
  margin-top: var(--sp-12);
  margin-bottom: var(--sp-4);
}

.prose h3 {
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.prose h4 {
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-2);
}

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

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li {
  margin-bottom: var(--sp-2);
  line-height: var(--lh-relaxed);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--clr-gold);
}

.prose table {
  margin: var(--sp-6) 0;
  border: var(--border-thin);
  font-size: var(--fs-sm);
}

.prose th,
.prose td {
  padding: var(--sp-3) var(--sp-4);
  border: var(--border-thin);
  text-align: left;
}

.prose th {
  background: var(--clr-cream);
  font-weight: var(--fw-semibold);
}

/* Responsive table wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Noscript Fallback ────────────────────────────────────── */
noscript .noscript-banner {
  background: var(--clr-gold);
  color: var(--clr-midnight);
  text-align: center;
  padding: var(--sp-4);
  font-weight: var(--fw-semibold);
}

/* ── Print Styles ─────────────────────────────────────────── */
@media print {
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .site-header,
  .site-footer,
  .fab-group,
  .skip-link,
  .bci-modal,
  .reading-progress,
  nav { display: none !important; }

  a { color: #000; text-decoration: underline; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 0.8em; }

  h1, h2, h3 { page-break-after: avoid; }
  img { max-width: 100% !important; }
  .container { max-width: 100%; padding: 0; }
}
