/* OKU · 2026-11-11 · Phone-only reading and artwork safety.
   Scope: the original home action, verse, listening and feature cards.
   Existing colours, routes, art, desktop layout and master portraits stay intact. */

@media (max-width: 620px) {
  /* The verse and its translation must never be clipped by a fixed-height mask. */
  #screen-home .home-daily-card {
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    gap:14px!important;
    padding:48px 22px 22px!important;
  }
  #screen-home .home-daily-title {
    max-width:100%!important;
    font-size:clamp(28px,7.6vw,38px)!important;
    line-height:1.12!important;
    white-space:normal!important;
    overflow-wrap:break-word!important;
  }
  #screen-home .home-daily-date {
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:5px!important;
    text-align:left!important;
  }
  #screen-home .home-daily-date p {
    max-width:100%!important;
    overflow-wrap:break-word!important;
  }
  #screen-home .home-daily-copy {
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    align-content:start!important;
    justify-items:center!important;
    gap:14px!important;
    margin:8px 0 0!important;
  }
  #screen-home .home-daily-arabic {
    font-size:clamp(24px,6.5vw,34px)!important;
    line-height:1.6!important;
  }
  #screen-home .home-daily-translation {
    font-size:clamp(16px,4.4vw,21px)!important;
    line-height:1.48!important;
    overflow-wrap:break-word!important;
    word-break:normal!important;
  }
  #screen-home .home-daily-go {
    position:relative!important;
    inset:auto!important;
    align-self:flex-end!important;
    min-height:44px!important;
    margin:4px 0 0!important;
    padding:8px 0!important;
  }

  /* Long translated 06 / 07 descriptions get the card's full width.
     The artwork is a separate row, never a squeezed fixed grid column. */
  #screen-home .home-feature-grid > .home-feature-card {
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:49px 21px 58px!important;
  }
  #screen-home .home-feature-card .home-feature-copy {
    display:flex!important;
    flex-direction:column!important;
    align-self:stretch!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    gap:12px!important;
    padding:0!important;
  }
  #screen-home .home-feature-card .home-feature-copy > strong {
    max-width:100%!important;
    font-size:clamp(24px,6.8vw,34px)!important;
    line-height:1.14!important;
    white-space:normal!important;
    overflow-wrap:break-word!important;
  }
  #screen-home .home-feature-card .home-feature-copy > span {
    max-width:100%!important;
    font-size:clamp(13px,3.45vw,16px)!important;
    line-height:1.45!important;
    overflow-wrap:break-word!important;
  }
  #screen-home .home-feature-card > .home-feature-art {
    position:relative!important;
    inset:auto!important;
    display:block!important;
    flex:none!important;
    align-self:center!important;
    justify-self:center!important;
    width:min(58%,208px)!important;
    height:auto!important;
    max-width:100%!important;
    max-height:180px!important;
    object-fit:contain!important;
    object-position:center!important;
    margin:17px auto 4px!important;
    transform:none!important;
  }
}

@media (max-width: 420px) {
  /* Keep the original illustration fully inside the smallest action tiles. */
  #screen-home .home-action-grid > .home-action-card {
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:47px 20px 52px!important;
  }
  #screen-home .home-action-card > .home-card-copy {
    align-self:stretch!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    gap:10px!important;
  }
  #screen-home .home-action-card > .home-card-art {
    position:relative!important;
    inset:auto!important;
    align-self:flex-end!important;
    flex:none!important;
    width:min(57%,175px)!important;
    height:auto!important;
    max-width:100%!important;
    max-height:170px!important;
    object-fit:contain!important;
    object-position:center!important;
    margin:8px 0 0!important;
    transform:none!important;
  }
  #screen-home .home-action-card:is(:hover,:focus-visible) > .home-card-art {
    transform:none!important;
  }

  /* The Arabic/Turkish audio cards also keep their wording off the artwork. */
  #screen-home .home-listen-grid > .home-listen-card {
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:48px 20px 56px!important;
  }
  #screen-home .home-listen-card > .home-listen-copy {
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  #screen-home .home-listen-card > .home-listen-art {
    position:relative!important;
    inset:auto!important;
    align-self:flex-end!important;
    flex:none!important;
    width:min(48%,150px)!important;
    height:auto!important;
    max-width:100%!important;
    max-height:148px!important;
    object-fit:contain!important;
    margin:12px 0 2px!important;
    transform:none!important;
  }
}

/* Correct Persian reading direction without reversing the card layout. */
html[lang='fa'] #screen-home :is(.home-card-copy,.home-feature-copy,.home-listen-copy) {
  direction:rtl!important;
  text-align:right!important;
  unicode-bidi:plaintext;
}
html[lang='fa'] #screen-home :is(.home-daily-date,.home-daily-translation) {
  direction:rtl!important;
  unicode-bidi:plaintext;
}

/* The existing focus resets must not conceal keyboard navigation. */
#screen-home :is(.home-action-card,.home-feature-card,.home-listen-card,.home-daily-go):focus-visible {
  outline:3px solid #171717!important;
  outline-offset:4px!important;
}
html[data-oku-theme='dark'] #screen-home :is(.home-action-card,.home-feature-card,.home-listen-card,.home-daily-go):focus-visible {
  outline-color:#f5d65e!important;
}
