/*
Minimal Portfolio Styles - Clean & Efficient
Keep it simple, let Docsy do its thing
*/

/* Beige Color Palette */
:root {
  --bg-primary: #f7f3ed;
  --bg-secondary: #faf7f2;
  --text-primary: #2d2d2d;
  --text-secondary: #5c5c5c;
  --accent: #4a9eff;
}

/* Base Styles */
html {
  background: var(--bg-primary) !important;
}

body {
  font-size: 14px;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  min-height: 100vh;
}

/* Ensure all page sections have beige background */
.td-outer,
.td-main,
.td-content {
  background: var(--bg-primary) !important;
}

/* Compact Sidebar */
.td-sidebar {
  font-size: 0.75rem;
  padding: 0.5rem;
}

.td-sidebar-link {
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  line-height: 1.3;
}

.td-sidebar-nav__section-title {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

/* Compact Content */
.td-content {
  font-size: 0.9375rem;
  padding: 1.5rem 2rem;
}

.td-content h1 {
  font-size: 1.875rem;
}

.td-content h2 {
  font-size: 1.375rem;
  margin-top: 1.75rem;
}

.td-content h3 {
  font-size: 1.0625rem;
  margin-top: 1.5rem;
}

.td-content p {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Projects Grid - 3 Columns */
.projects-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.project-card {
  background: var(--bg-secondary);
}

.project-content {
  padding: 1rem;
}

.project-content h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.project-content p {
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.project-image {
  height: 180px;
}

/* Responsive */
@media (max-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    font-size: 13px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Clean Right Sidebar - TOC Only */
.td-page-meta,
.taxonomy {
  display: none;
}

/* Keep TOC visible and clean */
.td-toc {
  font-size: 0.8125rem;
}

.td-toc a {
  color: var(--text-secondary);
  text-decoration: none;
}

.td-toc a:hover {
  color: var(--accent);
}

/* Prevent jitter on page transitions and horizontal scroll */
html {
  overflow-x: hidden;
  width: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

/* Ensure all main containers respect viewport width */
.container,
.container-fluid,
.td-outer,
.td-main,
.td-content,
.td-sidebar-toc,
.row {
  overflow-x: hidden;
  max-width: 100%;
}

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

.td-outer {
  min-height: calc(100vh - 60px);
}

.td-content {
  min-height: 70vh;
}


/* Beautiful Clean Navbar */
.td-navbar {
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(45, 45, 45, 0.08);
  padding: 0.75rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Sticky Navbar */
.sticky-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: 5rem; /* Fixed height to prevent layout shifts */
  min-height: 5rem;
  max-height: 5rem;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.navbar-nav .nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.navbar-nav .nav-link:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.navbar-nav .nav-link.active {
  color: var(--accent);
  background: rgba(74, 158, 255, 0.08);
}

/* TOC Dropdown in Navbar */
.toc-dropdown {
  min-width: 300px;
  max-width: 400px;
  max-height: 500px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid rgba(45, 45, 45, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.toc-dropdown-content {
  padding: 1rem;
}

.toc-dropdown-content nav {
  font-size: 0.85rem;
}

.toc-dropdown-content ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc-dropdown-content li {
  margin: 0.25rem 0;
}

.toc-dropdown-content ul ul {
  padding-left: 1rem;
  margin-top: 0.25rem;
}

.toc-dropdown-content a {
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.toc-dropdown-content a:hover {
  color: var(--accent);
  background: rgba(74, 158, 255, 0.08);
}

/* Ensure dropdown appears on top */
.dropdown-menu.show {
  display: block;
}

/* Docs Navigation - Clean & Seamless */
.docs-nav-section {
  margin-bottom: 0.5rem;
}

.docs-nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.docs-nav-section-header:hover {
  background: rgba(0, 0, 0, 0.02);
}

.docs-nav-section-link {
  flex: 1;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
}

.docs-nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.section-expanded .docs-nav-toggle {
  transform: rotate(180deg);
}

.toggle-icon {
  display: block;
  pointer-events: none;
}

/* Seamless expand/collapse with no jumping */
.docs-nav-pages {
  display: none;
  padding-left: 1rem;
  margin-top: 0.25rem;
}

.docs-nav-pages.expanded {
  display: block;
}

.docs-nav-page {
  margin: 0.15rem 0;
}

.docs-nav-page a {
  display: block;
  padding: 0.25rem 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.docs-nav-page a:hover {
  color: var(--accent);
  background: rgba(74, 158, 255, 0.08);
}

.docs-nav-page.active a {
  color: var(--accent);
  background: rgba(74, 158, 255, 0.12);
  font-weight: 500;
}

/* Sidebar TOC */
.sidebar-toc {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(45, 45, 45, 0.1);
}

.sidebar-toc-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-toc-content {
  font-size: 0.8rem;
}

.sidebar-toc-content nav > ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.sidebar-toc-content ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.sidebar-toc-content li {
  margin: 0.35rem 0;
}

.sidebar-toc-content ul ul {
  padding-left: 0.75rem;
  margin-top: 0.25rem;
}

.sidebar-toc-content a {
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.15s ease;
  font-size: 0.75rem;
  line-height: 1.4;
}

.sidebar-toc-content a:hover {
  color: var(--accent);
  background: rgba(74, 158, 255, 0.08);
}
