/* public/themes/modern-white/assets/css/responsive.css */

/* ============================================================
   Mobile-first hardening
   ============================================================ */

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
iframe {
  max-width: 100%;
}

.card,
.cp-callout,
.cp-auth-card,
.lp-panel,
.cp-learn-content,
.cp-course-block-anchor {
  min-width: 0;
  max-width: 100%;
}

/* ============================================================
   Typography
   ============================================================ */

.cp-title,
.lp-title {
  font-size: clamp(1.75rem, 7vw, 3.5rem);
  line-height: 1.08;
}

.cp-subtitle,
.lp-subtitle {
  font-size: clamp(1rem, 3.8vw, 1.25rem);
  line-height: 1.55;
}

.cp-md {
  overflow-wrap: anywhere;
}

.cp-md h1,
.cp-md h2,
.cp-md h3,
.cp-md h4,
.cp-md p,
.cp-md li {
  overflow-wrap: anywhere;
}

/* ============================================================
   Landing
   ============================================================ */

.lp-hero__inner,
.lp-features__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.lp-hero {
  padding: 28px 14px;
}

.lp-features,
.lp-how {
  padding-left: 14px;
  padding-right: 14px;
}

.lp-actions,
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lp-actions .btn,
.form-actions .btn {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   Auth forms
   ============================================================ */

.cp-auth-wrap {
  padding: 16px 12px;
}

.cp-auth-card {
  width: 100%;
  padding: 18px;
}

.input,
.select,
textarea {
  max-width: 100%;
}

/* ============================================================
   Learning player
   ============================================================ */

.cp-grid--learn,
.cp-grid--learn--no-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-width: 0;
}

.cp-learn-sidebar {
  display: none;
}

.cp-learn-content {
  width: 100%;
  padding: 14px;
  overflow-x: hidden;
}

.cp-learn-topbar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cp-sidebar-toggle {
  display: inline-flex;
}

/* ============================================================
   Course blocks
   ============================================================ */

.ub-card,
.ub-columns,
.ub-section,
.ub-note,
.ub-text,
.ub-image,
.ub-video,
.ub-table,
.ub-code {
  min-width: 0;
  max-width: 100%;
}

.ub-columns__grid,
.ub-columns__col {
  min-width: 0;
}

.cp-learn-content table,
.cp-table-wrap,
pre,
.cp-code {
  max-width: 100%;
  overflow-x: auto;
}

pre,
code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ============================================================
   Assessments
   ============================================================ */

.cp-assess-q {
  padding: 14px;
}

.cp-choice,
.cp-match-row {
  min-width: 0;
}

.cp-match-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.cp-match-left,
.cp-match-right {
  min-width: 0;
}

/* ============================================================
   Tablet+
   ============================================================ */

@media (min-width: 640px) {
  .lp-actions,
  .form-actions {
    flex-direction: row;
  }

  .lp-actions .btn,
  .form-actions .btn {
    width: auto;
  }

  .cp-match-row {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
  }
}

/* ============================================================
   Desktop
   ============================================================ */

@media (min-width: 900px) {
  .lp-hero {
    padding: 56px 24px;
  }

  .lp-hero__inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    align-items: center;
  }

  .lp-features__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cp-grid--learn {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .cp-learn-sidebar {
    display: block;
  }

  .cp-learn-content {
    padding: 22px;
  }
}

/* ============================================================
   Mobile layout: header/footer compactos
   ============================================================ */

@media (max-width: 639px) {
  .nav,
  .lp-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--c-surface) 92%, transparent);
    border-bottom: 1px solid var(--c-border);
  }

  .nav-inner,
  .lp-header__inner,
  .layout-public .lp-header__inner {
    min-height: 56px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 10px;
  }

  .brand,
  .layout-public .lp-brand {
    gap: 10px;
  }

  .brand-logo,
  .lp-brand__logo,
  .layout-public .lp-brand__logo {
    width: 34px;
    height: 34px;
  }

  .brand-title,
  .lp-brand__title,
  .layout-public .lp-brand__title {
    font-size: .95rem;
    line-height: 1.1;
  }

  .brand-subtitle,
  .lp-brand__subtitle,
  .layout-public .lp-brand__subtitle,
  .brand .badge,
  .lp-brand .badge {
    display: none;
  }

  .nav-links,
  .lp-header__nav,
  .layout-public .lp-header__nav {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .nav-links > a:not(.btn):not(:first-child),
  .lp-header__link:not(:first-child) {
    display: none;
  }

  .layout-public .lp-header__link,
  .nav-links > a:not(.btn) {
    font-size: .88rem;
  }

  .nav-links .btn,
  .lp-header__nav .btn,
  .layout-public .lp-header__nav .btn,
  .nav-logout .btn {
    min-height: 34px;
    padding: 7px 12px;
    font-size: .88rem;
  }

  main.container,
  .lp-main {
    padding-top: 12px;
  }

  .cp-footer-min,
  .lp-footer {
    padding: 10px 12px 14px;
    border-top: 1px solid var(--c-border);
  }

  .cp-footer-min__inner,
  .lp-footer__inner {
    display: block;
    text-align: center;
  }

  .cp-footer-min__brand,
  .lp-footer__brandRow,
  .lp-footer__cols {
    display: none;
  }

  .lp-footer__brand {
    text-align: center;
  }

  .cp-footer-min__meta,
  .lp-footer__meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
    font-size: .76rem;
    line-height: 1.4;
    color: var(--c-muted);
  }

  .cp-footer-min__dot {
    display: none;
  }

  .lp-footer-mobile-legal {
    display: block;
    margin-top: 8px;
    text-align: center;
  }

  .lp-footer-mobile-legal summary {
    cursor: pointer;
    color: var(--c-muted);
    font-size: .78rem;
    list-style: none;
  }

  .lp-footer-mobile-legal summary::-webkit-details-marker {
    display: none;
  }

  .lp-footer-mobile-legal__links {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: .8rem;
  }
}

@media (min-width: 640px) {
  .lp-footer-mobile-legal {
    display: none;
  }
}