/* ============================================================
   WEDSI BLOG POST — general-template-styles-v2.css
   Designed to match Wedsi homepage design language:
   - Manrope font family
   - Accent: #a62d0d (Wedsi red)
   - Warm neutrals: #f8f5f2, #e5ddd7, #5f5a56
   - Rounded cards, editorial layout, sticky sidebar
   ============================================================ */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
   :root {
    --accent:         #a62d0d;
    --accent-dark:    #7f2108;
    --accent-light:   rgba(166, 45, 13, 0.08);
    --accent-tint:    #f3e6e3;
  
    --fg:             #111111;
    --fg-muted:       #5f5a56;
    --fg-subtle:      #8a817c;
  
    --bg:             #ffffff;
    --bg-warm:        #f8f5f2;
    --bg-card:        #f3eeea;
  
    --border:         #e5ddd7;
    --border-soft:    #ede6e0;
  
    --radius-sm:      8px;
    --radius-md:      16px;
    --radius-lg:      24px;
    --radius-xl:      32px;
  
    --font-body:      'Manrope', system-ui, sans-serif;
  
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-md:      0 2px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.07);
  
    --content-max:    950px;
    --sidebar-w:      300px;
    --wrapper-max:    1400px;
  }
  
  /* ============================================================
     RESET / BASE
     ============================================================ */
  *, *::before, *::after {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--fg);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  
  a {
    text-decoration: none;
    color: inherit;
    font-family: var(--font-body);
  }
  
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }
  
  /* ============================================================
     OUTER WRAPPER  (content + sidebar)
     ============================================================ */
  .blog-wrapper {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    gap: 48px;
    max-width: var(--wrapper-max);
    margin: 0 auto;
    padding: 0 24px;
    align-items: start;
  }
  
  /* ============================================================
     MAIN CONTENT COLUMN
     ============================================================ */
  .blog-container {
    min-width: 0;
    padding: 120px 0 100px;
  }
  
  /* ============================================================
     ARTICLE HEADER
     ============================================================ */
  
  /* Category tag above the title */
  .blog-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 6px 14px;
    border-radius: 999px;
    background-color: var(--accent-tint);
    border: 1px solid rgba(166, 45, 13, 0.15);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  
  /* Main H1 — left-aligned, editorial, strong */
  .blog-container h1 {
    margin: 0 0 20px;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
    font-weight: 800;
    color: var(--fg);
    text-align: left;
    max-width: var(--content-max);
    word-spacing: normal;
  }
  
  /* Accent the last word or a span inside h1 */
  .blog-container h1 span {
    color: var(--accent);
  }
  
  /* Meta row: date + read time */
  .blog-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
    flex-wrap: wrap;
  }
  
  /* Keep legacy .blog-date working */
  .blog-date {
    font-size: 0.85rem;
    color: var(--fg-subtle);
    font-weight: 500;
  }
  
  .blog-read-time {
    font-size: 0.85rem;
    color: var(--fg-subtle);
    font-weight: 500;
  }
  
  /* Dot separator between meta items */
  .blog-meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--border);
    flex-shrink: 0;
  }
  
  /* Author chip */
  .blog-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 6px;
    border-radius: 999px;
    background-color: var(--bg-warm);
    border: 1px solid var(--border);
  }
  
  .blog-author-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
  }
  
  .blog-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Fallback initials */
  .blog-author-avatar::after {
    content: 'W';
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    font-family: var(--font-body);
  }
  
  .blog-author-avatar img ~ ::after {
    display: none;
  }
  
  .blog-author-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--fg);
  }
  
  /* ============================================================
     HERO IMAGE
     ============================================================ */
  .blog-feature-wrapper {
    width: 100%;
    max-width: var(--content-max);
    height: 420px;
    margin: 0 0 48px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
    position: relative;
  }
  
  .blog-feature-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
  }
  
  .blog-feature-wrapper:hover .blog-feature-image {
    transform: scale(1.015);
  }
  
  /* ============================================================
     BODY CONTENT
     ============================================================ */
  .blog-content {
    max-width: var(--content-max);
  }
  
  /* Opening paragraph — slightly larger, bolder weight */
  .blog-content > p:first-child {
    font-size: 1.12rem;
    line-height: 1.85;
    color: #3a3530;
    font-weight: 500;
    margin-bottom: 1.6rem;
  }
  
  .blog-content p {
    font-size: 1.02rem;
    line-height: 1.85;
    margin: 0 0 1.5rem;
    color: #2d2926;
  }
  
  /* H2 — section titles */
  .blog-content h2 {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--fg);
    margin: 3rem 0 1rem;
    padding-top: 0.5rem;
    border-top: 2px solid var(--accent-tint);
    padding-top: 1.5rem;
  }
  
  /* H3 — sub-sections */
  .blog-content h3 {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.4;
    color: var(--fg);
    margin: 2rem 0 0.75rem;
  }
  
  /* ============================================================
     INLINE ELEMENTS
     ============================================================ */
  .blog-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    font-weight: 600;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
  }
  
  .blog-content a:hover {
    color: var(--accent-dark);
  }
  
  .blog-content strong {
    font-weight: 700;
    color: var(--fg);
  }
  
  .blog-content em {
    font-style: italic;
    color: var(--fg-muted);
  }
  
  /* ============================================================
     LISTS
     ============================================================ */
  .blog-content ul,
  .blog-content ol {
    padding: 0 0 0 0;
    margin: 0 0 1.75rem;
    list-style: none;
  }
  
  .blog-content ul li,
  .blog-content ol li {
    position: relative;
    padding: 10px 0 10px 28px;
    font-size: 1rem;
    line-height: 1.75;
    color: #2d2926;
    font-weight: 500;
    border-bottom: 1px solid var(--border-soft);
  }
  
  .blog-content ul li:last-child,
  .blog-content ol li:last-child {
    border-bottom: none;
  }
  
  /* Custom bullet: accent left line */
  .blog-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 2px;
    background-color: var(--accent);
    border-radius: 2px;
  }
  
  /* Numbered list */
  .blog-content ol {
    counter-reset: list-counter;
  }
  
  .blog-content ol li {
    counter-increment: list-counter;
  }
  
  .blog-content ol li::before {
    content: counter(list-counter);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-color: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  
  /* FontAwesome icon in lists (legacy support) */
  .blog-content li i.fa {
    color: var(--accent);
    margin-right: 10px;
    font-size: 0.8rem;
  }
  
  /* ============================================================
     PULL QUOTE / BLOCKQUOTE
     ============================================================ */
  .blog-content blockquote {
    margin: 2.5rem 0;
    padding: 24px 28px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-tint) 0%, #fdf8f7 100%);
    border-left: 4px solid var(--accent);
    border: 1px solid rgba(166, 45, 13, 0.12);
    border-left: 4px solid var(--accent);
  }
  
  .blog-content blockquote p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.75;
    font-weight: 600;
    color: #2a1a15;
    font-style: italic;
  }
  
  /* ============================================================
     CALLOUT BOX  (.blog-callout)
     Use for tips, warnings, and key takeaways
     ============================================================ */
  .blog-callout {
    margin: 2rem 0;
    padding: 20px 24px;
    border-radius: var(--radius-md);
    background-color: var(--bg-warm);
    border: 1px solid var(--border);
    display: flex;
    gap: 16px;
    align-items: flex-start;
  }
  
  .blog-callout-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--accent-tint);
    border: 1px solid rgba(166, 45, 13, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
    font-size: 0.8rem;
  }
  
  .blog-callout-body p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--fg-muted);
  }
  
  .blog-callout-body strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  
  /* ============================================================
     KEY STATS ROW  (.blog-stats)
     Use inside posts to highlight budget numbers, timing etc.
     ============================================================ */
  .blog-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin: 2rem 0;
  }
  
  .blog-stat {
    padding: 20px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, var(--accent-tint) 0%, #fdf9f8 100%);
    border: 1px solid rgba(166, 45, 13, 0.12);
    text-align: center;
  }
  
  .blog-stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
  }
  
  .blog-stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fg-muted);
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  
  /* ============================================================
     INLINE CTA BANNER  (.blog-cta-banner)
     Subtle mid-post prompt to visit Wedsi
     ============================================================ */
  .blog-cta-banner {
    margin: 2.5rem 0;
    padding: 28px 28px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
  }
  
  .blog-cta-banner-copy {
    flex: 1;
    min-width: 200px;
  }
  
  .blog-cta-banner-copy p {
    margin: 0;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    line-height: 1.6;
  }
  
  .blog-cta-banner-copy strong {
    display: block;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
  }
  
  .blog-cta-banner a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background-color: var(--accent);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
  }
  
  .blog-cta-banner a:hover {
    background-color: var(--accent-dark);
    color: #fff;
    transform: translateY(-1px);
  }
  
  /* ============================================================
     RELATED POSTS  (.blog-related)
     Add at the bottom of each post manually
     ============================================================ */
  .blog-related {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
  }
  
  .blog-related-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 24px;
  }
  
  .blog-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
  }
  
  .blog-related-card {
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background-color: var(--bg-warm);
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  }
  
  .blog-related-card:hover {
    transform: translateY(-3px);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
  }
  
  .blog-related-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
  }
  
  .blog-related-card-body {
    padding: 14px 16px 16px;
  }
  
  .blog-related-card-body h4 {
    margin: 0 0 4px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--fg);
  }
  
  .blog-related-card-body span {
    font-size: 0.75rem;
    color: var(--fg-subtle);
  }
  
  /* ============================================================
     READING PROGRESS BAR
     ============================================================ */
  .blog-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #d44d28);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
  }
  
  /* ============================================================
     SIDEBAR
     ============================================================ */
  .blog-aside {
    position: sticky;
    top: 0px;
    width: var(--sidebar-w);
    padding-top: 120px;
  }
  
  /* Ad container */
  .ad-sticky {
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: #000;
    background-image: url(/images/advert-fallback.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border: 1px solid var(--border);
  }
  
  .ad-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    text-align: center;
    padding: 10px 0 8px;
    background-color: var(--bg-warm);
    border-bottom: 1px solid var(--border);
  }
  
  .ad-box {
    width: 300px;
    height: 600px;
    margin: 0 auto;
    display: block;
  }
  
  /* Sidebar newsletter nudge (optional add-on below ad) */
  .sidebar-nudge {
    margin-top: 20px;
    padding: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, var(--accent-tint) 0%, #fdf9f8 100%);
    border: 1px solid rgba(166, 45, 13, 0.12);
    margin-bottom: 20px;
  }
  
  .sidebar-nudge-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--fg);
    margin: 0 0 6px;
    line-height: 1.4;
  }
  
  .sidebar-nudge-text {
    font-size: 0.78rem;
    color: var(--fg-muted);
    line-height: 1.6;
    margin: 0 0 14px;
  }
  
  .sidebar-nudge a {
    display: block;
    text-align: center;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background-color: var(--accent);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    transition: background-color 0.2s ease;
  }
  
  .sidebar-nudge a:hover {
    background-color: var(--accent-dark);
  }
  
  /* ============================================================
     READING PROGRESS SCRIPT HOOK
     Add this snippet to your HTML just before </body>:
  
     <div class="blog-progress-bar" id="blogProgress"></div>
     <script>
       const bar = document.getElementById('blogProgress');
       window.addEventListener('scroll', () => {
         const doc = document.documentElement;
         const scrolled = doc.scrollTop;
         const total = doc.scrollHeight - doc.clientHeight;
         bar.style.width = (scrolled / total * 100) + '%';
       });
     </script>
     ============================================================ */
  
  /* ============================================================
     RESPONSIVE — 1100px: sidebar shrinks
     ============================================================ */
  @media (max-width: 1100px) {
    :root {
      --sidebar-w: 260px;
    }
  
    .blog-wrapper {
      gap: 32px;
    }
  }
  
  /* ============================================================
     RESPONSIVE — 900px: sidebar collapses, single column
     ============================================================ */
  @media (max-width: 900px) {
    .blog-wrapper {
      grid-template-columns: 1fr;
      padding: 0 20px;
      gap: 0;
    }
  
    .blog-aside {
      display: none; /* hide sidebar on mobile */
    }
  
    .blog-container {
      padding: 100px 0 70px;
    }
  
    .blog-container h1 {
      font-size: clamp(1.65rem, 5vw, 2.2rem);
    }
  
    .blog-feature-wrapper {
      height: 320px;
      border-radius: var(--radius-md);
    }
  
    .blog-content h2 {
      font-size: 1.25rem;
    }
  
    .blog-content > p:first-child {
      font-size: 1.05rem;
    }
  }
  
  /* ============================================================
     RESPONSIVE — 640px
     ============================================================ */
  @media (max-width: 640px) {
    .blog-wrapper {
      padding: 0 16px;
    }
  
    .blog-container {
      padding: 90px 0 50px;
    }
  
    .blog-container h1 {
      font-size: clamp(1.5rem, 6vw, 2rem);
      letter-spacing: -0.02em;
    }
  
    .blog-feature-wrapper {
      height: 240px;
      border-radius: 12px;
      margin-bottom: 32px;
    }
  
    .blog-content h2 {
      font-size: 1.15rem;
      margin-top: 2rem;
      padding-top: 1.25rem;
    }
  
    .blog-content h3 {
      font-size: 1rem;
    }
  
    .blog-content p,
    .blog-content > p:first-child {
      font-size: 0.96rem;
      line-height: 1.8;
    }
  
    .blog-stats {
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
    }
  
    .blog-cta-banner {
      padding: 20px;
      flex-direction: column;
      gap: 16px;
    }
  
    .blog-cta-banner a {
      width: 100%;
      justify-content: center;
    }
  
    .blog-related-grid {
      grid-template-columns: 1fr;
      gap: 14px;
    }
  
    .blog-meta {
      gap: 10px;
    }
  }
  
  /* ============================================================
     RESPONSIVE — 420px
     ============================================================ */
  @media (max-width: 420px) {
    .blog-wrapper {
      padding: 0 14px;
    }
  
    .blog-container h1 {
      font-size: 1.45rem;
      line-height: 1.25;
    }
  
    .blog-content ul li,
    .blog-content ol li {
      font-size: 0.93rem;
    }
  
    .blog-stats {
      grid-template-columns: 1fr 1fr;
    }
  }