/* ═══════════════════════════════════════════════════════════════
   LANDSCAPE RESPONSIVE — Mobile & Tablet
   Optimize layouts for orientation: landscape
═══════════════════════════════════════════════════════════════ */

/* ─── General Mobile Landscape Rules ─── */
@media (max-width: 1024px) and (orientation: landscape) {
  body {
    --section-padding: 48px 20px;
  }
  
  html, body {
    max-height: 100vh;
    overflow-x: hidden;
  }
  
  /* Reduce vertical padding in landscape */
  section, .section {
    padding: 32px 0;
  }
  
  .nav {
    padding: 8px 0;
  }
  
  .nav-logo span {
    display: none;
  }
}

/* ─── Navigation in Landscape ─── */
@media (max-width: 768px) and (orientation: landscape) {
  .nav {
    flex-wrap: wrap;
    height: auto;
    padding: 6px 12px;
  }
  
  .nav-links {
    gap: 6px;
    font-size: 12px;
  }
  
  .nav-links a {
    padding: 4px 8px;
  }
}

/* ─── Cards & Grids in Landscape ─── */
@media (max-width: 1024px) and (orientation: landscape) {
  .tools-grid,
  .arsenal-body .tools-grid,
  .quetes-grid,
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
  }
  
  .modal-box {
    max-height: 85vh;
    max-width: 90vw;
  }
}

/* ─── Text & Font sizes in Landscape ─── */
@media (max-height: 600px) and (orientation: landscape) {
  .arsenal-title,
  .sec-h,
  .quetes-hero {
    font-size: clamp(18px, 4vw, 28px);
  }
  
  .sec-p,
  .tool-desc,
  p {
    font-size: 13px;
  }
  
  button {
    padding: 6px 12px;
  }
}

/* ─── Modal & Input Landscape ─── */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
  .modal-box {
    max-height: 90vh;
  }
  
  .modal-body {
    padding: 12px 16px;
    overflow-y: auto;
    max-height: 60vh;
  }
  
  .ef {
    margin-bottom: 10px;
  }
  
  .ef label {
    margin-bottom: 3px;
  }
  
  .ef input,
  .ef textarea {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ─── Tables in Landscape ─── */
@media (max-width: 1024px) and (orientation: landscape) {
  table {
    font-size: 12px;
  }
  
  th, td {
    padding: 8px 6px;
  }
}

/* ─── Buttons in Landscape ─── */
@media (max-width: 768px) and (orientation: landscape) {
  .btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .btn-primary,
  .btn-ghost {
    padding: 6px 12px;
  }
}

/* ─── Forms in Landscape ─── */
@media (max-width: 768px) and (orientation: landscape) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  textarea,
  select {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  .oracle-wrap {
    padding: 24px 16px 60px;
  }
  
  .oracle-card {
    padding: 12px;
  }
  
  .oracle-input {
    min-height: 80px;
    padding: 10px;
  }
}

/* ─── Stats & KPI Cards in Landscape ─── */
@media (max-width: 1024px) and (orientation: landscape) {
  .quetes-stats,
  .qstat {
    gap: 10px;
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .dc-card {
    padding: 12px;
  }
}

/* ─── Reduce spacing in very tight landscape ─── */
@media (max-height: 500px) and (orientation: landscape) {
  .quetes-header,
  .arsenal-header {
    padding: 16px 20px 12px;
  }
  
  .quetes-hero,
  .arsenal-title {
    margin-bottom: 4px;
  }
}

/* ─── Specific page adjustments ─── */

/* Oracle in landscape */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 600px) {
  .oracle-wrap {
    max-width: 900px;
    padding: 12px 16px 40px;
  }
}

/* Boutique in landscape */
@media (max-width: 1024px) and (orientation: landscape) {
  .item-card {
    padding: 12px;
  }
}

/* Architecte dashboard in landscape */
@media (max-width: 1024px) and (orientation: landscape) and (max-height: 700px) {
  .dc-card {
    margin-bottom: 10px;
  }
  
  .dc-table thead,
  .dc-table tbody {
    font-size: 12px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOB-01 — Message de rotation forcée (portrait → paysage)
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) and (orientation: portrait) {
  body::before {
    content: "↻ Tournez votre écran pour une meilleure expérience";
    position: fixed;
    inset: 0;
    background: #07070F;
    color: #F0C040;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-align: center;
    padding: 2rem;
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    letter-spacing: 0.02em;
    line-height: 1.6;
  }
  body { overflow: hidden; }
}
