/* Белый фон и черный шрифт */
body {
  --md-default-bg-color: white !important;
  --md-footer-bg-color--light: white !important;
  --md-footer-fg-color--lighter: #ffffff !important;
  --md-footer-bg-color--dark: #ffffffff !important;
  --md-footer-fg-color--light: #000000 !important;
  --md-footer-fg-color--dark: #000000 !important;
}

/* Заголовки капсом */
h1 {
  text-transform: uppercase;
  color: black !important;
}

/* Сссылки в футере */
.md-footer-links {
  margin-left: 10px;
  margin-right: 10px;
  margin-bottom: 20px;
  margin-top: 20px;
  font-size: 14px;
  text-align: left;
}

.links-list {
  text-align: left;
  font-size: 14px;
  color: black !important;
  padding-top: 20px;
  width: 100%;
  line-height: 1.6;
}

/* Add some padding to the footer */
.md-footer-meta {
  padding: 10px 20px;
}

.md-footer-donations {
  text-align: center;
  width: 100%;
  margin: 1.5rem 0;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  font-size: 1.5625em;
  line-height: 1.6;
  color: black;
  display: block;
  border-top: 3px solid black !important;
  border-bottom: 3px solid black !important;
}

/* a.link {
  color: black !important;
  text-decoration: underline;
}

a.link:hover {
  color: #000000 !important;
}

a.link:visited {
  color: #000000 !important;
} */

.links-list li {
  list-style-type: none;
  margin: 0 !important;
  padding: 0 !important;
}

.links-list {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 2.1;
}

/* адаптация по поиск Гугла на сайте */
/* body>header>nav.md-header__inner.md-grid>label:nth-child(3) {
  display: none;
} */

/* ============================================
   Google Custom Search — inside Material search dialog
   (same approach as original MkDocs site)
   ============================================ */

/* Hide the original search icon label (3rd label) like original site does */
body > header > nav.md-header__inner.md-grid > label:nth-child(3) {
  display: none;
}

/* Style the GCSE input box */
.gsc-input-box {
  border-radius: 0 !important;
  border: 1px solid #ccc !important;
  height: 32px !important;
}

.gsc-input {
  padding: 0 8px !important;
}

/* Style the search button */
.gsc-search-button-v2,
td.gsc-search-button>button {
  border-radius: 0 !important;
  background-color: #4051b5 !important;
  border: none !important;
  padding: 8px 16px !important;
  cursor: pointer !important;
}

.gsc-search-button-v2:hover,
td.gsc-search-button>button:hover {
  background-color: #303f9f !important;
}

/* Hide the powered by Google branding in the input */
.gsib_b {
  display: none !important;
}


@media (min-width: 650px) {
  .md-footer-links {
    text-align: left;
    width: 50%;
    margin-bottom: 0;
    margin-top: 10px;
    padding-left: 0.2em;
  }

  .md-footer-text {
    text-align: right;
    width: 35%;
    padding-top: 0px;
    line-height: 2.1;
    margin-top: 10px;
    padding: 0.1em 1.3em !important;
    font-size: 14px !important;
  }

  /* Черная полоса над футером */
  .md-footer-meta__inner.md-grid {
    border-top: 7px solid black !important;
  }
}

#_1>a {
  display: none;
}

.md-tabs__link {
  text-transform: uppercase;
}

@font-face {
  font-family: "Grotesk HK";
  src: url("../fonts/HKGrotesk-Medium.c471e9ace164.otf");
}

@media screen and (max-width: 76.1875em) {
  .md-nav--primary .md-nav__title .md-logo {
    display: none;
  }

  .md-nav--primary .md-nav__title {
    padding: 0rem 0.8rem 0.2rem;
    height: 2.4rem;
  }

  .md-container {
    border-top: 4px solid black !important;
  }

  .md-footer-meta {
    padding: 0;
  }

  /* Черная полоса над футером */
  .md-footer-meta__inner.md-grid {
    border-top: 4px solid black !important;
  }

  .md-footer-donations {
    text-align: left;
    padding: 0 0.5rem;
  }

}

.md-header__inner {
  padding: 0 0;
  height: 2.4rem;
  overflow: hidden;
}

/* Vertically center GCSE search within the header */
.md-search {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 !important;
}

.md-header__inner .gcse-search,
.md-header__inner .gsc-control-cse {
  padding: 0 !important;
  margin: 0 !important;
}

.md-header__inner .gsc-search-box {
  margin: 0 !important;
}

.md-header__inner .gsc-input-box {
  height: 28px !important;
  overflow: hidden !important;
}

.md-header__inner .gsib_a {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.md-header__inner table.gsc-input {
  height: 100% !important;
}

.md-tabs__item {
  text-transform: uppercase;
}

.md-footer-text {
  line-height: 1.6;
  padding: 0.1em 0.7em !important;
  font-size: 14px !important;
  margin-bottom: 10px;
  /* display: block-inline; */
}

.md-content__inner {
  margin: 0 0.8rem 5rem;
}

body>header>nav.md-tabs>div>ul {
  margin-left: 0.3rem !important;
}

header {
  box-shadow: none !important;
  border: none !important;
}

.md-tabs__link {
  opacity: 1 !important;
}

.md-tabs {
  border: none !important;
}

.md-tabs__list {
  border-bottom: 7px solid black !important;
}

/* Выравнять поиск */
@media screen and (min-width: 60em) {
  .md-search__inner {
    display: flex;
    align-items: center;
    padding: 0 !important;
  }
}

/* Убрать "Главная" на главной странице слева */
.md-nav__link.md-nav__link--index.md-nav__link--active {
  display: none;
}

.md-footer {
  color: black !important;
}

.links-list a:hover {
  color: black !important;
  /* font-weight: bold; */
}

.links-list a:visited {
  color: black !important;
  color: 400 !important;
}

.links-list> :active {
  color: black !important;
  color: 400 !important;
}

.md-header__topic:first-child {
  font-weight: 500 !important;
}

.call-to-action {
  margin-bottom: 10px;
  text-transform: uppercase;
}

nav>div>div>div:nth-child(1)>span>a {
  text-transform: uppercase;
  /* Ссылка на индексную слева в навигации*/
}

/* Sidebar scroll behavior: constrain height to viewport and enable internal scrolling */
.md-sidebar__scrollwrap {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.md-sidebar__scrollwrap:hover,
.md-sidebar__scrollwrap:focus-within {
  scrollbar-color: var(--md-default-fg-color--lighter) transparent;
}

.md-sidebar__scrollwrap::-webkit-scrollbar {
  width: 0.2rem;
}

.md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background-color: transparent;
}

.md-sidebar__scrollwrap:hover::-webkit-scrollbar-thumb,
.md-sidebar__scrollwrap:focus-within::-webkit-scrollbar-thumb {
  background-color: var(--md-default-fg-color--lighter);
}

/* Constrain sidebar height to viewport on desktop for internal scrolling */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-sidebar__scrollwrap {
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
  }
}

/* Tags page H1 styling */
.template-tagsindexpage .md-content__title {
  color: black !important;
  text-transform: uppercase;
}

.template-tagsindexpage .md-content__title a,
.template-tagsindexpage .md-content__title a:hover,
.template-tagsindexpage .md-content__title a:visited,
.template-tagsindexpage h1.md-content__title a.md-header__topic {
  color: black !important;
  text-decoration: none;
}

/* ============================================
   Footer Styles (matching original MkDocs)
   ============================================ */
.md-footer {
  background-color: white;
  color: #000;
  margin-top: 3rem;
  border: none;
  position: relative;
  z-index: 2;
}

.md-footer-meta {
  padding: 0;
  background-color: transparent;
}

.md-footer-meta__inner {
  border-top: 7px solid #000;
  max-width: 61rem;
  margin: 0 auto;
  padding: 1rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.md-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.md-footer-links {
  flex: 0 0 auto;
}

.links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 2.1;
}

.links-list li {
  margin: 0 !important;
  padding: 0 !important;
}

.links-list a {
  color: #000;
  text-decoration: none;
  font-weight: 400;
  font-size: 14px;
  text-transform: uppercase;
  transition: opacity 0.2s ease;
}

.links-list a:hover {
  opacity: 0.7;
}

.md-footer-text {
  flex: 1;
  color: #000;
  font-size: 14px;
  line-height: 1.6;
  text-align: right;
  padding-left: 2rem;
}

.md-footer-text .footer-text {
  max-width: 400px;
  margin-left: auto;
}

.md-footer-text a {
  color: #000;
  text-decoration: underline;
}

.md-footer-text a:hover {
  opacity: 0.7;
}

@media (max-width: 768px) {
  .md-footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .md-footer-links {
    min-width: auto;
    width: 100%;
  }

  .md-footer-text {
    text-align: left;
  }

  .md-footer-text .footer-text {
    margin-left: 0;
  }

  .md-footer-meta__inner {
    padding: 0 1rem;
  }
}

/* ============================================
   Category Page Styles
   ============================================ */
.template-categorypage h1 {
  color: black !important;
  text-transform: uppercase;
}

/* ============================================
   Category Sidebar Navigation
   ============================================ */
.md-nav__link--active {
  color: var(--md-primary-fg-color) !important;
  font-weight: 600;
}

/* ============================================
   TOC Scroll-Spy Active State
   ============================================ */
.md-nav--secondary .md-nav__link--active {
  color: #4051b5 !important;
  font-weight: 500;
  border-left: 2px solid #4051b5;
  padding-left: 0.5rem;
  margin-left: -0.5rem;
}

.md-nav--secondary .md-nav__link {
  transition: color 0.15s ease, border-color 0.15s ease;
}

/* ============================================
   Article Tags (at top of article)
   ============================================ */
.md-tags--top {
  margin-bottom: 0.5rem;
}

.md-tags--top .md-tag {
  display: inline-block;
  background-color: #f0f0f0;
  color: #666;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  text-decoration: none;
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
  transition: background-color 0.15s ease;
}

.md-tags--top .md-tag:hover {
  background-color: #e0e0e0;
  color: #333;
}

/* ============================================
   Article Meta (last edit date at bottom)
   ============================================ */
.md-meta--footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  color: #666;
  font-size: 0.85rem;
}

.md-meta__icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.35rem;
  fill: currentColor;
}

.md-meta__item {
  display: flex;
  align-items: center;
}

.md-meta__item time {
  color: #666;
}

/* ============================================
   Breadcrumbs (Reviews/Generic)
   ============================================ */
.md-breadcrumbs__list {
  display: flex !important;
  flex-wrap: wrap;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center;
}

.md-breadcrumbs__item {
  display: flex !important;
  align-items: center;
  list-style: none !important;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.54);
}

.md-breadcrumbs__item:not(:last-child)::after {
  content: "/";
  margin: 0 0.5rem;
  color: rgba(0, 0, 0, 0.26);
}

.md-breadcrumbs__link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.md-breadcrumbs__link:hover {
  color: black;
}

.md-breadcrumbs__item--active {
  color: black;
  font-weight: 600;
}

/* ============================================
   Index Page Fixes (Header & CTA)
   ============================================ */

/* Revert Header background to match MkDocs (light gray/white theme dependent) */
/* The user requested "old site ui". Old site had light gray header in some screenshots. */
/* However, "white" is set in :root body vars at top of this file. */
/* We ensure the title is readable and search icon is visible. */

/* CTA Button Styling (matching MkDocs) */
.md-content__stream .md-button,
.md-button--primary {
    background-color: #4051b5; /* Indigo */
    color: white !important;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.625rem 2rem;
    border-radius: 0.2rem;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    transition: background-color 0.25s, transform 0.2s;
}

.md-content__stream .md-button:hover,
.md-button--primary:hover {
    background-color: #536dfe; /* Lighter indigo on hover */
    transform: translateY(-2px);
}

/* ============================================
   Article Page Fixes (Blockquotes, Back-to-Top)
   ============================================ */

/* Blockquotes — use MkDocs Material defaults from main.css */

/* Back to Top Button — use main.css styles, just ensure svg sizing */
.md-top svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* ============================================
   Mobile Search & TOC Logic
   ============================================ */

/* Hide TOC toggle on Desktop, but keep the sidebar title visible only when there are TOC items */
@media screen and (min-width: 76.25em) {
    label[for="__toc"] {
        display: none !important;
    }
    .md-nav--secondary:has(.md-nav__item) > label[for="__toc"].md-nav__title {
        display: block !important;
    }
}

/* Mobile: hide GCSE by default, show via Material's search dialog */
@media screen and (max-width: 60em) {
    .gsc-input-box {
        border-top-left-radius: 0px !important;
        border-bottom-left-radius: 0px !important;
    }

    td.gsc-search-button>button {
        border-radius: 0px !important;
    }
}

/* Mobile TOC Drawer Logic */
@media screen and (max-width: 76.1875em) {
    /* Ensure secondary sidebar is hidden by default but styled as drawer */
    .md-sidebar--secondary {
        display: none; 
        position: fixed;
        top: 0; 
        right: 0; 
        bottom: 0;
        width: 16rem; /* standard drawer width */
        height: 100%;
        z-index: 130; /* above header */
        background: white;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(100%); /* Slide out */
        box-shadow: 0 0 10px rgba(0,0,0,0.2);
        overflow-y: auto;
    }
    
    /* When checked, show it */
    body > input#__toc:checked ~ .md-container .md-main .md-sidebar--secondary {
        display: block !important;
        transform: translateX(0); /* Slide in */
    }

    /* Adjust inner container for drawer */
    .md-sidebar--secondary .md-sidebar__scrollwrap {
        height: 100%;
        overflow-y: auto;
    }
}

/* ============================================
   Mobile Main Menu (Tree-like) Styles
   ============================================ */
.md-nav__item .md-nav__toggle ~ label.md-nav__link {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.md-nav__item .md-nav__toggle ~ label.md-nav__link .md-nav__icon {
    transition: transform 0.25s;
    width: 1.2rem;
    height: 1.2rem;
    display: block;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/></svg>");
    mask-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/></svg>");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.md-nav__item .md-nav__toggle:checked ~ label.md-nav__link .md-nav__icon {
    transform: rotate(180deg);
}

/* Hide arrow for items without children (handled by template logic, but extra safely) */
.md-nav__item:not(.md-nav__item--nested) .md-nav__icon {
    display: none;
}

/* ============================================
   Cookie Consent Banner (GDPR)
   ============================================ */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: #1e293b;
    color: #fff;
    padding: 1rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cookie-consent__inner {
    max-width: 61rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-consent__text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    flex: 1;
}

.cookie-consent__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cookie-consent__btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.cookie-consent__btn--accept {
    background-color: #4051b5;
    color: #fff;
}

.cookie-consent__btn--accept:hover {
    background-color: #536dfe;
}

.cookie-consent__btn--decline {
    background-color: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-consent__btn--decline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 600px) {
    .cookie-consent__inner {
        flex-direction: column;
        text-align: center;
    }

    .cookie-consent__actions {
        width: 100%;
        justify-content: center;
    }
}