/* ============================================
   Школа №BY — Custom Styles
   Design Reference: design/specs.md
   Framework: Bootstrap 5.3.2
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  --primary-blue: #2563EB;
  --primary-blue-dark: #1D4ED8;
  --accent-yellow: #F59E0B;
  --accent-yellow-hover: #D97706;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --bg-soft: #F9FAFB;
  --surface-white: #FFFFFF;
  --success-green: #10B981;
  --border-light: #E5E7EB;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --radius: 0.75rem;
}

/* --- Base Typography --- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
}

/* --- Header / Navbar --- */
.site-header {
  background: var(--surface-white);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  z-index: 1030;
}

.navbar {
  padding: 0.75rem 0;
}

.navbar-brand {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary) !important;
}

.brand-accent {
  color: var(--primary-blue);
}

.nav-link {
  font-weight: 500;
  color: var(--text-primary) !important;
  padding: 0.5rem 1rem !important;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary-blue) !important;
}

.dropdown-menu {
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  padding: 0.5rem 0;
}

.dropdown-item:hover {
  background-color: var(--bg-soft);
  color: var(--primary-blue);
}

.search-form .form-control {
  border-radius: 2rem;
  border: 1px solid var(--border-light);
  font-size: 0.875rem;
  padding-left: 0.75rem;
}

.search-form .input-group-text {
  background: transparent;
  border: 1px solid var(--border-light);
  border-right: 0;
  border-radius: 2rem 0 0 2rem;
  color: var(--text-secondary);
}

.search-form .form-control {
  border-left: 0;
  border-radius: 0 2rem 2rem 0;
}

/* --- Sidebar --- */
.sidebar-nav {
  background: var(--surface-white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  position: sticky;
  top: 80px;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.sidebar-menu .nav-link {
  padding: 0.4rem 0.75rem !important;
  font-size: 0.875rem;
  color: var(--text-secondary) !important;
  border-radius: 0.5rem;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.sidebar-menu .nav-link:hover {
  color: var(--primary-blue) !important;
  background: rgba(37, 99, 235, 0.04);
  border-left-color: var(--primary-blue);
}

.sidebar-parent {
  font-weight: 500;
  color: var(--text-primary) !important;
}

.sidebar-parent .bi-chevron-down {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.sidebar-parent[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

.sidebar-children .nav-link {
  font-size: 0.8125rem;
  padding: 0.3rem 0.5rem !important;
}

/* --- Main Content --- */
.site-main {
  min-height: 60vh;
}

/* --- Article --- */
.article-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.article-longform .article-body {
  max-width: 720px;
}

.article-body .content-paragraph {
  margin-bottom: 1rem;
}

.article-body .content-heading {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

/* --- Tables --- */
.table-responsive {
  border-radius: var(--radius);
  overflow: hidden;
}

.table {
  margin-bottom: 0;
  font-size: 0.875rem;
}

.table thead th {
  background: var(--primary-blue);
  color: white;
  font-weight: 500;
  border: 0;
  padding: 0.75rem;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
  background-color: rgba(37, 99, 235, 0.03);
}

.table td {
  padding: 0.6rem 0.75rem;
  vertical-align: middle;
}

.table a {
  color: var(--primary-blue);
  text-decoration: none;
}

.table a:hover {
  text-decoration: underline;
}

/* --- List Items (Cards) --- */
.content-list-item.card {
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  transition: box-shadow 0.2s, transform 0.15s;
}

.content-list-item.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.content-list-item .stretched-link {
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Images --- */
.content-image img {
  max-width: 100%;
  border-radius: var(--radius);
}

.figure-caption {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* --- Blockquotes --- */
.content-quote {
  border-left: 4px solid var(--accent-yellow);
  background: rgba(245, 158, 11, 0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--text-secondary);
}

.content-quote .blockquote-footer {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 0.8125rem;
}

/* --- Gallery --- */
.content-gallery img {
  border-radius: 0.5rem;
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}

/* --- Code blocks --- */
.content-code {
  background: #1F2937;
  color: #E5E7EB;
  font-size: 0.8125rem;
  overflow-x: auto;
}

/* --- Homepage --- */
.homepage-hero .display-6 {
  color: var(--text-primary);
}

.cta-banner {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
}

.cta-banner .btn-warning {
  background: var(--accent-yellow);
  border-color: var(--accent-yellow);
  color: var(--text-primary);
  font-weight: 600;
  border-radius: 2rem;
  padding: 0.6rem 1.5rem;
}

.cta-banner .btn-warning:hover {
  background: var(--accent-yellow-hover);
  border-color: var(--accent-yellow-hover);
}

/* --- Listing --- */
.listing-title {
  font-size: 1.5rem;
  font-weight: 700;
}

/* --- Footer --- */
.site-footer {
  background: var(--text-primary);
  color: #D1D5DB;
}

.footer-brand {
  color: var(--surface-white) !important;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

.footer-brand .brand-accent {
  color: var(--accent-yellow);
}

.site-footer h6 {
  color: var(--surface-white);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #9CA3AF;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--surface-white);
}

.social-links a {
  color: #9CA3AF;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.social-links a:hover {
  color: var(--surface-white);
}

.site-footer .border-top {
  border-color: #374151 !important;
}

.site-footer .border-top a {
  color: #9CA3AF;
  text-decoration: none;
}

.site-footer .border-top a:hover {
  color: var(--surface-white);
}

/* --- Breadcrumbs --- */
.breadcrumb {
  font-size: 0.8125rem;
  background: transparent;
  padding: 0;
}

.breadcrumb-item a {
  color: var(--primary-blue);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--text-secondary);
}

/* --- Offcanvas mobile --- */
.offcanvas-header {
  border-bottom: 1px solid var(--border-light);
}

.offcanvas-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
  .search-form {
    margin-top: 1rem;
  }
}

@media (max-width: 767.98px) {
  .article-title {
    font-size: 1.375rem;
  }
  .listing-title {
    font-size: 1.25rem;
  }
}
