/* ==================================================
   KAYTECH BLOG.CSS
   FULL REBUILD / FIXED VERSION
================================================== */

/* -------------------------------
   VARIABLES
--------------------------------*/
:root {
  --blog-radius: 22px;
  --blog-border:
    color-mix(in srgb, var(--default-color), transparent 88%);
  --blog-shadow:
    0 12px 40px rgba(0, 0, 0, 0.18);
}

/* -------------------------------
   RESET
--------------------------------*/
* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  display: block;
}

/* -------------------------------
   PRELOADER FIX
--------------------------------*/
#preloader {
  display: none !important;
}

/* -------------------------------
   PAGE OFFSET
--------------------------------*/
.blog-page {
  overflow-x: hidden;
}

.blog-offset {
  padding-top: 140px;
}

/* -------------------------------
   BREADCRUMB
--------------------------------*/
.blog-breadcrumb {
  margin-bottom: 30px;
}

.blog-breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-breadcrumb li {
  font-size: 14px;
}

.blog-breadcrumb a {
  color: var(--default-color);
  text-decoration: none;
}

.blog-breadcrumb .active {
  color: var(--accent-color);
  font-weight: 700;
}

/* -------------------------------
   HERO
--------------------------------*/
.blog-hero {
  padding: 40px 0 50px;
}

.hero-label {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-color);
  font-weight: 700;
}

.blog-hero h1 {
  font-family: var(--heading-font);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 18px;
}

.blog-hero p {
  max-width: 720px;
  line-height: 1.8;
}

/* -------------------------------
   SEARCH
--------------------------------*/
.blog-search {
  display: flex;
  margin-top: 32px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-color);
  border: 1px solid var(--blog-border);
}

.blog-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--default-color);
  padding: 18px 24px;
}

.blog-search button {
  border: none;
  padding: 18px 28px;
  font-weight: 700;
  background: var(--accent-color);
  color: var(--contrast-color);
  cursor: pointer;
}

/* -------------------------------
   CATEGORY FILTERS
--------------------------------*/
.blog-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.cat-btn {
  border: 1px solid var(--blog-border);
  background: transparent;
  color: var(--default-color);
  border-radius: 999px;
  padding: 12px 22px;
  transition: .3s ease;
}

.cat-btn:hover,
.cat-btn.active {
  background: var(--accent-color);
  color: var(--contrast-color);
  border-color: var(--accent-color);
}

/* -------------------------------
   SECTION HEADINGS
--------------------------------*/
.blog-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--blog-border);
  padding-bottom: 16px;
}

.blog-section-heading h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin: 0;
}

.view-all {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 700;
}

/* -------------------------------
   FEATURED CARD
--------------------------------*/
.blog-card-featured .blog-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
  border-radius: var(--blog-radius);
}

/* -------------------------------
   GRID
--------------------------------*/
.blog-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

/* -------------------------------
   BLOG CARD
--------------------------------*/
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-color);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  overflow: hidden;
  transition: .3s ease;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--blog-shadow);
}

/* -------------------------------
   IMAGE FIX
--------------------------------*/
.card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* -------------------------------
   CATEGORY TAG
--------------------------------*/
.card-category {
  position: absolute;
  top: 18px;
  left: 18px;
  background: var(--accent-color);
  color: var(--contrast-color);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
}

/* -------------------------------
   BLOG CARD BODY
--------------------------------*/
.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 28px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  margin-bottom: 18px;
  opacity: .8;
}

.blog-card-body h3 {
  font-size: 1.45rem;
  line-height: 1.4;
  margin-bottom: 16px;

  /* equal card heights */
  min-height: 4.5rem;

  /* clamp long titles */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-body h3 a {
  color: var(--heading-color);
  text-decoration: none;
}

.card-excerpt {
  line-height: 1.8;
  flex-grow: 1;
}

/* -------------------------------
   BLOG CARD FOOTER
--------------------------------*/
.blog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--blog-border);
}

.read-more {
  text-decoration: none;
  color: var(--accent-color);
  font-weight: 700;
}

/* -------------------------------
   ADS
--------------------------------*/
.ad-slot {
  width: 100%;
  border-radius: 20px;
  border: 1px dashed var(--blog-border);
  background:
    color-mix(in srgb, var(--surface-color), black 5%);
}

.ad-slot-leaderboard {
  min-height: 120px;
  margin-top: 32px;
}

.ad-slot-in-article {
  grid-column: 1 / -1;
  min-height: 280px;
}

.ad-slot-rectangle {
  min-height: 320px;
  margin: 80px 0;
}

/* -------------------------------
   PAGINATION
--------------------------------*/
.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 60px;
}

.page-link {
  width: 46px;
  height: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  text-decoration: none;
  border: 1px solid var(--blog-border);
  color: var(--default-color);
}

.page-link.active,
.page-link:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* -------------------------------
   CATEGORY CARDS
--------------------------------*/
.cat-filter-card {
  transition: .3s ease;
}

.cat-filter-card:hover {
  transform: translateY(-4px);
}

/* -------------------------------
   NEWSLETTER
--------------------------------*/
.light-background {
  padding: 90px 0;
}

/* -------------------------------
   RESPONSIVE
--------------------------------*/
@media (max-width: 991px) {

  .blog-card-featured .blog-card {
    grid-template-columns: 1fr;
  }

  .blog-offset {
    padding-top: 120px;
  }

  .blog-hero {
    text-align: center;
  }

  .blog-search {
    flex-direction: column;
    border-radius: 22px;
  }

  .blog-search button {
    width: 100%;
  }

  .blog-section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

@media (max-width: 768px) {

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-card-body {
    padding: 22px;
  }

  .blog-hero h1 {
    font-size: 2rem;
  }

  .blog-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 576px) {

  .cat-btn {
    width: 100%;
  }

  .blog-search input,
  .blog-search button {
    padding: 16px 18px;
  }
}
