/*
Theme Name: Chosen Pools Child
Theme URI: https://chosenpools.co.za/
Description: Child theme for Chosen Pools. Adds custom single-post and archive templates that bypass Elementor, so the WordPress block editor (with custom HTML blocks) controls the post body.
Author: Chosen Pools
Author URI: https://chosenpools.co.za/
Template: hello-elementor
Version: 1.0.3
License: GNU General Public License v2 or later
Text Domain: chosen-pools-child
*/

/* ============================================================
   CHOSEN POOLS — Custom post + archive styles
   Brand-neutral palette. Tweak the two CSS variables below to
   match the rest of the site if/when colours are confirmed.
   ============================================================ */

:root {
  /* Brand blues */
  --cp-blue-deep:    #2068B0;   /* darkest — hover states, hero gradient base */
  --cp-blue:         #1880D0;   /* primary — links, buttons, pagination active */
  --cp-blue-bright:  #1890E0;   /* lightest — subtle accents, gradient end */

  /* Contrast accent (warm amber — sparingly used: eyebrows, "Read on" arrow, key CTAs) */
  --cp-accent:       #F4A340;
  --cp-accent-dark:  #D8862A;

  /* Neutrals */
  --cp-text:         #1a1a1a;
  --cp-muted:        #5b6266;
  --cp-bg-soft:      #f5f8fb;   /* very faint blue tint to relate to brand */
  --cp-border:       #e3e6e8;
}

/* ---------- Single post hero ---------- */
.cp-post-hero {
  position: relative;
  width: 100%;
  min-height: 62vh;
  background-size: cover;
  background-position: center;
  background-color: var(--cp-blue-deep);
  display: flex;
  align-items: flex-end;
  margin: 0 0 3rem;
}
.cp-post-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* Brand-blue gradient overlay — light wash at top, deep blue at bottom for text legibility */
  background: linear-gradient(180deg, rgba(24,144,224,0.55) 0%, rgba(24,128,208,0.78) 50%, rgba(32,104,176,0.92) 100%) !important;
}
.cp-post-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  color: #fff;
}
.cp-post-hero__category {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 1rem;
}
.cp-post-hero__category a { color: #fff; text-decoration: none; }
/*
 * Note: Elementor kit (.elementor-kit-5 h1) sets line-height with a `px` unit
 * by accident in Site Settings → Typography. That overrides our rule via
 * selector specificity. We use h1.cp-post-hero__title with !important on
 * line-height as a defensive override. The clean fix is to correct the unit
 * in Elementor → Site Settings → Typography (set line-height unit to em).
 */
/*
 * Override the Elementor kit (.elementor-kit-5 h1) which sets:
 *   color: var(--e-global-color-secondary)  → renders the title brand-blue
 *   line-height: 1.15px                     → broken unit, lines stack
 * We force white + correct line-height with !important.
 */
.cp-post-hero h1.cp-post-hero__title,
h1.cp-post-hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem) !important;
  line-height: 1.25 !important;
  font-weight: 600 !important;
  margin: 0 0 1rem !important;
  color: #ffffff !important;
  letter-spacing: -0.01em !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
  font-family: inherit;
}
.cp-post-hero__meta {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ---------- Article body ---------- */
.cp-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--cp-text);
}
.cp-article > *:first-child { margin-top: 0; }
.cp-article p { margin: 0 0 1.5rem; }
.cp-article h2 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 2.75rem 0 1rem;
  font-weight: 600;
}
.cp-article h3 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 2.25rem 0 0.75rem;
  font-weight: 600;
}
.cp-article img,
.cp-article figure {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 4px;
}
.cp-article a {
  color: var(--cp-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cp-article a:hover { color: var(--cp-blue-deep); }
.cp-article ul,
.cp-article ol { margin: 0 0 1.5rem 1.5rem; }
.cp-article li { margin-bottom: 0.5rem; }
.cp-article blockquote {
  border-left: 3px solid var(--cp-blue);
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  font-style: italic;
  color: var(--cp-muted);
}

/* ---------- Related posts (single page) ---------- */
.cp-related {
  background: var(--cp-bg-soft);
  padding: 4.5rem 1.5rem;
  margin-top: 5rem;
}
.cp-related__inner {
  max-width: 1200px;
  margin: 0 auto;
}
.cp-related__heading {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 2.5rem;
  text-align: center;
}

/* ---------- Card (used in related + archive) ---------- */
.cp-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.cp-card {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--cp-border);
}
.cp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}
.cp-card__image {
  display: block;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: #e5e7e8;
}
.cp-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.cp-card__category {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cp-accent);
  margin-bottom: 0.6rem;
  font-weight: 600;
}
.cp-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}
.cp-card__title a { color: var(--cp-text); text-decoration: none; }
.cp-card__title a:hover { color: var(--cp-blue); }
.cp-card__excerpt {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--cp-muted);
  margin: 0 0 1.25rem;
  flex-grow: 1;
}
.cp-card__more {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cp-accent);
  text-decoration: none;
  align-self: flex-start;
}
.cp-card__more::after { content: " \2192"; }

/* ---------- Archive ---------- */
.cp-archive-header {
  text-align: center;
  padding: 4.5rem 1.5rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}
.cp-archive-header__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cp-accent);
  margin-bottom: 0.75rem;
  display: block;
}
.cp-archive-header__title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0 0 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--cp-text);
}
.cp-archive-header__sub {
  color: var(--cp-muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto;
}
.cp-archive {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.cp-archive .cp-card-grid { gap: 2rem; }

/* ---------- Pagination ---------- */
.cp-pagination {
  text-align: center;
  padding: 1rem 1.5rem 4rem;
}
.cp-pagination .page-numbers {
  display: inline-block;
  padding: 0.55rem 1rem;
  margin: 0 0.2rem;
  border: 1px solid var(--cp-border);
  color: var(--cp-text);
  text-decoration: none;
  border-radius: 3px;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}
.cp-pagination .page-numbers:hover {
  border-color: var(--cp-blue);
  color: var(--cp-blue);
}
.cp-pagination .page-numbers.current {
  background: var(--cp-blue);
  color: #fff;
  border-color: var(--cp-blue);
}

/* ---------- Empty state ---------- */
.cp-empty {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--cp-muted);
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .cp-post-hero { min-height: 48vh; }
  .cp-post-hero__inner { padding: 3rem 1.25rem 2rem; }
  .cp-related { padding: 3rem 1rem; }
  .cp-card-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
