@layer rest, base, theme, layout, components, utilities;

@layer rest {
  /* 1. Use a more-intuitive box-sizing model */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  /* 2. Remove default margin */
  *:not(dialog) {
    margin: 0;
  }

  /* 3. Enable keyword animations */
  @media (prefers-reduced-motion: no-preference) {
    html {
      interpolate-size: allow-keywords;
    }
  }

  body {
    /* 4. Increase line-height */
    line-height: 1.5;
    /* 5. Improve text rendering */
    -webkit-font-smoothing: antialiased;
  }

  /* 6. Improve media defaults */
  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
  }

  /* 7. Inherit fonts for form controls */
  input,
  button,
  textarea,
  select {
    font: inherit;
  }

  /* 8. Avoid text overflows */
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
    margin-top: 0;
  }

  /* 9. Improve line wrapping */
  p {
    text-wrap: pretty;
  }
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    text-wrap: balance;
  }
}

@layer base {
  body {
    background-color: var(--background-color);
    color: var(--txt-color);
    font-family: var(--txt-font);
  }

  img {
    border-radius: 0.625rem;
  }

  /* h1 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
  }
  h2 {
    font-size: clamp(1.3rem, 2.5vw, 2rem);
  }
  p {
    font-size: clamp(1rem, 2.2vw, 1.5rem);
  } */
  a:link,
  .link-card {
    margin: 0 auto;
    cursor: pointer;
    margin-top: 1rem;
  }
  a:visited {
    color: var(--txt-accent);
  }

  .link-card {
    display: inline-block;
    width: 100%;
    background-color: #808000;
    border-radius: 0.625rem;
    text-decoration: none;
    color: var(--txt-color);
  }

  .link-card:hover {
    text-decoration: underline var(--txt-accent);
    background-color: var(--txt-accent);
    color: var(--txt-licht);
  }
}

@layer theme {
  :root {
    --background-color: #808000;
    --txt-color: #000000;
    --txt-accent: #c1440e;
    --txt-licht: #f5f1e6;
    --txt-font: "Google Sans", Arial, Helvetica, sans-serif;
  }
}

@layer layout {
  .container {
    display: flex;
    width: min(90vw, 1200px);
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
    align-content: stretch;
    gap: 1.5625rem;
    flex-wrap: nowrap;
    background-color: var(--txt-licht);
    margin: 1.25rem auto;
    padding: 1.25rem;
    border-radius: 10px;
    box-shadow: 0.625rem 0.625rem;
  }
  .container img {
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.625rem;
  }

  .txt-container {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    line-height: 1.8;
    gap: 0.625rem;
    text-align: center;
    padding: 0.625rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .link-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: start;
    align-content: stretch;
    justify-content: center;
    gap: 1rem;
  }
  .card-container {
    display: flex;
    flex-direction: row;
    max-width: 85%;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: stretch;
    gap: 1.25rem;
    margin: 0 auto;
  }
  .card {
    display: flex;
    flex-direction: column;
    background-color: var(--txt-licht);
    border-radius: 0.625rem;
    box-shadow: 0.625rem 0.625rem;
    max-width: 15rem;
    max-height: 20rem;
    text-align: center;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    line-height: 1.6;
  }
}

@media only screen and (max-width: 48rem) {
  .container {
    flex-direction: column;
    margin-top: 2.1875rem;
  }
  .container img {
    max-width: 75vw;
    border-radius: 0.625rem;
  }
}
