/* kroker.com.br: mobile and tablet layout adjustments.
   Loaded on every page after the page styles. The pages are rendered from the design mockup with
   inline styles, so these rules target structure and use !important to override them. */

/* Never split a word across lines (the generated pages hyphenate big titles on phones).
   When a word does not fit, kd-nav.js shrinks that title's font instead. */
.d, #dc-root * {
  -webkit-hyphens: manual !important;
  hyphens: manual !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

@media (max-width: 980px) {
  /* Hero of the home and the three lens pages: on desktop the text sits beside and over the photo.
     On small screens the photo used to come first and push the name below the first screen.
     Here the photo goes behind the text and the text rises into the first screen. */
  section[style*="wrap-reverse"]:has(> div > h1) {
    position: relative;
    display: block !important;
  }
  section[style*="wrap-reverse"]:has(> div > h1) > div:last-child {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    /* the photo fills the whole screen height below the menu bar */
    height: calc(100vh - var(--kd-nav-top, 61px)) !important;
    height: calc(100svh - var(--kd-nav-top, 61px)) !important;
    z-index: 0;
  }
  section[style*="wrap-reverse"]:has(> div > h1) > div:last-child > div {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
  }
  /* fade the photo into the background at the bottom, under the text */
  section[style*="wrap-reverse"]:has(> div > h1) > div:last-child > div > div {
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%) !important;
    mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%) !important;
  }
  /* the text starts right under the menu bar, over the photo */
  section[style*="wrap-reverse"]:has(> div > h1) > div:first-child {
    padding-top: 28px !important;
  }
  /* Hero intro lines (home and lenses): on small screens the lines wrap and run together, so every
     second line is darker to tell the topics apart. */
  section[style*="wrap-reverse"]:has(> div > h1) > div:first-child div:has(> span + span) > span:nth-child(even) {
    color: #858E94 !important;
  }
}

@media (max-width: 760px) {
  /* Two-column rows (label left, details right), e.g. Education "Domus Academy | Master in Design":
     on phones the right column was squeezed and cut. Stack them: details go under the label. */
  div[style*="460px) minmax"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Brand and award logo strips: when the device asks to reduce motion the strip does not animate
   (by design). Let people swipe through the logos instead of seeing a frozen row. */
@media (prefers-reduced-motion: reduce) {
  div:has(> .marq) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  div:has(> .marq)::-webkit-scrollbar { display: none; }
}
