/* Post Grid Layouts CSS */

/* Card Body Base Padding - All Layouts */
.post-card .card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.huna-post-grid-1 .main-post .card-body,
.huna-post-grid-2 .main-post .card-body,
.huna-post-grid-3 .card-body,
.huna-layout-4-main .card-body {
  padding: 30px;
}

/* Responsive Padding for all layouts */
@media (max-width: 767px) {
  .post-card .card-body,
  .huna-post-grid-1 .main-post .card-body,
  .huna-post-grid-2 .main-post .card-body,
  .huna-post-grid-3 .card-body,
  .huna-layout-4-main .card-body,
  .huna-layout-4-side .card-body {
    padding: 20px;
  }
}

.huna-post-grid-1 .post-card,
.huna-post-grid-2 .post-card {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  height: 100%;
  transition: all 0.3s ease;
}

.huna-post-grid-1 .post-card:hover,
.huna-post-grid-2 .post-card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.huna-post-grid-1 .main-post .img-container,
.huna-post-grid-2 .main-post .img-container {
  width: 100%;
  background-size: cover;
  background-position: left top;
}

.huna-post-grid-1 .main-post .img-container {
  height: 450px;
}

.huna-post-grid-2 .main-post .img-container {
  height: 350px;
}

/* Removed individual card-body paddings here to use global ones above */

.huna-post-grid-1 .main-post .card-title,
.huna-post-grid-2 .main-post .card-title {
  font-size: 24px;
  font-weight: 700;
  margin-top: 10px;
  margin-bottom: 8px;
  color: var(--tg-text-color);
  line-height: 1.3;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Side Posts */
.huna-post-grid-1 .huna-layout-4-side .post-card a,
.huna-post-grid-2 .huna-layout-4-side .post-card a {
  flex-direction: row;
  align-items: stretch;
}

.huna-post-grid-1 .huna-layout-4-side .img-container,
.huna-post-grid-2 .huna-layout-4-side .img-container {
  width: 40%;
  min-height: 180px;
  background-size: cover;
  background-position: left top;
}

.huna-post-grid-1 .huna-layout-4-side .card-title,
.huna-post-grid-2 .huna-layout-4-side .card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 8px;
  margin-bottom: 8px;
  color: var(--tg-text-color);
  text-align: left;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Date shared */
.huna-post-query-date {
  font-size: 13px;
  color: #888;
  margin-bottom: 0;
}

.huna-post-grid-1 .post-card a,
.huna-post-grid-2 .post-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.huna-post-grid-1 .post-card a:hover .card-title,
.huna-post-grid-2 .post-card a:hover .card-title {
  color: var(--tg-primary-color, #007bff);
}

/* Responsive Adjustments (Desktop overrides moved up) */
@media (max-width: 991px) {
  .huna-post-grid-1 .huna-layout-4-side,
  .huna-post-grid-2 .huna-layout-4-side {
    margin-bottom: 24px;
  }
}

@media (max-width: 767px) {
  .huna-post-grid-1 .main-post .img-container,
  .huna-post-grid-2 .main-post .img-container {
    height: 250px;
  }

  .huna-post-grid-1 .huna-layout-4-side .post-card a,
  .huna-post-grid-2 .huna-layout-4-side .post-card a {
    flex-direction: column;
  }
  .huna-post-grid-1 .huna-layout-4-side .img-container,
  .huna-post-grid-2 .huna-layout-4-side .img-container {
    width: 100%;
    height: 200px;
  }
  .huna-post-grid-1 .main-post .card-title,
  .huna-post-grid-2 .main-post .card-title {
    font-size: 16px;
  }
}

/* Layout 3 specific */
.huna-post-grid-3 .post-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.huna-layout-4-main .post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  border: 1px solid #eaeaea;
  position: relative;
  width: 100%;
  height: 100%;
}

.huna-post-grid-4 .main-post .post-card:hover {
  transform: translateY(-5px);
}

.huna-post-grid-3 .post-card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.huna-post-grid-3 .img-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: left top;
  z-index: 1;
  transition: transform 0.3s ease;
}

.huna-post-grid-3 .post-card:hover .img-container {
  transform: scale(1.05);
}

.huna-post-grid-3 .gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(42, 40, 47, 0) 19.9%, #0096db 100%);
  z-index: 2;
}

.huna-post-grid-3 .card-body {
  position: relative;
  z-index: 3;
  padding: 30px;
  color: #fff;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.huna-post-grid-3 .card-title,
.huna-post-grid-3 .huna-post-query-date,
.huna-post-grid-3 .post-excerpt,
.huna-layout-4-main .title-overlay .card-title {
  color: #fff !important;
}

.huna-layout-4-main .card-body .post-excerpt {
  color: #666;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.huna-layout-4-main .card-body .huna-post-query-date {
  color: #999;
  font-size: 14px;
  margin-bottom: 0;
}

.huna-post-grid-3 .card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.huna-post-grid-3 .post-card a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  width: 100%;
}

@media (max-width: 767px) {
  .huna-post-grid-3 .card-title,
  .huna-layout-4-main .card-title {
    font-size: 18px;
  }
}

.huna-post-grid-4 .row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  margin-right: -15px;
  margin-left: -15px;
}

.huna-post-grid-4 .row > [class*="col-"] {
  padding-right: 15px;
  padding-left: 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.huna-post-grid-4 .col-12,
.huna-post-grid-4 .col-md-12,
.huna-post-grid-4 .col-lg-12 {
  flex: 0 0 100%;
  max-width: 100%;
  width: 100%;
}

@media (min-width: 768px) {
  .huna-post-grid-4 .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
    width: 50%;
  }
}

@media (max-width: 767px) {
  .huna-post-grid-4 .col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }
}

.huna-layout-4-main .huna-media-container {
  position: relative !important;
  min-height: 350px !important;
  flex-grow: 1 !important;
  width: 100% !important;
  overflow: hidden !important;
  display: block !important;
}

.huna-layout-4-main .img-container {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-size: cover;
  background-position: left top;
  z-index: 1;
  transition: transform 0.5s ease;
}

.huna-layout-4-main .post-card:hover .img-container {
  transform: scale(1.05);
}

.huna-layout-4-main .gradient-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(180deg, rgba(42, 40, 47, 0) 19.9%, #0096db 100%);
  z-index: 2;
}

.huna-layout-4-main .title-overlay {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  padding: 30px !important;
  z-index: 3;
}

.huna-layout-4-main .title-overlay .card-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  line-height: 1.3;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.huna-layout-4-main .card-body {
  background: #fff;
  position: relative;
  display: block;
  color: #333;
}

/* Layout 4 specific */
.huna-layout-4-side .post-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid #eaeaea;
  height: 100%;
  position: relative;
}

.huna-layout-4-side .post-card:last-child {
  border-bottom: none;
}

.huna-layout-4-side .post-card:hover {
  box-shadow: none;
}

.huna-layout-4-side .post-card a {
  flex-direction: row;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  display: flex;
}

.huna-layout-4-side .img-container {
  width: 30%;
  min-height: 160px;
  background-size: cover;
  background-position: left top;
  border-radius: 8px;
}

.huna-layout-4-side .card-body {
  width: 70%;
  padding-left: 20px;
  justify-content: center;
}

.huna-layout-4-side .card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 8px;
  margin-bottom: 8px;
  color: var(--tg-primary-color);
  text-align: left;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.huna-layout-4-side .post-card a:hover .card-title {
  color: var(--tg-secondary-color, #007bff);
}

@media (max-width: 767px) {
  .huna-layout-4-side .post-card a {
    flex-direction: column;
  }
  .huna-layout-4-side .img-container {
    width: 100%;
    height: 180px;
  }
  .huna-layout-4-side .card-body {
    width: 100%;
    padding: 20px;
  }
}


/* Post Carousel Specific */
.huna-post-carousel .slick-prev,
.huna-post-carousel .slick-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--tg-text-color);
  cursor: pointer;
}
.huna-post-carousel .slick-prev {
  left: -35px;
}
.huna-post-carousel .slick-next {
  right: -35px;
}
.huna-post-carousel .slick-dots {
  list-style: none;
  display: flex;
  justify-content: center;
  padding: 0;
  margin: 30px 0 0 0;
}
.huna-post-carousel .slick-dots li {
  margin: 0 5px;
}
.huna-post-carousel .slick-dots button {
  font-size: 0;
  line-height: 0;
  display: block;
  width: 10px;
  height: 10px;
  padding: 5px;
  cursor: pointer;
  color: transparent;
  border: 0;
  outline: none;
  background: #d6d6d6;
  border-radius: 50%;
}
.huna-post-carousel .slick-dots li.slick-active button {
  background: #0096db;
}


/* Custom Search Bar */
.huna-custom-search {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #f7f7f7;
  border-radius: 50px;
  padding: 10px 25px;
  width: 100%;
}
.huna-custom-search .huna-search-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--tg-text-color);
  padding: 5px 0;
  box-shadow: none;
}
.huna-custom-search .huna-search-input::placeholder {
  color: #a4a4a4;
}
.huna-custom-search .huna-search-icon {
  color: var(--tg-text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.huna-custom-search .huna-search-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--tg-text-color);
}


/* Load More Button UI */
.huna-load-more-wrapper {
  text-align: center;
  width: 100%;
}
.huna-load-more-btn {
  background-color: transparent;
  color: #0096db;
  border: 1px solid #0096db;
  border-radius: 50px;
  padding: 10px 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}
.huna-load-more-btn:hover {
  background-color: #0096db;
  color: #fff;
}
.huna-load-more-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}


/* Work Layout Specific */
.huna-post-work {
  width: 100%;
}

.huna-post-work .row {
  width: 100%;
  margin: 0;
}

.huna-post-work .huna-work-item .work-card {
  background: #F7F7F7;
  border: 1px solid #e0e4e8;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  height: 100%;
}

.huna-post-work .huna-work-item .work-card:hover {
  background: linear-gradient(116.33deg, #C0E5F6 1.12%, rgba(215, 239, 249, 0.633663) 9.08%, rgba(255, 255, 255, 0) 52.97%, #C2ECFF 80.02%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.huna-post-work .huna-work-item .work-title {
  margin-bottom: 20px;
  font-size: 22px;
  line-height: 1.4;
}

.huna-post-work .huna-work-item .work-title a {
  color: #004d80;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s ease;
}

.huna-post-work .huna-work-item .work-title a:hover {
  color: #0096db;
}

.huna-post-work .huna-work-item .work-meta-row {
  display: flex;
  align-items: flex-start;
  font-size: 15px;
  margin-bottom: 12px;
}
.huna-post-work .huna-work-item .work-meta-row:last-child {
  margin-bottom: 0;
}

.huna-post-work .huna-work-item .work-meta-label {
  font-weight: 700;
  color: var(--tg-text-color);
  min-width: 90px;
  margin-right: 15px;
}

.huna-post-work .huna-work-item .work-meta-value {
  color: var(--tg-text-color);
  word-break: break-word;
}

.huna-post-work .huna-work-item .work-meta-value a {
  color: var(--tg-text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.huna-post-work .huna-work-item .work-meta-value a:hover {
  color: #0096db;
}

@media (max-width: 767px) {
  .huna-post-work .huna-work-item .work-card {
    padding: 20px;
  }
  .huna-post-work .huna-work-item .work-title {
    font-size: 18px;
  }
  .huna-post-work .huna-work-item .work-meta-row {
    margin-bottom: 10px;
  }
  .huna-post-work .huna-work-item .work-meta-label {
    min-width: 80px;
    margin-right: 10px;
  }
}

