/* ============================================================
   06. GLOSSARY & INTERNAL MATERIALS — внутренние материалы и глоссарий

   ОГЛАВЛЕНИЕ
   6.1    Внутреннее окно материалов: overlay, контейнер и header
   6.2    Glossary table: базовая структура и типографика
   6.3    Glossary table: цветовое кодирование и иерархия
   6.4    Glossary navigation
   6.5    Glossary: мобильная адаптация

   Порядок подключения: 6 / 10

   ============================================================ */

/* ============================================================
   6.1. Внутреннее окно материалов: overlay, контейнер и header
   ============================================================ */

#material-content-body {
  flex-grow: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}


#material-content-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(
    43,
    37,
    33,
    0.7
  ) !important; 
  backdrop-filter: blur(
    5px
  ) !important; 
  display: none;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2000000 !important;
}



.custom-material-modal {
  width: 1200px !important;
  min-width: 60vw !important;
  max-width: 90vw !important;
  height: 1000px !important;
  max-height: 85vh !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid #d2c3b3 !important;
    border-radius: 10px !important;
    background: #f3ede4 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.22) !important;
  border-radius: 12px !important; 
  padding: 24px !important;
  margin: auto !important;
  box-sizing: border-box !important;
}


.custom-material-modal .modal-header2 {
  display: block !important;
  position: relative !important;
  border-bottom: 1px solid #e6e1da !important;
  padding-bottom: 14px !important;
  margin-bottom: 16px !important;
  width: 100% !important;
}


.custom-material-modal .modal-header2 h2 {
  margin: 0 !important;
  padding: 0 45px !important;
  text-align: center !important;
  font-family: var(--font-primary) !important;
  color: #4f433a !important;
  font-size: clamp(1.24rem, calc(1.16rem + 0.12vw), 1.38rem);
  line-height: 1.2;
  font-weight: 700;
}




.custom-material-modal .modal-header2 .modal-close,
.custom-material-modal .modal-header2 .modal-back {
  position: absolute !important;
  top: -0.15rem !important; 

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  
  width: 2rem !important;
  height: 2rem !important;

  background-color: #ece3d8 !important;
    border: 1px solid #c4b19f !important;
    color: #7a695b !important;
  border-radius: 50% !important;
  color: #8e7f71 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
  padding: 0 !important;
}


.custom-material-modal .modal-header2 .modal-close {
  right: 0 !important;
}


.custom-material-modal .modal-header2 .modal-close i {
  font-size: 1.1rem !important; 
  font-weight: 700 !important;
  display: block;
}

.custom-material-modal .modal-header2 .modal-close:hover {
 background-color:
        #75604f !important;

    color:
        #ffffff !important;

    border-color:
        #75604f !important;

    transform:
        rotate(90deg);
}


.custom-material-modal .modal-header2 .modal-back {
  left: 0 !important;
}


.custom-material-modal .modal-header2 .modal-back i {
  font-size: 1.05rem !important; 
  font-weight: 800 !important;
  display: block;
  
  transform: translateX(-1px);
}

.custom-material-modal .modal-header2 .modal-back:hover {
  background-color:
        #75604f !important;

    color:
        #ffffff !important;

    border-color:
        #75604f !important;
  transform: translateX(-3px); 
}


.custom-material-modal .modal-header2 .modal-back:hover i {
  transform: translateX(-1px); 
}




.custom-material-modal #material-content-body {
  flex-grow: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  height: calc(100% - 60px) !important; 
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}



.custom-material-modal .glossary-table-container {
    width: 100% !important;
    height: 100% !important;
    flex-grow: 1 !important;
    overflow-y: auto !important;

    border: 1px solid #d2c3b3 !important;
    border-radius: 10px !important;
    background: #f3ede4 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.22) !important;

    scrollbar-width: thin !important;
    scrollbar-color: #bfb2a4 #eee7dd !important;
}


.custom-material-modal .glossary-table-container::-webkit-scrollbar {
  width: 8px !important;
}

.custom-material-modal .glossary-table-container::-webkit-scrollbar-track {
  background-color: #f4f1ea !important;
  border-left: 1px solid #e6e1da !important;
  border-radius: 0 0 6px 0 !important;
}

.custom-material-modal .glossary-table-container::-webkit-scrollbar-thumb {
  background-color: #c2bab0 !important;
  border: 1px solid #f4f1ea !important;
  border-radius: 4px !important;
}

.custom-material-modal
  .glossary-table-container::-webkit-scrollbar-thumb:hover {
  background-color: #a3998e !important;
}

/* ============================================================
   6.2. Glossary table: базовая структура и типографика
   ============================================================ */

.custom-glossary-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-family: var(--font-primary) !important;
  color: #3a3530 !important;
  text-align: left !important;
}


.custom-glossary-table th {
  position: sticky !important;
  top: 0 !important;
  background-color: #5c5045 !important; 
  color: #faf8f5 !important; 
  font-weight: 700 !important;
  font-size: 0.92rem !important;
  text-transform: uppercase !important; 
  letter-spacing: 0.8px !important;
  text-align: center !important;
  padding: 16px 18px !important;
  border-bottom: 3px solid #4a3e33 !important;
  z-index: 10 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
}


.custom-glossary-table th:nth-child(1) {
  text-align: center !important;
}
.custom-glossary-table th:nth-child(2) {
  text-align: left !important;
}
.custom-glossary-table th:nth-child(3) {
  text-align: center !important;
}
.custom-glossary-table th:nth-child(4) {
  text-align: left !important;
}

.custom-glossary-table td {
    padding: 14px 18px !important;
    border-bottom: 1px solid #e6ddd2 !important;
    vertical-align: top !important;
    line-height: 1.5 !important;
    background-color: #f9f6f1 !important;
    font-size: 0.92rem !important;
    color: #4f433a !important;
}

.custom-glossary-table td:nth-child(3) {
  text-align: center !important;
}


.custom-glossary-table th:nth-child(1),
.custom-glossary-table td:nth-child(1) {
  width: 7% !important;
}
.custom-glossary-table th:nth-child(2),
.custom-glossary-table td:nth-child(2) {
  width: 20% !important;
}
.custom-glossary-table th:nth-child(3),
.custom-glossary-table td:nth-child(3) {
  width: 18% !important;
}
.custom-glossary-table th:nth-child(4),
.custom-glossary-table td:nth-child(4) {
  width: 55% !important;
}

.custom-glossary-table td.cell-index {
  font-size: 0.90rem !important;
  color: #4f433a !important; 
  font-weight: 700 !important;
  text-align: center !important;
}

.custom-glossary-table .cell-term {
  font-size: 0.98rem !important;
}


.custom-glossary-table td.cell-term {
  font-weight: 700 !important;
  color: #4f433a !important;
}


.custom-glossary-table tr.glossary-group-row td.cell-term {
  font-family: var(--font-primary) !important;
  font-size: 0.90rem !important;
  font-style: italic !important;
  font-weight: 700 !important;
  color: #4a6b53 !important; 
  padding-left: 32px !important; 
  position: relative;
}


.custom-glossary-table tr.glossary-group-row td.cell-term::before {
  content: "↳" !important;
  position: absolute !important;
  left: 14px !important;
  color: #a39689 !important;
  font-weight: normal !important;
  font-style: normal !important;
}


.custom-glossary-table td .category-text {
    font-family: var(--font-primary) !important;
    font-size: 0.88rem !important;
    font-style: italic !important;
    font-weight: 600 !important;
    color: #556d5d !important;
    padding-left: 32px !important;
    position: relative;
}


.custom-glossary-table td.cell-definition {
  font-size: 0.95rem !important;
  color: #4a4641 !important; 
  font-weight: normal !important;
}

/* ============================================================
   6.3. Glossary table: цветовое кодирование и иерархия
   ============================================================ */

.custom-glossary-table tr {
    --section-bg: #ddd4c7;
    --group-header-bg: #e9e1d6;
    --row-bg: #f5efe6;

}


.custom-glossary-table tr.glossary-group-header td,
.custom-glossary-table tr.glossary-normal-row td {
  background-color: var(--group-header-bg) !important;
}


.custom-glossary-table tr.glossary-group-row td {
  background-color: var(--row-bg) !important;
}


.custom-glossary-table tr.group-general {
  --section-bg: #d8d1c1 !important;
  --row-bg: #ece7dc !important;
}


.custom-glossary-table tr.group-interface {
  --section-bg: #e5d3a2 !important;
  --row-bg: #f3ead3 !important;
}


.custom-glossary-table tr.group-navigation {
  --section-bg: #adc2d1 !important;
  --row-bg: #dbe4eb !important;
}


.custom-glossary-table tr.group-representation {
  --section-bg: #b1c5a1 !important; 
  --row-bg: #e9efe3 !important; 
}


.custom-glossary-table tr.group-functionality {
  --section-bg: #c7c7c0 !important;
  --row-bg: #e6e6e1 !important;
}




.custom-glossary-table tr[class*="group-"]:not(.group-default) td {
  background-color: var(--row-bg) !important;
}


.custom-glossary-table
  tr.glossary-section-title-row[class*="group-"]:not(.group-default)
  td {
  background-color: var(--section-bg) !important;
}




.custom-glossary-table tr.glossary-section-title-row td {
  background-color: var(--section-bg) !important;
  font-weight: 700 !important; 
  font-size: 0.98rem !important; 
  text-transform: uppercase !important; 
  letter-spacing: 1.2px !important; 
  color: #2b2521 !important; 
  padding: 16px 18px !important; 
}

.custom-glossary-table tr.glossary-section-title-row td.section-text-centered {
  text-align: center !important;
  padding-right: 7% !important;
}


.custom-glossary-table
  tr[class*="group-"]:not(.group-default).glossary-group-row
  td {
  background-image: linear-gradient(
    rgba(255, 255, 255, 0.5),
    rgba(255, 255, 255, 0.5)
  ) !important;
}


/* ============================================================
   6.4. Glossary navigation
   ============================================================ */

.glossary-nav-menu {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  padding: 0.2em 24px !important; 
  background-color: transparent !important;
  border-bottom: none !important;

  
  margin-top: clamp(10px, 2vh, 20px) !important;
  margin-bottom: 2px !important;
  gap: 0.8em !important;
}

.nav-menu-label {
  margin-right: 0.5em !important;
  font-family: var(--font-primary) !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important; 
  color: #8e7f71 !important;
}

.nav-menu-items {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0.5em !important;
}

.nav-group-basics,
.nav-group-main {
  display: flex !important;
  gap: 0.5em !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
}


.nav-group-main {
  margin-left: 1.8em !important;
}

.nav-item {.item-description 
  font-family: var(--font-primary) !important;
  font-size: 0.85rem !important; 
  font-weight: 600 !important;
  text-decoration: none !important;
  padding: 0.4em 0.9em !important; 
  border-radius: 1.5em !important; 
  transition: all 0.2s ease !important;
  border: 1px solid transparent !important;
  box-sizing: border-box !important;
  display: inline-block !important;
}

@media (max-width: 1400px), (max-height: 900px) {
  .glossary-nav-menu {
    padding: 0.3em 1em !important;
  }

  .nav-item {
    padding: 0.35em 0.8em !important;
    font-size: 0.88rem !important;
  }

  .nav-group-main {
    margin-left: 1em !important;
  }
}


.nav-default {
  background-color: #eae4d9 !important;
  color: #5c5045 !important;
  border-color: #dfd9ce !important;
}
.nav-default:hover {
  background-color: #dfd9ce !important;
  box-shadow: 0 2px 6px rgba(92, 80, 69, 0.15) !important;
}


.nav-content {
  background-color: #eae4d9 !important;
  color: #5c5045 !important;
  border-color: #dfd9ce !important;
}
.nav-content:hover {
  background-color: #dfd9ce !important;
  box-shadow: 0 2px 6px rgba(92, 80, 69, 0.15) !important;
}

.nav-general {
  background-color: #ece7dc !important;
  color: #5c5446 !important;
  border-color: #d8d1c1 !important;
}
.nav-general:hover {
  background-color: #d8d1c1 !important;
  box-shadow: 0 2px 6px rgba(125, 110, 97, 0.15) !important;
}

.nav-interface {
  background-color: #f3ead3 !important;
  color: #6b592c !important;
  border-color: #e5d3a2 !important;
}
.nav-interface:hover {
  background-color: #e5d3a2 !important;
  box-shadow: 0 2px 6px rgba(107, 89, 44, 0.15) !important;
}

.nav-navigation {
  background-color: #dbe4eb !important;
  color: #3b4f5e !important;
  border-color: #adc2d1 !important;
}
.nav-navigation:hover {
  background-color: #adc2d1 !important;
  box-shadow: 0 2px 6px rgba(59, 79, 94, 0.15) !important;
}

.nav-representation {
  background-color: #e9efe3 !important;
  color: #445438 !important;
  border-color: #b1c5a1 !important;
}
.nav-representation:hover {
  background-color: #b1c5a1 !important;
  box-shadow: 0 2px 6px rgba(68, 84, 56, 0.15) !important;
}

.nav-functionality {
  background-color: #e6e6e1 !important;
  color: #4f4f4a !important;
  border-color: #c7c7c0 !important;
}
.nav-functionality:hover {
  background-color: #c7c7c0 !important;
  box-shadow: 0 2px 6px rgba(79, 79, 74, 0.15) !important;
}



.custom-glossary-table tr.glossary-section-title-row {
  scroll-margin-top: 52px !important; 
}

/* ============================================================
   6.5. Glossary: мобильная адаптация
   ============================================================ */

@media screen and (max-width: 767px),
       screen and (max-width: 1024px) and (max-height: 600px) {

 

  #material-content-modal {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;

    padding: 0.5rem !important;

    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box;
  }

  .custom-material-modal {
    width: calc(100vw - 1rem) !important;
    min-width: 0 !important;
    max-width: none !important;

    height: calc(100vh - 1rem) !important;
    height: calc(100dvh - 1rem) !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0.65rem !important;

    border-radius: 10px !important;

    overflow: hidden !important;
  }



  .custom-material-modal .modal-header2 {
    flex: 0 0 auto;

    margin-bottom: 0.55rem !important;
    padding-bottom: 0.55rem !important;
  }

  .custom-material-modal .modal-header2 h2 {
    min-height: 2rem;

    padding: 0.2rem 2.7rem !important;

    line-height: 1.25 !important;

    overflow-wrap: anywhere;
  }

  
  .custom-material-modal .modal-header2 .modal-close,
  .custom-material-modal .modal-header2 .modal-back {
    top: 0 !important;

    width: 2rem !important;
    height: 2rem !important;
  }

  
  .custom-material-modal .modal-header2 .modal-back:hover,
  .custom-material-modal .modal-header2 .modal-close:hover {
    transform: none;
  }


  .glossary-nav-menu {
    display: block !important;

    width: 100%;
    margin: 0.55rem 0 0 !important;
    padding: 0 !important;

    overflow: hidden;
  }

  .nav-menu-label {
    display: block;

    margin: 0 0 0.35rem !important;

    line-height: 1.2;
  }

  .nav-menu-items {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 0.4rem !important;

    width: 100%;
    padding: 0 0 0.35rem;

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: thin;
    scrollbar-color: #c2bab0 transparent;

    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .nav-menu-items::-webkit-scrollbar {
    height: 4px;
  }

  .nav-menu-items::-webkit-scrollbar-track {
    background: transparent;
  }

  .nav-menu-items::-webkit-scrollbar-thumb {
    background-color: #c2bab0;
    border-radius: 4px;
  }

  .nav-group-basics,
  .nav-group-main {
    display: flex !important;
    flex: 0 0 auto;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 0.4rem !important;
  }

  .nav-group-main {
    margin-left: 0 !important;
  }

  .nav-item {
    flex: 0 0 auto;

    padding: 0.35rem 0.65rem !important;

    line-height: 1.2;
    white-space: nowrap;
  }


  .custom-material-modal #material-content-body {
    flex: 1 1 auto !important;

    min-height: 0;
    height: auto !important;

    overflow: hidden !important;
  }

 
  .custom-material-modal .glossary-table-container {
    flex: 1 1 auto !important;

    width: 100% !important;
    min-height: 0;
    height: auto !important;

    overflow: auto !important;

    border-radius: 6px !important;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .custom-glossary-table {
    width: 100% !important;
    min-width: 46rem !important;

    table-layout: fixed;
  }

  
  .custom-glossary-table th {
    padding: 0.65rem 0.7rem !important;

    line-height: 1.25;
    letter-spacing: 0.05em !important;
  }

  
  .custom-glossary-table td {
    padding: 0.65rem 0.7rem !important;
    line-height: 1.4 !important;
  }


  
.custom-glossary-table tr.glossary-group-row td.cell-term {
    padding-left: 1.5rem !important;
}


.custom-glossary-table td:nth-child(3) .category-text {
    display: block !important;
    width: 100% !important;

    padding-left: 0 !important;

    text-align: center !important;
    line-height: 1.35 !important;
}

  .custom-glossary-table tr.glossary-group-row td.cell-term::before {
    left: 0.55rem !important;
  }

  
  .custom-glossary-table tr.glossary-section-title-row td {
    padding: 0.7rem !important;

    line-height: 1.3;
    letter-spacing: 0.07em !important;
  }

  .custom-glossary-table tr.glossary-section-title-row {
    scroll-margin-top: 2.8rem !important;
  }
}

