:root {
  --color-header: #000;
  --color-header-text: #fff;
  --color-header-accent: #ff4747;
}

/* ======= header ======== */
.header {
  display: grid;
  grid-template-columns: 2fr 13fr 6fr;
  align-items: center;
  padding: 8px 0px;

  position: sticky;
  top: 0;
  z-index: 100;

  font-size: 16px;
  font-family: sans-serif;
  
  border-bottom: 1px solid var(--color-header-text);
  background: var(--color-header);
  color: var(--color-header-text);
}

/* ======= logo ======== */
.logo {
  display: flex;
  justify-content: center;
  padding: 0px 12px;
}

.logo a,
.logo a:visited,
.logo a:focus {
  display: inline-block;

  font-size: 24px;
  font-weight: 600;
  text-decoration: none;

  transition:
    color 0.2s ease,
    text-shadow 0.2s ease;
}

.logo a:hover,
.logo a:active {
  color: var(--color-header-accent);
  text-shadow: 0 0 16px var(--color-header-accent);
}

/* ======= search ======== */
.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.search-input {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input input {
  width: 100%;
  padding: 12px 42px 12px 12px;

  border-radius: 9px;
  border: 1px solid var(--color-header-text);
  outline: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.3s ease;
}

.search-input input:focus {
  border-color: var(--color-header-accent);
  box-shadow: 0 0 10px var(--color-header-accent);
}

/* ======= search icon ======== */
.search-icon-button {
  position: absolute;
  right: 0px;
  top: 50%;
  transform: translateY(-50%);
  
  display:flex;
  justify-content:center;
  align-items: center;

  width: 48px;
  height: 48px;

  border: none;
  background: none;
  cursor: pointer;
}

.search-icon {
  width: 65%;
  height: 65%;

  stroke: var(--color-header-text);
  stroke-width: 1px;
  fill: none;

  pointer-events: none;
  transition: stroke 0.2s ease;
}

/* ======= navigation ======== */
.navigation-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.navigation {
  display: flex;
  justify-content: center;
  align-items: center;

  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.navigation-button {
  padding: 12px 12px;

  background: none;
  border: none;
  cursor: pointer;

  transition:
    color 0.2s ease,
    text-shadow 0.2s ease;
}

.navigation-button:hover,
.navigation-button:active {
  color: var(--color-header-accent);
  text-shadow: 0 0 10px var(--color-header-accent);
}

/* ======= hamburger icon on small screen ======== */
.hamburger-button {
  display: none;
  justify-content: center;
  align-items: center;

  position: relative;
  width: 44px;
  height: 44px;

  border: none;
  background: none;
  cursor: pointer;
}

/* ======= shadow of hamburger icon ======== */
.hamburger-button::after {
  position: absolute;
  width: 16px;
  height: 16px;

  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  content: '';
  border-radius: 50%;
  filter: blur(12px);
  background: var(--color-header-accent);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hamburger-icon {
  width: 32px;
  height: 32px;
}

.hamburger-icon line {
  transform-box: fill-box;
  transform-origin: center;
  
  stroke: var(--color-header-text);
  stroke-width: 2px;
  stroke-linecap: round;

  transition:
    transform 0.3s ease,
    opacity 0.3s ease,
    stroke 0.3s ease;
}

@media (max-width: 700px) {
  .header {
    grid-template-columns: 2fr 12fr 3fr;
  }

  .navigation {
    display: flex;
    flex-direction: column;
    position: absolute;

    top: 100%;
    left: 0;
    right: 0;
  
    border-bottom: 1px solid var(--color-header-text);
    background: var(--color-header);

    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
  }

  .navigation-container.small-screen .navigation {
    display: flex;
    flex-direction: column;
    position: absolute;

    top: 100%;
    left: 0;
    right: 0;

    opacity: 1;
    transform: translateY(0px);
    pointer-events: auto;
  }

  .hamburger-button {
    display:flex;
  }
  
  .navigation-container.small-screen .hamburger-icon line:nth-of-type(1) {
    transform: translateY(6px) rotate(225deg);
  }

  .navigation-container.small-screen .hamburger-icon line:nth-of-type(2) {
    opacity: 0;
  }

  .navigation-container.small-screen .hamburger-icon line:nth-of-type(3) {
    transform: translateY(-6px) rotate(-225deg);
  }
  
  .navigation-container.small-screen .hamburger-icon line {
    stroke: var(--color-red);
  }
  
  .navigation-container.small-screen .hamburger-button::after {
    opacity: 1;
  }
  
  .search-input input {
    opacity: 0;
    pointer-events: none;
  }

  .header.search-open {
    grid-template-columns: 1fr;
  }

  .header.search-open .logo,
  .header.search-open .navigation-container {
    display: none;
  }

  .header.search-open .search-input input {
    display: block;
    width: 100%;
    opacity: 1;
    pointer-events: auto;
  }
}

