/* ==========================================================================
   KidsMathic - Main Stylesheet
   ========================================================================== */

/* ==========================================================================
   Base / Reset
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Sarabun', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: white;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-nav > a,
.nav-link {
  color: white;
  text-decoration: none;
  transition: opacity 0.2s;
  font-weight: 500;
}

.navbar-nav > a:hover,
.nav-link:hover {
  opacity: 0.8;
}

/* ==========================================================================
   Search (Navbar)
   ========================================================================== */
.search-container {
  position: relative;
}

.search-toggle {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.search-toggle:hover {
  background: rgba(255,255,255,0.3);
}

.search-toggle svg {
  color: white;
}

.search-input-wrapper {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
}

.search-input-wrapper.active {
  width: 280px;
}

.search-input {
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 320px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  color: #333;
  text-decoration: none;
  display: block;
}

.search-result-item:hover {
  background: #f5f5f5;
}

/* ==========================================================================
   Language Switcher
   ========================================================================== */
.lang-switch {
  position: relative;
}

.lang-toggle {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  transition: background 0.2s;
}

.lang-toggle:hover {
  background: rgba(255,255,255,0.3);
}

.lang-toggle svg {
  transition: transform 0.2s;
}

.lang-switch.active .lang-toggle svg {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  display: none;
  min-width: 120px;
  z-index: 100;
}

.lang-switch.active .lang-dropdown {
  display: block;
}

.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: #333;
  text-decoration: none;
  transition: background 0.2s;
}

.lang-dropdown a:hover {
  background: #f5f5f5;
}

.lang-dropdown a.current {
  background: #f0f0f0;
  font-weight: 600;
}

/* ==========================================================================
   Hamburger Button
   ========================================================================== */
.hamburger-btn {
  display: none;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 8px;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: white;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: rgba(255,255,255,0.3);
}

.hamburger-btn svg {
  color: white;
}

/* ==========================================================================
   Mobile Menu Overlay & Drawer
   ========================================================================== */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: white;
  z-index: 2001;
  transition: right 0.3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}

.mobile-menu.active {
  display: block;
  right: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.mobile-menu-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.mobile-menu-close {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 8px;
  padding: 0.5rem;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s;
}

.mobile-menu-close:hover {
  background: rgba(255,255,255,0.3);
}

.mobile-menu-content {
  padding: 1rem 0;
}

.mobile-menu-link {
  display: block;
  padding: 1rem 1.5rem;
  color: #333;
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid #eee;
  transition: background 0.2s, color 0.2s;
}

.mobile-menu-link:hover {
  background: #f5f5f5;
  color: #667eea;
}

/* ==========================================================================
   Search Modal (Mobile)
   ========================================================================== */
.search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 2000;
  flex-direction: column;
}

.search-modal.active {
  display: flex;
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.search-modal-close {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.search-modal-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-family: inherit;
}

.search-modal-input:focus {
  outline: none;
}

.search-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-modal-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: #333;
}

.search-modal-result-item:hover {
  background: #f5f5f5;
}

.search-modal-result-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.search-modal-result-info {
  flex: 1;
  min-width: 0;
}

.search-modal-result-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-modal-result-meta {
  font-size: 0.85rem;
  color: #666;
}

.search-modal-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.main-content {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ==========================================================================
   Page Header
   ========================================================================== */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.page-header p {
  opacity: 0.9;
}

/* Page Header - Listing Style (Gradient) */
.page-header-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: left;
}

.page-header-gradient h1 {
  color: white;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: #5a67d8;
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #999;
}

.breadcrumb-current {
  color: #666;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Breadcrumb in white header */
.page-header-gradient .breadcrumb {
  opacity: 0.8;
}

.page-header-gradient .breadcrumb a {
  color: white;
}

/* ==========================================================================
   Worksheets Grid & Cards
   ========================================================================== */
.worksheets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.worksheet-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.worksheet-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-content {
  padding: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-tag {
  background: #f0f0f0;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #666;
}

/* ==========================================================================
   Category Grid (Listing Pages)
   ========================================================================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.category-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.category-card-count {
  font-size: 0.9rem;
  color: #667eea;
  font-weight: 600;
}

/* ==========================================================================
   Tag Cloud
   ========================================================================== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag-cloud-item {
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  color: #333;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-cloud-item:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

.tag-cloud-item.size-lg {
  font-size: 1.1rem;
  padding: 0.6rem 1.2rem;
}

.tag-cloud-item.size-md {
  font-size: 1rem;
}

.tag-cloud-item.size-sm {
  font-size: 0.9rem;
}

.tag-count {
  background: rgba(102, 126, 234, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.75rem;
}

.tag-cloud-item:hover .tag-count {
  background: rgba(255,255,255,0.3);
}

/* ==========================================================================
   Load More Button
   ========================================================================== */
.load-more-container {
  text-align: center;
  margin-top: 2rem;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 2rem;
  border-radius: 25px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.load-more-btn.hidden {
  display: none;
}

/* ==========================================================================
   Hero Search (Home Page)
   ========================================================================== */
.hero-search {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  padding: 3rem 1rem;
  margin: -2rem -1rem 2rem -1rem;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.hero-search h2 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero-search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.hero-search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  padding-right: 3.5rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  font-family: inherit;
}

.hero-search-input:focus {
  outline: none;
  box-shadow: 0 4px 25px rgba(0,0,0,0.3);
}

.hero-search-icon {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
}

.hero-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  margin-top: 0.5rem;
  text-align: left;
  z-index: 100;
}

.hero-search-results.active {
  display: block;
}

.hero-search-result-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  color: #333;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-search-result-item:hover {
  background: #f5f5f5;
}

.hero-search-result-item:last-child {
  border-bottom: none;
}

.hero-search-result-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.hero-search-result-info {
  flex: 1;
}

.hero-search-result-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.hero-search-result-meta {
  font-size: 0.85rem;
  color: #666;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: #333;
  color: white;
  padding: 0;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #667eea;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

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

.footer-links a:hover {
  color: white;
}

.footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-tag {
  background: rgba(102, 126, 234, 0.3);
  color: #ccc;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.footer-tag:hover {
  background: #667eea;
  color: white;
}

.footer-more,
.footer-section .more-link {
  display: inline-block;
  margin-top: 1rem;
  color: #667eea;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-more:hover,
.footer-section .more-link:hover {
  color: #8b9df0;
}

.footer-about {
  grid-column: span 1;
}

.footer-desc {
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-bottom {
  background: rgba(0,0,0,0.2);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  color: #999;
}

.footer-bottom a {
  color: #aaa;
  text-decoration: none;
  margin: 0 0.25rem;
}

.footer-bottom a:hover {
  color: white;
}

/* ==========================================================================
   Static Pages
   ========================================================================== */
.static-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.static-content h2 {
  font-size: 1.5rem;
  color: #333;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #667eea;
}

.static-content h2:first-child {
  margin-top: 0;
}

.static-content h3 {
  font-size: 1.2rem;
  color: #444;
  margin: 1.5rem 0 0.75rem;
}

.static-content p {
  margin-bottom: 1rem;
  color: #555;
  line-height: 1.8;
}

.static-content ul,
.static-content ol {
  margin: 1rem 0 1rem 1.5rem;
  color: #555;
}

.static-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.static-content a {
  color: #667eea;
  text-decoration: none;
}

.static-content a:hover {
  text-decoration: underline;
}

.static-content .last-updated {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
  color: #888;
}

.contact-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
}

.contact-info p {
  margin-bottom: 0.5rem;
}

.contact-info a {
  color: #667eea;
  font-weight: 600;
}

/* ==========================================================================
   Worksheet Page
   ========================================================================== */
.worksheet-page {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.worksheet-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
}

.worksheet-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.worksheet-description {
  opacity: 0.9;
  font-size: 1rem;
}

.worksheet-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
}

.worksheet-preview {
  text-align: center;
}

.preview-image {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.button-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.download-btn,
.answer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
}

.download-btn:hover,
.answer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.answer-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.answer-btn:hover {
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.answer-btn.active {
  background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.answer-image {
  border: 3px solid #28a745;
}

.worksheet-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
}

.info-card h3 {
  color: #667eea;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-weight: 600;
  color: #333;
}

.info-link {
  text-decoration: none;
  transition: color 0.2s;
}

.info-link:hover {
  color: #667eea;
  text-decoration: underline;
}

.difficulty-easy {
  color: #28a745;
}

.difficulty-medium,
.difficulty-intermediate {
  color: #ffc107;
}

.difficulty-hard {
  color: #dc3545;
}

.objectives-list {
  list-style: none;
  padding: 0;
}

.objectives-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.objectives-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: #667eea;
  font-weight: bold;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: #667eea;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  display: inline-block;
}

.tag:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

/* ==========================================================================
   Related Worksheets
   ========================================================================== */
.related-section {
  margin-top: 2rem;
}

.related-title {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.related-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.related-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.related-card-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.related-card-content {
  padding: 1rem;
}

.related-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.related-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.related-card-tag {
  background: #f0f0f0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  color: #666;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  /* Navbar */
  .navbar {
    padding: 0.75rem 1rem;
  }

  .navbar-container {
    flex-wrap: nowrap;
  }

  .navbar-brand {
    font-size: 1.25rem;
  }

  .navbar-nav {
    gap: 0.75rem;
  }

  .navbar-nav > a.nav-link,
  .nav-link {
    display: none;
  }

  /* Hide desktop search on mobile */
  .search-input-wrapper,
  .search-results {
    display: none !important;
  }

  .lang-toggle {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  /* Show hamburger on mobile */
  .hamburger-btn {
    display: flex;
  }

  /* Page Header */
  .page-header h1 {
    font-size: 1.5rem;
  }

  /* Breadcrumb */
  .breadcrumb {
    font-size: 0.8rem;
  }

  .breadcrumb-current {
    max-width: 150px;
  }

  /* Main Content */
  .main-content {
    padding: 0 1rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
  }

  /* Worksheet Page */
  .worksheet-content {
    grid-template-columns: 1fr;
  }

  /* Static Page */
  .static-content {
    padding: 1.5rem;
  }

  .static-content h2 {
    font-size: 1.25rem;
  }
}

@media (min-width: 769px) {
  .search-modal {
    display: none !important;
  }

  .mobile-menu,
  .mobile-menu-overlay {
    display: none !important;
  }
}
