/* Manrope, served from this site (ip/fonts/manrope, SIL Open Font License).
   It used to be an @import from Google Fonts, which made the browser wait
   for this file, then Google's CSS, then the font before showing any text.
   One variable font file per character set covers weights 400–800; the
   Latin file is preloaded in front/partials/seo-head. */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/manrope/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/manrope/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  line-height: 1.5; /* Essential for Indic matras */
  -webkit-font-smoothing: antialiased;
}

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

ul, ol {
  list-style: none;
}

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

/* ==========================================================================
   Typography Classes
   ========================================================================== */
.display-hero {
  font-size: var(--font-hero-size);
  font-weight: var(--font-hero-weight);
  line-height: var(--font-hero-lh);
  letter-spacing: var(--font-hero-ls);
}
.headline-lg {
  font-size: var(--font-hl-lg-size);
  font-weight: var(--font-hl-lg-weight);
  line-height: var(--font-hl-lg-lh);
  letter-spacing: var(--font-hl-lg-ls);
}
.headline-md {
  font-size: var(--font-hl-md-size);
  font-weight: var(--font-hl-md-weight);
  line-height: var(--font-hl-md-lh);
  letter-spacing: var(--font-hl-md-ls);
}
.headline-sm {
  font-size: var(--font-hl-sm-size);
  font-weight: var(--font-hl-sm-weight);
  line-height: var(--font-hl-sm-lh);
}
.title-md {
  font-size: var(--font-title-md-size);
  font-weight: var(--font-title-md-weight);
  line-height: var(--font-title-md-lh);
}
.body-lg {
  font-size: var(--font-body-lg-size);
  font-weight: var(--font-body-lg-weight);
  line-height: var(--font-body-lg-lh);
}
.body-md {
  font-size: var(--font-body-md-size);
  font-weight: var(--font-body-md-weight);
  line-height: var(--font-body-md-lh);
}
.body-sm {
  font-size: var(--font-body-sm-size);
  font-weight: var(--font-body-sm-weight);
  line-height: var(--font-body-sm-lh);
}
.label-md {
  font-size: var(--font-label-md-size);
  font-weight: var(--font-label-md-weight);
  line-height: var(--font-label-md-lh);
  letter-spacing: var(--font-label-md-ls);
}
.label-sm {
  font-size: var(--font-label-sm-size);
  font-weight: var(--font-label-sm-weight);
  line-height: var(--font-label-sm-lh);
  letter-spacing: var(--font-label-sm-ls);
}
.badge-text {
  font-size: var(--font-badge-xs-size);
  font-weight: var(--font-badge-xs-weight);
  line-height: var(--font-badge-xs-lh);
  letter-spacing: var(--font-badge-xs-ls);
}

/* ==========================================================================
   Global Layout System
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter-desktop);
  padding-right: var(--gutter-desktop);
}

.section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.full-width {
  width: 100%;
}

.grid {
  display: grid;
  gap: var(--gutter-desktop);
}

/* Default to 4 columns on desktop for template cards */
.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.flex-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.horizontal-rail {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: var(--space-md);
  padding-bottom: var(--space-sm);
}

/* ==========================================================================
   Responsive Rules
   ========================================================================== */
@media (max-width: 1023px) { /* Tablet */
  .container {
    padding-left: var(--gutter-tablet);
    padding-right: var(--gutter-tablet);
  }
  .grid {
    gap: var(--gutter-tablet);
  }
  .grid-cols-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) { /* Mobile */
  .container {
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
  }
  
  .display-hero {
    font-size: var(--font-hero-mob-size);
    font-weight: var(--font-hero-mob-weight);
    line-height: var(--font-hero-mob-lh);
    letter-spacing: var(--font-hero-mob-ls);
  }
  .headline-lg {
    font-size: var(--font-hl-lg-mob-size);
    font-weight: var(--font-hl-lg-mob-weight);
    line-height: var(--font-hl-lg-mob-lh);
    letter-spacing: var(--font-hl-lg-mob-ls);
  }

  .grid {
    gap: var(--gutter-mobile);
  }
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .section {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }
}
