/* ==========================================================================
   리눅스 커널 정리 /with MINZKN - Responsive Styles
   Breakpoints: 1200px, 768px, 480px
   ========================================================================== */

/* ---------- Tablet: TOC 숨김 ---------- */
@media (max-width: 1200px) {
  .page-wrapper {
    grid-template-columns: 260px 1fr;
    grid-template-areas:
      "header header"
      "nav    main"
      "footer footer";
  }

  .toc-sidebar {
    display: none;
  }

  .inline-toc {
    display: block;
  }

  .main-content {
    padding: 1.5em 2em;
  }

  .search-input {
    width: 200px;
  }

  .search-input:focus {
    width: 260px;
  }
}

/* ---------- Mobile: 햄버거 메뉴 ---------- */
@media (max-width: 768px) {
  .page-wrapper {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main"
      "footer";
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .side-nav {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 95;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
  }

  .side-nav.open {
    transform: translateX(0);
  }

  .main-content {
    padding: 1.2em 1.5em;
  }

  .hero {
    padding: 2em 1.5em;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.15rem; }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .search-input {
    width: 160px;
  }

  .search-input:focus {
    width: 220px;
  }

  .page-nav {
    flex-direction: column;
  }

  .page-nav a {
    max-width: 100%;
  }

  table {
    font-size: 0.82rem;
  }

  th, td {
    padding: 0.4em 0.6em;
  }

  pre {
    font-size: 0.8rem;
    padding: 0.8em;
  }

  .diagram-container {
    padding: 1em;
  }

  .back-to-top {
    bottom: 1.2em;
    right: 1.2em;
    width: 40px;
    height: 40px;
  }

  .header-title .title-full {
    display: none;
  }

  .header-title .title-short {
    display: inline;
  }
}

/* Show full title by default, hide short */
.header-title .title-short {
  display: none;
}

/* ---------- Small Mobile ---------- */
@media (max-width: 480px) {
  .home-icon {
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
  }

  .footer-powered {
    text-align: center;
  }

  .main-content {
    padding: 1em;
  }

  .hero {
    padding: 1.5em 1em;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }

  .search-container {
    display: none;
  }

  .mobile-search-toggle {
    display: flex;
  }

  .search-mobile {
    display: block;
    padding: 0.6em 1em;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
  }

  .search-mobile .search-input {
    width: 100%;
  }

  .card-grid {
    gap: 0.8em;
  }

  .card {
    padding: 1em;
  }

  .info-box {
    padding: 0.8em;
    flex-direction: column;
    gap: 0.4em;
  }

  pre {
    font-size: 0.75rem;
    border-radius: 6px;
  }

  .ascii-art {
    font-size: 0.7rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.6em;
  }
  .beginner-guide { padding: 1em; }
  .beginner-guide h2 { font-size: 1.1rem; }
}

/* ---------- Large screens ---------- */
@media (min-width: 1601px) {
  .page-wrapper {
    max-width: 1800px;
    grid-template-columns: 280px 1fr 240px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
