:root {
  --primary: #2c3e50;
  --secondary: #3498db;
  --accent: #e74c3c;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --text: #333;
  --text-light: #7f8c8d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Open Sans", sans-serif;
}

body {
  background-color: #f5f7fa;
  color: var(--text);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

h1 {
  font-family: "Cardo", serif;
}

header {
  background: linear-gradient(135deg, var(--primary), var(--dark));
  color: white;
  /* padding: 1.5rem; */
  padding: 12px 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-content .header-left .logo {
  width: 80px;
  height: 60px;
}

.header-content .header-left .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-title a {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 1px;
  font-family: "Cardo", serif;
  color: white;
  text-decoration: none;
}

.logo-title span {
  color: var(--accent);
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0.5rem 0;
  position: relative;
  font-size: 15px;
}

nav ul li a:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

nav ul li a:hover:after {
  width: 100%;
}

nav ul li a.active:after {
  width: 100%;
}

.container {
  display: grid;
  grid-template-columns: 300px 1fr;
  max-width: 1200px;
  margin: 30px auto;
  gap: 2rem;
  padding: 0 20px;
}

.sidebar {
  grid-column: 1;
}

.main-content {
  grid-column: 2;
}

aside {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  height: fit-content;
  position: sticky;
  top: 20px;
}

.sidebar-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary);
  color: var(--primary);
  font-family: "Cardo", serif;
}

.sidebar-menu {
  list-style: none;
}

/* .sidebar-menu li {
  margin-bottom: 0.8rem;
} */

.sidebar-menu a {
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s ease;
  display: block;
  padding: 0.5rem 0;
  font-size: 15px;
}

.sidebar-menu a:hover {
  color: var(--secondary);
  transform: translateX(5px);
  text-decoration: underline;
}

.sidebar-menu a.active {
  color: var(--secondary);
  font-weight: 600;
}

main {
  display: grid;
  gap: 2rem;
}

.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url("https://source.unsplash.com/random/1200x400/?books");
  background-size: cover;
  background-position: center;
  color: white;
  padding: 4rem 2rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 300px;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  position: relative;
  z-index: 2;
}

.articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* .article-image {
            height: 180px;
            background-size: cover;
            background-position: center;
        } */

.article-image img {
  width: 100%;
  height: auto;
}

.article-content {
  padding: 1.5rem;
}

.article-category {
  display: inline-block;
  background: var(--secondary);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

.article-title {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: var(--dark);
  font-family: "Cardo", serif;
}

.article-excerpt {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.5;
  font-size: 15px;
}

.read-more {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  font-size: 15px;
}

.read-more svg {
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.read-more:hover svg {
  transform: translateX(3px);
}

.featured-article {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.featured-image {
  height: 100%;
  min-height: 300px;
  background-size: cover;
  background-position: center;
}

.featured-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-category {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.featured-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.featured-excerpt {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 1.1rem;
}

/*  === Footer ==== */

footer {
  background: var(--dark);
  color: white;
  padding: 1.5rem;
  height: fit-content;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: auto;
}

.footer-section p {
  font-size: 14px;
  opacity: 0.8;
  line-height: 22px;
}

.footer-section h4 {
  font-size: 20px;
  margin-bottom: 1rem;
  color: white;
  font-family: "Cardo", serif;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
  font-size: 14px;
  opacity: 0.8;
}

.footer-links li a {
  color: var(--light);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-links li a:hover {
  transform: translateX(5px);
  text-decoration: underline;
}

/* .footer-links a:hover {
  color: var(--accent);
} */

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  color: #bdc3c7;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}

.copyright {
  color: #bdc3c7;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }

  .footer-container > div:first-child {
    grid-column: span 2;
  }

  .container {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .main-content {
    order: 1;
    grid-column: 1;
  }

  .sidebar {
    order: 2;
    grid-column: 1;
  }

  aside {
    position: static;
    margin-bottom: 2rem;
  }

  .featured-article {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }

  .featured-image {
    min-height: 200px;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  header {
    padding: 12px 20px;
  }
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  nav ul {
    margin-top: 1rem;
    justify-content: center;
  }

  nav ul li {
    margin: 0 0.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  /* Limit to 4 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-clamp: 4;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  /* Limit to 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-clamp: 3;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* Limit to 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-clamp: 2;
}

/* scroll to top */
#scrollToTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  /* padding: 10px 15px; */
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--secondary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none; /* Hidden by default */
  transition: opacity 0.3s ease-in-out;
}

/* loader  */
/* From Uiverse.io by Donewenfu */
.loadingspinner {
  position: absolute;
  /* top: 0;
  bottom: 0;
  left: 0;
  right: 0; */
}

.jimu-primary-loading:before,
.jimu-primary-loading:after {
  position: absolute;
  top: 0;
  content: "";
}

.jimu-primary-loading:before {
  left: -19.992px;
}

.jimu-primary-loading:after {
  left: 19.992px;
  -webkit-animation-delay: 0.32s !important;
  animation-delay: 0.32s !important;
}

.jimu-primary-loading:before,
.jimu-primary-loading:after,
.jimu-primary-loading {
  background: var(--dark);
  -webkit-animation: loading-keys-app-loading 0.8s infinite ease-in-out;
  animation: loading-keys-app-loading 0.8s infinite ease-in-out;
  width: 13.6px;
  height: 32px;
}

.jimu-primary-loading {
  text-indent: -9999em;
  margin: auto;
  position: absolute;
  right: calc(50% - 6.8px);
  top: calc(50% - 16px);
  -webkit-animation-delay: 0.16s !important;
  animation-delay: 0.16s !important;
}

@-webkit-keyframes loading-keys-app-loading {
  0%,
  80%,
  100% {
    opacity: 0.75;
    box-shadow: 0 0 var(--dark);
    height: 32px;
  }

  40% {
    opacity: 1;
    box-shadow: 0 -8px var(--dark);
    height: 40px;
  }
}

@keyframes loading-keys-app-loading {
  0%,
  80%,
  100% {
    opacity: 0.75;
    box-shadow: 0 0 var(--dark);
    height: 32px;
  }

  40% {
    opacity: 1;
    box-shadow: 0 -8px var(--dark);
    height: 40px;
  }
}
