/* AlgoLodge: mobilanpassning för de två portföljverktygen.
   Enbart mobil. Ändrar inte grafer, beräkningar eller desktop-vyn.
   2026-10-22 */

@media (max-width: 720px) {
  /* Jämför modeller: kompakt introduktion och tydliga länkar. */
  .cmp-hero {
    height: auto !important;
    min-height: 0 !important;
    padding: 26px 0 30px;
  }
  .cmp-hero-main {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .cmp-hero-copy { min-width: 0; width: 100%; }
  .cmp-hero h1 {
    font-size: 30px;
    line-height: 1.12;
    margin-bottom: 12px;
  }
  .cmp-hero p:not(.cmp-kicker) {
    font-size: 14px;
    line-height: 1.6;
  }
  .cmp-hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    gap: 8px;
    margin-top: 4px;
  }
  .cmp-hero-actions .cmp-guide-cta {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .cmp-content { margin-top: -18px; }
  .cmp-workspace { gap: 14px; }
  .cmp-workspace > * { min-width: 0; }
}

@media (max-width: 560px) {
  .cmp-select-panel .cmp-choice-grid { grid-template-columns: minmax(0, 1fr); }
  .cmp-feature-chart { padding: 0 12px 16px; }
}

@media (max-width: 680px) {
  /* Bygg din egen modellportfölj: undvik stor tom hero och överfulla knappar. */
  .adv-hero {
    height: auto !important;
    min-height: 0 !important;
    padding: 24px 0 30px;
  }
  .adv-hero-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  /* Originalet ger textblocket flex-basis: 540px: på en staplad mobil-flex
     gör detta elementet onödigt högt. Återställ basstorleken. */
  .adv-hero-copy {
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
  }
  .adv-hero h1 {
    font-size: 30px;
    line-height: 1.12;
    margin-bottom: 12px;
  }
  .adv-hero p:not(.adv-kicker) {
    font-size: 14px;
    line-height: 1.6;
  }
  .adv-hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    gap: 8px;
    padding-top: 0;
  }
  .adv-hero-actions .adv-back {
    display: flex;
    width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
    white-space: normal;
    padding: 10px 12px;
    overflow-wrap: anywhere;
  }
  .adv-content { margin-top: -18px; }
  .adv-two { gap: 14px; }
  .adv-two > *, .adv-right-stack > * { min-width: 0; }
  .adv-model-grid { grid-template-columns: minmax(0, 1fr); }
  .adv-chart-head { flex-direction: column; gap: 8px; }
  .adv-chart-head strong { text-align: left; }
}


/* 2026-10-22 v2 – fix the underlying mobile navigation collision.
   The old performance CSS bundle contains a GLOBAL mobile "nav" rule:
   nav { position:absolute; top:70px; background:var(--surface); ... }
   This must NOT apply to the advanced-portfolio page's hero CTA <nav>.
   Scope the correction to the two comparison pages to avoid touching
   the site's actual mobile navigation and footer. */
@media (max-width: 760px) {
  .adv-page .adv-hero {
    position: relative;
    height: auto !important;
    min-height: 0 !important;
    background: linear-gradient(130deg, #102d4b, #204966);
    color: #fff;
  }
  .adv-page .adv-hero-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    min-width: 0;
  }
  .adv-page .adv-hero-copy {
    flex: 0 1 auto !important;
    width: 100%;
    min-width: 0;
    position: static;
  }
  .adv-page nav.adv-hero-actions {
    /* Override ALL the unrelated global nav/mobile-menu declarations. */
    display: grid !important;
    position: static !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    align-content: normal;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: auto !important;
  }
  .adv-page nav.adv-hero-actions > a.adv-back {
    display: flex !important;
    position: static !important;
    width: 100% !important;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 13px !important;
    margin: 0 !important;
    box-sizing: border-box;
    border: 1px solid rgba(218,232,242,.6) !important;
    border-radius: 9px;
    background: rgba(255,255,255,.08) !important;
    color: #fff !important;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-align: center;
    text-decoration: none !important;
  }
  .adv-page nav.adv-hero-actions > a.adv-back-featured {
    background: rgba(226,195,142,.18) !important;
    border-color: rgba(229,194,140,.85) !important;
    color: #fff !important;
  }

  /* Ensure the comparison tool's CTA row stays in normal document flow. */
  .cmp-page .cmp-hero-main {
    position: relative;
    align-items: stretch;
  }
  .cmp-page .cmp-hero-actions {
    position: static !important;
    inset: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }
  .cmp-page .cmp-hero-actions > a.cmp-guide-cta {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(218,232,242,.6);
    background: rgba(255,255,255,.08);
    color: #fff !important;
    text-decoration: none !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .cmp-page .cmp-hero-actions > a.cmp-guide-feature {
    background: rgba(226,195,142,.18);
    border-color: rgba(229,194,140,.85);
    color: #fff !important;
  }
  .cmp-page .cmp-hero {height:auto !important; min-height:0 !important;}
  /* Long translations must not widen the viewport (notably ES on 320px). */
  .adv-page .adv-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }
  .adv-page .adv-field select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .adv-page .adv-content, .cmp-page .cmp-content {position:relative; z-index:1;}
}
