from pathlib import Path

src = Path("/mnt/data/Yapıştırılan metin(7).txt")
text = src.read_text(encoding="utf-8")

# Keep the original premium template only; remove the stacked override blocks
marker = "/* =========================================\n   KIMERA KURUMSAL RENK PALETİ"
if marker in text:
text = text.split(marker)[0].rstrip() + "\n"

replacements = {
    "#0F172A": "#201D1B", "#0f172a": "#201D1B", "#111827": "#181614", "#C9A227": "#A67C52", "#c9a227": "#A67C52", "#b58d17": "#8D6844", "#0d6efd": "#A67C52", "#1f2937": "#2B2724", "#F8FAFC": "#F7F3EE", "#f8fafc": "#F7F3EE", "#374151": "#3A342F", "rgba(15,23,42,.95)": "rgba(32,29,27,.96)", "rgba(15,23,42,.82)": "rgba(32,29,27,.82)", "rgba(15,23,42,.92)": "rgba(32,29,27,.92)", "rgba(15,23,42,.65)": "rgba(32,29,27,.65)", "rgba(201,162,39,.35)": "rgba(166,124,82,.35)", "rgba(201,162,39,.12)": "rgba(166,124,82,.12)", "rgba(201,162,39,.15)": "rgba(166,124,82,.15)",
}

for a, b in replacements.items():
text = text.replace(a, b)

# Add only color overrides for Bootstrap. No spacing/layout/typography changes.
text + = r'''
/* ==========================================================
   KIMERA COLOR PATCH
   Yalnızca renkleri değiştirir; layout/ölçü/spacing değiştirmez.
========================================================== */
:root {
    --kimera-charcoal: #201D1B;
    --kimera-charcoal-2: #2B2724;
    --kimera-bronze: #A67C52;
    --kimera-bronze-light: #C2A17A;
    --kimera-cream: #F7F3EE;
    --kimera-border: #DED4C8;
}

.bg-dark,
.navbar-dark {
    background-color: var(--kimera-charcoal) !important;
}

.bg-primary,
.btn-primary,
.btn-info {
    background-color: var(--kimera-charcoal) !important;
    border-color: var(--kimera-charcoal) !important;
    color: #fff !important;
}

    .btn-primary:hover,
    .btn-info:hover {
        background-color: var(--kimera-bronze) !important;
        border-color: var(--kimera-bronze) !important;
    }

.btn-success {
    background-color: var(--kimera-bronze) !important;
    border-color: var(--kimera-bronze) !important;
    color: #fff !important;
}

    .btn-success:hover {
        background-color: #8D6844 !important;
        border-color: #8D6844 !important;
    }

.btn-warning {
    background-color: var(--kimera-bronze-light) !important;
    border-color: var(--kimera-bronze-light) !important;
    color: var(--kimera-charcoal) !important;
}

    .btn-warning:hover {
        background-color: var(--kimera-bronze) !important;
        border-color: var(--kimera-bronze) !important;
        color: #fff !important;
    }

.btn-outline-primary {
    color: var(--kimera-bronze) !important;
    border-color: var(--kimera-bronze) !important;
}

    .btn-outline-primary:hover,
    .card:hover .btn-outline-primary {
        background-color: var(--kimera-bronze) !important;
        border-color: var(--kimera-bronze) !important;
        color: #fff !important;
    }

.text-primary,
.link-primary {
    color: var(--kimera-bronze) !important;
}

.table-dark,
.table-dark th,
.table-dark td,
thead.table-dark,
thead.table-dark th {
    background-color: var(--kimera-charcoal) !important;
    color: #fff !important;
    border-color: #3A342F !important;
}

.card-header.bg-dark,
.card-header.bg-primary {
    background-color: var(--kimera-charcoal) !important;
    color: #fff !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--kimera-bronze) !important;
    box-shadow: 0 0 0 .2rem rgba(166,124,82,.15) !important;
}

.badge.bg-primary,
.badge.bg-info,
.badge.bg-warning,
.badge.bg-success {
    background-color: var(--kimera-bronze) !important;
    color: #fff !important;
}

a {
    color: var(--kimera-bronze);
}

    a:hover {
        color: #8D6844;
    }

'''

out = Path("/mnt/data/site_clean.css")
out.write_text(text, encoding="utf-8")

print(f"Created: {out}")
print(f"Lines: {len(text.splitlines())}")
print("Removed stacked duplicate color override blocks and preserved the original template structure.")
/* =====================================================
   KIMERA FOOTER
===================================================== */
.kimera-footer {
    width: 100%;
    margin-top: 80px;
    padding-top: 70px;
    background: #171513;
    color: #d5cec7;
    font-family: "Poppins", sans-serif;
}

.footer-brand h3 {
    margin: 0;
    color: #c4a06f;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 5px;
}

.footer-brand span {
    display: block;
    margin-top: 5px;
    color: #aaa198;
    font-size: 10px;
    letter-spacing: 2px;
}

.footer-description {
    max-width: 360px;
    margin-top: 25px;
    color: #aaa39c;
    font-size: 14px;
    line-height: 1.8;
}

.footer-contact {
    margin-top: 25px;
}

    .footer-contact p {
        margin-bottom: 13px;
        color: #d5cec7;
        font-size: 14px;
    }

    .footer-contact i {
        width: 24px;
        color: #b48b5b;
    }


/* BAŞLIKLAR */

.footer-title {
    position: relative;
    margin-bottom: 27px;
    padding-bottom: 13px;
    color: #ffffff;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 19px;
    font-weight: 600;
}

    .footer-title::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 35px;
        height: 2px;
        background: #a98255;
    }


/* LİNKLER */

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    .footer-links a {
        color: #aaa39c;
        font-size: 14px;
        text-decoration: none;
        transition: all .25s ease;
    }

        .footer-links a::before {
            content: "›";
            margin-right: 8px;
            color: #a98255;
        }

        .footer-links a:hover {
            color: #c4a06f;
            transform: translateX(4px);
        }


/* İLETİŞİM */

.footer-small-text {
    color: #aaa39c;
    font-size: 14px;
    line-height: 1.8;
}

.footer-contact-button {
    display: inline-block;
    margin-top: 10px;
    padding: 12px 23px;
    border: 1px solid #a98255;
    background: #a98255;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: .25s;
}

    .footer-contact-button:hover {
        background: transparent;
        color: #c4a06f !important;
    }


/* SOSYAL MEDYA */

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

    .footer-social a {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #403a35;
        color: #c4a06f;
        text-decoration: none;
        transition: .25s;
    }

        .footer-social a:hover {
            background: #a98255;
            border-color: #a98255;
            color: #fff;
        }


/* ALT BANT */

.footer-bottom {
    margin-top: 60px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: #11100f;
}

.footer-bottom-inner {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #817a74;
    font-size: 12px;
}


/* MOBİL */

@media (max-width: 767px) {

    .kimera-footer {
        margin-top: 50px;
        padding-top: 50px;
    }

    .footer-bottom-inner {
        padding: 20px 0;
        flex-direction: column;
        align-items: flex-start;
    }
}