/* The desktop layout is intentionally left unchanged. */
@media (max-width: 767px) {
  body {
    overflow-wrap: anywhere;
  }

  header {
    padding: 16px;
  }

  header h1 {
    font-size: 1.5em;
  }

  .layout-page .container {
    flex-direction: column;
  }

  .layout-page .top-nav ul {
    flex-wrap: wrap;
    gap: 8px;
  }

  .layout-page .sidebar {
    width: 100%;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid #ddd;
  }

  .layout-page .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
  }

  .layout-page .sidebar li {
    margin-bottom: 0;
  }

  .layout-page .sidebar a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .layout-page .sidebar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
  }

  .layout-page .main-content {
    min-width: 0;
    padding: 16px;
  }

  .layout-page .blog-card,
  .layout-page .device-item {
    flex-direction: column;
    min-width: 0;
  }

  .layout-page .blog-card img {
    width: 100%;
    height: auto;
  }

  .layout-page .blog-card-content,
  .layout-page .device-info {
    min-width: 0;
    width: 100%;
  }

  .layout-page .device-item img {
    max-width: 100%;
    margin: 0 0 16px;
  }

  .layout-page .gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .layout-page .modal {
    padding: 16px;
  }

  .layout-page .modal-content {
    max-width: 100%;
    max-height: 100%;
    overflow-y: auto;
  }

  .layout-page .modal-content img {
    object-fit: contain;
    flex-shrink: 0;
    max-height: 65vh;
    max-height: 65dvh;
  }

  .layout-page .modal-caption {
    font-size: 1em;
    flex-shrink: 0;
  }

  .post-page .container {
    margin: 24px auto;
    padding: 0 16px;
  }

  .post-page .post-title {
    font-size: 1.4em;
  }

  .post-page .post-date {
    margin-bottom: 20px;
  }

  .post-page .dark-toggle {
    position: static;
    width: fit-content;
    max-width: calc(100% - 32px);
    margin: 24px 16px;
  }

  .post-page .dark-toggle label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
  }

  .post-page footer {
    margin-top: 32px;
    padding: 16px;
  }
}
