/*
  1. Use a more-intuitive box-sizing model.
*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

/*
    2. Remove default margin
  */
* {
  margin: 0;
}

/*
    Typographic tweaks!
    3. Add accessible line-height
    4. Improve text rendering
  */
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-family: 'Work Sans', sans-serif;
}

/*
    5. Improve media defaults
  */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/*
    6. Remove built-in form typography styles
  */
input,
button,
textarea,
select {
  font: inherit;
}

/*
    7. Avoid text overflows
  */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/*
    8. Create a root stacking context
  */
#root,
#__next {
  isolation: isolate;
}


:root {

    --light: #F9F7F7;
    --second: #DBE2EF;
    --third: #3F72AF;
    --fourth: #112D4E;


}

h2 {
  margin-bottom: 1em;
}

ul {
  list-style-type: none;
  padding: 0;
}

a {

  text-decoration: none;
  color: black;
}


header, section, main, footer, #error {

  padding: 1em 7%;
}

header {
  border-bottom: 3px solid var(--fourth);

}

footer {
  border-top: 3px solid var(--fourth);

}

.errorload:not(:first-child) {

  display: none;
}

#top {

  background-color: var(--light);
  color: black;
  border: none;
  border-radius: 5px;
  padding: .4em;

}

#top:hover {

  cursor: pointer;
  background-color: var(--second);
}

footer a:first-child {

  margin-right: 1em;
}

.detail a {
  color: var(--third);
}

.catbutton {

    background-color: var(--fourth);
    border-radius: 8px;
    color: var(--light);
    text-align: center;
    width: 200px;
    margin: 0 auto;
    margin-top: 1em;
    padding: .5em 0;
}

.catbutton:hover {

    cursor: pointer;
    opacity: .7;
 

}

input[type=submit] {

  background-color: var(--fourth);
  color: var(--light);
  border: none;
  border-radius: 4px;
}

input[type=submit]:hover {

  cursor: pointer;
  opacity: .7;
}



.article {

  background-color: var(--light);
  border-radius: 8px;
  padding: 1em;
}

.article h3 a:hover {

    text-decoration: underline;
    color: var(--third);

}

#error {
  position: absolute;
  display: none;
  color: red;
  padding: 0.5;
  line-height: 18px;
  background-color: white;
  z-index: 1;
}

form {
  position: relative;
}

header,
nav ul {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav ul {
  gap: 1em;
}

main {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;

}

#desktop ul li:hover {

  opacity: .7;
}

.catwrapper:not(:first-child) {
  flex-basis: 49%;

}

.catwrapper:not(:first-child) .category {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.catwrapper:first-child .category {
  flex-wrap: wrap;
  display: flex;
  gap: 1em;
}

.catwrapper:first-child .category .article {
    flex-basis: 49%;

}

#mobile {
  display: none;
}

#mobile img {
  width: 30px;
}

.catwrapper:first-child .catbutton {
  display: none;
}


.ajanlo {

  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1em;
}


@media screen and (max-width: 940px) {

  #mobile {
    display: block;
   
  }


  #desktop {
    display: none;
  }


  #list {
    display: none;
    position: absolute;
    left: 0px;
    width: 100%;
    text-align: center;
    line-height: 25px;
    background-color: var(--light);
    z-index: 1;
  }


  .catwrapper:not(:first-child) {
    flex-basis: 48%;
  
  }

  .catwrapper:first-child .category .article {
    flex-basis: 48%;

}




}


@media screen and (max-width: 550px) {


main, .catwrapper:not(:first-child) .category, .catwrapper:first-child .category .article {

  flex-direction: column;
}

.catwrapper:not(:first-child) {
  flex-basis: 100%;

}

.catwrapper:first-child .category .article {
  flex-basis: 100%;

}


#desktop ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

#desktop ul li {
flex-basis: 30%;
}





header {
  flex-wrap: wrap;
}


}


@media screen and (max-width: 472px) {

  form {
    order: 3;
  }
}