/* Containers, sections and grid helpers. Logical properties throughout for a future RTL (Urdu) version. */

.container {
  inline-size: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-6);
}

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

.section--dawn {
  background: var(--c-dawn);
}

.section--paper {
  background: var(--c-paper);
}

/* Vertical rhythm inside prose blocks */
.flow > * + * {
  margin-block-start: var(--space-4);
}

.flow > * + :is(h2, h3) {
  margin-block-start: var(--space-6);
}

/* A row of buttons that wraps on narrow screens */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Section heading with a link at the far end (e.g. "Our activities ... All activities") */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
}

.section-head > p {
  max-inline-size: none;
}

/* Two-column split from md up */
.split {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-7);
  }
}

/* Geometric texture: night surfaces only, never behind body text on light backgrounds.
   The SVG tile is used as a mask so its colour still comes from a token. */
.textured {
  position: relative;
  isolation: isolate;
}

.textured::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c-on-night);
  opacity: var(--texture-opacity);
  -webkit-mask: url("/assets/images/pattern-khatam.svg") repeat;
  mask: url("/assets/images/pattern-khatam.svg") repeat;
  -webkit-mask-size: 48px 48px;
  mask-size: 48px 48px;
  pointer-events: none;
}
