:root {
  --fs-xl: clamp(1.5rem, 5vw, 3rem);
  --fs-700: 1.75rem;
  --fs-500: 1.125rem;
  --fs-400: 1rem;
  --fs-300: 0.875rem;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #6366f1;
}

/* ====================
   Base
   ==================== */

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

body,
h1,
h2,
h3,
p {
  margin: 0;
}

body {
  padding: 0;
}

a {
  text-decoration: none;
  color: inherit;
} 

img {
  max-width: 100%;
  display: block;
  border-radius: 3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}


/* ====================
   Typography
   ==================== */

body {
  font-family: 'Source Sans Pro', sans-serif;
  color: #404040;
  line-height: 1.5;
  font-size: var(--fs-400);
}

h1,
h2 {
  line-height: 1;
}

h1 {
  font-size: var(--fs-xl);
}

h2 {
  font-size: var(--fs-700);
}

h3 {
  font-size: var(--fs-500);
}

span,
.site-header,
footer {
  font-size: var(--fs-300);
}

.site-header {
  font-weight: 800;
}

.about-intro {
  font-size: var(--fs-500);
  line-height: 1.6;
}

.meta {
  font-size: var(--fs-300);
  color: #777;
}

.bold {
  font-weight: 900;
}


/* ====================
   Layout
   ==================== */

.container {
  width: min(100% - 3rem, 900px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2em 0;
}

.main-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

footer {
  text-align: center;
  padding: 2em 0;
  background-color: #202020;
  color: #ececec;
}

.recent-post-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2em;
  margin-bottom: 3em;
}

.recent-post-container {
  display: flex;
  flex-direction: column;
  gap: 3em;
}

#full-post-container {
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin-top: 2em;
  margin-bottom: 1em;
}

#about-container {
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin-bottom: 1em;
}

.about-div {
  display: flex;
  flex-direction: column;
  gap: 2em;
}


/* ====================
   Components
   ==================== */

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.logo-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.nav-ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
}

.nav-ul li:not(:last-child) {
  text-align: center;
  width: 100%;
  padding: 1em 0;
  border-top: 1px dotted #a190b6;
  border-bottom: 1px dotted #a190b6;
}

.nav-ul a:focus-visible::after {
  width: 100%;
}

.featured-post-card {
  max-width: 90vw;
  margin-inline: auto;
  margin-bottom: 3em;
}

.featured-info-div {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 1em;
  margin-bottom: 1em;
}

.featured-info-div {
  grid-area: fdiv;
}

.featured-img {
  grid-area: fimg;
}

.recent-post-card {
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: flex-start;
  gap: 0.5em;
}

.recent-post-card, 
.featured-post-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.recent-post-card:hover,
.featured-post-card:hover {
  transform: translateY(-4px);
}

.recent-post-card:focus-visible,
.featured-post-card:focus-visible {
  outline: none;
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18);
}

.recent-post-card:hover img,
.featured-post-card:hover img {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18);
}

.avatar {
  width: 180px;
  border-radius: 50%;
  box-shadow: 0 20px 40px #6365f14a;
  grid-area: avat;
}

.nav-ul a {
  position: relative;
}

.nav-ul a::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -2px;
  width: 0%;
  height: 1px;
  background-color: #6365f1;
  transition: width 0.3s ease;
}

.nav-ul a:hover::after {
  width: 100%;
}

.about-heading {
  grid-area: head;
}

.about-intro {
  display: block;
  border-left: 4px solid #6366f1;
  padding-left: 1em;
  grid-area: intr;
}

.view-more-btn {
  border: none;
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-more-btn:hover {
  text-decoration: 1px underline #6366f1;
  color: #8586d1;
  transform: translateY(-1px);
}

.view-more-btn:active {
  transform: translateY(0);
}

.view-more-btn:focus-visible {
  outline: none;
  color: #6366f1;
  text-decoration: underline;
  transform: translateY(-1px);
}   

/* ====================
   Media Queries
   ==================== */

@media (min-width: 480px) {
  .site-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1em 0;
  }

  .nav-ul {
    flex-direction: row;
    gap: 3em;
  }

  .nav-ul li:not(:last-child) {
    width: auto;
    padding: 0;
    border: none;
  }

  .recent-post-container {
    display: grid;
    gap: 2em;
    grid-template-columns: repeat(2, 1fr);
  }

  .about-div {
    display: grid;
    align-items: center;
    gap: 1em;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
      "avat head head"
      "intr intr intr";
  }

  .avatar {
    width: min(100% - 1em, 250px);
  }

  .about-content-div {
    width: min(100% - 3rem, 750px);
    margin-inline: auto;
  }
}

@media (min-width: 700px) {
  .featured-post-card {
    display: grid;
    gap: 3em;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
      "fdiv fimg fimg"
      "fdiv fimg fimg";
    padding: 2em;
    border-radius: 8px;
    background-color: #fafafa;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  }

  .recent-post-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-div {
    display: grid;
    column-gap: 1em;
    gap: 20px;
    grid-template-columns: repeat(5, 1fr);
    grid-template-areas:
      "avat avat head head head"
      "avat avat intr intr intr";
  }
}