﻿/* ==========================================================================
   Accessibility widget (შშმ პირებისთვის ვიჯეტი)
   Markup: Views/Shared/Widget.cshtml, logic: Scripts/accessibility.js
   The widget lives outside #wrapper, so the page-wide rules below
   (which are all scoped to #wrapper) never change the widget itself.
   ========================================================================== */

/* ---------- Toggle button (bottom right) ---------- */
.a11y-widget {
    font-family: "FiraGO", "BPG Arial", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: normal;
    color: #1a1a1a;
}

/* Holds the SVG filter of the red image mode. Not display: none, as some
   browsers then ignore the filter. */
.a11y-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.a11y-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    background-color: #CB0C24;
    color: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

    .a11y-toggle:hover,
    .a11y-toggle[aria-expanded="true"] {
        background-color: #A50A1D;
        transform: scale(1.06);
    }

    .a11y-toggle svg {
        display: block;
        width: 46px;
        height: 46px;
    }

/* ---------- Panel ---------- */
.a11y-panel {
    position: fixed;
    right: 20px;
    bottom: 90px;
    z-index: 2147483000;
    box-sizing: border-box;
    width: 420px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 0 20px 20px;
    background-color: #fff;
    color: #1a1a1a;
    border-top: 4px solid #CB0C24;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    text-align: left;
}

    .a11y-panel[hidden] {
        display: none !important;
    }

.a11y-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 -20px 2px;
    padding: 12px 12px 12px 20px;
    border-bottom: 1px solid #ececec;
}

.a11y-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
}

.a11y-close {
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #CB0C24;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

    .a11y-close:hover {
        background-color: #fdecee;
    }

.a11y-group {
    padding: 14px 0 16px;
    border-bottom: 1px solid #ececec;
}

.a11y-label {
    margin: 0 0 10px;
    font-size: 15px;
    color: #444;
}

.a11y-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- Option buttons ---------- */
.a11y-btn {
    box-sizing: border-box;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    background-color: #fff;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

    .a11y-btn:not(.a11y-swatch):hover {
        border-color: #CB0C24;
    }

    .a11y-btn:not(.a11y-swatch)[aria-pressed="true"] {
        border: 2px solid #CB0C24;
        background-color: #fdecee;
        color: #A50A1D;
        font-weight: 600;
    }

/* Square colour swatches ("A" and "img") */
.a11y-swatch {
    min-width: 44px;
    padding: 8px 10px;
    border-color: #1a1a1a;
    font-family: Arial, sans-serif;
    font-size: 17px;
}

.a11y-theme-default-btn { background-color: #fff; color: #000; }
.a11y-theme-dark-btn { background-color: #000; color: #fff; }
.a11y-theme-blue-btn { background-color: #99ccff; color: #003366; }
.a11y-img-color-btn { background-color: #008000; color: #fff; }
.a11y-img-red-btn { background-color: #ff0000; color: #fff; }
.a11y-img-gray-btn { background-color: #000; color: #fff; }

    .a11y-swatch:hover {
        opacity: 0.85;
    }

    .a11y-swatch[aria-pressed="true"] {
        box-shadow: 0 0 0 2px #fff, 0 0 0 4px #CB0C24;
    }

.a11y-reset {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 12px 18px;
    border: 2px solid #CB0C24;
    border-radius: 6px;
    background-color: #fff;
    color: #CB0C24;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

    .a11y-reset:hover {
        background-color: #CB0C24;
        color: #fff;
    }

.a11y-toggle:focus-visible,
.a11y-close:focus-visible,
.a11y-btn:focus-visible,
.a11y-reset:focus-visible {
    outline: 3px solid #1d6fb8;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .a11y-toggle {
        right: 12px;
        bottom: 12px;
        width: 50px;
        height: 50px;
    }

        .a11y-toggle svg {
            width: 40px;
            height: 40px;
        }

    .a11y-panel {
        right: 12px;
        left: 12px;
        bottom: 74px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 90px);
    }
}

/* ==========================================================================
   Page-wide settings, switched by classes on <html>.
   Font size is scaled from JS, because the site's CSS uses px everywhere.
   JS also tags page elements (see scan() in accessibility.js):
     .a11y-bg        has its own solid background -> recoloured by the themes
     .a11y-accent    small coloured box (red button, badge, calendar "today")
                     with readable text -> left as it is, with its contents
     .a11y-grad      gradient background
     .a11y-bgimg     background image (.a11y-icon when small)
     .a11y-on-photo  text sitting on a photo -> gets a solid backing
   ========================================================================== */

/* Set by JS for a moment while it measures the page */
html.a11y-measuring #wrapper,
html.a11y-measuring #wrapper * {
    transition: none !important;
}

/* Font size: the site's fixed-width "see more" buttons grow with their text */
html.a11y-fs-1 #wrapper .homepageSlider-btn,
html.a11y-fs-2 #wrapper .homepageSlider-btn,
html.a11y-fs-1 #wrapper .seeMoreA,
html.a11y-fs-2 #wrapper .seeMoreA {
    align-self: flex-start;
    width: auto !important;
    min-width: 200px;
    height: auto !important;
    min-height: 48px;
    padding-right: 60px !important;
}

/* (the biodiversity button's arrow sits 40px in from its right edge) */
html.a11y-fs-1 #wrapper .biodivercityText button,
html.a11y-fs-2 #wrapper .biodivercityText button {
    align-self: flex-start;
    width: auto !important;
    min-width: 200px;
    padding-right: 70px !important;
}

/* The calendar's weekday names share the width evenly instead of each
   column being at least as wide as its name */
html.a11y-fs-1 #wrapper #content .calendar .days,
html.a11y-fs-2 #wrapper #content .calendar .days,
html.a11y-ls-1 #wrapper #content .calendar .days,
html.a11y-ls-2 #wrapper #content .calendar .days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    column-gap: 4px;
}

    html.a11y-fs-1 #wrapper #content .calendar .day,
    html.a11y-fs-2 #wrapper #content .calendar .day,
    html.a11y-ls-1 #wrapper #content .calendar .day,
    html.a11y-ls-2 #wrapper #content .calendar .day {
        padding-left: 2px;
        padding-right: 2px;
    }

/* News cards: the date and the "see more" button each stay on one line,
   and the button moves under the date when both don't fit side by side */
html.a11y-fs-1 #wrapper .simpleNews .clickBlock,
html.a11y-fs-2 #wrapper .simpleNews .clickBlock,
html.a11y-ls-1 #wrapper .simpleNews .clickBlock,
html.a11y-ls-2 #wrapper .simpleNews .clickBlock {
    flex-wrap: wrap;
    gap: 8px;
}

    html.a11y-fs-1 #wrapper .simpleNews .clickBlock time,
    html.a11y-fs-2 #wrapper .simpleNews .clickBlock time,
    html.a11y-ls-1 #wrapper .simpleNews .clickBlock time,
    html.a11y-ls-2 #wrapper .simpleNews .clickBlock time,
    html.a11y-fs-1 #wrapper .simpleNews .clickBlock button,
    html.a11y-fs-2 #wrapper .simpleNews .clickBlock button,
    html.a11y-ls-1 #wrapper .simpleNews .clickBlock button,
    html.a11y-ls-2 #wrapper .simpleNews .clickBlock button {
        white-space: nowrap;
    }

/* Font size (medium and large): the top menu folds into a ☰ button at the
   right end of the header, after the language and search buttons; the logo
   stays on the left, all on one line. JS sets .a11y-compact-nav
   (with letter spacing alone, only once the menu no longer fits). The drop-
   down works with the site's own ☰ script (Views/Home/Menu.cshtml). */
html.a11y-compact-nav #header .menuBox {
    order: 1;
    align-self: center;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    margin-left: 12px;
    position: relative;
}

html.a11y-compact-nav #header .menuBox nav {   /* inner pages wrap the menu in a second nav */
    display: block;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    position: static;
}

/* (a round button like the search button next to it: grey lines on light grey) */
html.a11y-compact-nav #header nav.mainMenu > div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    position: static;
    border-radius: 50%;
    background-color: #F8F8F8;
    box-shadow: rgba(0, 0, 0, 0.03) 0 6px 24px 0, rgba(0, 0, 0, 0.04) 0 0 0 1px;
    cursor: pointer;
}

html.a11y-compact-nav #header nav.mainMenu > div .bars {
    display: block;
    height: auto;
}

html.a11y-compact-nav #header nav.mainMenu > div #nav-icon1 {
    display: block;
    width: 22px;
    height: 12px;
    margin: 0;
}

html.a11y-compact-nav #header nav.mainMenu > div #nav-icon1 span {
    background-color: #818181;
}

html.a11y-compact-nav #header .logoSpace {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
}

html.a11y-compact-nav #header .langSearch {
    margin-left: auto;
}

/* The language button is a fixed 75px wide; with bigger text it grows, so
   "ქარ"/"Eng" stays clear of the arrow on its right */
html.a11y-fs-1 #header .languageBox,
html.a11y-fs-2 #header .languageBox {
    width: auto;
    min-width: 75px;
}

html.a11y-fs-1 #header .lang-btn,
html.a11y-fs-2 #header .lang-btn {
    padding-right: 28px;
    white-space: nowrap;
}

html.a11y-compact-nav #header nav.mainMenu > ul {
    display: none;
    flex-direction: column;
    width: max-content;
    min-width: 300px;
    max-width: 85vw;
    height: max-content;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 20px #c1c3c7;
}

html.a11y-compact-nav #header nav.mainMenu > ul > li {
    align-items: stretch;
    padding: 0;
    border-bottom: 0;
}

html.a11y-compact-nav #header nav.mainMenu > ul > li > a {
    display: block;
    padding: 14px 1em;
    color: #0E0E0E;
    text-align: left;
}

html.a11y-compact-nav #header nav.mainMenu > ul > li:hover > a {
    color: #fff;
}

html.a11y-compact-nav #header nav.mainMenu > ul ul {
    display: none;
    width: 100%;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    box-shadow: none;
    border-top: 1px solid rgba(199, 199, 199, 0.3);
}

html.a11y-compact-nav #header nav.mainMenu > ul > li:hover ul {
    display: block;
}

html.a11y-compact-nav #header nav.mainMenu > ul ul li a {
    display: block;
    padding: 14px 2em;
    text-align: left;
}

/* Line spacing */
html.a11y-lh-1 #wrapper,
html.a11y-lh-1 #wrapper * {
    line-height: 1.9 !important;
}

html.a11y-lh-2 #wrapper,
html.a11y-lh-2 #wrapper * {
    line-height: 2.4 !important;
}

/* Letter spacing */
html.a11y-ls-1 #wrapper,
html.a11y-ls-1 #wrapper * {
    letter-spacing: 0.08em !important;
}

html.a11y-ls-2 #wrapper,
html.a11y-ls-2 #wrapper * {
    letter-spacing: 0.16em !important;
}

/* ---------- Black theme ---------- */
html.a11y-theme-dark body,
html.a11y-theme-dark #wrapper,
html.a11y-theme-dark #wrapper .a11y-bg:not(.a11y-accent *),
html.a11y-theme-dark #wrapper .a11y-grad:not(.a11y-accent):not(.a11y-accent *) {
    background-color: #000 !important;
}

html.a11y-theme-dark #wrapper,
html.a11y-theme-dark #wrapper *:not(.a11y-accent):not(.a11y-accent *) {
    color: #fff !important;
    text-shadow: none !important;
}

html.a11y-theme-dark #wrapper .a11y-on-photo:not(.a11y-accent):not(.a11y-accent *) {
    background-color: #000 !important;
    box-shadow: 0 0 0 12px #000 !important;
}

html.a11y-theme-dark #wrapper input::placeholder,
html.a11y-theme-dark #wrapper textarea::placeholder {
    color: #ccc !important;
}

/* ---------- Light blue theme ---------- */
html.a11y-theme-blue body,
html.a11y-theme-blue #wrapper,
html.a11y-theme-blue #wrapper .a11y-bg:not(.a11y-accent *),
html.a11y-theme-blue #wrapper .a11y-grad:not(.a11y-accent):not(.a11y-accent *) {
    background-color: #99ccff !important;
}

html.a11y-theme-blue #wrapper,
html.a11y-theme-blue #wrapper *:not(.a11y-accent):not(.a11y-accent *) {
    color: #003366 !important;
    text-shadow: none !important;
}

html.a11y-theme-blue #wrapper .a11y-on-photo:not(.a11y-accent):not(.a11y-accent *) {
    background-color: #99ccff !important;
    box-shadow: 0 0 0 12px #99ccff !important;
}

html.a11y-theme-blue #wrapper input::placeholder,
html.a11y-theme-blue #wrapper textarea::placeholder {
    color: #335c85 !important;
}

/* The ☰ menu in the themes: its drop-down has the theme's background, and the
   three lines of the button the theme's text colour */
html.a11y-theme-dark #wrapper #header .menuBox nav > ul ul,
html.a11y-theme-dark.a11y-compact-nav #wrapper #header .menuBox nav > ul {
    background-color: #000 !important;
    box-shadow: 0 0 0 1px #fff !important;
}

html.a11y-theme-blue #wrapper #header .menuBox nav > ul ul,
html.a11y-theme-blue.a11y-compact-nav #wrapper #header .menuBox nav > ul {
    background-color: #99ccff !important;
    box-shadow: 0 0 0 1px #003366 !important;
}

html.a11y-theme-dark #wrapper #header nav div #nav-icon1 span {
    background-color: #fff !important;
}

html.a11y-theme-dark #wrapper #header nav.mainMenu > div {
    background-color: #000 !important;
    box-shadow: 0 0 0 1px #fff !important;
}

html.a11y-theme-blue #wrapper #header nav.mainMenu > div {
    background-color: #99ccff !important;
    box-shadow: 0 0 0 1px #003366 !important;
}

html.a11y-theme-blue #wrapper #header nav div #nav-icon1 span {
    background-color: #003366 !important;
}

/* On tablets and phones the search opens as a bar under the header
   (responsive.css); it takes the theme's background too */
@media (max-width: 999px) {
    html.a11y-theme-dark #wrapper #header .sb-search.open .sb-form {
        background-color: #000 !important;
        box-shadow: 0 0 0 1px #fff !important;
    }

    html.a11y-theme-blue #wrapper #header .sb-search.open .sb-form {
        background-color: #99ccff !important;
        box-shadow: 0 0 0 1px #003366 !important;
    }
}

/* The site marks the hovered menu item red; dark blue text is unreadable on it */
html.a11y-theme-blue #wrapper #header .menuBox nav > ul > li:hover {
    background-color: #003366 !important;
}

html.a11y-theme-blue #wrapper #header .menuBox nav > ul > li:hover > a {
    color: #fff !important;
}

/* Shared by both themes */
html.a11y-theme-dark #wrapper .a11y-grad:not(.a11y-accent):not(.a11y-accent *),
html.a11y-theme-blue #wrapper .a11y-grad:not(.a11y-accent):not(.a11y-accent *) {
    background-image: none !important;
}

html.a11y-theme-dark #wrapper .a11y-accent,
html.a11y-theme-blue #wrapper .a11y-accent {
    background-color: var(--a11y-solid) !important;
    color: var(--a11y-text) !important;
}

html.a11y-theme-dark #wrapper .a11y-on-photo,
html.a11y-theme-blue #wrapper .a11y-on-photo {
    border-radius: 4px;
}

html.a11y-theme-dark #wrapper :is(h1, h2, h3, h4, h5, h6, p).a11y-on-photo,
html.a11y-theme-blue #wrapper :is(h1, h2, h3, h4, h5, h6, p).a11y-on-photo {
    width: fit-content !important;
    max-width: 100%;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* ---------- Images: red ----------
   Pictures are recoloured in shades of red, nothing is hidden. Pictures use
   the SVG filter in Widget.cshtml. Background photos (.a11y-photo, set by JS)
   are blended with a red background instead, which looks the same and keeps
   the captions and buttons on top of them in their own colours. */
html.a11y-img-red #wrapper img,
html.a11y-img-red #wrapper video,
html.a11y-img-red #wrapper canvas,
html.a11y-img-red #wrapper iframe {
    filter: url(#a11y-red-filter) !important;
}

html.a11y-img-red #wrapper .a11y-bgimg.a11y-photo {
    background-color: #e0001b !important;
    background-blend-mode: luminosity !important;
}

/* ---------- Images: black and white ---------- */
html.a11y-img-gray #wrapper img,
html.a11y-img-gray #wrapper picture,
html.a11y-img-gray #wrapper video,
html.a11y-img-gray #wrapper iframe,
html.a11y-img-gray #wrapper .a11y-bgimg {
    filter: grayscale(100%) !important;
}
