/* Старото съдържание от WordPress (legacy_html) в новия вид.
   Собствени правила за класовете, които се срещат в текстовете (Flatsome/WordPress имена).
   Не е копиран CSS от Flatsome или Divi. HTML-ът не се променя — само как изглежда. */

.legacy-content { color: var(--text); }
.legacy-content > :first-child { margin-top: 0; }
.legacy-content p:empty { display: none; }
.legacy-content ul, .legacy-content ol { padding-left: 1.4em; }
.legacy-content li { margin: 0.25em 0; }
.legacy-content hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.legacy-content table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.legacy-content td, .legacy-content th { border: 1px solid var(--line-2); padding: 6px 10px; }
.legacy-content iframe { display: block; width: 100%; max-width: 100%; border: 0; margin: 0 auto; }
.legacy-content blockquote { margin: 24px 0; padding: 8px 20px; border-left: 4px solid var(--green); background: var(--blog-bg); }

/* Цветът на текста от стария сайт (Flatsome „primary“/„secondary“) → лилаво */
.legacy-content [data-text-color="primary"], .legacy-content [data-text-color="secondary"] { color: var(--purple); }
.legacy-content .text-center { text-align: center; }
.legacy-content .text-right { text-align: right; }
.legacy-content .uppercase { text-transform: uppercase; }

/* Декоративни слоеве и елементи, които без JS на Flatsome нямат смисъл */
.legacy-content .bg,
.legacy-content .section-bg,
.legacy-content .banner-bg,
.legacy-content .overlay,
.legacy-content .section-bg-overlay,
.legacy-content .is-border,
.legacy-content .banner-link,
.legacy-content .loading-spin,
.legacy-content .scroll-for-more { display: none !important; }
.legacy-content .is-divider { height: 3px; width: 48px; background: var(--green); margin: 16px auto; }

/* „dark“ при Flatsome = светъл текст върху тъмна снимка. Тук снимките ги няма → обикновен текст. */
.legacy-content .dark, .legacy-content .dark h1, .legacy-content .dark h2, .legacy-content .dark h3,
.legacy-content .dark h4, .legacy-content .dark p { color: inherit; }
.legacy-content .dark h1, .legacy-content .dark h2, .legacy-content .dark h3 { color: var(--purple); }

/* --- Колони ---------------------------------------------------------------------------------- */
.legacy-content .row { display: flex; flex-wrap: wrap; gap: 24px; margin: 24px 0; justify-content: center; }
.legacy-content .row.align-middle { align-items: center; }
.legacy-content .col { flex: 1 1 100%; min-width: 0; }
.legacy-content .col.large-4, .legacy-content .col.medium-4 { flex: 1 1 calc(33.333% - 24px); }
.legacy-content .col.large-10, .legacy-content .col.medium-10 { flex: 0 1 83.333%; }
.legacy-content .col-inner { height: 100%; }
@media (max-width: 800px) {
    .legacy-content .col.large-4, .legacy-content .col.medium-4,
    .legacy-content .col.large-10, .legacy-content .col.medium-10 { flex: 1 1 100%; }
}

/* --- Секции ---------------------------------------------------------------------------------- */
.legacy-content .section { display: block; position: relative; padding: 24px 0; }
.legacy-content .section-content { position: relative; }

/* --- Банери (Flatsome) ----------------------------------------------------------------------- */
.legacy-content .banner {
    position: relative;
    padding-top: 0 !important;      /* старите <style> дават padding-top:100% (квадрат) */
    height: auto !important;
    min-height: 0 !important;
    background-color: transparent !important;
}
.legacy-content .banner-inner, .legacy-content .banner-layers { position: static; height: auto; }
.legacy-content .text-box { position: static !important; transform: none !important; width: auto !important; margin: 0 auto; }
.legacy-content .text-box .text { position: static; }
.legacy-content .text-inner > :first-child { margin-top: 0; }

/* Банер в секция („ЗА НАС“) — бял фон, лилави заглавия */
.legacy-content .section-content > .banner { padding: 16px 0; }
.legacy-content .section-content > .banner p { max-width: 900px; margin-left: auto; margin-right: auto; }
.legacy-content .section-content > .banner span[style*="font-size"] { font-size: 1.15em !important; }
.legacy-content .section-content > .banner h1 span[style*="font-size"] { font-size: 1em !important; }

/* Карти: банерите в слайдер и в колони (Услуги, слайдерът на началната) */
.legacy-content .slider { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.legacy-content .slider > .row { grid-column: 1 / -1; margin: 0; }
.legacy-content .slider-wrapper { margin: 24px 0; }
.legacy-content .slider .banner,
.legacy-content .col-inner > .banner {
    height: 100% !important;
    border-radius: 18px;
    background-color: var(--purple) !important;
    color: var(--white);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.legacy-content .slider .banner *,
.legacy-content .col-inner > .banner * { color: var(--white) !important; }
.legacy-content .slider .banner h2, .legacy-content .slider .banner h3,
.legacy-content .col-inner > .banner h2, .legacy-content .col-inner > .banner h3 { margin: 0.3em 0; }
.legacy-content .slider .banner h3 span[style*="font-size"] { font-size: 1em !important; }
.legacy-content .slider .banner h2:empty, .legacy-content .slider .banner h3:empty,
.legacy-content .col-inner > .banner h2:empty, .legacy-content .col-inner > .banner h3:empty { display: none; }

/* Услугите на началната като номериран списък 01–03 (В12 А): номерата са от CSS, не текст в HTML */
.page-home .legacy-content .slider { counter-reset: service; }
.page-home .legacy-content .slider > .banner { counter-increment: service; justify-content: flex-start; }
.page-home .legacy-content .slider > .banner::before {
    content: counter(service, decimal-leading-zero);
    display: block;
    font-family: var(--heading);
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--green);
    margin-bottom: 8px;
}

/* Голям банер на първо ниво (началната, „Начало“ 456) — лилав блок по дизайн Б, без старата снимка (В6 А) */
.legacy-content > .banner {
    background-color: var(--purple) !important;
    color: var(--white);
    margin: 0 calc(50% - 50vw);
    padding: 72px max(var(--gutter), calc(50vw - var(--max) / 2 + var(--gutter))) !important;
}
.legacy-content > .banner * { color: var(--white) !important; }
.legacy-content > .banner .text-inner { text-align: left; }
.legacy-content > .banner h2 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin: 0; letter-spacing: 0.02em; }
.legacy-content > .banner h3 { font-size: clamp(1.4rem, 3vw, 2rem); color: var(--green) !important; margin: 0.1em 0 0.6em; text-transform: uppercase; }
.legacy-content > .banner h4 { font-family: var(--heading); font-weight: 400; letter-spacing: 0.06em; }
.legacy-content > .banner .text, .legacy-content > .banner .text-box { box-shadow: none !important; text-shadow: none !important; }

/* На началната текстът е на цялата ширина: всичко освен големия банер е в 1200 px */
.page-home .legacy-content > :not(.banner) { max-width: var(--max); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.page-home .legacy-content > .banner { margin: 0; }

/* На началната кръгът с логото е вдясно до първия банер */
.page-home .legacy-content > .banner:first-of-type { min-height: 560px !important; display: flex; align-items: center; }
@media (min-width: 901px) {
    .page-home .legacy-content > .banner:first-of-type { padding-right: max(460px, calc(50vw - var(--max) / 2 + 460px)) !important; }
}
@media (max-width: 900px) {
    .page-home .legacy-content > .banner:first-of-type { min-height: 0 !important; padding-top: 32px !important; }
}

/* --- Бутони от старото съдържание ------------------------------------------------------------ */
.legacy-content .button {
    border-radius: 999px !important;
    padding: 10px 26px !important;
    margin: 8px 4px;
    box-shadow: none !important;
}
.legacy-content .button span, .legacy-content .banner .button span { color: inherit !important; }
.legacy-content .button.white { background: var(--white); border-color: var(--white); color: var(--purple) !important; }
.legacy-content .button.white.is-outline { background: transparent; color: var(--white) !important; }
.legacy-content .button.white:hover { background: var(--green); border-color: var(--green); color: var(--text-on-green) !important; }
.legacy-content .button.secondary, .legacy-content > .banner .button { background: var(--green); border-color: var(--green); color: var(--text-on-green) !important; }
.legacy-content > .banner .button span { color: var(--text-on-green) !important; }

/* --- Снимки от WordPress --------------------------------------------------------------------- */
.legacy-content .alignright { float: right; margin: 4px 0 16px 24px; max-width: 45%; }
.legacy-content .alignleft { float: left; margin: 4px 24px 16px 0; max-width: 45%; }
.legacy-content .aligncenter { display: block; margin: 16px auto; }
.legacy-content .wp-caption { max-width: 100%; margin: 16px 0; }
.legacy-content .wp-caption img { display: block; }
.legacy-content .wp-caption-text, .legacy-content figcaption { font-size: 0.9rem; color: var(--text); padding-top: 6px; }
.legacy-content::after { content: ""; display: table; clear: both; }
@media (max-width: 600px) {
    .legacy-content .alignright, .legacy-content .alignleft { float: none; display: block; margin: 16px auto; max-width: 100%; }
}

/* --- Бутони за споделяне (В5 А): собствени знаци в кръг вместо иконите на Flatsome ----------- */
.legacy-content .blog-share { clear: both; margin: 40px 0 0; text-align: center; }
.legacy-content .share-icons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.legacy-content .share-icons a.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    min-height: var(--tap);
    padding: 0 !important;
    margin: 0;
    border: 2px solid var(--purple);
    border-radius: 50% !important;
    background: transparent;
    color: var(--purple) !important;
    font-family: var(--heading);
    font-size: 1rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
.legacy-content .share-icons a.icon:hover { background: var(--purple); color: var(--white) !important; }
.legacy-content .share-icons a.show-for-medium { display: none; }
@media (max-width: 850px) { .legacy-content .share-icons a.show-for-medium { display: inline-flex; } }
.legacy-content .share-icons i { font-style: normal; }
.legacy-content .share-icons .icon-facebook::before { content: "f"; content: "f" / ""; }
.legacy-content .share-icons .icon-twitter::before { content: "X"; content: "X" / ""; }
.legacy-content .share-icons .icon-envelop::before { content: "@"; content: "@" / ""; }
.legacy-content .share-icons .icon-pinterest::before { content: "P"; content: "P" / ""; }
.legacy-content .share-icons .icon-linkedin::before { content: "in"; content: "in" / ""; }
.legacy-content .share-icons .icon-whatsapp::before { content: "W"; content: "W" / ""; }
.legacy-content .icon-angle-down, .legacy-content .icon-angle-right, .legacy-content .icon-angle-left { display: none; }

/* --- Контакти: старата форма (Contact Form 7) е скрита до етап 6 (В13 А) ---------------------- */
.page-contacts .legacy-content .wpcf7 { display: none !important; }
.page-contacts .legacy-content .section .dark h2 { margin-top: 0; }
/* Етап 4, стъпка В: заглавието над картата — по-голямо; отстоянието над него е по-малко,
   за да остане горният ръб на картата на същото място (измерено при 1366 и 390 px). */
.page-contacts .legacy-content .section .dark h2 { font-size: var(--contacts-h2); line-height: 1.1; }
.page-contacts .legacy-content > .section:first-of-type { padding-top: var(--contacts-gap); }
.page-contacts { --contacts-h2: 3rem; --contacts-gap: 2px; }
@media (max-width: 700px) {
    .page-contacts { --contacts-h2: 1.75rem; --contacts-gap: 21px; }  /* 28 px: и „DIVI Accounting office address“ (en) остава на 1 ред */
}
.page-contacts .legacy-content iframe { height: 400px; border-radius: 12px; margin: 24px auto; }

/* H1 вътре в текста на статия (46 статии имат и такъв) — по-малък от заглавието на статията */
.page-article .legacy-content h1 { text-transform: none; font-size: clamp(1.6rem, 3vw, 2.1rem); }
