/* =========================================
   SMART HOME CINEMA — DESKTOP
   ========================================= */

.tutorial-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto 40px auto;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,0,0,0.25);
}

.main-wrapper,
.content,
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

h1, h2, h3, h4 {
  line-height: 1.25;
}

p {
  line-height: 1.7;
  max-width: 75ch;
}

ul, ol {
  line-height: 1.7;
}

img {
  max-width: 100%;
  height: auto;
}

/* =========================================
   MOBILE — FINAL & FUNCTIONAL
   ========================================= */
@media (max-width: 900px) {

  html, body {
    width: 100%;
    overflow-x: hidden;
  }

  .app {
    display: block;
  }

  /* ===== Mobile header ===== */
  .mobile-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--panel);
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .mobile-menu-toggle {
    border: 1px solid #2b385b;
    background: var(--panel2);
    color: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 15px;
    cursor: pointer;
  }

  /* ===== Sidebar overlay ===== */
  .sidebar {
    position: fixed;
    inset: 0;
    width: 80%;
    max-width: 320px;
    background: linear-gradient(180deg, var(--panel), var(--panel2));
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* ===== Close button ===== */
  .mobile-close {
    display: block;
    padding: 14px 16px;
    font-size: 16px;
    cursor: pointer;
    border-bottom: var(--line);
    background: rgba(0,0,0,0.35);
  }

  /* ===== Content ===== */
  .page,
  .content,
  .main-wrapper {
    max-width: 100%;
    padding: 16px;
  }

  body {
    font-size: 18px;
    line-height: 1.8;
  }

  p, li {
    font-size: 16px;
    line-height: 1.75;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  h1 { font-size: 24px; }
  h2 { font-size: 21px; }
  h3 { font-size: 18px; }

  /* ===== Images ===== */
  .tutorial-image {
    width: 100%;
    margin: 16px 0 28px;
  }

  /* ===== Tables & code ===== */
  table {
    display: block;
    overflow-x: auto;
  }

  pre {
    white-space: pre-wrap;
    font-size: 14px;
  }
}

/* ===============================
   MOBILE CLOSE — FINAL FIX
   =============================== */
@media (max-width: 900px){
  .mobile-close{
    position: sticky;
    top: 0;
    z-index: 1001;

    display: block;
    width: 100%;
    padding: 14px 16px;

    font-size: 16px;
    font-weight: 600;
    color: #ffffff;

    background: linear-gradient(
      180deg,
      rgba(15,22,41,.98),
      rgba(15,22,41,.90)
    );

    border: none;
    border-bottom: var(--line);
    cursor: pointer;
  }
}

/* ===============================
   HARD MOBILE OVERRIDE — FIX LAYOUT
   =============================== */
@media (max-width: 600px){

  /* forțează layout simplu */
  .app{
    display: block !important;
  }

  /* sidebar rămâne overlay */
  .sidebar{
    position: fixed !important;
    inset: 0 !important;
    width: 80% !important;
    max-width: 320px !important;
    transform: translateX(-100%);
  }

  .sidebar.open{
    transform: translateX(0);
  }

  /* content full width */
  .content,
  .page,
  .main-wrapper{
    width: 100% !important;
    max-width: 100% !important;
  }

  /* OPREȘTE orice layout pe coloane */
  section,
  .card,
  .steps > li,
  .grid2,
  .grid3{
    display: block !important;
    width: 100% !important;
  }
}


