/**
 * Base element styles: a light reset, typography and accessibility helpers.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--dal-white);
  color: var(--dal-black);
  font-family: var(--font-family-base);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Headings: semantic level and visual size are decoupled. Elements get a
 * default size; components override it with the .heading-size-* classes. */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block: 0;
  line-height: var(--line-height-tight);
  text-wrap: balance;
}

h1 { font-size: var(--font-size-display); font-weight: var(--font-weight-black); }
h2 { font-size: var(--font-size-xl); font-weight: var(--font-weight-black); }
h3 { font-size: var(--font-size-l); font-weight: var(--font-weight-black); }
h4 { font-size: var(--font-size-m); font-weight: var(--font-weight-bold); }
h5 { font-size: var(--font-size-s); font-weight: var(--font-weight-bold); }
/* The smallest size is light and looser, as dal.ca's h6 and "xs" teaser titles. */
h6 { font-size: var(--font-size-xs); font-weight: var(--font-weight-light); line-height: var(--line-height-snug); }

.heading-size-display { font-size: var(--font-size-display); font-weight: var(--font-weight-black); }
.heading-size-xl { font-size: var(--font-size-xl); font-weight: var(--font-weight-black); }
.heading-size-l { font-size: var(--font-size-l); font-weight: var(--font-weight-black); }
.heading-size-m { font-size: var(--font-size-m); font-weight: var(--font-weight-bold); }
.heading-size-s { font-size: var(--font-size-s); font-weight: var(--font-weight-bold); }
.heading-size-xs { font-size: var(--font-size-xs); font-weight: var(--font-weight-light); line-height: var(--line-height-snug); }

p,
ul,
ol,
dl,
blockquote,
figure {
  margin-block: 0;
}

/* The underline is set explicitly: CSS resets loaded by other parts of the
 * site (such as Canvas code components' Tailwind base) remove it. */
a {
  color: var(--link-color, currentcolor);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* The colour is read where the element is, so it follows the surface. */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

button {
  font: inherit;
}

hr {
  margin: 0;
  border: 0;
  border-block-start: 2px solid var(--rule-color, currentcolor);
}

/* Rich text written in CKEditor (Text, Teaser descriptions, ...). */
.prose > * + * {
  margin-block-start: 1em;
}

.prose :is(h2, h3, h4) {
  margin-block-start: 1.25em;
}

/* List markers are set explicitly: CSS resets loaded by other parts of the
 * site (such as Canvas code components' Tailwind base) remove them. */
.prose ul,
.prose ol {
  padding-inline-start: 1.5em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose ul ul {
  list-style: circle;
}

/* dal.ca spaces list items like paragraphs. */
.prose li + li {
  margin-block-start: 1em;
}

/* Links in running text, as on dal.ca: regular weight, heavier underline. */
.prose a {
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.visually-hidden {
  position: absolute !important;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px;
  height: 1px;
  word-wrap: normal;
}

.visually-hidden.focusable:is(:active, :focus) {
  position: static !important;
  overflow: visible;
  clip: auto;
  width: auto;
  height: auto;
}

/* Skip link (core html.html.twig renders it without a class of its own). */
body > a.visually-hidden.focusable:is(:focus, :active) {
  position: absolute !important;
  z-index: 1000;
  inset-block-start: var(--space-2xs);
  inset-inline-start: var(--space-2xs);
  padding: var(--space-xs) var(--space-s);
  background: var(--dal-gold);
  color: var(--dal-black);
  font-weight: var(--font-weight-bold);
}

/* Status messages. */
.messages-list {
  max-width: var(--page-max-width);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.messages-list:has(.messages) {
  padding-block: var(--space-s);
}

.messages {
  padding: var(--space-s) var(--space-m);
  border-inline-start: 0.375rem solid var(--dal-gold);
  background-color: var(--dal-gray);
  color: var(--dal-black);
}

.messages--warning {
  border-inline-start-color: var(--dal-gray-dark);
}

.messages--error {
  border-inline-start-color: var(--dal-red);
}

.messages + .messages {
  margin-block-start: var(--space-2xs);
}

.messages__list {
  margin: 0;
  padding-inline-start: 1.25em;
}

/*
 * A listing that brings its own heading (a view whose header holds a
 * Heading, printed only when the listing has something to show): the
 * heading keeps its size and a gap before the list.
 */
.views-element-container > [class*="js-view-dom-id"] > header:has(> .heading) {
  margin-block: 0 var(--space-l);
  font-size: inherit;
}

.views-element-container > [class*="js-view-dom-id"] > header > .heading + p {
  margin-block-start: var(--space-s);
}

/* A listing in groups (retail food locations by part of campus): each group
 * has its name as a heading, with a gap before its cards and a larger one
 * before the next group. */
.card-listing-group > .heading {
  margin-block-end: var(--space-l);
}

.card-listing-group + .card-listing-group {
  margin-block-start: var(--space-2xl);
}
