/*--------------------------------------------------------------
# Blog Homepage
--------------------------------------------------------------*/

/* Featured Main Post */
.featured-main {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.featured-main article {
  height: 387px;
}

.featured-post .post-thumbnail {
  max-height: 387px;
  width: 100%;
}

.featured-post .post-thumbnail img {
  width: 100%;
  height: 100%;
}

.featured-post .post-thumbnail::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.4) 60%,
    transparent 100%
  );
}

.featured-post .entry-header {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5em;
  z-index: 2;
}

.featured-post .post-category {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--main-yellow-400);
  text-decoration: none;
  text-transform: capitalize;
  margin-bottom: 0.75em;
}

.featured-post .entry-title {
  font-size: 30px;
  margin: 0 0 0.5em 0;
  font-weight: 700;
}

.featured-post .entry-title a {
  color: #ffffff;
  text-decoration: none;
}

.featured-post .entry-summary {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

/* Featured Sidebar */
.blog-homepage-featured-side {
  background-color: var(--main-blue-1000);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.blog-homepage-side-post {
  padding: 1rem 0;
  border-bottom: 1px solid #fff;
}

.blog-homepage-side-post:first-child {
  padding-top: 0;
}

.blog-homepage-side-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.blog-homepage-side-post .post-thumbnail {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  position: relative;
}

.blog-homepage-side-post .post-thumbnail::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.3) 90%,
    transparent 100%
  );
  border-radius: 8px;
  pointer-events: none;
}

.blog-homepage-side-post .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.blog-homepage-side-post .entry-header {
  flex: 1;
}

.blog-homepage-side-post .post-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--main-yellow-400);
  text-decoration: none;
  text-transform: capitalize;
  margin-bottom: 0.4em;
}

.blog-homepage-side-post .entry-title {
  font-size: 18px;
  line-height: 1.4;
  margin: 0;
  font-weight: 600;
}

.blog-homepage-side-post .entry-title a {
  color: #ffffff;
  text-decoration: none;
  display: block;
}

.blog-homepage-post-thumbnail-featured-list img {
  position: relative;
  width: 150px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .featured-main {
    height: 400px;
  }

  .blog-homepage-featured-side {
    height: auto;
    margin-top: 0;
  }

  .featured-post .entry-header {
    padding: 1.5rem;
  }

  .featured-post .entry-title {
    font-size: 1.5rem;
  }

  .blog-homepage-topic-post-large .blog-homepage-topic-post-large-thumbnail {
    max-width: 100%;
  }

  .blog-homepage-card-post {
    max-width: 279px; /* Desktop size */
  }

  .blog-homepage-card-post-thumbnail {
    max-width: 279px; /* Desktop size */
  }
}

@media (max-width: 767.98px) {
  .featured-main {
    max-height: 213px;
  }

  .featured-post .entry-title {
    font-size: 1.25rem;
  }

  .featured-post .entry-summary {
    font-size: 0.875rem;
  }

  .blog-homepage-side-post .post-thumbnail {
    width: 80px;
    height: 80px;
  }

  .blog-homepage-side-post .entry-title {
    font-size: 18px;
  }

  .blog-homepage-topic-post-large {
    height: auto;
    margin-bottom: 1.5rem;
  }

  .blog-homepage-topic-post-large
    .blog-homepage-topic-post-large-thumbnail
    img {
    max-height: 200px;
  }

  .blog-homepage-topic-post-large .blog-homepage-topic-post-large-entry-header {
    padding: 1rem;
  }

  .blog-homepage-topic-post-large
    .blog-homepage-topic-post-large-entry-title
    a {
    font-size: 16px;
    font-weight: 600;
  }

  .blog-homepage-topic-post-small {
    gap: 0.75rem;
    padding-bottom: 0.875rem;
  }

  .blog-homepage-topic-post-small .blog-homepage-topic-post-small-thumbnail {
    width: 120px !important;
    height: 85px !important;
  }

  .blog-homepage-topic-post-small .blog-homepage-topic-post-small-entry-title {
    font-size: 16px;
    line-height: 1.4;
  }

  .blog-homepage-topic-section-container {
    gap: 0.875rem;
  }
}

@media (max-width: 575.98px) {
  .blog-homepage-section-title {
    font-size: 20px;
    padding-bottom: 20px;
  }

  .blog-homepage-topic-post-large .blog-homepage-topic-post-large-thumbnail {
    max-width: 100%;
  }

  .blog-homepage-topic-post-small .blog-homepage-topic-post-small-thumbnail {
    height: 70px !important;
  }

  .blog-homepage-topic-post-small .blog-homepage-topic-post-small-entry-title {
    font-size: 16px;
    line-height: 1.3;
  }

  .blog-homepage-topic-post-small .post-category {
    font-size: 14px !important;
  }

  .blog-homepage-newsletter-section {
    padding: 2em 1.5em;
    justify-content: center;
    text-align: center;
  }

  .blog-homepage-newsletter-section .newsletter-content {
    width: 100%;
    max-width: 400px;
    align-items: center;
  }

  .blog-homepage-newsletter-section .newsletter-content h3 {
    font-size: 28px;
  }

  .blog-homepage-newsletter-section .newsletter-content p {
    font-size: 15px;
    max-width: 100%;
  }

  .blog-homepage-newsletter-form {
    flex-direction: column;
    gap: 0.75em;
    width: 100%;
  }

  .blog-homepage-newsletter-form input {
    width: 100%;
    max-width: 300px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .blog-homepage-newsletter-form button {
    width: 100%;
    max-width: 300px;
    padding: 0.9em 1.5em;
  }

  .blog-home-most-read-container {
    padding: 1.5rem;
  }

  .blog-home-most-read-list li::before {
    font-size: 2rem;
    min-width: 40px;
  }

  .blog-home-most-read-list li a {
    font-size: 14px;
  }

  .blog-homepage-card-post {
    max-width: 332px; /* Mobile size */
    margin: 0 auto; /* Center align on mobile */
  }

  .blog-homepage-card-post-thumbnail {
    max-width: none; /* Mobile size */
    height: 158px;
  }

  .blog-homepage-card-post-thumbnail img {
    height: 158px;
  }
}

@media (max-width: 399.98px) {
  .blog-homepage-topic-post-small .blog-homepage-topic-post-small-thumbnail {
    width: 85px !important;
    height: 60px !important;
  }

  .blog-homepage-topic-post-small .blog-homepage-topic-post-small-entry-title {
    font-size: 0.75rem;
  }

  .blog-homepage-topic-post-small {
    gap: 0.5rem;
  }

  .blog-homepage-topic-post-large .blog-homepage-topic-post-large-entry-header {
    padding: 0.75rem;
  }

  .blog-home-most-read-list li {
    gap: 1rem;
  }

  .blog-homepage-card-post {
    max-width: 300px; /* Slightly smaller for very small screens */
    margin: 0 auto; /* Center align on very small mobile */
  }

  .blog-homepage-card-post-thumbnail {
    max-width: 300px;
  }

  .blog-homepage-newsletter-section {
    padding: 1.5em 1em;
  }

  .blog-homepage-newsletter-section .newsletter-content h3 {
    font-size: 24px;
  }

  .blog-homepage-newsletter-section .newsletter-content p {
    font-size: 14px;
  }

  .blog-homepage-newsletter-form {
    gap: 0.5em;
  }

  .blog-homepage-newsletter-form input {
    max-width: 280px;
    padding: 0.75em;
  }

  .blog-homepage-newsletter-form button {
    max-width: 280px;
    padding: 0.8em 1.25em;
    font-size: 15px;
  }
}

.blog-homepage-section-title {
  font-size: 24px;
  color: var(--main-gray-950);
  padding: 15px 0;
  font-weight: 600;
}

.blog-home-most-read-container {
  background-color: var(--main-blue-950);
  border-radius: 12px;
  padding: 2rem;
}

.blog-home-most-read-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: most-read-counter;
}

.blog-home-most-read-list li {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  counter-increment: most-read-counter;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.blog-home-most-read-list li:first-child {
  padding-top: 0;
}

.blog-home-most-read-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.blog-home-most-read-list li::before {
  content: counter(most-read-counter);
  font-size: 3rem;
  color: var(--main-yellow-400);
  line-height: 1;
  flex-shrink: 0;
  min-width: 50px;
}

.blog-home-most-read-list li a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  flex: 1;
}

.blog-home-most-read-list li a:hover {
  color: var(--main-yellow-400);
}

.blog-homepage-topic-section-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  justify-content: space-between;
}

/* Large posts list category */
.blog-homepage-topic-post-large {
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
}

.blog-homepage-topic-post-large .blog-homepage-topic-post-large-thumbnail {
  position: relative;
  height: 100%;
  width: 100%;
  max-width: 385px;
  min-height: 217px;
}

.blog-homepage-topic-post-large
  .blog-homepage-topic-post-large-thumbnail::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.4) 60%,
    transparent 100%
  );
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  pointer-events: none;
}

.blog-homepage-topic-post-large .blog-homepage-topic-post-large-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  max-height: 217px;
}

.blog-homepage-topic-post-large .blog-homepage-topic-post-large-entry-title a {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-white);
  text-decoration: none;
}

h3.blog-homepage-topic-post-large-entry-title {
  line-height: 15px !important;
}

.blog-homepage-topic-post-large-entry-header {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 20px;
  z-index: 2;
}

/* Small posts list category */
.blog-homepage-topic-post-small {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  transition: all 0.3s ease;
}

.blog-homepage-topic-post-small:hover
  h3.blog-homepage-topic-post-small-entry-title
  a {
  color: var(--main-blue-800);
}

h3.blog-homepage-topic-post-small-entry-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--main-gray-950);
  line-height: 18px;
}

h3.blog-homepage-topic-post-small-entry-title a {
  color: var(--main-gray-950);
  text-decoration: none;
}

.blog-homepage-topic-post-small:hover {
  transform: translateY(-4px);
}

.blog-homepage-topic-post-small:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.blog-homepage-topic-post-small .blog-homepage-topic-post-small-thumbnail {
  height: 92px;
  width: 151px;
  justify-content: center;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px;
}

.blog-homepage-topic-post-small .post-thumbnail::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.2) 90%,
    transparent 100%
  );
  pointer-events: none;
}

.blog-homepage-topic-post-small .blog-homepage-topic-post-small-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.blog-homepage-topic-post-small .entry-header {
  flex: 1;
}

.blog-homepage-topic-post-small .post-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--main-blue-950);
  text-decoration: none;
  text-transform: capitalize;
  margin-bottom: 0.25rem;
}

.blog-homepage-topic-post-small .entry-title {
  font-size: 1rem;
  line-height: 1.4;
  margin: 0;
  font-weight: 600;
}

.blog-homepage-topic-post-small .entry-title a {
  color: var(--main-blue-950);
  text-decoration: none;
}

.blog-homepage-section {
  margin-bottom: 3em;
}

.blog-homepage-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5em;
}

.blog-homepage-section-header .blog-homepage-section-title {
  margin: 0;
  border: none;
  padding: 0;
}

.view-all-link {
  color: var(--main);
  text-decoration: none;
  font-weight: 600;
}

/* Newsletter section */
.blog-homepage-newsletter-section {
  background-color: var(--color-gold);
  padding: 3em;
  border-radius: 8px;
  margin-bottom: 3em;
  background-image: url("../images/newsletter-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: end;
}

.blog-homepage-newsletter-section .newsletter-content {
  width: fit-content;
  display: flex;
  flex-direction: column;
  justify-content: start;
}

.blog-homepage-newsletter-section .newsletter-content h3 {
  color: var(--main-blue-950);
  font-size: 36px;
  font-weight: 600;
  margin: 0 0 0.5em 0;
}

.blog-homepage-newsletter-section .newsletter-content p {
  color: var(--main-blue-950);
  font-size: 16px;
  font-weight: 400;
  max-width: 400px;
  margin: 0 0 1.5em 0;
}

.blog-homepage-newsletter-form {
  display: flex;
  gap: 1em;
  align-items: flex-start;
}

.blog-homepage-newsletter-form input {
  padding: 0.8em;
  border-radius: 8px;
  width: 300px;
  border: 1px solid #ddd;
  font-size: 16px;
}

.blog-homepage-newsletter-form button {
  background-color: var(--main-green-500);
  color: var(--color-white);
  border: none;
  padding: 0.8em 1.5em;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  white-space: nowrap;
}

.blog-homepage-newsletter-form button:hover {
  background-color: var(--main-green-600);
}

/* Tablet responsiveness */
@media (max-width: 991.98px) {
  .blog-homepage-newsletter-section {
    justify-content: center;
    text-align: center;
  }

  .cri-page-title {
    font-size: 24px !important;
  }

  .blog-homepage-newsletter-section .newsletter-content {
    width: 100%;
    max-width: 500px;
    align-items: center;
  }

  .blog-homepage-newsletter-section .newsletter-content h3 {
    font-size: 32px;
  }

  .blog-homepage-newsletter-section .newsletter-content p {
    max-width: 100%;
  }
}

.blog-homepage-main-video .post-thumbnail img {
  width: 100%;
  border-radius: 8px;
}

.blog-homepage-main-video .entry-title {
  font-size: 1.5rem;
  margin-top: 0.5em;
}

.blog-homepage-main-video .entry-title a {
  color: var(--main-blue-950);
  text-decoration: none;
}

.video-playlist {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.blog-homepage-playlist-item {
  display: flex;
  gap: 1em;
  align-items: center;
}

.blog-homepage-playlist-item .post-thumbnail img {
  width: 120px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
}

.blog-homepage-playlist-item .entry-title {
  font-size: 1rem;
}

.blog-homepage-playlist-item .entry-title a {
  color: var(--main-blue-950);
  text-decoration: none;
}

.blog-homepage-divider {
  margin-bottom: 3em;
}

.blog-homepage-divider-line {
  border-top: 1px solid var(--main-gray-100);
}

/* Categories section */

.blog-homepage-categories-section {
  margin-bottom: 3em;
}

.blog-homepage-categories-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blog-homepage-categories-section-header .view-all-link {
  text-decoration: none;
  font-weight: 400;
  font-size: 16px;
  color: var(--main-gray-950);
}

h2.blog-homepage-categories-section-title a {
  font-size: 24px;
  color: var(--main-blue-950);
  font-weight: 600;
  margin: 0;
  text-decoration: none;
  margin-bottom: 20px;
}

/* Blog Homepage Card Post */

.blog-homepage-card-post {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: none; /* Default mobile size */
}

.blog-homepage-card-post-thumbnail {
  width: 100%;
  height: inherit;
  transition: all 0.3s ease;
  max-width: none; /* Default mobile size */
}

/* Desktop and larger screens - use smaller width */
@media (min-width: 992px) {
  .blog-homepage-card-post {
    max-width: 279px; /* Desktop size */
  }

  .blog-homepage-card-post-thumbnail {
    max-width: 279px; /* Desktop size */
  }
}

.blog-homepage-card-post-thumbnail:hover {
  transform: scale(1.02);
}

.blog-homepage-card-post-thumbnail img {
  width: 100%;
  height: min-content;
  object-fit: cover;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
}

.blog-homepage-card-post-entry-header h3 {
  font-size: 16px;
  color: var(--main-gray-950);
  font-weight: 600;
  margin: 0;
}

.blog-homepage-card-post-entry-header h3 a {
  color: var(--main-gray-950);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.blog-homepage-card-post-entry-header h3 a:hover {
  color: var(--main-blue-800);
}

.text-color-blue-950 {
  color: var(--main-blue-950);
}

.text-color-white {
  color: var(--color-white);
}

.bg-color-blue-950 {
  background-color: var(--main-blue-950);
}

/* Videos listing */

.blog-homepage-videos-listing {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/*--------------------------------------------------------------
# Latest Grid Responsive Styles
--------------------------------------------------------------*/
.blog-homepage-latest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media screen and (max-width: 1200px) {
  .blog-homepage-latest-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
  }
}

@media screen and (max-width: 991px) {
  .blog-homepage-latest-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media screen and (max-width: 767px) {
  .blog-homepage-latest-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .blog-homepage-latest-grid {
    gap: 1rem;
  }
}

/*--------------------------------------------------------------
# Categories Grid Responsive Styles
--------------------------------------------------------------*/
.blog-homepage-categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media screen and (max-width: 1200px) {
  .blog-homepage-categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
  }
}

@media screen and (max-width: 991px) {
  .blog-homepage-categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media screen and (max-width: 767px) {
  .blog-homepage-categories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .blog-homepage-categories-grid {
    gap: 2rem;
  }

  h2.blog-homepage-categories-section-title {
    margin-bottom: 0px;
  }

  .blog-homepage-categories-section-header {
    margin-bottom: 18px;
  }
}
