@import url('../fonts/web/variable/pretendardvariable.css');

:root {
  --md-text-font: 'Pretendard Variable', 'Pretendard', sans-serif;
  --md-code-font: 'Pretendard Variable', 'Pretendard', monospace;
}

/* 
 * ==========================================================================
 * GeoXD Analysis Brand Identity - Color System
 * 
 * 1. Main Color (Deep Wine):   #550014
 * 2. Point Color (Bright Red): #DC2828
 * ==========================================================================
 */


/* ==========================================================================
 * 1. Left Sidebar (Primary Navigation) - Card UI
 * ========================================================================== */

.md-sidebar--primary .md-sidebar__inner {
  background-color: #ffffff !important; 
  border: 1px solid rgba(85, 0, 20, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-top: 1rem;
  padding: 0.8rem 0; 
}

/* Nav Link Items (Common) */
.md-nav--primary .md-nav__link {
  color: #555555;
  padding: 0.5rem 1.2rem;
  border-left: none; 
  transition: color 0.2s ease;
}

/* Nav Hover */
.md-nav--primary .md-nav__link:hover {
  color: #550014;
  background-color: transparent;
}

/* Nav Active State */
.md-nav--primary .md-nav__item .md-nav__link--active {
  color: #550014 !important;
  font-weight: 700 !important;
  background-color: transparent !important;
  border-left: none !important;
}

/* Nav Section Titles */
.md-nav--primary .md-nav__title {
  color: #333333;
  font-weight: 700;
  padding: 0.8rem 1.2rem;
}


/* ==========================================================================
 * 2. Right Sidebar (Table of Contents) - Hierarchy & Thread
 * ========================================================================== */

.md-sidebar--secondary .md-sidebar__scrollwrap {
  background-color: #ffffff !important; 
  border: 1px solid rgba(85, 0, 20, 0.1); 
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin: 1rem 0.5rem;
  padding: 0;
  max-height: 85vh;
  overflow-y: auto;
}

/* TOC Header Area - Sticky & Glassmorphism Fix */
.md-nav--secondary .md-nav__title {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.96); 
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  color: #550014;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 2px solid #550014;
  margin: 0;
  padding: 1.2rem 1.2rem 0.8rem 1.2rem;
}

/* TOC List Container */
.md-nav--secondary > .md-nav__list {
  padding: 0.8rem 0;
}

/* Vertical Thread */
.md-nav--secondary .md-nav__list .md-nav__list {
  border-left: 1px solid #e0e0e0; 
  margin-left: 1.2rem; 
  padding-left: 0;
}

/* TOC Link Items (Common State) */
.md-nav--secondary .md-nav__link {
  color: #666666;
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 6px 16px;
  transition: all 0.2s ease;
  display: block;
}

/* TOC Hover */
.md-nav--secondary .md-nav__link:hover {
  color: #550014;
  background-color: rgba(85, 0, 20, 0.03);
}

/* TOC Active State */
.md-nav--secondary .md-nav__item .md-nav__link--active {
  color: #550014 !important;
  font-weight: 700 !important;
  background-color: rgba(220, 40, 40, 0.05) !important;
  margin-left: -1px; 
}

/* TOC Depth Control: H4 */
.md-nav--secondary .md-nav__list .md-nav__list .md-nav__list {
  display: none !important;
}


/* ==========================================================================
 * 3. Content Headers (Typography & Anchors)
 * ========================================================================== */

.md-typeset h2 {
  color: #333333;
  font-weight: 700;
  border-bottom: 1px solid #e0e0e0;
  margin-top: 2.5em;
  margin-bottom: 1.0em;
  padding-bottom: 0.4em;
}

.md-typeset h3 {
  color: #550014;
  font-weight: 600;
  border-left: 4px solid #DC2828;
  padding-left: 12px;
  margin-top: 2.0em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}


/* ==========================================================================
 * 4. Common UI Components (Scrollbar)
 * ========================================================================== */

.md-sidebar__scrollwrap::-webkit-scrollbar {
  width: 5px;
}

.md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background-color: rgba(220, 40, 40, 0.2);
  border-radius: 4px;
}

.md-sidebar__scrollwrap:focus-within,
.md-sidebar__scrollwrap:hover {
  scrollbar-color: #DC2828 #0000;
}

.md-sidebar__scrollwrap:focus-within::-webkit-scrollbar-thumb,
.md-sidebar__scrollwrap:hover::-webkit-scrollbar-thumb {
  background-color: rgba(220, 40, 40, 0.5); /* Lighter version of #DC2828 for better UX on hover area */
}

.md-sidebar__scrollwrap:focus-within::-webkit-scrollbar-thumb:hover,
.md-sidebar__scrollwrap:hover::-webkit-scrollbar-thumb:hover {
  background-color: #DC2828;
}


/* ==========================================================================
 * 5. Equation Box 
 * ========================================================================== */

.eq-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 20px 0;
  box-shadow: none;
  text-align: center;
  color: #212529; 
}

.eq-box hr {
    border: 0;
    border-top: 1px dashed #ccc;
    margin: 15px 0;
}

.eq-desc {
    font-size: 0.85em;      
    color: #444;            
    text-align: left;       
    line-height: 1.6;       
    margin-bottom: 0;       
    padding-left: 20px;     
}

.eq-desc li b {
    color: #000;            
}

/* Sidebar search mode */
.md-sidebar__mode-toggle {
  display: flex;
  gap: 6px;
  padding: 0.6rem 0.8rem 0.2rem 0.8rem;
}

.md-sidebar__mode-btn {
  flex: 1 1 0;
  border: 1px solid rgba(220, 40, 40, 0.3);
  background: #ffffff;
  color: #555555;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.md-sidebar__mode-btn:hover {
  color: #550014;
  border-color: #550014;
}

.md-sidebar__mode-btn.is-active {
  background: #550014;
  border-color: #550014;
  color: #ffffff;
  font-weight: 700;
}

.md-sidebar__panel--nav.is-hidden {
  display: none;
}

.md-sidebar__panel--search {
  display: none;
  padding: 0.2rem 0.4rem 0.8rem 0.4rem;
}

.md-sidebar__panel--search.is-active {
  display: block;
}

.md-sidebar__panel-header {
  display: none;
}

.md-sidebar__panel-empty {
  font-size: 0.85rem;
  color: #888888;
  padding: 0.4rem 0.8rem 0.8rem 0.8rem;
}

.md-sidebar__panel-results {
  padding: 0 0.4rem;
}

.md-sidebar__panel--search .md-search-result {
  position: static;
  box-shadow: none;
  background: transparent;
  display: block !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Search results count */
.md-sidebar__panel--search .md-search-result__meta {
  position: static;
  padding: 0.2rem 0.8rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #550014;
}

.md-sidebar__panel--search .md-search-result__list {
  max-height: none;
  display: block;
  list-style: decimal;
  padding-left: 1.4rem;
}


.md-sidebar__panel--search .md-search-result__link {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  color: inherit;
}

.md-sidebar__panel--search .md-search-result__link:hover {
  background: rgba(220, 40, 40, 0.08);
}

/* Search result list */
.md-sidebar__panel--search .md-search-result__title {
  font-size: 0.65rem;
  font-weight: 600;
  color: #707070;
}

/* Search result teaser */
.md-sidebar__panel--search .md-search-result__teaser {
  font-size: 0.85rem;
  color: #555555;
  margin-top: 2px;
}

.md-sidebar__panel--search .md-search-result__excerpt {
  font-size: 0.75rem;
  color: #666666;
  margin-top: 4px;
}

.md-sidebar__panel--search .md-search-result__item.is-selected .md-search-result__link {
  background: rgba(220, 40, 40, 0.12);
  border-left: 3px solid #550014;
  padding-left: 0.5rem;
}

.md-sidebar__panel--search .md-search-result__item.is-clicked .md-search-result__link {
  background: rgba(220, 40, 40, 0.08);
  box-shadow: inset 0 0 0 1px rgba(220, 40, 40, 0.25);
}


/* Search target highlight */
.md-search-target-highlight {
  background: rgba(220, 40, 40, 0.2);
  box-shadow: 0 0 0 6px rgba(220, 40, 40, 0.15);
  border-radius: 6px;
  animation: md-search-highlight 3s ease-out;
}

@keyframes md-search-highlight {
  0% {
    background: rgba(220, 40, 40, 0.35);
    box-shadow: 0 0 0 8px rgba(220, 40, 40, 0.25);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

.md-sidebar__panel--search .md-search-result__item {
  margin: 0;
  list-style-position: outside;
}

/* search result marker (disabled) */
.md-sidebar__panel--search .md-search-result__item::marker {
  font-size: 0.65rem;
  font-weight: 500;
  color: #555555;
}