/* ==========================================================================
   Main Blog page
   ========================================================================== */

html {
  box-sizing: border-box;
  font-size: 62.5%;
}

body {
  align-items: center;
  background-color: #f0f0f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  font-size: 1.4em;      
  height: auto;
  justify-content: flex-start;
  place-content: space-around;
  position: relative;
  width: 100%;
}

header {
  line-height: 0;
  position: relative;
}

a {
  color: #777;
  display: block;
  text-decoration: none;
}

a:hover {
  color: black;
}

hr {
  width: 100%;
}

article {
  display: flex;
  padding: 2rem;
  width: 100%;
}

aside {
  background-color: #fff;
  border: 1px solid #e2e2e2;
  box-sizing: content-box;
  height: fit-content;
  min-width: 168px;
  padding: 2rem;
  width: 21rem;
}

footer {
  background-color: #000;
  color: white;
  display: flex;
  justify-content: space-around;
  left: 0;
  margin: 0;
  max-width: 100%;
  padding: 3rem;
  position: relative;
  right: 0;
  width: 100%;
}

/* ==========================================================================
   Header Section
   ========================================================================== */

ul {
  list-style-type: none;
}

nav > ul {
  justify-content: space-between;
}

li {
  display: block;
}

.nav-box {
  align-items: center;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  overflow: visible;
  padding: 0;
  right: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown {
  display: inline-block;
  padding: 0;
  position: relative;
}

.dropdown > .dropdown-button {
  display: inline-block;
  position: relative;
}

.dropdown-button::after {
  background: transparent;
  content: "";
  height: 3.5rem;
  pointer-events: auto;
  position: absolute;
  right: 0;
  width: 100%;
  z-index: 5;
}

.dropdown > .dropdown-content {
  background: #fff;
  border: 1px solid #e2e2e2;
  box-shadow: 0 6px 18px rgb(0 0 0 / 8%);
  color: black;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4rem);
  transform: translateY(-0.6rem);
  transition: opacity 180ms ease, transform 180ms ease;
  visibility: hidden;
  width: max-content;
  z-index: 10;
}

.nav-box .dropdown > .dropdown-content a {
  color: #333;
  display: block;
  padding: 2rem;
  text-align: left;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.dropdown-items:hover {
  background: #e2e2e2;
  font-weight: 600;
  transition: 125ms;
}

.header-box {
  align-items: center;
  background-color: #fff;
  display: flex;
  justify-content: space-around;
  padding: 3rem;
  width: 100%;
}

.header-box h1 {
  font-size: 2.4em;
  font-weight: 700;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-container {
  align-items: center;
  display: flex;
  justify-content: space-between;
  line-height: 0;
  padding: 0;
  text-align: center;
  width: 100%;
}

.link-home {
  margin-right: 25px;
}

/* ==========================================================================
   Main Content (Except header and footer)
   ========================================================================== */

.content-box {
  border: 1px red;
  box-sizing: border-box;
  display: flex;
  height: auto;
  min-height: 100vh;
  overflow-wrap: normal;
  padding: 3rem;
  position: relative;
  width: 100%;
  word-break: break-word;
}

.content-box > * {
  justify-content: space-around;
}

.content-box p {
  font-size: 1.4em;
  line-height: 145%;
}

/* ==========================================================================
   Biography Section
   ========================================================================== */

.bio {
  align-items: center;
  border: 1px solid #e2e2e2;
  border-radius: 5px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  font-size: inherit;
  height: fit-content;
  hyphens: auto;
  justify-content: space-around;
  min-width: 18rem;
}

.bio-picture {
  align-items: center;
  border-radius: 50%;
  height: auto;
  margin-bottom: 2rem;
  max-width: 100%;
  min-width: 16rem;
}

/* ==========================================================================
   Articles Section
   ========================================================================== */

.article-box {
  align-items: stretch;
  background-color: #fff;
  border-radius: 5px;
  box-sizing: border-box;
  display: block;
  flex-flow: column nowrap;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  justify-content: space-between;
  padding: 2rem;
  row-gap: 3rem;
  width: 100%;
}

.article-title {
  padding: 2rem;
}

.article-container {
  background-color: #fff;
  border: 1px solid #e2e2e2;
  display: grid;
  gap: 3rem;
  grid-template-columns: 18rem 1fr;
  padding: 2rem;
  width: 100%;
}

.article-img {
  border: 1px;
  border-radius: 5px;
  flex-shrink: 1;
  grid-column: 1 / 1;
  height: 15rem;
  left: 50%;
  object-fit: cover;
  position: relative;
  transform: translateX(-50%);
  width: 100%;
  z-index: 0;
}

.article-text {
  align-items: stretch;
  display: flex;
  flex-flow: column;
  flex-direction: column;
  grid-column-start: 2;
  order: 1;
  padding: 0;
  width: 100%;
}

.article-container > a {
  color: #777;
  display: flex;
  flex-flow: column wrap;
  flex-direction: column;
  grid-column-start: 2;
  order: 2;
  text-decoration: underline;
}

.article-text > * {
  margin: 0;
}

.article-data > span {
  margin-left: 1rem;
  margin-right: 1rem;
}

.article-text h2 {
  font-size: 2.2em;
}

.article-data {
  align-items: center;
  color: #777;
  display: flex;
  flex-direction: row;
  grid-column-start: 2;
}

.article-data p , .article-data time{
  font-size: 1.4rem;
  line-height: 145%;
  margin-bottom: 1rem;
  margin-top: 1rem;
}

/* ==========================================================================
   Footer Section
   ========================================================================== */

.footer-box p {
  justify-content: space-around;
  margin: 0;
}

footer {
  box-sizing: border-box;
}

footer, .footer-container {
  left: 0;
  margin: 0 auto;
  max-width: 100%;
  right: 0;
  text-align: center;
  width: 100%;
}

/* ==========================================================================
   Mobile Portrait
   ========================================================================== */

@media (width <= 768px) and (orientation: portrait) {
  body {
    display: flex;
    flex-flow: column;
    flex-direction: column;
    margin: 0;
  }

  header {
    flex-direction: column;
    height: fit-content;
  }

  aside {
    height: auto;
    width: 100%;
  }

  .nav-box {
    position: relative;
  }

  .dropdown {
    position: static;
  }

  .nav-box .dropdown-content {
    left: 50%;
    min-width: max-content;
    opacity: 0;
    position: absolute;
    top: 2.4rem;
    transform: translate(-50%, 0);
  }

  .dropdown:focus-within .dropdown-content {
    opacity: 1;
  }

  .dropdown .dropdown-content .dropdown-items > a {
    text-align: center;
  }

  .header-box {
    align-items: center;
    border-bottom: 0.1rem solid #e2e2e2;
    display: flex;
    flex-shrink: 0;
    height: 9%;
    padding: 2rem;
    position: relative;
    text-align: center;
    width: 100%;
  }

  .header-container {
    align-items: center;
    display: flex;
    flex-flow: column nowrap;
    gap: 2rem;
    justify-content: space-around;
    text-align: center;
    width: 100%;
  }

  .header-container > * {
    display: flex;
    gap: 3rem;
  }

  .nav-box a {
    bottom: 0;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    right: 0;
  }

  .nav-box {
    display: flex;
    flex-flow: row;
    justify-content: space-around;
  }

  .content-box {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .article-box {
    margin: 0;
    padding: 2rem;
  }

  .article-img {
    height: 25rem;
    margin: 0;
    object-fit: cover;
    width: 100%;
  }

  .article-text {
    align-items: stretch;
    display: flex;
    flex-flow: column;
    flex-direction: column;
    order: 1;
    width: 100%;
  }

  .bio {
    display: flex;
    height: auto;
    order: 3;
    position: relative;
    width: 100%;
  }
}

/* ==========================================================================
   Mobile Landscape
   ========================================================================== */

@media (width >= 481px) and (width <= 768px) and (orientation: landscape) {
  body {
    display: flex;
    flex-flow: column;
    flex-direction: column;
  }

  aside {
    height: auto;
    width: 100%;
  }

  .title-blog {
    display: flex;
  }

  h1 {
    overflow: visible;
    white-space: normal;
  }

  .dropdown:focus-within .dropdown-content {
    border-top: 3rem;
    opacity: 1;
    top: 3rem;
  }

  .header-box {
    display: flex;
    height: 8%;
    padding: 4rem;
    width: 100%;
  }

  .content-box {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .article-box {
    margin: 0;
    padding: 2rem;
  }

  .article-img {
    height: 25rem;
    margin: 0;
    object-fit: cover;
    width: 100%;
  }

  .article-text {
    align-items: stretch;
    display: flex;
    flex-flow: column;
    flex-direction: column;
    order: 1;
    width: 100%;
  }

  .bio {
    display: grid;
    gap: 3rem;
    grid-template-columns: 16rem 1fr;
    order: 3;
    position: relative;
    width: 100%;
  }
}

/* ==========================================================================
   Tablet
   ========================================================================== */

@media (width >= 769px) and (width <= 999px) {
  body {
    height: auto;
  }

  .dropdown-content {
    overflow: auto;
  }

  .nav-box {
    flex-wrap: wrap;
  }

  .nav-box a {
    display: block;
  }

  .content-box {
    gap: 3rem;
    min-height: 100vh;
    width: 100%;
  }

  .article-box {
    flex-shrink: 1;
    margin-left: 0;
    min-width: min-content;
    padding: 2rem;
    width: 100%;
  }

  .article-img {
    height: 25rem;
    margin: 0;
    object-fit: cover;
    width: 100%;
  }

  .article-text {
    align-items: stretch;
    display: flex;
    flex-flow: column;
    flex-direction: column;
    order: 1;
    width: 100%;
  }

}

/* ==========================================================================
   Desktop
   ========================================================================== */

@media (width >= 1000px) {
  body {
    display: flex;
    height: auto;
    justify-content: space-around;
    justify-self: center;
    max-width: 100%;
    place-items: center center;
  }

  .content-box {
    box-sizing: border-box;
    display: flex;
    min-height: 100vh;
    place-content: center;
    width: auto;
  }

  .article-box {
  }

  .article-img {
    height: 25rem;
    margin: 0;
    object-fit: cover;
    width: 100%;
  }

}
