/* ==========================================================================
   Solar4Good Blog — Unified CSS
   Child theme stylesheet for blog posts WITHOUT Elementor

   Source of truth:
     - docs/superpowers/specs/blog-mockup-approved.html (template layout)
     - docs/superpowers/specs/blog-live-css-reference.css (content components)

   Root selector: .s4g-blog-post (replaces .single-post from live WPCode)
   ========================================================================== */


/* ==========================================================================
   SECTION A: TEMPLATE LAYOUT
   These styles target the PHP template structure (not body_html content).
   ========================================================================== */

/* --- Article wrapper --- */
.s4g-blog-post {
  font-family: 'Poppins', sans-serif;
  color: #707070;
  font-size: 16px;
  line-height: 1.8;
  background: #fff;
  position: relative;
  
}

.s4g-blog-post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  min-height: 550px;
  background-color: #FFEBC8;
  background-image: url('https://solar4good.co.uk/wp-content/uploads/2025/07/solar_panel_maintenance_hero-image-bg.jpg');
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
}

.s4g-blog-post > * {
  position: relative;
  z-index: 1;
}

/* --- Hero / Title --- */
.s4g-blog-hero {
  padding: 32px 0 16px;
  max-width: 700px;
  margin: 0 auto;
}

.s4g-blog-title {
  font: 700 36px/1.3 'Poppins', sans-serif;
  color: #1a1a1a;
  text-align: left;
  margin: 0;
}

/* --- Featured image --- */
.s4g-blog-featured {
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: 16px;
}

.s4g-blog-img {
  width: 100%;
  border-radius: 25px;
  display: block;
}

/* --- Author bar --- */
.s4g-blog-author-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  max-width: 700px;
  margin: 0 auto;
  border-bottom: 1px solid #e8e8e8;
}

.s4g-author-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.s4g-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.s4g-author-name {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.author_tag {
  color: #FFA200;
  font-size: 13px;
}

/* --- Trustpilot badge --- */
.s4g-trustpilot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
  font-size: 13px;
}

.s4g-tp-stars {
  color: #00b67a;
  font-size: 14px;
}

.s4g-tp-text {
  color: #00b67a;
  font-weight: 600;
}

/* --- Post meta (date, read time) --- */
.s4g-post-meta {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #999;
}

/* --- Content wrapper --- */
.s4g-blog-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 0 40px;
}


/* ==========================================================================
   SECTION B: CONTENT COMPONENTS
   Re-scoped from .single-post to .s4g-blog-post
   ========================================================================== */

/* --------------------------------------------------------------------------
   1a. Hook paragraph (separate box — intro text)
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-hook {
  margin: 20px 0 30px;
  max-width: 700px;
}

.s4g-blog-post .s4g-hook p {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: #707070;
  line-height: 1.8;
  margin: 0;
}

/* --------------------------------------------------------------------------
   1b. Legacy: Hook + TOC combined box (backward compat)
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-hook-toc-box {
  background: rgb(246, 250, 255);
  border-radius: 18px;
  padding: 45px 25px;
  margin: 30px 0;
  max-width: 700px;
  position: relative;
  overflow: visible;
}

.s4g-blog-post .s4g-hook-toc-box .s4g-hook-text {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: #707070;
  line-height: 1.8;
  margin-bottom: 24px;
}

/* TOC doodle: flush against left edge of box, vertically near top */
.s4g-blog-post .s4g-hook-toc-box::before {
  content: '';
  position: absolute;
  right: calc(100%);
  top: -20px;
  width: 200px;
  height: 123px;
  background-image: url('https://solar4good.co.uk/wp-content/uploads/2025/07/table_of_content_doodle.png');
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   2. TOC box (standalone — blue bg with doodle)
   -------------------------------------------------------------------------- */
.s4g-blog-post > .s4g-blog-content > .s4g-toc,
.s4g-blog-post .s4g-blog-content > .s4g-toc {
  background: rgb(246, 250, 255);
  border-radius: 18px;
  padding: 45px 25px;
  margin: 30px 0;
  max-width: 700px;
  position: relative;
  overflow: visible;
}

/* TOC doodle on standalone TOC box */
.s4g-blog-post .s4g-blog-content > .s4g-toc::before {
  content: '';
  position: absolute;
  right: calc(100%);
  top: -20px;
  width: 200px;
  height: 123px;
  background-image: url('https://solar4good.co.uk/wp-content/uploads/2025/07/table_of_content_doodle.png');
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

.s4g-blog-post .s4g-toc ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.s4g-blog-post .s4g-toc li {
  margin: 0 !important;
  padding: 0 !important;
}

.s4g-blog-post .s4g-toc a {
  font-family: 'Poppins', sans-serif;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #1a1a1a;
  text-decoration: none !important;
  display: block !important;
  padding: 3px 0 !important;
  line-height: 1.3 !important;
}

.s4g-blog-post .s4g-toc br {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
}

.s4g-blog-post .s4g-toc a::before {
  content: '\2192  ';
  color: #ea580c;
}

/* --------------------------------------------------------------------------
   3. TL;DR / Summary
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-tldr {
  background: rgb(255, 252, 246);
  border: 1px solid #FFA100;
  border-radius: 18px;
  padding: 40px 30px;
  margin: 30px 0;
  max-width: 700px;
  position: relative;
  overflow: visible;
}

.s4g-blog-post .s4g-tldr h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #FFA100;
  margin: 0 0 12px;
}

/* TL;DR doodle image */
.s4g-blog-post .s4g-tldr::after {
  content: '';
  position: absolute;
  right: -220px;
  top: 50%;
  transform: translateY(-50%);
  width: 200px;
  height: 120px;
  background-image: url('https://solar4good.co.uk/wp-content/uploads/2025/07/tldr.png');
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. Data Cards
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-data-card {
  background: #FFF7F1;
  border-radius: 14px;
  padding: 16px 20px;
  margin: 12px 0;
  box-shadow: 0px 7px 18px 0px rgba(117, 74, 0, 0.11);
}

.s4g-blog-post .s4g-data-label {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: #ea580c;
  font-size: 14px;
  margin-bottom: 6px;
}

/* --------------------------------------------------------------------------
   5. Review Cards
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-review {
  background: #FFF7F1;
  border-radius: 14px;
  padding: 22px 26px;
  margin: 20px 0;
  box-shadow: 0px 7px 18px 0px rgba(117, 74, 0, 0.11);
}

.s4g-blog-post .s4g-review p:first-child {
  color: #01B77D;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   6. Note Callout
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-note {
  background: #FFF7F1;
  border-left: 4px solid #ea580c;
  border-radius: 14px;
  padding: 18px 22px;
  margin: 24px 0;
  box-shadow: 0px 7px 18px 0px rgba(117, 74, 0, 0.11);
}

/* --------------------------------------------------------------------------
   7. Tip Callout
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-tip {
  background: #FFF7F1;
  border-left: 4px solid #01B77D;
  border-radius: 14px;
  padding: 18px 22px;
  margin: 24px 0;
  box-shadow: 0px 7px 18px 0px rgba(117, 74, 0, 0.11);
}

/* --------------------------------------------------------------------------
   8. Stat Card
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-stat {
  background: #FFF7F1;
  border-radius: 14px;
  padding: 22px 26px;
  margin: 20px 0;
  box-shadow: 0px 7px 18px 0px rgba(117, 74, 0, 0.11);
}

/* --------------------------------------------------------------------------
   9. Mid-Article CTA (grid layout, farmfield bg)
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-cta {
  background-color: #FFA100;
  background-image: url('https://solar4good.co.uk/wp-content/uploads/2025/09/farmfield_house_img_2.jpg');
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  padding: 70px 30px;
  margin: 40px 0;
  position: relative;
  display: grid;
  grid-template-columns: 3fr 1.5fr;
  align-items: center;
  max-width: 700px;
  overflow: hidden;
}

.s4g-blog-post .s4g-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFA200;
  opacity: 0.85;
  border-radius: 12px;
  z-index: 0;
}

.s4g-blog-post .s4g-cta > * {
  position: relative;
  z-index: 1;
}

.s4g-blog-post .s4g-cta h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 60px;
  font-weight: 800;
  color: #000;
  margin: 0;
  line-height: 1.1;
}

.s4g-blog-post .s4g-cta-btn,
.s4g-blog-post .s4g-cta a {
  display: inline-block;
  font-family: 'Roboto', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: #000;
  border-radius: 8px;
  padding: 20px 30px;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   10. Footer CTA
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-footer-cta {
  background: #1e293b;
  border-radius: 18px;
  padding: 36px 32px;
  margin: 36px 0;
  text-align: center;
  max-width: 700px;
}

.s4g-blog-post .s4g-footer-cta h2 {
  color: #fff;
  margin: 0 0 8px;
}

.s4g-blog-post .s4g-footer-cta p {
  color: rgba(255, 255, 255, 0.75);
}

.s4g-blog-post .s4g-footer-cta a:not(.s4g-cta-btn) {
  color: #FFA100;
  text-decoration: none;
}

.s4g-blog-post .s4g-footer-cta strong {
  color: #fff;
}

.s4g-blog-post .s4g-footer-cta .s4g-cta-btn {
  background: #01B77D;
  color: #fff;
  font-size: 16px;
  padding: 14px 36px;
  margin-top: 16px;
}

.s4g-blog-post .s4g-footer-cta .fine {
  font-size: 10px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.4);
}

/* --------------------------------------------------------------------------
   11. FAQ Accordion (details/summary with chevron-down SVG)
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-faq-item {
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 10px;
  border: none;
}

.s4g-blog-post .s4g-faq-item summary {
  background: #F7F7F7;
  padding: 18px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #000;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.4;
  transition: background 0.2s;
  border-radius: 10px;
  border: 0.625px solid rgba(0, 0, 0, 0.02);
}

.s4g-blog-post .s4g-faq-item summary:hover {
  background: #efefef;
}

.s4g-blog-post .s4g-faq-item summary::-webkit-details-marker {
  display: none;
}

/* Override WPCode live CSS that adds + via ::after — we use inline SVG chevron instead */
.s4g-blog-post .s4g-faq-item summary::after {
  content: none !important;
  display: none !important;
}

/* Chevron-down arrow icon (inline SVG in HTML, rotates 180deg on open) */
.s4g-blog-post .s4g-faq-item summary .faq-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 16px;
  transition: transform 0.2s;
}

.s4g-blog-post .s4g-faq-item summary .faq-icon svg {
  fill: #444;
  width: 16px;
  height: 16px;
}

.s4g-blog-post .s4g-faq-item[open] summary .faq-icon {
  transform: rotate(180deg);
}

.s4g-blog-post .s4g-faq-item > p,
.s4g-blog-post .s4g-faq-item > div {
  padding: 15px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: #707070;
  line-height: 1.8;
  margin: 0;
}

/* --------------------------------------------------------------------------
   12. FAQ Legacy Format (.s4g-faq-q, .s4g-faq-a)
   -------------------------------------------------------------------------- */
.s4g-blog-post .s4g-faq-q {
  background: rgb(247, 247, 247);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 6px;
}

.s4g-blog-post .s4g-faq-q h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #000;
  margin: 0;
}

.s4g-blog-post .s4g-faq-a {
  padding: 16px 20px;
  margin-bottom: 20px;
}

.s4g-blog-post .s4g-faq-a p {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: #707070;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   13. Audio Player
   -------------------------------------------------------------------------- */
.s4g-audio-wrap {
  max-width: 700px;
  margin: 20px auto 30px;
  padding: 0 10px;
}

.s4g-audio-player {
  background: #FFA100;
  border-radius: 12px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: 'Poppins', sans-serif;
  position: relative;
  overflow: hidden;
}

.s4g-audio-player::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('https://solar4good.co.uk/wp-content/uploads/2025/09/farmfield_house_img_2.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.08;
  border-radius: 12px;
  pointer-events: none;
}

.s4g-audio-player > * {
  position: relative;
  z-index: 1;
}

.s4g-audio-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  flex-shrink: 0;
}

.s4g-audio-bar {
  width: 3px;
  border-radius: 3px;
  background: #fff;
  height: 8px;
  transition: height 0.15s;
}

.s4g-audio-bars.s4g-playing .s4g-audio-bar {
  animation: s4gBarBounce 0.7s ease-in-out infinite alternate;
}

.s4g-audio-bars.s4g-playing .s4g-audio-bar:nth-child(1) { animation-delay: 0.0s; height: 16px; }
.s4g-audio-bars.s4g-playing .s4g-audio-bar:nth-child(2) { animation-delay: 0.15s; height: 24px; }
.s4g-audio-bars.s4g-playing .s4g-audio-bar:nth-child(3) { animation-delay: 0.05s; height: 12px; }
.s4g-audio-bars.s4g-playing .s4g-audio-bar:nth-child(4) { animation-delay: 0.2s; height: 20px; }
.s4g-audio-bars.s4g-playing .s4g-audio-bar:nth-child(5) { animation-delay: 0.1s; height: 14px; }

.s4g-audio-info {
  flex: 1;
  min-width: 0;
}

.s4g-audio-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.s4g-audio-duration {
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.15);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.s4g-audio-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
  display: none;
}

.s4g-audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.s4g-audio-speed {
  background: #fff;
  color: #333;
  border: none;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  outline: none;
}

.s4g-audio-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Poppins', sans-serif;
  transition: background 0.15s;
}

.s4g-audio-btn-play {
  background: #000;
  color: #fff;
}

.s4g-audio-btn-play:hover {
  background: #333;
}

.s4g-audio-btn-play.s4g-paused {
  background: #16a34a;
}

.s4g-audio-btn-play.s4g-paused:hover {
  background: #15803d;
}

.s4g-audio-btn-stop {
  background: rgba(0, 0, 0, 0.15);
  color: #fff;
  display: none;
}

.s4g-audio-btn-stop:hover {
  background: rgba(0, 0, 0, 0.3);
}

@keyframes s4gBarBounce {
  0% { height: 6px; }
  100% { height: 28px; }
}


/* ==========================================================================
   SECTION C: TYPOGRAPHY & TABLES
   ========================================================================== */

.s4g-blog-post h2 {
  font-family: 'Righteous', sans-serif;
  font-size: 22px;
  color: #404765;
  margin: 40px 0 16px;
  line-height: 1.3;
  font-weight: 500;
}

.s4g-blog-post h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  color: #000;
  margin: 28px 0 12px;
  font-weight: 600;
}

.s4g-blog-post p {
  margin-bottom: 16px;
}

.s4g-blog-post a {
  color: #ff9f00;
  text-decoration: underline;
}

/* --- Tables --- */
.s4g-blog-post table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border-radius: 10px;
  overflow: hidden;
}

.s4g-blog-post thead th {
  background: #03332b;
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
}

.s4g-blog-post tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.s4g-blog-post tbody tr:nth-child(even) {
  background: #f9f9f9;
}


/* ==========================================================================
   SECTION D: UTILITIES
   ========================================================================== */

/* Hide comments area */
.s4g-blog-post .comments-area,
.s4g-blog-post #comments {
  display: none;
}

/* Hide image placeholders */
.s4g-blog-post [data-imgslot] {
  display: none;
}


/* ==========================================================================
   SECTION E: AUDIO PLAYER — MOBILE (<= 600px)
   ========================================================================== */

@media (max-width: 600px) {
  .s4g-audio-player {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
  }

  .s4g-audio-info {
    flex: 1 1 60%;
  }

  .s4g-audio-controls {
    width: 100%;
    justify-content: flex-end;
  }

  .s4g-audio-title {
    font-size: 13px;
  }
}

/* Override WPCode .single-post FAQ rules that use !important and set display:block */
.s4g-blog-post .s4g-faq-item summary {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-right: 20px !important;
}
