/*
 * KMT Layout Utilities
 * Container and grid utilities per spec section 4.
 */

/* ------------------------------------------------------------------ */
/* Container                                                            */
/* ------------------------------------------------------------------ */

.kmt-container {
  max-width: var(--kmt-container-max);
  padding-inline: var(--kmt-space-md);
  margin-inline: auto;
}

@media (min-width: 768px) {
  .kmt-container {
    padding-inline: var(--kmt-space-xl);
  }
}

/* ------------------------------------------------------------------ */
/* Grid utilities                                                       */
/* ------------------------------------------------------------------ */

/* 2-column: 1 col mobile, 2 col tablet+ */
.kmt-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--kmt-space-lg);
}

@media (min-width: 768px) {
  .kmt-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3-column: 1 col mobile, 2 col tablet, 3 col desktop */
.kmt-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--kmt-space-lg);
}

@media (min-width: 768px) {
  .kmt-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .kmt-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 4-column: 1 col mobile, 2 col tablet, 4 col desktop */
.kmt-grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--kmt-space-lg);
}

@media (min-width: 768px) {
  .kmt-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .kmt-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ------------------------------------------------------------------ */
/* Section spacing                                                      */
/* ------------------------------------------------------------------ */

.kmt-section {
  padding-block: var(--kmt-space-2xl);
}

@media (min-width: 768px) {
  .kmt-section {
    padding-block: var(--kmt-space-3xl);
  }
}

@media (min-width: 1024px) {
  .kmt-section {
    padding-block: var(--kmt-space-4xl);
  }
}

/* ------------------------------------------------------------------ */
/* Prose: max-width content wrapper                                     */
/* ------------------------------------------------------------------ */

.kmt-prose {
  max-width: var(--kmt-measure-body);
}

.kmt-prose--blog {
  max-width: var(--kmt-measure-blog);
}

/* ------------------------------------------------------------------ */
/* 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;
}
