/* ==========================================================================
   Havendaxa - Blogs Page Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Showcase / Featured Section (Matching User Image 1)
   -------------------------------------------------------------------------- */
.blogs-showcase-section {
  width: 100%;
  margin-top: clamp(24px, 2.5vw, 40px);
  margin-bottom: clamp(36px, 4vw, 56px);
}

.blogs-showcase-card {
  width: 100%;
  background-color: #EDF3CF;
  border-radius: var(--radius-card, 32px);
  border: 1px solid rgba(149, 157, 106, 0.45);
  box-shadow: 0 16px 45px rgba(22, 64, 78, 0.06);
  padding: clamp(24px, 3.5vw, 48px);
  box-sizing: border-box;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.blogs-showcase-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(22, 64, 78, 0.09);
}

.blogs-showcase-content {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
}

.showcase-left {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.2vw, 18px);
}

.showcase-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(22, 64, 78, 0.08);
  color: #16404E;
  padding: 6px 16px;
  border-radius: 50px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  width: fit-content;
}

.showcase-title {
  font-family: var(--font-rosarivo, 'Playfair Display', serif);
  font-size: clamp(26px, 2.5vw, 38px);
  font-weight: 700;
  color: #16404E;
  line-height: 1.25;
  margin: 0;
}

.showcase-desc {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.65;
  color: #55664F;
  margin: 0;
}

.showcase-meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 24px);
  font-size: 13.5px;
  font-weight: 600;
  color: #16404E;
  margin-top: 4px;
}

.showcase-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.showcase-cta {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  cursor: pointer;
}

.showcase-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.showcase-img-frame {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(22, 64, 78, 0.16);
  border: 3px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.4s ease;
}

.showcase-img-frame:hover {
  transform: scale(1.02);
}

.showcase-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --------------------------------------------------------------------------
   2. Category Filter Pills Bar
   -------------------------------------------------------------------------- */
.blogs-filter-section {
  width: 100%;
  margin-bottom: clamp(28px, 3vw, 42px);
}

.blogs-filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-pill {
  background-color: transparent;
  color: #16404E;
  border: 1.5px solid rgba(22, 64, 78, 0.25);
  border-radius: 50px;
  padding: 8px 20px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-pill:hover {
  background-color: rgba(22, 64, 78, 0.07);
  border-color: #16404E;
}

.filter-pill.active {
  background-color: #16404E;
  color: #FFFFFF;
  border-color: #16404E;
  box-shadow: 0 4px 14px rgba(22, 64, 78, 0.2);
}

/* --------------------------------------------------------------------------
   3. Blog Posts Grid (Matching User Images 2 & 3)
   -------------------------------------------------------------------------- */
.blogs-grid-section {
  width: 100%;
  margin-bottom: clamp(60px, 7vw, 100px);
}

.blogs-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.4vw, 32px);
}

/* --------------------------------------------------------------------------
   4. 3D Card Architecture & Micro-Interactions
   -------------------------------------------------------------------------- */
.blog-card {
  perspective: 1400px;
  position: relative;
  width: 100%;
  border-radius: 24px;
}

.blog-card.is-hidden {
  display: none;
}

.blog-card-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}

.blog-card.is-flipped .blog-card-inner {
  transform: rotateY(180deg);
}

/* Front Face: Image + Buttons (Image 3) */
.blog-card-front {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.blog-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(22, 64, 78, 0.08);
  background-color: #e5ecd2;
  cursor: pointer;
  position: relative;
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.blog-card:hover .blog-card-img {
  transform: scale(1.03);
}

.blog-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
}

.btn-know-more {
  flex: 1;
  background-color: #16404E;
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  padding: 13px 20px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.btn-know-more:hover {
  background-color: #0d2c36;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 64, 78, 0.28);
}

.btn-chevron {
  width: 60px;
  min-width: 60px;
  background-color: #16404E;
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  padding: 13px 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.btn-chevron:hover {
  background-color: #0d2c36;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 64, 78, 0.28);
}

/* Back Face: Olive Green Summary Card (Image 2) */
.blog-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #979E6B;
  border-radius: 24px;
  padding: clamp(20px, 2.2vw, 26px);
  box-sizing: border-box;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  box-shadow: 0 12px 32px rgba(22, 64, 78, 0.12);
}

.btn-flip-back {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  border: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.25s ease;
  z-index: 5;
}

.btn-flip-back:hover {
  background-color: #FFFFFF;
  color: #16404E;
  transform: rotate(-180deg);
}

.blog-back-header {
  margin-top: 4px;
}

.blog-back-title {
  font-family: var(--font-rosarivo, 'Playfair Display', serif);
  font-size: clamp(17px, 1.4vw, 21px);
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
  margin: 0 0 12px 0;
  padding-right: 28px;
}

.blog-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.meta-tag {
  background-color: #F5F9E2;
  color: #2C351B;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  display: inline-block;
}

.blog-back-excerpt {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: clamp(12px, 0.95vw, 13px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 12px 0;
  flex: 1;
  overflow-y: auto;
  max-height: 160px;
  padding-right: 4px;
}

.blog-back-excerpt::-webkit-scrollbar {
  width: 4px;
}
.blog-back-excerpt::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}

.blog-back-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
}

.btn-read-more {
  background-color: #F5F9E2;
  color: #737B4B;
  border: none;
  border-radius: 9999px;
  padding: 9px 36px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.btn-read-more:hover {
  background-color: #FFFFFF;
  color: #16404E;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

/* --------------------------------------------------------------------------
   5. Full Article Reader Modal
   -------------------------------------------------------------------------- */
.blog-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 26, 28, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.blog-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.blog-modal-container {
  background: #F7F8F0;
  border-radius: 28px;
  max-width: 840px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: clamp(24px, 4vw, 44px);
  box-sizing: border-box;
}

.blog-modal-backdrop.open .blog-modal-container {
  transform: translateY(0) scale(1);
}

.blog-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(22, 64, 78, 0.1);
  color: #16404E;
  border: none;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.blog-modal-close:hover {
  background: #16404E;
  color: #FFFFFF;
}

.modal-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #EDF3CF;
  color: #16404E;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 50px;
  margin-bottom: 12px;
}

.modal-article-title {
  font-family: var(--font-rosarivo, 'Playfair Display', serif);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  color: #16404E;
  line-height: 1.3;
  margin: 0 0 16px 0;
}

.modal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
  color: #61735a;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(22, 64, 78, 0.12);
}

.modal-article-img-wrap {
  width: 100%;
  max-height: 380px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 10px 24px rgba(22, 64, 78, 0.1);
}

.modal-article-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-article-text {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 1.8;
  color: #33443b;
}

.modal-article-text p {
  margin-bottom: 18px;
}

.modal-article-text h4 {
  font-family: var(--font-rosarivo, 'Playfair Display', serif);
  font-size: 21px;
  color: #16404E;
  margin: 28px 0 12px 0;
}

.modal-article-text ul {
  margin: 12px 0 20px 24px;
}

.modal-article-text li {
  margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   6. Responsive Viewports
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .blogs-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .blogs-showcase-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .showcase-right {
    order: -1;
  }

  .showcase-img-frame {
    max-width: 360px;
  }
}

@media (max-width: 640px) {
  .blogs-grid-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .blogs-showcase-card {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .showcase-img-frame {
    max-width: 100%;
    border-radius: 20px;
  }

  .filter-pill {
    font-size: 13px;
    padding: 7px 16px;
  }

  .btn-know-more {
    font-size: 14px;
    padding: 11px 16px;
  }

  .btn-chevron {
    width: 52px;
    min-width: 52px;
    padding: 11px 0;
  }
}
