/*
  @file /css/base.css
  @brief Css file for default styles and layout primitives
  @author Ronald Tavarez
  @updated 2026-03-26

  @warning
    - Should be included directly below reset.css & token.css
*/

/* Debug */
.debug {
  outline: 2px dashed red;
}

/* Page defaults */
html {
  font-size: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--line-normal);
  color: var(--color-text);
  background-color: var(--color-page-bg);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: var(--line-height);
  color: var(--color-text);
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-md);
}

p {
  max-width: 65ch;
}

small {
  font-size: var(--text-xs);
}

/* Text Flow */
p + p {
  margin-top: var(--space-md);
}

/* Links */
a {
  color: var(--color-link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
  transition:
    color var(--transition-fast),
    text-decoration-color var(--transition-fast);
}

a:hover {
  color: var(--color-link-hover);
}

a:where(:not([class])) {
  text-decoration: underline;
}

/* Focus */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Layout */
.container {
  width: min(100% - (2 * var(--space-md)), var(--container-width));
  margin-inline: auto;
}

section {
  padding-block: var(--section-padding);
}

/* Media Defaults */
.img-link > img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* Selection */
::selection {
  background-color: var(--color-brand-accent);
  color: var(--color-text);
}

/* Responsive Type */
@media (max-width: 768px) {
  h1 {
    font-size: var(--text-3xl);
  }

  h2 {
    font-size: var(--text-2xl);
  }

  h3 {
    font-size: var(--text-xl);
  }

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