/*
 * Base Styles
 *
 * Element defaults, typography, and foundational styles.
 * Includes font fallbacks, body, headings, links, and images.
 */

/* ============================================
   FONT FALLBACKS
   ============================================ */
@font-face {
  font-family: roboto-fallback;
  size-adjust: 99.529%;
  src: local('Arial');
}

@font-face {
  font-family: roboto-condensed-fallback;
  size-adjust: 88.82%;
  src: local('Arial');
}

@font-face {
  font-family: roboto-semicondensed-fallback;
  size-adjust: 94.5%;
  src: local('Arial');
}

/* ============================================
   BODY
   ============================================ */
body {
  display: none;
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--body-font-family);
  font-size: var(--body-font-size-m);
  line-height: var(--line-height-relaxed);
  scrollbar-gutter: stable both-edges;

  /* Font rendering optimization for crisp text */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizelegibility;
}

body.appear {
  display: block;
}

/* ============================================
   HEADER & FOOTER
   ============================================ */
header {
  min-height: var(--header-height);
}

header .header,
footer .footer {
  visibility: hidden;
}

header .header[data-block-status="loaded"],
footer .footer[data-block-status="loaded"] {
  visibility: visible;
}

/* ============================================
   HEADINGS
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: var(--space-m);
  font-family: var(--heading-font-family);
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-heading);
  scroll-margin: 40px;
}

h1 {
  font-size: var(--heading-font-size-xxl);
}

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

h3 {
  font-size: var(--heading-font-size-l);
}

h4 {
  font-size: var(--heading-font-size-m);
}

h5 {
  font-size: var(--heading-font-size-s);
}

h6 {
  font-size: var(--heading-font-size-xs);
}

/* ============================================
   TEXT ELEMENTS
   ============================================ */
p,
dl,
ol,
ul,
pre,
blockquote {
  margin-top: var(--space-m);
  margin-bottom: var(--space-m);
}

code,
pre {
  font-size: var(--body-font-size-s);
}

pre {
  padding: var(--space-m);
  border-radius: var(--border-radius-m);
  background-color: var(--light-color);
  overflow-x: auto;
  white-space: pre;
}

/* ============================================
   LINKS
   ============================================ */
a:any-link {
  color: var(--link-color);
  text-decoration: none;
  overflow-wrap: break-word;
}

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

/* ============================================
   FORM ELEMENTS
   ============================================ */
input,
textarea,
select,
button {
  font: inherit;
}

/* ============================================
   IMAGES
   ============================================ */
main img {
  max-width: 100%;
  width: auto;
  height: auto;
}

/* ============================================
   ICONS
   ============================================ */
.icon {
  display: inline-block;
  height: 24px;
  width: 24px;
}

.icon img {
  height: 100%;
  width: 100%;
}
