/*
 Theme Name:   Kadence Child
 Theme URI:    https://example.com/kadence-child/
 Description:  Kadence Child Theme
 Author:       Your Name
 Author URI:   https://example.com
 Template:     kadence
 Version:      1.0.2
 Tags:         customizable, modern, responsive-layout, gutenberg, header builder, footer builder
 Text Domain:  kadencechild
*/

/* Theme customization starts here
-------------------------------------------------------------- */

/* =============================================
   CARETHRIVE BLOG PAGE — ENHANCED DESIGN
   ============================================= */

/* --- Design Tokens ---------------------------------------- */
:root {
  /* Brand palette (mirrors site globals for safety) */
  --ct-blue:          #134d87;
  --ct-blue-dark:     #0d3a66;
  --ct-blue-mid:      #185fa5;
  --ct-teal:          #3dbdb3;
  --ct-teal-dark:     #2a9d93;
  --ct-teal-light:    #e6f7f6;

  /* Neutral scale */
  --ct-ice:           #f7fafc;
  --ct-white:         #ffffff;
  --ct-text:          #1a202c;
  --ct-muted:         #4a5568;
  --ct-border:        #e2e8f0;
  --ct-border-soft:   rgba(226,232,240,.6);

  /* Shadows */
  --ct-shadow-xs:     0 1px 2px rgba(0,0,0,.06);
  --ct-shadow-sm:     0 2px 8px  rgba(19,77,135,.08);
  --ct-shadow:        0 6px 20px rgba(19,77,135,.11);
  --ct-shadow-md:     0 10px 32px rgba(19,77,135,.14);
  --ct-shadow-lg:     0 18px 52px rgba(19,77,135,.18);

  /* Radii */
  --ct-r-sm:          8px;
  --ct-r:             14px;
  --ct-r-lg:          20px;
  --ct-r-xl:          26px;

  /* Category accent colours */
  --cat-womens-bg:    #fce7f3;
  --cat-womens-txt:   #9d174d;
  --cat-sleep-bg:     #ede9fe;
  --cat-sleep-txt:    #5b21b6;
  --cat-infect-bg:    #fff7ed;
  --cat-infect-txt:   #92400e;
  --cat-nav-bg:       #ecfdf5;
  --cat-nav-txt:      #065f46;
}


/* ============================================================
   1. ENTRY WRAPPER
   ============================================================ */

/*.entry-content-wrap {
  padding: 2rem !important;
  padding-top: 0 !important;
  max-width: 1226px;
  margin: 0 auto;
}*/

/* Remove the default grey border/radius added by the old style.css */
.wp-block-query.is-layout-flow.wp-block-query-is-layout-flow {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
}

/* Ensure featured images fill their containers */
.wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ============================================================
   2. FEATURED HERO POST
      (first Query Loop - single post, two-column Columns block)
   ============================================================ */

/* Spacing below the featured-post query */
.wp-block-query.is-layout-flow:not(.alignwide) {
  margin-bottom: 2.75rem;
}

/* Card shell */
.wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns {
  background: var(--ct-white);
  border-radius: var(--ct-r-xl);
  box-shadow: var(--ct-shadow-md);
  overflow: hidden;
  border: 1px solid var(--ct-border);
  transition: box-shadow .3s ease, transform .3s ease;
}

.wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns:hover {
  box-shadow: var(--ct-shadow-lg);
  transform: translateY(-3px);
}

/* Left column: image */
.wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns > .wp-block-column:first-child {
  overflow: hidden;
  min-height: 360px;
  position: relative;
  flex: 1 1 50% !important;
}

.wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns > .wp-block-column:first-child .wp-block-post-featured-image {
  height: 100%;
  margin: 0;
}

.wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns > .wp-block-column:first-child .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  display: block;
  transition: transform .55s ease;
}

.wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns:hover .wp-block-post-featured-image img {
  transform: scale(1.04);
}

/* Right column: content */
.wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns > .wp-block-column:last-child {
  padding: 2.5rem 2.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 50% !important;
  border-left: 1px solid var(--ct-border-soft);
}

/* "Featured Article" eyebrow badge injected via ::before */
.wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns > .wp-block-column:last-child::before {
  content: "* Featured Article";
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ct-teal-dark);
  border: 1px solid rgba(61,189,179,.35);
  background: var(--ct-teal-light);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 1rem;
  width: fit-content;
}

/* Category tag */
.wp-block-post-template.is-layout-flow > .wp-block-post .taxonomy-category.wp-block-post-terms {
  margin-bottom: .6rem;
}

.wp-block-post-template.is-layout-flow > .wp-block-post .taxonomy-category.wp-block-post-terms a {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ct-teal-light);
  color: var(--ct-teal-dark);
  border: 1px solid rgba(61,189,179,.3);
  text-decoration: none;
  transition: background .2s, color .2s;
}

.wp-block-post-template.is-layout-flow > .wp-block-post .taxonomy-category.wp-block-post-terms a:hover {
  background: var(--ct-teal);
  color: #fff;
}

/* Title */
.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-post-title {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 .75rem;
  color: var(--ct-blue);
}

.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}

.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-post-title a:hover {
  color: var(--ct-teal-dark);
}

/* Excerpt */
.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-post-excerpt {
  margin-bottom: 1rem;
}

.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-post-excerpt p,
.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-post-excerpt__excerpt {
  color: var(--ct-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0;
}

/* Date */
.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-post-date {
  font-size: .82rem;
  color: var(--ct-muted);
  opacity: .85;
  margin-bottom: 1.5rem;
}

/* "Read more" - solid CTA button */
.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: .7rem 1.5rem;
  background: var(--ct-blue);
  color: #fff !important;
  border-radius: var(--ct-r-sm);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none !important;
  width: fit-content;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(19,77,135,.22);
}

.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-read-more .screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-read-more::after {
  content: " ->";
  display: inline-block;
  transition: transform .2s;
}

.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-read-more:hover {
  background: var(--ct-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(19,77,135,.30);
  color: #fff !important;
}

.wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-read-more:hover::after {
  transform: translateX(4px);
}


/* ============================================================
   3. "RECENT ARTICLES" SECTION HEADING
   ============================================================ */

.entry-content .wp-block-heading.has-medium-font-size {
  font-size: 1.45rem !important;
  font-weight: 700;
  color: var(--ct-blue);
  padding-bottom: .65rem;
  border-bottom: 3px solid var(--ct-teal);
  margin-top: .5rem;
  margin-bottom: 1.75rem;
  width: 100%;
  display: block;
}


/* ============================================================
   4. RECENT ARTICLES GRID  (3-column Query Loop)
   ============================================================ */

.wp-block-query.alignwide.is-layout-flow {
  margin-bottom: 2rem;
}

/* Reset list styling */
.wp-block-post-template.is-layout-grid {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Individual post card */
.wp-block-post-template.is-layout-grid > .wp-block-post {
  background: var(--ct-white);
  border-radius: var(--ct-r);
  border: 1px solid var(--ct-border);
  box-shadow: var(--ct-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease;
}

.wp-block-post-template.is-layout-grid > .wp-block-post:hover {
  box-shadow: var(--ct-shadow-md);
  transform: translateY(-5px);
  border-color: rgba(61,189,179,.55);
}

/* Cards without a featured image get a teal top border */
.wp-block-post-template.is-layout-grid > .wp-block-post:not(:has(.wp-block-post-featured-image)) {
  border-top: 4px solid var(--ct-teal);
}

/* Featured image */
.wp-block-post-template.is-layout-grid > .wp-block-post .wp-block-post-featured-image {
  margin: 0;
  overflow: hidden;
  background: var(--ct-ice);
  aspect-ratio: 16 / 9;
}

.wp-block-post-template.is-layout-grid > .wp-block-post .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .55s ease;
}

.wp-block-post-template.is-layout-grid > .wp-block-post:hover .wp-block-post-featured-image img {
  transform: scale(1.06);
}

/* Horizontal padding for card text elements */
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-terms,
.wp-block-post-template.is-layout-grid > .wp-block-post > .taxonomy-category,
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-title,
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-excerpt,
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-date,
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-read-more {
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}

/* Category pill */
.wp-block-post-template.is-layout-grid > .wp-block-post > .taxonomy-category,
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-terms {
  margin-top: 1rem;
  margin-bottom: 0;
}

.wp-block-post-template.is-layout-grid > .wp-block-post > .taxonomy-category a,
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-terms a {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ct-teal-light);
  color: var(--ct-teal-dark);
  border: 1px solid rgba(61,189,179,.28);
  text-decoration: none;
  transition: background .2s, color .2s;
}

.wp-block-post-template.is-layout-grid > .wp-block-post > .taxonomy-category a:hover,
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-terms a:hover {
  background: var(--ct-teal);
  color: #fff;
  border-color: var(--ct-teal);
}

/* Category-specific pill colours */
.wp-block-post-template.is-layout-grid > .wp-block-post.category-womens-health > .taxonomy-category a,
.wp-block-post-template.is-layout-grid > .wp-block-post.category-womens-health > .wp-block-post-terms a {
  background: var(--cat-womens-bg);
  color: var(--cat-womens-txt);
  border-color: rgba(157,23,77,.2);
}

.wp-block-post-template.is-layout-grid > .wp-block-post.category-womens-health > .taxonomy-category a:hover,
.wp-block-post-template.is-layout-grid > .wp-block-post.category-womens-health > .wp-block-post-terms a:hover {
  background: #9d174d;
  color: #fff;
}

.wp-block-post-template.is-layout-grid > .wp-block-post.category-sleep-health > .taxonomy-category a,
.wp-block-post-template.is-layout-grid > .wp-block-post.category-sleep-health > .wp-block-post-terms a {
  background: var(--cat-sleep-bg);
  color: var(--cat-sleep-txt);
  border-color: rgba(91,33,182,.2);
}

.wp-block-post-template.is-layout-grid > .wp-block-post.category-sleep-health > .taxonomy-category a:hover,
.wp-block-post-template.is-layout-grid > .wp-block-post.category-sleep-health > .wp-block-post-terms a:hover {
  background: #5b21b6;
  color: #fff;
}

.wp-block-post-template.is-layout-grid > .wp-block-post.category-infectious-disease-public-health > .taxonomy-category a,
.wp-block-post-template.is-layout-grid > .wp-block-post.category-infectious-disease-public-health > .wp-block-post-terms a {
  background: var(--cat-infect-bg);
  color: var(--cat-infect-txt);
  border-color: rgba(146,64,14,.2);
}

.wp-block-post-template.is-layout-grid > .wp-block-post.category-infectious-disease-public-health > .taxonomy-category a:hover,
.wp-block-post-template.is-layout-grid > .wp-block-post.category-infectious-disease-public-health > .wp-block-post-terms a:hover {
  background: #92400e;
  color: #fff;
}

.wp-block-post-template.is-layout-grid > .wp-block-post.category-navigating-healthcare > .taxonomy-category a,
.wp-block-post-template.is-layout-grid > .wp-block-post.category-navigating-healthcare > .wp-block-post-terms a {
  background: var(--cat-nav-bg);
  color: var(--cat-nav-txt);
  border-color: rgba(6,95,70,.2);
}

.wp-block-post-template.is-layout-grid > .wp-block-post.category-navigating-healthcare > .taxonomy-category a:hover,
.wp-block-post-template.is-layout-grid > .wp-block-post.category-navigating-healthcare > .wp-block-post-terms a:hover {
  background: #065f46;
  color: #fff;
}

/* Post title */
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-title {
  margin-top: .6rem;
  margin-bottom: .4rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-title a {
  color: var(--ct-text);
  text-decoration: none;
  transition: color .2s;
}

.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-title a:hover {
  color: var(--ct-blue);
}

/* Excerpt - clamped to 3 lines */
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-excerpt {
  margin-bottom: 0;
  flex-grow: 1;
}

.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-excerpt p,
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-excerpt .wp-block-post-excerpt__excerpt {
  font-size: .875rem;
  color: var(--ct-muted);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Date */
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-post-date {
  margin-top: .55rem;
  margin-bottom: .55rem;
  font-size: .78rem;
  color: var(--ct-muted);
  opacity: .8;
}

/* "Read more" link */
.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-read-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--ct-teal-dark);
  text-decoration: none;
  padding-bottom: 1.25rem;
  margin-top: auto;
  transition: gap .2s, color .2s;
  width: fit-content;
}

.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-read-more .screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-read-more::after {
  content: " ->";
  display: inline-block;
  transition: transform .2s;
}

.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-read-more:hover {
  color: var(--ct-blue);
  gap: 9px;
}

.wp-block-post-template.is-layout-grid > .wp-block-post > .wp-block-read-more:hover::after {
  transform: translateX(3px);
}


/* ============================================================
   5. PAGINATION
   ============================================================ */

.wp-block-query-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin: 2.25rem 0 1rem;
  flex-wrap: wrap;
}

.wp-block-query-pagination-numbers {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.wp-block-query-pagination-numbers .page-numbers,
.wp-block-query-pagination-next,
.wp-block-query-pagination-previous {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 .9rem;
  border-radius: var(--ct-r-sm);
  border: 1px solid var(--ct-border);
  background: var(--ct-white);
  color: var(--ct-blue);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
  box-shadow: var(--ct-shadow-xs);
}

.wp-block-query-pagination-numbers .page-numbers:hover,
.wp-block-query-pagination-next:hover,
.wp-block-query-pagination-previous:hover {
  background: var(--ct-blue);
  color: #fff;
  border-color: var(--ct-blue);
  box-shadow: var(--ct-shadow-sm);
}

/* Active / current page */
.wp-block-query-pagination-numbers .page-numbers.current {
  background: var(--ct-teal);
  color: #fff;
  border-color: var(--ct-teal);
  box-shadow: 0 4px 12px rgba(61,189,179,.30);
  pointer-events: none;
}

/* Prev / Next wider pill */
.wp-block-query-pagination-next,
.wp-block-query-pagination-previous {
  font-weight: 700;
  padding: 0 1.1rem;
  border-radius: 999px;
}


/* ============================================================
   6. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet - featured post stacks vertically */
@media (max-width: 900px) {

  .wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns {
    flex-direction: column !important;
    flex-wrap: wrap !important;
  }

  .wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns > .wp-block-column:first-child {
    min-height: 280px;
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  .wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns > .wp-block-column:first-child .wp-block-post-featured-image img {
    min-height: 280px;
  }

  .wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns > .wp-block-column:last-child {
    padding: 2rem;
    border-left: none;
    border-top: 1px solid var(--ct-border-soft);
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* Large phone - 2-column grid */
@media (max-width: 767px) {
  .wp-block-post-template.is-layout-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns > .wp-block-column:last-child {
    padding: 1.75rem;
  }
}

/* Small phone - 1-column grid */
@media (max-width: 520px) {
  .wp-block-post-template.is-layout-grid {
    grid-template-columns: 1fr !important;
  }

  .wp-block-post-template.is-layout-flow > .wp-block-post > .wp-block-columns > .wp-block-column:last-child {
    padding: 1.5rem;
  }

  .wp-block-post-template.is-layout-flow > .wp-block-post .wp-block-read-more {
    padding: .65rem 1.25rem;
    font-size: .9rem;
  }
}
