/* layout.css - Nav sidebar, grid, footer */

/* Main layout */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .page-wrapper {
    flex-direction: row;
  }
}

/* Mobile header */
.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  background: white;
  z-index: 20;
}

@media (min-width: 768px) {
  .mobile-header {
    display: none;
  }
}

.mobile-header-title {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.025em;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.25rem;
}

.mobile-menu-btn:hover {
  color: var(--color-text-primary);
}

/* Sidebar */
.sidebar {
  width: 100%;
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-border);
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .sidebar {
    display: flex;
    width: 18rem;
  }
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-title {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
  margin: 0;
}

.sidebar-version {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

/* Sidebar search */
.sidebar-search {
  padding: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  background: white;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.search-wrapper {
  position: relative;
}

.search-shortcut {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Sidebar navigation */
.sidebar-nav {
  flex: 1;
  padding: 1rem;
  padding-bottom: 2rem;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: block;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-left: 4px solid transparent;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.nav-link.active {
  color: var(--color-accent);
  background: #eff6ff;
  border-left-color: var(--color-accent);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.sidebar-footer-link:hover {
  color: var(--color-text-primary);
}

.sidebar-footer-link svg {
  margin-right: 0.5rem;
}

/* Main content area */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: white;
}

.content-wrapper {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

@media (min-width: 768px) {
  .content-wrapper {
    padding: 3rem;
  }
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.breadcrumb-separator {
  margin: 0 0.5rem;
}

.breadcrumb-current {
  color: var(--color-text-primary);
}

/* Page header */
.page-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.page-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}

.page-description {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 48rem;
}

.page-tags {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Section styling */
.section {
  margin-bottom: 4rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.section-title-bordered {
  border-left: 4px solid var(--color-accent);
  padding-left: 0.75rem;
}

.section-timestamp {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
}

.section-link {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Footer */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-section-title {
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}

.footer-text {
  color: var(--color-text-secondary);
}

.footer-list {
  list-style: none;
}

.footer-list li {
  margin-bottom: 0.25rem;
}

.footer-list a {
  color: var(--color-text-secondary);
}

.footer-list a:hover {
  color: var(--color-accent);
}

.footer-copyright {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}
