/* ============================================================
   blog-styles.css — Red Digitals Blog Page
   Depends on global.css (root variables already defined)
   ============================================================ */

/* ── BLOG HERO ── */

.blogHero {
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  text-align: center;
}

.blogHero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(15, 15, 15, 0) 0%,
      rgba(15, 15, 15, 0.2) 50%,
      rgba(15, 15, 15, 0.85) 80%,
      rgba(15, 15, 15, 1) 100%
    ),
    linear-gradient(
      135deg,
      #1a2a0a 0%,
      #0d1f0a 15%,
      #152a08 25%,
      #0a1a06 40%,
      #1a2a0a 55%,
      #0d1f0a 70%,
      #0a150a 85%,
      #060f06 100%
    );
  z-index: 0;
}
 
.blogHero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.4;
  mix-blend-mode: overlay;
}

.blogHero-content {
  position: relative;
  z-index: 1;
  padding: 52px 40px 44px;
  width: 100%;
}

.blogHero-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.blogHero-title {
  font-family: var(--fs);
  font-size: clamp(32px, 5.5vw, 62px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.5px;
  color: var(--white);
  margin-bottom: 12px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.blogHero-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 32px;
}

/* ── FILTER TABS ── */
.filter-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 16px;
}

.ftab {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  padding: 7px 16px;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.ftab:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
}

.ftab.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  font-weight: 600;
}

/* ── BLOG WRAP ── */
.blog-wrap {
  padding-top: 8px;
  padding-bottom: 64px;
  max-width: var(--page-narrow-width, 1280px);
  margin: 0 auto;
  padding-left: var(--sec-padding);
  padding-right: var(--sec-padding);
}

/* ── SECTION ROW HEADER ── */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  margin-top: 48px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  font-family: var(--fs);
}

.view-all {
  font-size: 13px;
  font-weight: 500;
  color: var(--mid);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
  cursor: pointer;
  text-decoration: none;
}

.view-all:hover {
  color: var(--white);
}

/* ── BLOG SECTION (for JS toggling) ── */
.blog-section {
  /* visible by default */
}

.blog-section.hidden {
  display: none;
}

/* ── FEATURED GRID ── */
.featured-grid {
  display: grid;
  gap: 12px;
}

/* Layout: 1 big post full width */
.feat-layout-1 {
  grid-template-columns: 1fr;
}

.feat-layout-1 .feat-big .thumb {
  aspect-ratio: 16/7;
}

/* Layout: 2 posts side by side */
.feat-layout-2 {
  grid-template-columns: 1fr 1fr;
}

/* Layout: 3 posts — big left + 2 small right */
.feat-layout-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
}

/* ── FEAT BIG CARD ── */
.feat-big {
  grid-row: 1 / 3;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--card);
  display: block;
  transition: opacity 0.2s;
  text-decoration: none;
}

.feat-layout-1 .feat-big {
  grid-row: auto;
}

.feat-big:hover {
  opacity: 0.88;
}

.feat-big .thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 100%;
  position: relative;
  overflow: hidden;
}

.feat-big .thumb-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
}

.feat-big:hover .thumb-img {
  transform: scale(1.04);
}

.feat-big .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    transparent 100%
  );
}

.feat-big .card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
}

.feat-big .card-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 6px;
}

.feat-big .card-title {
  font-family: var(--fs);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 10px;
}

.feat-big .card-excerpt {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── FEAT SMALL CARD ── */
.feat-small {
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  display: grid;
  grid-template-columns: 180px 1fr;
  transition: opacity 0.2s;
  min-height: 110px;
  text-decoration: none;
}

.feat-small:hover {
  opacity: 0.85;
}

.feat-small .thumb {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.feat-small .thumb-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s;
}

.feat-small:hover .thumb-img {
  transform: scale(1.04);
}

.feat-small .card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feat-small .card-date {
  font-size: 11px;
  color: var(--mid);
  margin-bottom: 6px;
}

.feat-small .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feat-small .card-excerpt {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* feat-layout-2: tall cards with overlay */
.feat-small-tall {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  position: relative;
  min-height: 260px;
}

.feat-small-tall .thumb {
  position: absolute;
  inset: 0;
}

.feat-small-tall .thumb-img {
  width: 100%;
  height: 100%;
}

.feat-small-tall .card-body-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  justify-content: flex-end;
}

/* ── CATEGORY BADGE ── */
.cat-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  margin-right: 6px;
  background: var(--red);
  color: #fff;
}

.by-author {
  font-size: 11px;
  color: var(--mid);
  display: inline;
}

/* ── CARD GRIDS ── */

/* 1 post: full width */
.cards-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.cards-1 .card .c-thumb {
  aspect-ratio: 16/6;
}

/* 2 posts */
.cards-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* 4 posts */
.cards-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ── CARD ── */
.card {
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  transition:
    opacity 0.2s,
    transform 0.2s;
  display: block;
  text-decoration: none;
}

.card:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.card .c-thumb {
  aspect-ratio: 16/10;
  position: relative;
  overflow: hidden;
}

.card .c-thumb-inner {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s;
}

.card:hover .c-thumb-inner {
  transform: scale(1.06);
}

.card .c-body {
  padding: 14px 14px 16px;
}

.card .c-date {
  font-size: 11px;
  color: var(--mid);
  margin-bottom: 7px;
}

.card .c-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .c-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── PAGINATION ── */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 56px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--mid);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  transition: all 0.15s;
}

.page-btn:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.page-btn.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  font-weight: 700;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── Tablet: 1024px ── */
@media (max-width: 1024px) {
  .cards-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Tablet: 768px ── */
@media (max-width: 768px) {
  .blogHero-content {
    padding: 40px 20px 36px;
  }

  /* Featured layout-3: stack on tablet */
  .feat-layout-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .feat-layout-3 .feat-big {
    grid-row: auto;
    grid-column: span 2;
  }

  /* feat-small: horizontal stays but smaller */
  .feat-small {
    grid-template-columns: 110px 1fr;
  }

  /* feat-layout-2: stack */
  .feat-layout-2 {
    grid-template-columns: 1fr;
  }

  .feat-small-tall {
    min-height: 200px;
  }

  .cards-2 {
    grid-template-columns: 1fr;
  }

  .cards-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-row {
    margin-top: 36px;
  }
}

/* ── Mobile: 480px ── */
@media (max-width: 480px) {
  .blogHero-content {
    padding: 32px 16px 28px;
  }

  .blogHero-sub {
    font-size: 14px;
  }

  .filter-tabs {
    gap: 4px;
  }

  .ftab {
    font-size: 12px;
    padding: 6px 12px;
  }

  /* Featured: all stack */
  .feat-layout-3,
  .feat-layout-2,
  .feat-layout-1 {
    grid-template-columns: 1fr;
  }
    .feat-layout-3 .feat-big {
        grid-column: 1;
    }
  .feat-layout-3 .feat-big {
    grid-row: auto;
  }

  .feat-big .thumb {
    aspect-ratio: 16/9;
    min-height: max-content;
  }

  /* feat-small: go full width vertical on mobile */
  .feat-big .card-body {
      position: static;
  }
  .feat-small {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .feat-small .thumb {
    aspect-ratio: 16/9;
  }

  .feat-small-tall {
    min-height: 220px;
  }
    .feat-big .overlay {
        display: none;
    }
  /* Cards */
  .cards-4,
  .cards-2 {
    grid-template-columns: 1fr;
  }

  .cards-1 .card .c-thumb {
    aspect-ratio: 16/8;
  }

  .section-title {
    font-size: 17px;
  }

  .blog-pagination {
    margin-top: 40px;
    gap: 6px;
  }

  .page-btn {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
}
