/* =========================================================
   SAMVIDHAN SARAL — BASE CSS
   Reset, typography, utilities. Mobile-first.
   ========================================================= */

/* --------------------------------------------------
   GOOGLE FONTS IMPORT
   Playfair Display (display/headings) + DM Sans (body)
   Both support Latin + Devanagari path later
-------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  color: var(--color-primary);
}

p {
  line-height: var(--leading-normal);
}

/* --------------------------------------------------
   TYPOGRAPHY SCALE
-------------------------------------------------- */
.t-xs   { font-size: var(--text-xs); }
.t-sm   { font-size: var(--text-sm); }
.t-base { font-size: var(--text-base); }
.t-md   { font-size: var(--text-md); }
.t-lg   { font-size: var(--text-lg); }
.t-xl   { font-size: var(--text-xl); }
.t-2xl  { font-size: var(--text-2xl); }
.t-3xl  { font-size: var(--text-3xl); }
.t-4xl  { font-size: var(--text-4xl); }

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

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

.leading-tight  { line-height: var(--leading-tight); }
.leading-normal { line-height: var(--leading-normal); }
.leading-loose  { line-height: var(--leading-loose); }

.text-primary    { color: var(--color-primary); }
.text-accent     { color: var(--color-accent); }
.text-secondary  { color: var(--color-text-secondary); }
.text-tertiary   { color: var(--color-text-tertiary); }
.text-on-dark    { color: var(--color-text-on-dark); }

/* --------------------------------------------------
   CONTAINER SYSTEM
   Mobile-first containers
-------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max-mobile);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    max-width: var(--container-max-tablet);
    padding-inline: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: var(--container-max);
    padding-inline: var(--space-8);
  }
}

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

.container--narrow {
  max-width: 420px;
}

/* --------------------------------------------------
   FLEX / GRID UTILITIES
-------------------------------------------------- */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-row     { flex-direction: row; }
.flex-wrap    { flex-wrap: wrap; }
.items-start  { align-items: flex-start; }
.items-center { align-items: center; }
.items-end    { align-items: flex-end; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.flex-1 { flex: 1; }
.shrink-0 { flex-shrink: 0; }

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

/* --------------------------------------------------
   SPACING UTILITIES
-------------------------------------------------- */
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }
.px-3 { padding-inline: var(--space-3); }
.px-4 { padding-inline: var(--space-4); }
.px-5 { padding-inline: var(--space-5); }
.py-2 { padding-block: var(--space-2); }
.py-3 { padding-block: var(--space-3); }
.py-4 { padding-block: var(--space-4); }
.py-5 { padding-block: var(--space-5); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* --------------------------------------------------
   DISPLAY / VISIBILITY
-------------------------------------------------- */
.hidden         { display: none !important; }
.block          { display: block; }
.inline-block   { display: inline-block; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* --------------------------------------------------
   BORDER / SHAPE
-------------------------------------------------- */
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* --------------------------------------------------
   SCROLLBAR (minimal, theme-matched)
-------------------------------------------------- */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

/* --------------------------------------------------
   SELECTION
-------------------------------------------------- */
::selection {
  background-color: rgba(224, 90, 12, 0.15);
  color: var(--color-primary);
}

/* --------------------------------------------------
   FOCUS (accessible, clean)
-------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------
   MISC
-------------------------------------------------- */
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.pointer-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

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

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------
   DIVIDER
-------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--color-border);
  margin-block: var(--space-4);
}

/* --------------------------------------------------
   BADGE
-------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.badge--accent {
  background: rgba(224,90,12,0.12);
  color: var(--color-accent-dark);
}
.badge--civic {
  background: rgba(27,95,158,0.12);
  color: var(--color-civic);
}
.badge--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}
.badge--primary {
  background: rgba(28,43,74,0.1);
  color: var(--color-primary);
}

/* --------------------------------------------------
   ARTICLE NUMBER DISPLAY
   Specific to Constitution article cards
-------------------------------------------------- */
.article-num {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  color: var(--color-accent);
}
