:root {
  --color-primary: #ffe14c;
  --color-secondary: #fff;
  --color-page: #f7f7f7;
  --color-text: #333;
  --color-link: #1a73e8;
  --color-muted: #888;
  --color-shadow: rgba(0, 0, 0, 0.1);
  --color-border: rgba(0, 0, 0, 0.2);
  --font-family: lato, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: clamp(14px, 1.2vw, 16px);
}

body {
  font-family: var(--font-family);
  scroll-behavior: smooth;
  text-rendering: optimizeSpeed;
  background: var(--color-page);
  color: var(--color-text);
  line-height: 1.6;
}

a {
  color: var(--color-link);
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }
}

header, main {
  max-width: 1184px;
  margin: auto;
  background: var(--color-secondary);
  box-shadow: 0 4px 10px var(--color-shadow);
}

header {
  display: flex;
  overflow: hidden;

  figure {
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    margin-right: 0.25rem;
    min-height: 15rem;
    width: 20%;
    min-width: 10rem;

    img {
      min-width: 100%;
      min-height: 100%;
      object-fit: cover;
    }
  }

  aside {
    position: relative;
    flex: 1;
    background: var(--color-primary);
    padding: 1.5rem 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    word-break: break-word;
  }

  hgroup {
    margin-bottom: 1rem;
  }

  h1 {
    text-transform: uppercase;
    font-size: 2.25rem;
    line-height: 1.3;
  }

  ul {
    display: flex;
    flex-wrap: wrap;
  }

  li {
    list-style: none;
    width: clamp(45%, 24rem, 100%);

    &:first-child {
      width: 100%;
      margin-bottom: 0.5rem;
    }
  }

  button {
    position: absolute;
    width: 3rem;
    height: 3.25rem;
    right: 2rem;
    top: -0.25rem;
    padding: 0.5rem 0.25rem 0.25rem;
    border: none;
    background: var(--color-page);
    cursor: pointer;
    border-radius: 0 0 20% 20%;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 5px var(--color-border);
    opacity: 0.85;

    &:hover {
      background: var(--color-secondary);
      opacity: 1;
    }

    &:active {
      transform: translateY(0.25rem);
      box-shadow: 0 0 2px var(--color-border);
    }

    img {
      max-width: 100%;
      max-height: 100%;
    }
  }
}

main {
  padding: 2rem 4rem;

  section + section {
    margin-top: 2rem;
  }

  article + article {
    margin-top: 1.5rem;
  }

  hgroup {
    margin-bottom: 0.5rem;
  }

  h2 {
    display: inline-block;
    padding: 0 0.5rem;
    background: var(--color-text);
    color: var(--color-secondary);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  h3 {
    font-size: 1.125rem;
  }

  h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  mark {
    display: block;
    background: none;
    text-transform: uppercase;
    color: var(--color-muted);
    font-size: 0.875rem;
  }

  p, ul {
    margin-bottom: 0.75rem;
  }

  ul {
    padding-left: 1.25rem;
  }

  *:last-child {
    margin-bottom: 0;
  }
}

@media screen and (max-width: 767px) {
  header {
    aside {
      padding-left: 1.5rem;
      padding-right: 1.5rem;
    }
  }

  main {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 1cm 0;
  }

  @page :first {
    margin-top: 0;
  }

  html {
    font-size: 12.3px;
  }

  body {
    background: transparent;
  }

  header, main {
    max-width: none;
    box-shadow: none;
  }

  header {
    figure {
      min-height: 0;
    }

    button {
      display: none;
    }
  }

  hgroup {
    page-break-inside: avoid;
    page-break-before: auto;
  }

  main {
    ul {
      padding-left: 1.5rem;
    }
  }
}
