/* ==========================================================================
   BLOG PAGE STYLES - STEP 1 (Figma Rebuild)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero / Header Banner Section
   -------------------------------------------------------------------------- */
.blog-hero {
  display: flex;
  justify-content: center;
  width: 100%;
}

.blog-hero__container {
  width: 100%;
  max-width: 1280px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  text-align: center;
  box-sizing: border-box;
}

.blog-hero__breadcrumbs {
  font-family: 'Fredoka', sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 72px;
  color: var(--color-blue-25, #000080);
}

.blog-hero__breadcrumbs .active {
  font-weight: 600;
}

.blog-hero__title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 400;
  font-size: 60px;
  line-height: 72px;
  color: var(--color-blue-25, #000080);
  margin: 0;
}

.blog-hero__subtitle {
  font-family: 'Fredoka', sans-serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 32px;
  color: var(--color-blue-25, #000080);
  margin: 0;
}

/* --------------------------------------------------------------------------
   2. Featured Section (Our Picks)
   -------------------------------------------------------------------------- */
.blog-featured {
  width: 1770px;
  max-width: 100%;
  margin: 80px auto 0;
  background: #FFF3F8B2;
  border-radius: 20px;
  padding: 80px 0;
  box-sizing: border-box;
}

.blog-featured__inner {
  max-width: 1532px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  box-sizing: border-box;
}

.blog-featured__title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 40px;
  text-align: right;
  color: var(--color-blue-25, #000080);
  margin: 0;
}

.blog-featured__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(343px, 1fr));
  gap: 25px;
}

/* Card Component */
.blog-card {
  width: 343px;
  min-height: 407px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.blog-card__image-wrapper {
  width: 343px;
  height: 256px;
  background: var(--color-white-solid, #ffffff);
  border: 1.5px solid var(--color-rose-76, #e89dc4);
  border-radius: 18px;
  padding: 14px;
  box-sizing: border-box;
}

.blog-card__image-inner {
  width: 315px;
  height: 228px;
  background: var(--color-grey-9440, #e6e6fa66);
  border-radius: 12px;
  overflow: hidden;
}

.blog-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.blog-card__title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 22px;
  line-height: 27.5px;
  text-align: right;
  color: var(--color-blue-25, #000080);
  margin: 0;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  color: var(--Color-2, #183b51);
}

.blog-card__button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  padding: 5px 22px;
  border-radius: 9999px;
  border: 1px solid var(--color-blue-25, #000080);
  box-shadow: 0px 4px 20px 0px #1a237e1a;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 24px;
  color: var(--color-blue-25, #000080);
  text-decoration: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.blog-card__button:hover {
  background-color: var(--color-blue-25, #000080);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   3. Filter Bar & Controls
   -------------------------------------------------------------------------- */
.blog-filters-section {
  width: 100%;
  margin-top: 40px;
}

.blog-filters-container {
  max-width: 1532px;
  margin: 0 auto;
  padding: 0 32px;
  box-sizing: border-box;
}

.blog-filters {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.blog-filters__label {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  color: var(--color-blue-25, #000080);
}

.blog-type-tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.blog-filter-btn {
  height: 44px;
  padding: 10px 24px;
  border-radius: 12px;
  border: none;
  background: #c8dde2;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 24px;
  color: var(--color-blue-25, #000080);
  cursor: pointer;
  transition: all 0.2s ease;
}

.blog-filter-btn:hover {
  background: #b5d5dc;
}

.blog-filter-btn--active,
.blog-filter-btn.is-active {
  background: var(--color-azure-65, #7bb6d2) !important;
  font-weight: 600 !important;
}

.blog-filters__divider {
  width: 1px;
  height: 31px;
  background-color: #000080;
  margin: 0 10px;
}

/* --------------------------------------------------------------------------
   4. Dropdown Components
   -------------------------------------------------------------------------- */
.blog-dropdown {
  position: relative;
}

.blog-dropdown__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 257px;
  height: 44px;
  padding: 0 13px;
  border-radius: 10px;
  border: none;
  background: var(--color-rose-61, #cb6da7);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 20px;
  color: var(--color-white-solid, #ffffff);
  cursor: pointer;
  box-sizing: border-box;
}

.blog-dropdown__arrow {
  transition: transform 0.2s ease;
}

/* Dropdown Open State */
.blog-dropdown .blog-dropdown__menu {
  display: none !important;
}

.blog-dropdown.is-open .blog-dropdown__menu {
  display: flex !important;
  z-index: 999;
}

.blog-dropdown.is-open .blog-dropdown__arrow {
  transform: rotate(180deg);
}

.blog-dropdown__menu {
  position: absolute;
  top: 50px;
  right: 0;
  width: 257px;
  background: var(--color-rose-61, #cb6da7);
  border-radius: 10px;
  padding: 15px 13px;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
}

/* Checkbox Style (e.g., Diagnosis Dropdown) */
.blog-dropdown__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Container Layout */
.blog-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
}

/* Visually hide native checkbox while preserving accessibility */
.blog-checkbox__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Custom Box Styling */
.blog-checkbox__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #ffffff; /* Primary brand color */
  transition: color 0.2s ease;
}

.blog-checkbox:hover .blog-checkbox__box {
  color: #C22DAF;
}

/* Toggle SVG Visibility */
.blog-checkbox__svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.blog-checkbox__svg--checked {
  display: none;
}

.blog-checkbox__svg--unchecked {
  display: block;
}

/* Checked state logic via adjacent sibling '+' selector */
.blog-checkbox__input:checked + .blog-checkbox__box .blog-checkbox__svg--checked {
  display: block;
}

.blog-checkbox__input:checked + .blog-checkbox__box .blog-checkbox__svg--unchecked {
  display: none;
}

/* Focus Ring for Accessibility */
.blog-checkbox__input:focus-visible + .blog-checkbox__box {
  outline: 2px solid #000080;
  outline-offset: 2px;
  border-radius: 4px;
}

.blog-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  min-width: 23px;
  height: 24px;
  background: #f4d9e8;
  border-radius: 10px;
  font-family: 'Heebo', sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: #7a1f55;
  box-sizing: border-box;
}

/* Age Options Dropdown Items */
.blog-dropdown__item {
  width: 100%;
  height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ffffff;
  background: transparent;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  text-align: right;
  color: var(--color-white-solid, #ffffff);
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.blog-dropdown__item--active,
.blog-dropdown__item:hover {
  background: var(--color-white-solid, #ffffff) !important;
  color: var(--color-azure-21, #183b51) !important;
}

/* Reading Time Grid Pills */
.blog-dropdown__menu--grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.blog-pill-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 6px 12px;
  height: 30px;
  border: 1px solid #ffffff;
  border-radius: 9999px;
  background: transparent;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 16px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.blog-pill-btn--selected,
.blog-pill-btn:hover {
  background: #ffffff !important;
  color: #183b51 !important;
}


/* ==========================================================================
   BLOG ARTICLES & CASE STUDY SECTION (Figma Rebuild)
   ========================================================================== */

.blog-articles-section {
  width: 100%;
  margin-top: 60px;
  padding-bottom: 80px;
}

.blog-articles-container {
  max-width: 1470px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  flex-direction: column;
  gap: 60px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   1. Large Case Study Article Component (734px + 734px)
   -------------------------------------------------------------------------- */
.blog-card-large {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 563px;
  background: #F5F5F5;
  border: 1px solid rgba(196, 197, 217, 0.1);
  box-shadow: 0px 4px 30px rgba(0, 0, 0, 0.03);
  border-radius: 24px;
  overflow: hidden;
  box-sizing: border-box;
}

.blog-card-large__container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 40px;
  width: 50%;
  height: 100%;
  box-sizing: border-box;
}

/* Tags Top Right */
.blog-card-large__tags {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  margin-bottom: 24px;
}

.blog-tag {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 2px 8px;
  height: 25px;
  border-radius: 5px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #183B51;
}

.blog-tag--teal {
  background: #BEE1DA;
}

.blog-tag--purple {
  background: #D9B8FF;
}

.blog-card-large__title {
  width: 100%;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 41px;
  text-align: right;
  color: #000080;
  margin: 0 0 16px 0;
}

.blog-card-large__description {
  width: 100%;
  font-family: 'Fredoka', sans-serif;
  font-weight: 400;
  font-size: 21px;
  line-height: 28px;
  text-align: right;
  color: #183B51;
  margin: 0;
}

.blog-card-large__footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: auto;
}

.blog-btn-outline {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 5px 22px;
  min-width: 140px;
  height: 40px;
  border: 1px solid #000080;
  filter: drop-shadow(0px 4px 20px rgba(26, 35, 126, 0.1));
  border-radius: 9999px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 24px;
  color: #000080;
  text-decoration: none;
  background: transparent;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.blog-btn-outline:hover {
  background: #000080;
  color: #ffffff;
}

.blog-card-large__read-time {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  text-align: right;
  color: #183B51;
}

/* Image Media Column */
.blog-card-large__media {
  position: relative;
  width: 50%;
  height: 100%;
  background: #C4C4C4;
  overflow: hidden;
}

.blog-card-large__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card-large__overlay-tag {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  background: #F7EFE6;
  backdrop-filter: blur(4px);
  border-radius: 8px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  color: #000080;
}

/* --------------------------------------------------------------------------
   2. 3-Column Articles Grid Component
   -------------------------------------------------------------------------- */
.blog-articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  width: 100%;
  align-items: stretch; /* Forces all cards in the row to take equal height */
}

.blog-grid-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%; /* Spans full height of grid row cell */
  border-radius: 24px;
  overflow: hidden;
  box-sizing: border-box;
}

.blog-grid-card__media {
  position: relative;
  width: 100%;
  height: 256px;
  border-radius: 24px;
  overflow: hidden;
  background: #C4C4C4;
  flex-shrink: 0; /* Prevents image container from shrinking */
}

.blog-grid-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-grid-card__overlay-tag {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: #F7EFE6;
  backdrop-filter: blur(4px);
  border-radius: 8px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 16px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #000080;
}

.blog-grid-card__content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 1; /* Fills all available vertical space inside the card */
  padding: 20px 15px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 25px;
  gap: 12px;
  box-sizing: border-box;
}

.blog-grid-card__title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  text-align: right;
  color: #000080;
  margin: 0;
  width: 100%;
}

.blog-grid-card__description {
  font-family: 'Fredoka', sans-serif;
  font-weight: 400;
  font-size: 21px;
  line-height: 28px;
  text-align: right;
  color: #183B51;
  margin: 0;
  width: 100%;
}

.blog-grid-card__footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: auto; /* Pins the footer uniformly to the bottom of the card */
  padding-top: 16px;
}

.blog-grid-card__read-time {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  color: #183B51;
}

/* --------------------------------------------------------------------------
   3. Pagination Component
   Buttons are styled once, shared, in
   assets/css/components/_pagination.css (.pagination-shared*) — see
   assets/js/components/pagination.js. Only page-specific spacing lives
   here.
   -------------------------------------------------------------------------- */
[data-blog-pagination] {
  margin-top: 20px;
}
/* ==========================================================================
   RESPONSIVE — Blog page
   ========================================================================== */
@media (max-width: 1023px) {
  .blog-hero__title {
    font-size: 44px;
    line-height: 52px;
  }

  .blog-hero__subtitle {
    font-size: 20px;
    line-height: 28px;
  }

  .blog-featured {
    padding: 48px 0;
    margin-top: 0;
    max-width: calc(100% - 40px);
  }

  .blog-card-large {
    height: auto;
    flex-direction: column;
  }

  .blog-card-large__container,
  .blog-card-large__media {
    width: 100%;
  }

  .blog-card-large__media {
    height: 280px;
    order: -1;
  }

  .blog-card-large__title {
    font-size: 26px;
    line-height: 34px;
  }

  .blog-articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

@media (max-width: 767px) {
  .blog-hero__container {
    padding: 0 20px;
    gap: 16px;
  }

  .blog-hero__title {
    font-size: 32px;
    line-height: 40px;
  }

  .blog-hero__subtitle {
    font-size: 18px;
    line-height: 26px;
  }

  .blog-hero__breadcrumbs {
    font-size: 16px;
    line-height: 1.6;
  }

  .blog-featured__inner,
  .blog-filters-container,
  .blog-articles-container {
    padding: 0 20px;
  }

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

  .blog-card {
    width: 100%;
  }

  .blog-card__image-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 343 / 256;
  }

  .blog-card__image-inner {
    width: 100%;
    height: 100%;
  }

  .blog-filters {
    gap: 12px;
  }

  .blog-filters__divider {
    display: none;
  }

  .blog-dropdown,
  .blog-dropdown__toggle,
  .blog-dropdown__menu {
    width: 100%;
  }

  .blog-articles-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .blog-card-large__container {
    padding: 24px;
  }

  .blog-card-large__title {
    font-size: 22px;
    line-height: 28px;
  }

  .blog-card-large__description {
    font-size: 17px;
    line-height: 24px;
  }

  .blog-grid-card__title {
    font-size: 20px;
    line-height: 26px;
  }

  .blog-grid-card__description {
    font-size: 17px;
    line-height: 24px;
  }
}

@media (max-width: 480px) {
  .blog-card-large__footer,
  .blog-grid-card__footer {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    margin-top: 20px;
  }

  .blog-filters {
    flex-direction: column;
    align-items: flex-start;
  }

  .blog-type-tabs {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   WordPress — AJAX loading state + no-JS pagination fallback
   ========================================================================== */
.blog-articles-container.is-loading [data-blog-hero-card],
.blog-articles-container.is-loading [data-blog-grid] {
  opacity: 0.45;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

[data-blog-pagination]:not(.pagination-shared) {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

[data-blog-pagination]:not(.pagination-shared) a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
}
