/* ==========================================================================
   ДГ „Слънце“ – Бургас (slancebs.com)
   Пълна съвместимост по EN 301 549 V3.2.1 / WCAG 2.1 & 2.2 Ниво AA
   ========================================================================== */

/* 1. Екранни четци (Screen-reader only) */
.sr-only,
.a11y-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 2. Връзки за прескачане на повтарящи се блокове (WCAG 2.4.1) */
.a11y-skip-links {
    position: relative;
    z-index: 100001;
}

.a11y-skip-link {
    position: fixed;
    top: -200px;
    left: 12px;
    z-index: 100002;
    background-color: #002b49 !important;
    color: #ffffff !important;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: underline !important;
    border: 3px solid #ffbf00;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    transition: top 0.15s ease-in-out;
}

.a11y-skip-link:focus,
.a11y-skip-link:active {
    top: 12px;
    color: #ffffff !important;
}

/* 3. Видим клавиатурен фокус навсякъде (WCAG 2.4.7 & 2.4.11) */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
summary:focus,
[role="button"]:focus,
[tabindex]:not([tabindex="-1"]):focus,
.bd-menu-3.nav-pills .bd-menuitem-3 > a:focus,
.bd-menu-4 .bd-menuitem-4 > a:focus,
.bd-menu-23.nav-pills .bd-menuitem-23 > a:focus,
.bd-menu-24 .bd-menuitem-24 > a:focus,
.bd-menu-47 .bd-menuitem-43 > a:focus,
.bd-menu-50.nav-pills .bd-menuitem-39 > a:focus,
.bd-menu-54.nav-pills .bd-menuitem-54 > a:focus,
.bd-menu-55 .bd-menuitem-55 > a:focus,
.bd-responsivemenu-11 .bd-menuitem-10 > a:focus,
.bd-responsivemenu-15 .bd-menuitem-13 > a:focus,
.bd-accordion .bd-menuitem-14 > a:focus,
.bd-indicators > li > a:focus {
    outline: 3px solid #ffbf00 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px #002b49 !important;
}

main#main-content:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 4. Преоразмеряване до 200% и Reflow при 320px ширина (WCAG 1.4.4, 1.4.10) */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    color: #1f2937;
    background-color: #ffffff;
    line-height: 1.55;
}

img {
    max-width: 100%;
    height: auto;
}

main a,
article a,
.bd-postcontent-2 a,
.bd-postcontent-3 a,
.bd-postcontent-4 a,
.bd-postcontent-5 a,
.bd-postcontent-6 a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* 5. Цветови контраст и четливост на връзки, бутони и заглавия (WCAG 1.4.1, 1.4.3) */
/* Основни текстови връзки (контраст 8.88:1 върху бяло + подчертаване) */
.bd-postcontent-2 a:not(.btn):not(.bd-button),
.bd-postcontent-3 a:not(.btn):not(.bd-button),
.bd-postcontent-4 a:not(.btn):not(.bd-button),
.bd-postcontent-5 a:not(.btn):not(.bd-button),
.bd-postcontent-6 a:not(.btn):not(.bd-button),
main .item-page a:not(.btn):not(.bd-button),
main .jg_gallery a,
main .jg_category a {
    color: #004b87 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

.bd-postcontent-2 a:not(.btn):not(.bd-button):hover,
.bd-postcontent-3 a:not(.btn):not(.bd-button):hover,
.bd-postcontent-4 a:not(.btn):not(.bd-button):hover,
.bd-postcontent-5 a:not(.btn):not(.bd-button):hover,
.bd-postcontent-6 a:not(.btn):not(.bd-button):hover,
main .item-page a:not(.btn):not(.bd-button):hover {
    color: #7a0000 !important;
    background-color: #eef6ff;
}

/* Заглавие и описание в хедъра */
.bd-block-7 .bd-site-title,
.bd-block-7 .media-heading {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: #004b87 !important;
}

.bd-block-7 .bd-site-title a,
.bd-block-7 .media-heading a {
    color: #004b87 !important;
    text-decoration: none;
}

.bd-block-7 .bd-site-title a:hover,
.bd-block-7 .media-heading a:hover {
    text-decoration: underline !important;
    color: #002b49 !important;
}

.bd-block-7 .bd-blockcontent:not(.shape-only) {
    color: #0b3d59 !important;
    font-size: 15px;
    line-height: 1.5;
}

/* Странични блокове и главно меню (position-7 -> .bd-block-10) */
.bd-block-10 .bd-blockheader {
    background-color: #00558c !important;
    background-image: none !important;
    padding: 8px 12px !important;
    border-radius: 6px 6px 0 0;
}

.bd-block-10 .bd-blockheader h2,
.bd-block-10 .bd-blockheader h3,
.bd-block-10 .bd-blockheader h4 {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    margin: 0 !important;
}

.bd-block-2 .bd-blockheader {
    background-color: #1e6b1e !important;
}

.bd-block-2 .bd-blockheader h2,
.bd-block-2 .bd-blockheader h4,
.bd-block-14 .bd-blockheader h4,
.bd-block-19 .bd-blockheader h4,
.bd-block-21 .bd-blockheader h4 {
    color: #ffffff !important;
}

.bd-block-14 .bd-blockheader { background-color: #00558c !important; }
.bd-block-19 .bd-blockheader { background-color: #1e6b1e !important; }
.bd-block-21 .bd-blockheader { background-color: #8a4b00 !important; }

/* Елементи в страничното меню (Главно меню и Групи) */
.bd-block-10 ul.menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bd-block-10 ul.menu li {
    margin-bottom: 3px;
}

.bd-block-10 ul.menu li a {
    display: block;
    padding: 8px 10px;
    color: #1a202c !important;
    background-color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 4px;
    text-decoration: none !important;
    border-left: 4px solid transparent;
}

.bd-block-10 ul.menu li a:hover {
    background-color: #e6f2ff !important;
    color: #002b49 !important;
    text-decoration: underline !important;
    border-left-color: #00558c;
}

.bd-block-10 ul.menu li.current > a,
.bd-block-10 ul.menu li.active > a,
.bd-block-10 ul.menu li a[aria-current="page"] {
    background-color: #004b87 !important;
    color: #ffffff !important;
    font-weight: 700;
    border-left: 4px solid #ffbf00;
}

/* Хоризонтално меню (ако бъде активирано в position-1) */
.bd-menu-3.nav-pills .bd-menuitem-3 > a,
.bd-menu-3.nav-pills .bd-menuitem-3 > a:link {
    color: #1f2937 !important;
}

.bd-menu-3.nav-pills .bd-menuitem-3:not(.active) > a:hover:not(.active),
.bd-menu-3.nav-pills .bd-menuitem-3 > a.active,
.bd-menu-3.nav-pills .bd-menuitem-3.active > a {
    background-color: #004b87 !important;
    color: #ffffff !important;
}

.bd-menu-4 .bd-menuitem-4 > a,
.bd-menu-4 .bd-menuitem-4 > a:link {
    color: #1f2937 !important;
}

/* Заглавия на публикации в блог и единични страници */
h1.bd-postheader-3,
h1.bd-postheader-4,
h1.bd-postheader-5,
h1.bd-postheader-6,
h2.bd-postheader-2,
h2.bd-postheader-3,
h2.bd-postheader-4 {
    color: #003b6b !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
}

h1.bd-postheader-3 {
    font-size: 27px;
    margin-top: 0;
    margin-bottom: 12px;
}

h2.bd-postheader-2 a,
h1.bd-postheader-3 a {
    color: #004b87 !important;
    font-weight: 700 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

h2.bd-postheader-2 a:hover,
h1.bd-postheader-3 a:hover {
    color: #002b49 !important;
}

.bd-postreadmore-2.btn-primary {
    background-color: #004b87 !important;
    border-color: #003b6b !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 8px 16px;
    min-height: 40px;
}

.bd-postreadmore-2.btn-primary:hover,
.bd-postreadmore-2.btn-primary:focus {
    background-color: #002b49 !important;
    color: #ffffff !important;
}

/* 6. Карусел – висок контраст на надписи и контроли + бутон Пауза (WCAG 2.2.2) */
#carousel-2 {
    position: relative;
}

.bd-textblock-13,
.bd-textblock-10,
.bd-textblock-15,
.bd-textblock-16 {
    background-color: rgba(255, 255, 255, 0.94) !important;
    padding: 8px 16px !important;
    border-radius: 6px;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.bd-textblock-13 { color: #004b87 !important; }
.bd-textblock-10 { color: #8c004f !important; }
.bd-textblock-15 { color: #1b5e20 !important; }
.bd-textblock-16 { color: #9e1b18 !important; }

.bd-carousel-2 span:before {
    background-color: rgba(0, 43, 73, 0.88) !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

.bd-carousel-2:hover span:before,
.bd-carousel-2:focus span:before {
    background-color: #002b49 !important;
    border-color: #ffbf00 !important;
}

/* v1.2.1: контролата е под снимката – върху нея закриваше надписа на слайда */
.a11y-carousel-controls {
    position: absolute;
    top: 100%;
    bottom: auto;
    right: 0;
    margin-top: 20px;
    z-index: 25;
}

/* v1.2.1: бутонът е под снимката, вдясно – като на dgmoriache.com, в синьото на сайта */
.a11y-carousel-toggle {
    background-color: #ffffff !important;
    color: #004b87 !important;
    border: 2px solid #004b87 !important;
    border-radius: 4px;
    padding: 5px 12px !important;
    font: 700 13px Arial, Helvetica, sans-serif;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.a11y-carousel-toggle:hover,
.a11y-carousel-toggle:focus {
    background-color: #004b87 !important;
    border-color: #004b87 !important;
    color: #ffffff !important;
    outline: 3px solid #ffbf00;
    outline-offset: 2px;
}

/* 7. Четирите кръгли секции и Инфо секцията на начална страница */
.bd-section-8 {
    color: #1f2937 !important;
}

.bd-section-8 h2,
.bd-section-8 h3 {
    color: #004b87 !important;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bd-section-1 .bd-layoutbox-5 {
    background-color: rgba(0, 43, 73, 0.86);
    border-radius: 12px;
    padding: 24px 20px;
    max-width: 920px;
    margin: 16px auto;
}

.bd-section-1 h2.bd-textblock-2,
.bd-section-1 h1.bd-textblock-2 {
    color: #ffffff !important;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.35;
    text-transform: uppercase;
    margin-top: 0;
}

.bd-section-1 .bd-textblock-7 {
    color: #ffffff !important;
    font-size: 17px;
    font-weight: 500;
}

.bd-linkbutton-2 a.bd-button-25[href],
.bd-button-25 {
    background-color: #004b87 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    font-weight: 700;
    border-radius: 6px;
}

.bd-linkbutton-2 a.bd-button-25[href]:hover,
.bd-linkbutton-2 a.bd-button-25[href]:focus {
    background-color: #ffffff !important;
    color: #002b49 !important;
    border-color: #ffbf00 !important;
}

/* 8. Секция Контакти, Карта и Футър */
.bd-section-2 {
    background-color: #003b6b !important;
    background-image: linear-gradient(180deg, #004b87 0%, #002b49 100%) !important;
    height: auto !important;
    min-height: 410px;
    padding: 24px 0;
    color: #ffffff !important;
}

.bd-section-2 h2,
.bd-section-2 h3,
.bd-section-2 p,
.bd-section-2 a {
    color: #ffffff !important;
}

.bd-section-2 a {
    text-decoration: underline !important;
}

.bd-section-2 a:hover {
    color: #ffdf80 !important;
}

.bd-googlemap-2 {
    min-height: 320px;
}

.bd-googlemap-2 iframe {
    min-height: 320px;
    border: 0;
}

.bd-layoutbox-9 {
    background-color: #002b49 !important;
    border-top: 2px solid #79d2f7;
    padding: 12px 16px;
}

.bd-layoutbox-9 p,
.bd-layoutbox-9 a {
    color: #ffffff !important;
}

.a11y-footer-links {
    text-align: center;
    padding: 6px 12px 10px;
    font-size: 14px;
}

.a11y-footer-links a {
    color: #ffffff !important;
    text-decoration: underline !important;
    font-weight: 600;
    margin: 0 10px;
    display: inline-block;
    padding: 4px 2px;
}

.a11y-footer-links a:hover {
    color: #ffdf80 !important;
}

/* Бутони, странициране и нагоре */
button:not([class]):hover,
input[type="submit"]:not([class]):hover,
input[type="button"]:not([class]):hover,
.bd-button:hover {
    background-color: #003b6b !important;
    color: #ffffff !important;
}

.bd-pagination > li.bd-paginationitem-1 > a,
.bd-pagination > li.bd-paginationitem-1 > span,
.bd-pagination-2 > li.bd-paginationitem-2 > a,
.bd-pagination-2 > li.bd-paginationitem-2 > span {
    color: #1f2937 !important;
    background-color: #f8fafc !important;
    border: 1px solid #64748b !important;
}

.bd-pagination > li.active.bd-paginationitem-1 > a,
.bd-pagination > li.active.bd-paginationitem-1 > span,
.bd-pagination-2 > li.active.bd-paginationitem-2 > a,
.bd-pagination-2 > li.active.bd-paginationitem-2 > span {
    background-color: #004b87 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.bd-backtotop-1 {
    background-color: #003b6b !important;
    color: #ffffff !important;
    border: 2px solid #ffffff;
    border-radius: 50%;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* 9. Достъпни таблици и текстови транскрипции */
.a11y-table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 16px 0;
}

table.a11y-data-table,
main table {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border-collapse: collapse;
    margin: 12px 0;
}

table.a11y-data-table caption,
main table caption {
    caption-side: top;
    text-align: left;
    font-weight: 700;
    color: #003b6b;
    padding: 8px 4px;
    font-size: 16px;
}

table.a11y-data-table th,
main table th {
    background-color: #004b87;
    color: #ffffff;
    font-weight: 700;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    text-align: left;
}

table.a11y-data-table td,
main table td {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    color: #1f2937;
    vertical-align: top;
}

table.a11y-data-table tbody tr:nth-child(even) td {
    background-color: #f8fafc;
}

.a11y-text-transcript {
    background-color: #f8fafc;
    border-left: 4px solid #004b87;
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
    color: #1f2937;
}

.a11y-text-transcript h2,
.a11y-text-transcript h3 {
    color: #003b6b;
    margin-top: 12px;
    font-size: 19px;
    font-weight: 700;
}

/* 10. Помощник за достъпност (Accessibility Widget) */
.a11y-widget {
    position: fixed;
    bottom: 20px;
    left: 16px;
    z-index: 99999;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

.a11y-widget-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #003b6b !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    border-radius: 28px;
    padding: 10px 16px !important;
    min-height: 46px;
    min-width: 46px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.a11y-widget-toggle:hover,
.a11y-widget-toggle:focus {
    background-color: #002240 !important;
    border-color: #ffbf00 !important;
}

.a11y-widget-panel {
    position: absolute;
    bottom: 58px;
    left: 0;
    width: 310px;
    max-width: calc(100vw - 32px);
    background-color: #ffffff;
    color: #1f2937;
    border: 2px solid #003b6b;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

.a11y-widget-panel[hidden] {
    display: none !important;
}

.a11y-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.a11y-widget-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #003b6b;
}

.a11y-widget-close {
    background-color: #e2e8f0 !important;
    color: #1f2937 !important;
    border: 1px solid #64748b !important;
    border-radius: 6px;
    min-width: 34px;
    min-height: 34px;
    padding: 4px 8px !important;
    font-weight: 700;
    cursor: pointer;
}

.a11y-widget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.a11y-widget-btn {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #64748b !important;
    border-radius: 6px;
    padding: 8px 10px !important;
    min-height: 40px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    white-space: normal !important;
    line-height: 1.25;
}

.a11y-widget-btn:hover {
    background-color: #e2e8f0 !important;
}

.a11y-widget-btn[aria-pressed="true"] {
    background-color: #004b87 !important;
    color: #ffffff !important;
    border-color: #002b49 !important;
}

.a11y-widget-footer {
    border-top: 1px solid #cbd5e1;
    padding-top: 10px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.a11y-widget-footer a {
    color: #004b87 !important;
    font-weight: 700;
    text-decoration: underline !important;
}

/* Режими от Помощника за достъпност */
html.a11y-font-lg { font-size: 112.5% !important; }
html.a11y-font-xl { font-size: 125% !important; }
html.a11y-font-lg body,
html.a11y-font-lg p,
html.a11y-font-lg li,
html.a11y-font-lg td,
html.a11y-font-lg a { font-size: 1.12em !important; line-height: 1.65 !important; }

html.a11y-font-xl body,
html.a11y-font-xl p,
html.a11y-font-xl li,
html.a11y-font-xl td,
html.a11y-font-xl a { font-size: 1.25em !important; line-height: 1.7 !important; }

html.a11y-readable-font body,
html.a11y-readable-font p,
html.a11y-readable-font li,
html.a11y-readable-font a,
html.a11y-readable-font h1,
html.a11y-readable-font h2,
html.a11y-readable-font h3 {
    font-family: Verdana, Tahoma, Arial, sans-serif !important;
    letter-spacing: 0.04em !important;
    word-spacing: 0.12em !important;
    line-height: 1.7 !important;
}

html.a11y-highlight-links a {
    background-color: #fff3b0 !important;
    color: #002244 !important;
    text-decoration: underline !important;
    outline: 1px solid #004b87;
}

html.a11y-high-contrast,
html.a11y-high-contrast body,
html.a11y-high-contrast .bd-pagebackground,
html.a11y-high-contrast .bd-pagebackground-13,
html.a11y-high-contrast .bd-sheetstyles,
html.a11y-high-contrast .bd-section-22,
html.a11y-high-contrast .bd-section-8,
html.a11y-high-contrast .bd-section-1,
html.a11y-high-contrast .bd-section-2,
html.a11y-high-contrast .bd-section-15,
html.a11y-high-contrast .bd-layoutbox-9,
html.a11y-high-contrast .bd-block-10 .bd-blockcontent,
html.a11y-high-contrast .a11y-text-transcript,
html.a11y-high-contrast table td {
    background-color: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
}

html.a11y-high-contrast h1,
html.a11y-high-contrast h2,
html.a11y-high-contrast h3,
html.a11y-high-contrast h4,
html.a11y-high-contrast p,
html.a11y-high-contrast li,
html.a11y-high-contrast span:not(.sr-only) {
    color: #ffffff !important;
}

html.a11y-high-contrast a,
html.a11y-high-contrast .bd-block-10 ul.menu li a {
    background-color: #000000 !important;
    color: #ffff00 !important;
    text-decoration: underline !important;
}

html.a11y-high-contrast .bd-block-10 ul.menu li.current > a,
html.a11y-high-contrast .bd-block-10 ul.menu li.active > a {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

/* 11. Намаляване на анимациите (WCAG 2.3.3 & потребителска настройка) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

@media (max-width: 767px) {
    .a11y-widget-toggle span.a11y-widget-label {
        display: none;
    }
    .a11y-carousel-controls {
        margin-top: 8px;
        right: 0;
    }
}

/* 12. v1.2.1: залепената горна лента (164px) не залепва при нисък прозорец.
   При увеличение 200% на лаптоп видимата височина пада под ~600px и лентата
   заемаше около половината екран (WCAG 1.4.4 / 1.4.10). */
@media (max-height: 600px) {
    [data-affix].affix {
        position: relative !important;
        top: auto !important;
    }
    [data-affix] + .bd-affix-fake {
        display: none !important;
    }
}
