/* ==========================================================================
   Precision Heart™ — blog styles for the child theme
   wp-content/themes/precisionheart-child/assets/css/blog-single.css

   Covers single.php and the [ph_blog_grid] card / mini markup.
   Colours are the site's Elementor global kit:
   primary #1D2970 · accent #C69F53 · secondary #4D4D4D · text #7A7A7A
   ========================================================================== */

:root {
  --ph-blue: #1D2970;
  --ph-gold: #C69F53;
  --ph-secondary: #4D4D4D;
  --ph-text: #7A7A7A;
  --ph-line: #E3E5E9;
  --ph-grey: #F8F9FA;
  --ph-cream: #FDF9F1;
  --ph-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --ph-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---------- layout shell ---------- */
/* Scoped border-box. The parent theme sets this globally, but relying on that
   would break these components anywhere it isn't set. */
.ph-single, .ph-single *, .ph-single *::before, .ph-single *::after,
.ph-grid, .ph-grid *, .ph-mini, .ph-mini * { box-sizing: border-box; }

.ph-wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}
.ph-wrap--narrow { max-width: 880px; }

.ph-single { font-family: var(--ph-sans); color: var(--ph-secondary); }

/* ---------- buttons ---------- */
.ph-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: 600 16px/1.2 var(--ph-sans);
  text-align: center;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.ph-btn--gold { background: var(--ph-gold); color: #fff; }
.ph-btn--gold:hover { background: #b38d44; color: #fff; }
.ph-btn--outline { background: transparent; color: var(--ph-blue); border-color: var(--ph-blue); }
.ph-btn--outline:hover { background: var(--ph-blue); color: #fff; }

/* ==========================================================================
   Post header
   ========================================================================== */
.ph-single__head { padding-block: clamp(26px, 3.2vw, 44px) clamp(18px, 2.2vw, 28px); }

.ph-breadcrumb {
  margin-bottom: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ph-text);
}
.ph-breadcrumb a { color: var(--ph-text); text-decoration: none; }
.ph-breadcrumb a:hover { color: var(--ph-gold); }
.ph-breadcrumb span { color: var(--ph-blue); }

.ph-single__cat {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--ph-gold);
  font: 600 12.5px/1.4 var(--ph-sans);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ph-single__title {
  margin: 0 0 18px;
  font-family: var(--ph-serif);
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1.28;
  color: var(--ph-blue);
}

.ph-single__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  padding-top: 18px;
  border-top: 1px solid var(--ph-line);
}

.ph-author { display: flex; align-items: center; gap: 12px; }
.ph-author__avatar {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ph-gold);
  color: #fff;
  font: 600 14.5px/1 var(--ph-sans);
}
.ph-author__name { display: block; color: var(--ph-blue); font: 600 15px/1.35 var(--ph-sans); }
.ph-author__role { display: block; color: var(--ph-text); font-size: 13.5px; }

.ph-single__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-left: auto;
  font-size: 14px;
  color: var(--ph-text);
}
@media (max-width: 620px) { .ph-single__stats { margin-left: 0; } }

/* ---------- featured image ---------- */
.ph-single__feature {
  max-width: 1000px;
  margin: 0 auto clamp(28px, 3.2vw, 44px);
  padding-inline: clamp(16px, 4vw, 40px);
}
.ph-single__feature img { width: 100%; height: auto; display: block; border-radius: 6px; }

/* ==========================================================================
   Body + sidebar
   ========================================================================== */
.ph-single__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: clamp(34px, 4vw, 60px);
  align-items: start;
  padding-bottom: clamp(48px, 6vw, 90px);
}

@media (max-width: 1024px) {
  .ph-single__layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- article typography (styles whatever the editor outputs) ---------- */
.ph-article { font-size: 17px; line-height: 1.8; color: var(--ph-secondary); }

.ph-article > h2 {
  margin: 2em 0 .6em;
  font-family: var(--ph-serif);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--ph-blue);
}
.ph-article > h2:first-child { margin-top: 0; }

.ph-article > h3 {
  margin: 1.7em 0 .5em;
  font-size: clamp(17.5px, 1.6vw, 20px);
  font-weight: 600;
  color: var(--ph-blue);
}

.ph-article p { margin: 0 0 1.3em; }
.ph-article > p:first-of-type { font-size: 18px; }

.ph-article a {
  color: var(--ph-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.ph-article a:hover { color: var(--ph-blue); }

.ph-article ul, .ph-article ol { margin: 0 0 1.4em; padding-left: 22px; }
.ph-article li { margin-bottom: .6em; }
.ph-article ul { list-style: none; padding-left: 0; }
.ph-article ul > li {
  position: relative;
  padding-left: 26px;
}
.ph-article ul > li::before {
  content: '';
  position: absolute;
  left: 2px; top: .68em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ph-gold);
}
/* Lists inside the editor's styled boxes (takeaways etc.) keep plain bullets.
   :not() keeps this away from the tag row in .ph-article__foot. */
.ph-article div:not(.ph-article__foot) ul { list-style: disc; padding-left: 20px; }
.ph-article div:not(.ph-article__foot) ul > li { padding-left: 0; }
.ph-article div:not(.ph-article__foot) ul > li::before { content: none; }

.ph-article img { max-width: 100%; height: auto; }
.ph-article figure { margin: 2.1em 0; }
.ph-article figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ph-text);
  text-align: center;
}
.ph-article blockquote {
  margin: 2em 0;
  padding: 24px 28px;
  border-left: 3px solid var(--ph-gold);
  background: var(--ph-grey);
  font-size: 18px;
  color: var(--ph-blue);
}
.ph-article table { width: 100%; border-collapse: collapse; margin: 1.8em 0; }
.ph-article th, .ph-article td { padding: 10px 12px; border: 1px solid var(--ph-line); text-align: left; }

/* ---------- tags + share ---------- */
.ph-article__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 28px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--ph-line);
}

/* The tag list lives inside .ph-article, so it must outrank both the article's
   own bullet styling and the `.ph-article div ul` rule above — hence the
   two-class selectors. */
.ph-article .ph-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding-left: 0; list-style: none; }
.ph-article .ph-tags li { margin: 0; padding-left: 0; }
.ph-article .ph-tags li::before { content: none; }
.ph-tags a {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--ph-line);
  border-radius: 4px;
  color: var(--ph-text);
  font-size: 13px;
  text-decoration: none;
}
.ph-tags a:hover { border-color: var(--ph-gold); color: var(--ph-gold); }

.ph-share { display: flex; align-items: center; gap: 10px; }
.ph-share__label { font: 600 13.5px/1 var(--ph-sans); color: var(--ph-blue); }
.ph-share a {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--ph-line);
  border-radius: 50%;
  color: var(--ph-blue);
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.ph-share a:hover { background: var(--ph-gold); border-color: var(--ph-gold); color: #fff; }
.ph-share svg { width: 16px; height: 16px; fill: currentColor; }

/* ==========================================================================
   Sidebar
   ========================================================================== */
.ph-sidebar { position: sticky; top: 100px; display: grid; gap: 20px; }

.ph-back-btn {
  display: block;
  padding: 13px 18px;
  border: 1px solid var(--ph-blue);
  border-radius: 6px;
  color: var(--ph-blue);
  font: 600 13px/1.2 var(--ph-sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease;
}
.ph-back-btn:hover { background: var(--ph-blue); color: #fff; }

.ph-widget {
  padding: 24px 22px;
  border: 1px solid var(--ph-line);
  border-radius: 6px;
  background: #fff;
}
.ph-widget__title {
  margin: 0 0 14px;
  font: 600 13px/1.4 var(--ph-sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ph-blue);
}
.ph-widget--cta { background: var(--ph-cream); border-color: rgba(198,159,83,.38); text-align: center; }
.ph-widget--cta p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: var(--ph-secondary); }
.ph-widget--cta .ph-btn { width: 100%; }

/* Everything in the sidebar repeats in full below the article — the back link,
   the Latest Posts grid and the membership CTA — so drop the column rather than
   showing the reader the same three blocks twice.
   NB: this must come AFTER `.ph-sidebar { display: grid }` above, or the base
   rule wins on equal specificity and the sidebar never hides. */
@media (max-width: 1024px) {
  .ph-sidebar { display: none; }
}

/* ==========================================================================
   CTA band + Latest posts
   ========================================================================== */
.ph-cta {
  padding-block: clamp(40px, 4.6vw, 64px);
  border-top: 1px solid var(--ph-line);
  background: var(--ph-grey);
  text-align: center;
}
.ph-cta__title {
  margin: 0 auto 12px;
  max-width: 22ch;
  font-family: var(--ph-serif);
  font-size: clamp(22px, 2.7vw, 32px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ph-blue);
}
.ph-cta__text { margin: 0 auto 24px; max-width: 60ch; font-size: 16px; line-height: 1.65; color: var(--ph-text); }
.ph-cta__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.ph-latest { padding-block: clamp(44px, 5vw, 76px); }
.ph-latest__title {
  margin: 18px 0 22px;
  font-family: var(--ph-serif);
  font-size: clamp(21px, 2.3vw, 28px);
  font-weight: 700;
  color: var(--ph-blue);
}
.ph-back-link {
  display: inline-block;
  color: var(--ph-blue);
  font: 600 13px/1.2 var(--ph-sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
}
.ph-back-link:hover { color: var(--ph-gold); }

/* ==========================================================================
   [ph_blog_grid] — card grid
   ========================================================================== */
.ph-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 20px;
  margin-inline: -12px;
}
@media (max-width: 960px) { .ph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .ph-grid { grid-template-columns: minmax(0, 1fr); } }

/* Padding and a transparent border sit on the card at rest, so hovering only
   changes colour — nothing reflows. The grid is pulled out by the same 12px so
   the images stay flush with the page margin. */
.ph-card {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  transition: border-color .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.ph-card:hover { border-color: var(--ph-line); background: #fff; box-shadow: 0 10px 28px rgba(29,41,112,.10); }
.ph-card--soon:hover { border-color: transparent; background: transparent; box-shadow: none; }

.ph-card__media { display: block; overflow: hidden; border-radius: 4px; background: var(--ph-grey); }
.ph-card__media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform .5s ease;
}
.ph-card:hover .ph-card__media img { transform: scale(1.04); }
.ph-card__media--empty {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  border: 1px dashed var(--ph-line);
  background: var(--ph-grey);
}
.ph-card__media--empty span {
  color: #9AA0AA;
  font: 600 12px/1.4 var(--ph-sans);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ph-card__tag {
  display: block;
  margin-top: 16px;
  color: var(--ph-gold);
  font: 600 12px/1.4 var(--ph-sans);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.ph-card__title { margin: 8px 0 10px; font: 700 19px/1.42 var(--ph-serif); }
.ph-card__title, .ph-card__title a { color: var(--ph-blue); text-decoration: none; }
.ph-card__title a:hover { color: var(--ph-gold); }
.ph-card--soon .ph-card__title { color: #9AA0AA; }
.ph-card__excerpt { margin: 0 0 18px; color: var(--ph-text); font: 400 15.5px/1.68 var(--ph-sans); }

.ph-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}
.ph-card__date {
  color: var(--ph-text);
  font: 500 13px/1.4 var(--ph-sans);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ph-card__link {
  color: var(--ph-blue);
  font: 600 13px/1.4 var(--ph-sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .25s ease;
}
.ph-card__link:hover { color: var(--ph-gold); }
.ph-card__arrow { display: inline-block; transition: transform .25s ease; }
.ph-card__link:hover .ph-card__arrow { transform: translateX(4px); }
.ph-grid__empty { grid-column: 1 / -1; text-align: center; color: var(--ph-text); }

/* ==========================================================================
   [ph_blog_grid layout="mini"] — sidebar list
   ========================================================================== */
.ph-mini__item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--ph-line); }
.ph-mini__item:first-child { padding-top: 0; }
.ph-mini__item:last-child { padding-bottom: 0; border-bottom: 0; }
.ph-mini__thumb {
  flex: 0 0 74px;
  display: block;
  width: 74px; height: 56px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--ph-grey);
}
.ph-mini__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-mini__thumb--empty { border: 1px dashed var(--ph-line); }
.ph-mini__title { margin: 0 0 5px; font: 600 14px/1.42 var(--ph-sans); }
.ph-mini__title a { color: var(--ph-blue); text-decoration: none; }
.ph-mini__title a:hover { color: var(--ph-gold); }
.ph-mini__date { color: var(--ph-text); font: 400 12.5px/1.4 var(--ph-sans); letter-spacing: .05em; }
.ph-mini__empty { margin: 0; color: var(--ph-text); font-size: 14px; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .ph-card, .ph-card__media img, .ph-card__arrow, .ph-btn, .ph-back-btn, .ph-share a {
    transition: none !important;
  }
}

/* ==========================================================================
   Heading size overrides
   --------------------------------------------------------------------------
   Elementor's global kit styles bare headings as `.elementor-kit-N h1/h2/h3`
   (specificity 0,1,1), which outranks a single class (0,1,0) — so without
   these, every heading falls back to the kit's large sizes. Adding a parent
   class raises each selector to (0,2,x) so the blog's own sizes win.
   ========================================================================== */
.ph-single .ph-single__title { font-size: clamp(26px, 3.6vw, 42px); line-height: 1.28; }
.ph-single .ph-article > h2  { font-size: clamp(20px, 2vw, 26px);   line-height: 1.35; }
.ph-single .ph-article > h3  { font-size: clamp(17.5px, 1.6vw, 20px); line-height: 1.4; }
.ph-single .ph-cta__title    { font-size: clamp(22px, 2.7vw, 32px); line-height: 1.3; }
.ph-single .ph-latest__title { font-size: clamp(21px, 2.3vw, 28px); line-height: 1.3; }
.ph-single .ph-widget__title { font-size: 13px; line-height: 1.4; }
.ph-grid  .ph-card__title    { font-size: 19px; line-height: 1.42; }
.ph-mini  .ph-mini__title    { font-size: 14px; line-height: 1.42; }
