/* =========================================
   GFN TYPO RESET – Bootstrap-like spacing
   ========================================= */

/* Remove medatsu negative margin hack */
p + p,
p + ul,
p + ol {
  margin-top: 0 !important;
}

/* Base vertical rhythm for text elements */
p,
ul,
ol {
  margin-top: 0;
  margin-bottom: 2rem !important;
}

/* Tighter spacing for nested lists */
ul ul,
ul ol,
ol ul,
ol ol {
  margin-top: 0;
  margin-bottom: 0.5rem !important;
}

/* =========================================
   Heading spacing normalization
   ========================================= */

/* Reset heading margins */
:where(
h1, .font--alpha) {
  margin-top: 2rem !important;
  margin-bottom: 0 !important;
}

:where(
h2, .font--beta, 
h3, .font--gamma, 
h4, .font--delta, 
h5, .font--epsilon, 
h6, .font--zeta) {
  margin-top: .5rem !important;
  margin-bottom: 1rem !important;
}

/* Remove bottom margin on last paragraph */
p:last-child {
  margin-bottom: 0 !important;
}

/* Normalize list spacing */
:where(ol, ul) {
  margin-top: 0;
  margin-bottom: 1rem !important;
}

/* Remove grid heading padding hack */
.grid__column :where(h1, h2, h3, h4, h5) {
  padding-top: 0 !important;
}

/* Remove additional negative spacing cases */
:where(p + p, p + ul, p + ol),
:where(p + .event-info__link) {
  margin-top: 0 !important;
}

/* Add section spacing before headings */
:where(p + h1, p + h2, p + h3, p + h4, p + h5, p + h6),
:where(ul + h1, ul + h2, ul + h3, ul + h4, ul + h5, ul + h6),
:where(ol + h1, ol + h2, ol + h3, ol + h4, ol + h5, ol + h6) {
  margin-top: 2rem !important;
}

/* Adjust text column bottom spacing */
.text-columns__text {
  padding: 0 0 2rem 0 !important;
}

/* ============================================
   BASE TYPOGRAPHY
   ============================================ */

/* Limit width in standalone content paragraphs */
@media screen and (min-width: 80rem) {
    #intro .infotext, #intro .teasertext {
      box-sizing: border-box;
      padding-inline-end: 25%;
    }
}

@media screen and (min-width: 80rem) {
    #content > ol, #content > p:not(.font--align-center), #content > ul {
      box-sizing: border-box;
      padding-inline-end: 25%;
    }
}
