39292-vm/fix_home_block2.py
2026-03-25 17:51:55 +00:00

204 lines
6.2 KiB
Python

import re
with open('tmp_home_current2.html', 'r', encoding='utf-8') as f:
content = f.read()
# Remove old CSS targeting .kmc-next from the top style block if we can find it
# Let's be careful. The block from /* KMC NEXT SECTION START */ to /* KMC NEXT SECTION END */
css_pattern = r'/\* KMC NEXT SECTION START \*/.*?/\* KMC NEXT SECTION END \*/'
content = re.sub(css_pattern, '', content, flags=re.DOTALL)
# There are also some global styles in <style> block overriding things.
# .kmc-next { padding-top ... } etc.
# I will just replace the KMC NEXT SECTION HTML.
# And add my new scoped style for block 2.
new_html = """
<!-- KMC BLOCK 2 SECTION START -->
<style>
.kmc-block2-section {
background: #FFFFFF;
padding: 120px 0;
}
.kmc-block2-container {
width: min(1360px, calc(100% - 72px));
margin: 0 auto;
display: grid;
grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
gap: 80px;
align-items: center;
}
.kmc-block2-left {
display: flex;
flex-direction: column;
max-width: 600px;
}
.kmc-block2-heading {
margin: 0 0 24px !important;
font-family: 'Cardo', serif;
color: #1C3434;
font-size: clamp(40px, 4.5vw, 64px) !important;
line-height: 1.05 !important;
font-weight: 700;
letter-spacing: -0.01em;
}
.kmc-block2-purpose {
margin: 0 0 20px !important;
font-family: 'Cardo', serif;
font-size: clamp(20px, 2vw, 26px) !important;
line-height: 1.3 !important;
color: #1C3434;
font-weight: 700;
}
.kmc-block2-body {
margin: 0 0 40px !important;
color: rgba(1, 1, 1, 0.8) !important;
font-family: 'Inter', sans-serif;
font-size: clamp(16px, 1.3vw, 18px) !important;
line-height: 1.6 !important;
font-weight: 400;
}
.kmc-block2-actions {
display: flex;
align-items: center;
gap: 32px;
flex-wrap: wrap;
}
.kmc-block2-btn {
display: inline-flex !important;
align-items: center !important;
gap: 16px !important;
padding: 8px 8px 8px 24px !important;
border-radius: 999px !important;
background: #1C3434 !important;
color: #FFFFFF !important;
text-decoration: none !important;
font-family: 'Inter', sans-serif;
font-size: 16px !important;
font-weight: 700 !important;
line-height: 1 !important;
transition: opacity 0.2s ease;
}
.kmc-block2-btn:hover {
opacity: 0.9;
}
.kmc-block2-btn-icon {
width: 36px !important;
height: 36px !important;
border-radius: 50% !important;
background: #90F1AE !important;
color: #1C3434 !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
flex: 0 0 36px !important;
}
.kmc-block2-btn-icon svg {
display: block;
}
.kmc-block2-link {
display: inline-flex !important;
align-items: center !important;
gap: 10px !important;
color: #1C3434 !important;
text-decoration: none !important;
font-family: 'Inter', sans-serif;
font-size: 16px !important;
font-weight: 600 !important;
transition: opacity 0.2s ease;
}
.kmc-block2-link:hover {
opacity: 0.7;
}
.kmc-block2-link svg {
display: block;
}
.kmc-block2-infocard {
border-radius: 32px !important;
overflow: hidden;
background: #f3f4f4;
box-shadow: 0 24px 48px rgba(15, 34, 34, 0.12);
margin: 0 !important;
}
.kmc-block2-infocard img {
width: 100%;
display: block;
aspect-ratio: 1.1 / 1;
object-fit: cover;
}
@media (max-width: 980px) {
.kmc-block2-container {
width: calc(100% - 48px) !important;
grid-template-columns: 1fr !important;
gap: 56px !important;
}
.kmc-block2-section {
padding: 80px 0 !important;
}
}
@media (max-width: 680px) {
.kmc-block2-container {
width: calc(100% - 28px) !important;
}
.kmc-block2-section {
padding: 60px 0 !important;
}
.kmc-block2-heading {
font-size: 34px !important;
}
.kmc-block2-actions {
gap: 20px !important;
flex-direction: column;
align-items: flex-start;
}
.kmc-block2-btn {
font-size: 14px !important;
padding: 6px 6px 6px 20px !important;
gap: 12px !important;
}
.kmc-block2-btn-icon {
width: 32px !important;
height: 32px !important;
flex: 0 0 32px !important;
}
.kmc-block2-link {
font-size: 14px !important;
}
}
</style>
<section class="kmc-block2-section">
<div class="kmc-block2-container">
<div class="kmc-block2-left">
<h2 class="kmc-block2-heading">Executive and Life Coaching to Achieve Your Potential</h2>
<p class="kmc-block2-purpose">Purpose: enable others to achieve their potential</p>
<p class="kmc-block2-body">Coaching for C-Level Executives who want to breakthrough and achieve the impossible in their business, navigating their organizations with clarity, reduced complexity and with more purpose.</p>
<div class="kmc-block2-actions">
<a class="kmc-block2-btn" href="https://calendly.com/ktmckeand/coaching-assessment">
<span>Schedule an assessment</span>
<div class="kmc-block2-btn-icon">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#1C3434" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg>
</div>
</a>
<a class="kmc-block2-link" href="/pricing/">
<span>View coaching options</span>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#1C3434" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg>
</a>
</div>
</div>
<div>
<div class="kmc-block2-infocard">
<img src="/wp-content/uploads/2026/03/pasted-20260324-203420-829e4248.jpg" alt="Executive coaching infographic">
</div>
</div>
</div>
</section>
<!-- KMC BLOCK 2 SECTION END -->
"""
html_pattern = r'<!-- KMC NEXT SECTION START -->.*?<!-- KMC NEXT SECTION END -->'
content = re.sub(html_pattern, new_html, content, flags=re.DOTALL)
with open('tmp_home_updated_block2.html', 'w', encoding='utf-8') as f:
f.write(content)