/* ==========================================
   TOOL LAYOUT SYSTEM
   Loaded by all tool pages
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --primary: #3E3D35;
  --secondary: #89826E;
  --accent: #89826E;
  --primary-light: rgba(62, 61, 53, 0.1);
  --secondary-light: rgba(137, 130, 110, 0.1);
  --accent-light: rgba(137, 130, 110, 0.2);
}

body {
  font-family: 'Avenir', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #F8F8F4;
  color: #3E3D35;
  line-height: 1.6;
}

/* ----- Sidebar Toggle Button (mobile) ----- */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 200;
  background: var(--primary, #3E3D35);
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.2s;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle:hover { transform: scale(1.05); }

/* ----- Page Layout Grid ----- */
.tool-page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1400px;
  margin: 0 auto;
  gap: 0;
  min-height: calc(100vh - 120px);
}

/* ----- Left Sidebar ----- */
.tool-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  background: white;
  border-right: 1px solid #eee;
  padding: 1.5rem 0;
  z-index: 50;
  scrollbar-width: thin;
}
.tool-sidebar::-webkit-scrollbar { width: 4px; }
.tool-sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Sidebar Section Header */
.sidebar-section-header {
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary, #3E3D35);
}

/* Sidebar Tool Links */
.sidebar-tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-tool-list li a {
  display: block;
  padding: 0.5rem 1.25rem 0.5rem 1.5rem;
  font-size: 0.85rem;
  color: #555;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
}
.sidebar-tool-list li a:hover {
  background: #f5f7fa;
  color: var(--primary, #3E3D35);
}
.sidebar-tool-list li a.active {
  color: var(--secondary, #89826E);
  border-left-color: var(--secondary, #89826E);
  background: rgba(137, 130, 110, 0.08);
  font-weight: 500;
}

.sidebar-tool-list li.tool-overview a {
  font-weight: 500;
  font-size: 0.8rem;
  color: #888;
}

.tool-nav-icon {
  font-size: 0.9rem;
  margin-right: 0.15rem;
}

/* ----- Main Content Area ----- */
.tool-main-content {
  min-width: 0;
}

/* ----- Prev/Next Navigation ----- */
.prev-next-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.prev-next-link {
  display: block;
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  border: 1px solid #eee;
}
.prev-next-link:hover {
  background: #eef1f5;
  transform: translateY(-2px);
}

.prev-next-link .pn-direction {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 0.25rem;
}

.prev-next-link .pn-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--primary, #3E3D35);
}

.prev-next-link.next {
  text-align: right;
}
.prev-next-link.prev .pn-direction::before { content: "\2190 "; }
.prev-next-link.next .pn-direction::after { content: " \2192"; }

.prev-next-placeholder {
  /* empty spacer */
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .tool-page-layout {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 300;
    transition: left 0.3s ease;
    box-shadow: none;
    border-right: none;
    padding-top: 1rem;
  }
  .tool-sidebar.open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 250;
  }
  .sidebar-overlay.active {
    display: block;
  }

  .prev-next-nav {
    grid-template-columns: 1fr;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}


/* ==========================================
   SITE NAV (injected by tool-nav.js)
   ========================================== */
.site-nav {
  background: #3E3D35;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: #89826E;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.nav-cta {
  background: rgba(137, 130, 110, 0.25) !important;
  color: #fff !important;
  border: 1px solid rgba(137, 130, 110, 0.4);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #3E3D35;
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
    z-index: 100;
  }
  .nav-links.open { display: flex; }
}

/* ==========================================
   BREADCRUMB (injected by tool-nav.js)
   ========================================== */
.breadcrumb {
  background: white;
  padding: 1rem 2rem;
  border-bottom: 1px solid #eee;
}

.breadcrumb-container {
  max-width: 1140px;
  margin: 0 auto;
  font-size: 0.9rem;
  color: #666;
}

.breadcrumb-container a,
.breadcrumb a {
  color: #89826E;
  text-decoration: none;
}

.breadcrumb-container a:hover,
.breadcrumb a:hover {
  text-decoration: underline;
}


/* ==========================================
   SHARED CONTENT LAYOUT
   ========================================== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  color: var(--primary, #3E3D35);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.page-subtitle {
  font-size: 1.1rem;
  color: #666;
}

@media (max-width: 768px) {
  .container {
    padding: 1.25rem 1rem;
  }
  .page-header h1 {
    font-size: 1.5rem;
  }
}
