/* LOREUM Design System RC5.32 | Phone + small-tablet refinements.
 * Isolated mobile stylesheet; WordPress loads this only at max-width:720px.
 * Do not alter the desktop masthead, mega menu or article/card layouts.
 */
@media screen and (max-width:720px) {
  /* A balanced two-row masthead. The menu gets a dedicated target; social
     icons and the search field share row two without squeezing the logo. */
  body :is(.ld-home,.ld-global-header) .ld-header {
    padding:14px 0 12px!important;
    overflow:visible!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-header-row {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:auto auto!important;
    align-items:center!important;
    column-gap:12px!important;
    row-gap:10px!important;
    padding:0!important;
    border:0!important;
    min-width:0!important;
  }
  /* Let the search form and menu toggle occupy distinct grid cells, while
     their original .ld-tools container still works on the desktop. */
  body :is(.ld-home,.ld-global-header) .ld-header .ld-tools {
    display:contents!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-brand {
    grid-column:1/-1!important;
    grid-row:1!important;
    justify-self:start!important;
    align-self:center!important;
    width:auto!important;
    max-width:calc(100% - 58px)!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    text-align:left!important;
    line-height:1!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-brand:has(.ld-logo-picture),
  body :is(.ld-home,.ld-global-header) .ld-header .ld-logo-picture {
    width:min(225px,61vw)!important;
    max-width:100%!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-logo {
    display:block!important;
    width:auto!important;
    height:auto!important;
    max-width:100%!important;
    max-height:70px!important;
    object-fit:contain!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-menu-toggle {
    grid-column:2!important;
    grid-row:1!important;
    justify-self:end!important;
    align-self:center!important;
    z-index:2;
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
    padding:8px!important;
    margin:0!important;
    border:1px solid #525c6b!important;
    border-radius:11px!important;
    background:#202733!important;
    color:#f6f7fa!important;
    font-size:23px!important;
    line-height:1!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-social {
    grid-column:1!important;
    grid-row:2!important;
    justify-self:start!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    flex-wrap:nowrap!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    gap:6px!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-social:empty {
    display:none!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-social a {
    flex:0 0 34px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    min-height:34px!important;
    padding:0!important;
    border-radius:9px!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-social .ld-social-icon {
    width:19px!important;
    height:19px!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-tools form {
    grid-column:2!important;
    grid-row:2!important;
    display:flex!important;
    align-items:center!important;
    justify-self:stretch!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    height:40px!important;
    margin:0!important;
    padding:0!important;
    border:1px solid #525c6b!important;
    border-radius:12px!important;
    background:#1b222e!important;
    overflow:hidden!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-tools input[type=search] {
    flex:1 1 0!important;
    width:0!important;
    min-width:0!important;
    height:100%!important;
    padding:0 0 0 11px!important;
    margin:0!important;
    border:0!important;
    outline-offset:-3px!important;
    color:#f4f7fb!important;
    background:transparent!important;
    font-size:14px!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-tools input[type=search]::placeholder {
    color:#b4bdca!important;
    opacity:1!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-tools form button {
    flex:0 0 39px!important;
    width:39px!important;
    min-width:39px!important;
    min-height:39px!important;
    height:39px!important;
    padding:0!important;
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:22px!important;
    line-height:1!important;
    color:#f5f7fb!important;
    background:transparent!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-header-row:not(:has(.ld-social a)) .ld-tools form {
    grid-column:1/-1!important;
  }
  /* The collapsed navigation must not leave a second empty frame; expanded
     menu remains an accessible accordion with the existing JS. */
  body :is(.ld-home,.ld-global-header) .ld-header.ld-nav-enhanced .ld-nav:not(.ld-menu-open) {
    display:none!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav.ld-menu-open {
    margin:14px 0 0!important;
    padding:6px 0 0!important;
    border-top:1px solid #343b48!important;
    border-bottom:0!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav .ld-menu > li > a {
    justify-content:flex-start!important;
    text-align:left!important;
    border-radius:9px!important;
  }
  /* One separator, sensible whitespace and a legible date line. */
  body.ld-new-home .ld-home .ld-dateline {
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:8px!important;
    padding:13px 0 12px!important;
    margin:0 0 15px!important;
    border-top:1px solid #343b48!important;
    font-size:10px!important;
    line-height:1.4!important;
    letter-spacing:.04em!important;
  }
  body.ld-new-home .ld-home .ld-dateline time {
    flex:none!important;
    white-space:nowrap!important;
  }

  /* Main article is the visual anchor; other two stories become readable
     image + headline rows instead of two clipped thumbnail columns. */
  body.ld-new-home .ld-home .ld-hero {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto!important;
    gap:13px!important;
    align-items:stretch!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:first-child {
    grid-column:1!important;
    grid-row:auto!important;
    min-height:325px!important;
    border:0!important;
    border-radius:17px!important;
    overflow:hidden!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:first-child .ld-card-link {
    min-height:325px!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:first-child .ld-copy {
    padding:84px 17px 18px!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:first-child .ld-copy h2 {
    font-size:clamp(24px,6vw,30px)!important;
    line-height:1.16!important;
    letter-spacing:-.025em!important;
    margin:8px 0 12px!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:not(:first-child) {
    min-height:0!important;
    padding:0 0 12px!important;
    margin:0!important;
    border:0!important;
    border-bottom:1px solid #343b48!important;
    overflow:visible!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:not(:first-child) .ld-card-link {
    display:grid!important;
    grid-template-columns:minmax(0,38%) minmax(0,1fr)!important;
    gap:13px!important;
    align-items:start!important;
    height:auto!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:not(:first-child) .ld-image {
    display:block!important;
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:4/3!important;
    overflow:hidden!important;
    border-radius:11px!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:not(:first-child) .ld-image img {
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:not(:first-child) .ld-copy {
    display:block!important;
    position:relative!important;
    inset:auto!important;
    min-width:0!important;
    padding:0!important;
    margin:0!important;
    background:none!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:not(:first-child) .ld-copy h2 {
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:3!important;
    overflow:hidden!important;
    margin:5px 0 8px!important;
    font-size:clamp(15px,3.8vw,17px)!important;
    line-height:1.28!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:not(:first-child) .ld-copy .ld-tag {
    font-size:10px!important;
    padding:4px 7px!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:not(:first-child) .ld-meta {
    font-size:10px!important;
    gap:5px 10px!important;
    line-height:1.3!important;
  }
  /* Keep the below-the-fold editorial cards legible in two columns. */
  body.ld-new-home .ld-home .ld-latest {margin-top:28px!important}
  body.ld-new-home .ld-home .ld-topic {margin-top:34px!important}
  body.ld-new-home .ld-home .ld-section-title h2 {font-size:23px!important}
  body.ld-new-home .ld-home .ld-grid,
  body.ld-new-home .ld-home .ld-topic-grid {gap:15px 12px!important}
}

@media screen and (max-width:365px) {
  /* At 320–365px, give search its full-width row rather than truncating it. */
  body :is(.ld-home,.ld-global-header) .ld-header .ld-header-row {
    grid-template-rows:auto auto auto!important;
    row-gap:9px!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-tools form {
    grid-column:1/-1!important;
    grid-row:2!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-social {
    grid-column:1/-1!important;
    grid-row:3!important;
    justify-self:start!important;
  }
  body.ld-new-home .ld-home .ld-hero .ld-card:first-child,
  body.ld-new-home .ld-home .ld-hero .ld-card:first-child .ld-card-link {
    min-height:310px!important;
  }
}

/* RC5.33 | Magazine reading flow on phones only.
   All selectors below are paired with mobile media boundaries; no desktop
   changes and no interference with the external ad delivery components. */
@media screen and (max-width:720px) {
  /* Mobile accordion: clear tappable targets and a distinct expanded state.
     The navigation still consumes WordPress menu items and real URLs. */
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav.ld-menu-open {
    background:#171e2a!important;
    border:1px solid #394557!important;
    border-radius:14px!important;
    padding:9px!important;
    margin-top:13px!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav .ld-menu {
    margin:0!important;
    padding:0!important;
    gap:0!important;
    max-height:min(68vh,580px)!important;
    max-height:min(68dvh,580px)!important;
    overflow-y:auto!important;
    scrollbar-gutter:stable;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav .ld-menu > li {
    min-width:0!important;
    padding:2px 0!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav .ld-menu > li > a {
    font-size:13px!important;
    min-width:0!important;
    min-height:46px!important;
    padding:11px 12px!important;
    overflow-wrap:anywhere!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav .ld-menu .ld-sub-toggle {
    min-width:46px!important;
    min-height:46px!important;
    border-radius:10px!important;
    background:#273246!important;
    margin:1px 2px!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav .ld-menu li.ld-sub-open > .ld-sub-toggle {
    color:#fff!important;
    background:#a62b44!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav .ld-menu li > ul.sub-menu {
    background:#202b3d!important;
    max-height:none!important;
    padding:8px!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav .ld-menu li > ul.sub-menu li > a {
    min-height:44px!important;
    line-height:1.3!important;
    padding:11px 12px!important;
    font-size:13px!important;
  }
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav .ld-menu .ld-sub-toggle:focus-visible,
  body :is(.ld-home,.ld-global-header) .ld-header .ld-menu-toggle:focus-visible {
    outline:3px solid #ffd19a!important;
    outline-offset:2px!important;
  }

  /* Make long section titles readable; retain the real "Všechny články" link. */
  body.ld-new-home .ld-home .ld-section-title {
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:8px 12px!important;
  }
  body.ld-new-home .ld-home .ld-section-title h2 {
    min-width:0!important;
    max-width:100%!important;
    overflow-wrap:break-word!important;
    line-height:1.2!important;
  }
  body.ld-new-home .ld-home .ld-section-title > a {
    min-height:36px!important;
    display:inline-flex!important;
    align-items:center!important;
    font-size:12px!important;
  }
  body.ld-new-home .ld-home .ld-section-title > a span {
    display:inline!important;
  }

  /* The optional global footer turns into a normal readable vertical stack
     on phones; its markup, links and desktop columns remain unchanged. */
  body.ld-global .ld-global-footer .ld-footer-inner {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:18px!important;
  }
  body.ld-global .ld-global-footer {
    padding:28px 18px!important;
  }
  body.ld-global .ld-global-footer .ld-footer-heading {
    margin-bottom:10px!important;
  }
  body.ld-global .ld-global-footer .ld-footer-links a {
    display:inline-flex!important;
    align-items:center!important;
    min-height:42px!important;
  }
  body.ld-global .ld-global-footer .ld-footer-legal {
    padding-top:12px!important;
    border-top:1px solid #344153!important;
  }

  /* Mobile archive pagination is touch-friendly, never a narrow row of links. */
  body.ld-archive-style .ld-archive .ld-pagination .page-numbers {
    min-width:43px!important;
    min-height:43px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    margin:3px!important;
  }
}

@media screen and (max-width:520px) {
  /* Listing cards in Latest / topics / editor picks / archives:
     one story per row, thumbnail left, headline right, compact metadata.
     Avoid truncating the entire card by fixing a pixel height. */
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid),
  body.ld-archive-style .ld-archive .ld-grid {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:0!important;
  }
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) > .ld-card,
  body.ld-archive-style .ld-archive .ld-grid > .ld-card {
    min-width:0!important;
    padding:12px 0!important;
    margin:0!important;
    background:transparent!important;
    border:0!important;
    border-bottom:1px solid #353e4c!important;
    border-radius:0!important;
    overflow:visible!important;
  }
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) > .ld-card .ld-card-link,
  body.ld-archive-style .ld-archive .ld-grid > .ld-card .ld-card-link {
    display:grid!important;
    grid-template-columns:minmax(0,37%) minmax(0,1fr)!important;
    gap:12px!important;
    align-items:start!important;
    min-width:0!important;
    height:auto!important;
  }
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) > .ld-card .ld-image,
  body.ld-archive-style .ld-archive .ld-grid > .ld-card .ld-image {
    display:block!important;
    position:relative!important;
    inset:auto!important;
    aspect-ratio:4/3!important;
    width:100%!important;
    height:auto!important;
    overflow:hidden!important;
    border-radius:10px!important;
  }
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) > .ld-card .ld-image img,
  body.ld-archive-style .ld-archive .ld-grid > .ld-card .ld-image img {
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    display:block!important;
  }
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) > .ld-card .ld-copy,
  body.ld-archive-style .ld-archive .ld-grid > .ld-card .ld-copy {
    position:relative!important;
    inset:auto!important;
    display:block!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    background:none!important;
  }
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) > .ld-card .ld-copy :is(h2,h3),
  body.ld-archive-style .ld-archive .ld-grid > .ld-card .ld-copy :is(h2,h3) {
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:4!important;
    overflow:hidden!important;
    font-size:clamp(14px,3.8vw,17px)!important;
    line-height:1.3!important;
    margin:5px 0 7px!important;
    overflow-wrap:anywhere!important;
  }
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) > .ld-card .ld-meta,
  body.ld-archive-style .ld-archive .ld-grid > .ld-card .ld-meta {
    display:flex!important;
    flex-wrap:wrap!important;
    gap:3px 8px!important;
    font-size:10px!important;
    line-height:1.35!important;
  }
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) > .ld-card .ld-tag,
  body.ld-archive-style .ld-archive .ld-grid > .ld-card .ld-tag {
    font-size:9px!important;
    padding:3px 7px!important;
  }
  body.ld-archive-style .ld-archive > h1 {
    font-size:clamp(25px,6.5vw,31px)!important;
    line-height:1.18!important;
    overflow-wrap:anywhere!important;
  }
}

@media screen and (max-width:365px) {
  /* No clipped headlines on small 320px phones. */
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) > .ld-card .ld-card-link,
  body.ld-archive-style .ld-archive .ld-grid > .ld-card .ld-card-link {
    grid-template-columns:minmax(0,34%) minmax(0,1fr)!important;
    gap:10px!important;
  }
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) > .ld-card .ld-copy :is(h2,h3),
  body.ld-archive-style .ld-archive .ld-grid > .ld-card .ld-copy :is(h2,h3) {
    font-size:14px!important;
  }
}

@media screen and (max-width:720px) and (prefers-reduced-motion:reduce) {
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav,
  body.ld-new-home .ld-home :is(.ld-grid,.ld-topic-grid) .ld-card img {
    transition:none!important;
    animation:none!important;
  }
}

/* Final mobile alignment override for Jannah's high-specificity centered nav. */
@media screen and (max-width:720px) {
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav ul.ld-menu > li > a,
  body :is(.ld-home,.ld-global-header) .ld-header .ld-nav ul.ld-menu li > ul.sub-menu li > a {
    justify-content:flex-start!important;
    text-align:left!important;
  }
}

@media screen and (max-width:720px){body :is(.ld-home,.ld-global-header) .ld-header .ld-header-row{grid-template-rows:auto auto auto!important}body :is(.ld-home,.ld-global-header) .ld-header .ld-account-link{grid-column:1/-1!important;grid-row:3!important;justify-self:end!important;min-height:44px!important}}
