/*
 * HOME LAYOUT FIX — 5 Dec 2026 (owner order ~13:36 WAT: "go fix it
 * immediately"; testing version first, verify before promote).
 * Layout repair ONLY: approved colours (#b40059, bright blues, gold,
 * white), hero 5 slides LOCKED, ecosystem + footer content LOCKED.
 * Loaded last on index/testing so these scoped overrides win.
 * Phone widths (<=760px) keep the approved layout untouched.
 */

/* Defect 3 — page container: proper responsive width at desktop
   (was a fixed 1024px centred column with big white gutters).
   Full-width bands inside keep their own consistent max-widths. */
@media(min-width:1025px){
  .shell{width:min(1440px,100% - 32px)!important;max-width:1440px!important;margin-inline:auto}
}

/* Defect 2 — header: masthead grows with its content so the
   "End-Time Global Evangelization" tagline sits inside the header
   (was overflowing into the nav bar); gold rule stays aligned. */
@media(min-width:761px){
  .mast{height:auto!important;min-height:82px;align-items:center!important}
  .mast .tagline{align-self:center;line-height:1.15}
}

/* Defect 1 — nav bar: items never shrink or clip; the bar wraps to a
   second row instead of truncating labels ("About the Moven" etc.).
   Icons stay beside their text (flex, no shrink). */
@media(min-width:761px){
  .nav{height:auto!important;min-height:44px;flex-wrap:wrap!important;row-gap:2px}
  .nav a,.nav button{flex:0 0 auto!important;white-space:nowrap}
  .nav .inline-icon{flex:0 0 auto}
}

/* Defects 4+5 — ecosystem in the two-column homepage: URL pills are
   never truncated (wrap instead of ellipsis); Ministry Use tiles form
   an even 4-across row (was 2 + 1 half + 1 full). */
@media(min-width:1025px){
  .two.hk-twocol-restore .hk-eco-url{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;text-align:center}
  .two.hk-twocol-restore .hk-eco-tiles{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .two.hk-twocol-restore .hk-eco-tile:last-child{grid-column:auto!important}
}

/* Defect 4 — ecosystem cards gridded two-across at wide desktop
   (clean single stack below that and on phones, as approved). */
@media(min-width:1280px){
  .two.hk-twocol-restore .hk-eco-rows{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .two.hk-twocol-restore .hk-eco-row{align-content:start}
}

/* Defect 6 — footer Ecosystem & Quick Links swipe: rows keep the
   approved 26px height (the generic 44px min-height on footer links
   clipped every row inside its overflow:hidden 26px slot). */
footer.footer .hk-eco-list li a{min-height:26px!important}

/* Defect 7 — community advert: the emblem sizes to the owner's
   supplied group photo and the photo always fills it (was rendering
   as a blank pale box). */
.two.hk-twocol-restore .social-body.community-portrait .community-emblem{display:flex!important;align-items:center;justify-content:center;height:auto!important;min-height:0!important}
.two.hk-twocol-restore .social-body.community-portrait .community-emblem img{display:block;width:100%!important;height:auto!important;max-height:100%;object-fit:contain!important}

/* ROUND 2 — 5 Dec 2026 (browser verification of staging 107 found
   3 remaining defects). Layout repair ONLY, same locks as round 1. */

/* Defect 8 — eco URL pills never truncate at ANY width (the base
   rule ellipsised below 1025px). The pill text carries <wbr> after
   each dot (index/testing), so a squeezed pill breaks only at dot
   boundaries — never mid-word, never ellipsis. */
.two.hk-twocol-restore .hk-eco-url{white-space:normal!important;overflow:visible!important;text-overflow:clip!important}

/* Defect 8 — full URL on ONE line at desktop: at 2-across widths
   (>=1280) the pill takes its own full-width row under Visit and
   card paddings tighten (16px font floor kept; layout widened
   instead). Same stacking at <=1024 so phones/tablets never
   squeeze the pill. */
@media(min-width:1280px){
  .two.hk-twocol-restore .hk-eco-grid{padding:10px}
  .two.hk-twocol-restore .hk-eco-rows{gap:8px}
  .two.hk-twocol-restore .hk-eco-row{padding:10px 8px}
  .two.hk-twocol-restore .hk-eco-row-links{display:flex;flex-wrap:wrap}
  .two.hk-twocol-restore .hk-eco-visit{flex:1 1 100%}
  .two.hk-twocol-restore .hk-eco-url{flex:1 1 100%;padding:7px 6px}
}
@media(max-width:1024px){
  .two.hk-twocol-restore .hk-eco-row-links{display:flex;flex-wrap:wrap}
  .two.hk-twocol-restore .hk-eco-visit{flex:1 1 100%}
  .two.hk-twocol-restore .hk-eco-url{flex:1 1 100%}
}

/* Defect 9 — footer Ecosystem & Quick Links: all 8 links static at
   desktop (the 130px swipe window hid 3 of 8; the JS slide is
   neutralised and any cloned rows hidden). Approved footer
   content/order/colours unchanged; swipe kept below desktop. */
@media(min-width:1025px){
  footer.footer .hk-eco-swipe{height:auto!important;overflow:visible!important}
  footer.footer .hk-eco-list{transform:none!important}
  footer.footer .hk-eco-list li:nth-child(n+9){display:none!important}
}

/* Defect 10 — the two columns end together: the community advert
   card stretches to the ecosystem column height (photo centres,
   text distributes via its space-between flex); the members strip
   sits at the column foot. No blank white gap. */
@media(min-width:1025px){
  .two.hk-twocol-restore>.hk-social-col>section.panel{flex:1 1 auto;display:flex;flex-direction:column}
  .two.hk-twocol-restore .social-body{flex:1 1 auto}
}

/* Defect 10b — members feed failure state: the track collapses
   around the graceful message (JS wording fixed in index/testing;
   no stuck "loading" text). */
.members-track:has(>.members-error){min-height:0!important;align-items:center;justify-content:center}

/* ROUND 3 — 5 Dec 2026 (browser re-check of staging 108: one defect
   left). Layout repair ONLY, same locks as rounds 1-2. */

/* Defect 11 — the right column stretches to the full height of the
   two-column row. Round 2 stretched the advert card only, but the
   parent grid used align-items:start (restore style block), so the
   column itself never grew and a blank void sat below the Members
   card beside the lower ecosystem cards. Now: grid stretch context
   + column height:100%; the advert card keeps its round-2 flex:1
   growth (photo centres, text distributes) so the Members card is
   pinned to the column foot with no void anywhere. (margin-top:auto
   on Members is deliberately NOT used: auto margins absorb free
   space before flex-grow, which would move the void between the
   two cards instead of eliminating it.) */
@media(min-width:1025px){
  .two.hk-twocol-restore{align-items:stretch!important}
  .two.hk-twocol-restore>.hk-social-col{height:100%}
}

/* ROUND 4 — 5 Dec 2026 (browser re-check of staging 109: columns
   align now, but the stretch made the advert's insides ugly).
   Layout repair ONLY, same locks as rounds 1-3. */

/* Defects 12+13 — inside the Global Christian Social Network
   advert (right column), desktop only:
   (12) the four feature tiles (Connect with Believers, Share
   God's Word, Grow Spiritually, Reach Nations) stretched into
   tall empty pink rectangles — the base rule gives
   .mini-features flex:1 + grid-template-rows:1fr 1fr inside the
   stretched card. Tiles now keep natural height
   (flex:0 0 auto, rows auto, align-items:start) and the card's
   extra height distributes as even spacing between its blocks
   (.social-content flex:1 + justify-content:space-between).
   (13) the community photo filled only the top ~55-60% of its
   tall cream-to-yellow gradient box (emblem stretched, photo
   natural height). The emblem no longer stretches and the photo
   carries its natural aspect (1334x1179, the supplied file's
   dimensions) with object-fit:cover, so it fills its box exactly
   — no empty gradient band. Phone <=760px untouched. */
@media(min-width:1025px){
  .shell .two.hk-twocol-restore .social-body.community-portrait{display:flex!important;flex-direction:column!important}
  .shell .two.hk-twocol-restore .social-body.community-portrait .community-emblem{flex:0 0 auto!important;height:auto!important;min-height:0!important}
  .shell .two.hk-twocol-restore .social-body.community-portrait .community-emblem img{width:100%!important;height:auto!important;aspect-ratio:1334/1179;object-fit:cover!important;display:block!important}
  .shell .two.hk-twocol-restore .social-body.community-portrait .social-content{flex:1 1 auto!important;height:auto!important;justify-content:space-between!important}
  .shell .two.hk-twocol-restore .social-body.community-portrait .social-content .mini-features{flex:0 0 auto!important;grid-template-rows:auto auto!important;align-items:start!important}
}

/* ROUND 5 — 5 Dec 2026 (browser re-check of staging 110: one
   defect left). Layout repair ONLY, same locks as rounds 1-4. */

/* Defect 14 — inside the Global Christian Social Network advert,
   round 4's space-between distribution (.social-content flex:1 +
   justify-content:space-between) spread the card's extra height
   as two large internal white voids (~250px each) between the
   "Connect • Share • Grow" heading, the paragraph and the four
   feature tiles — the card looked hollow. Fix at >=1025px: the
   text blocks keep natural spacing grouped together
   (.social-content flex:0 0 auto + justify-content:flex-start)
   and the PHOTO area absorbs the card's extra height instead —
   .community-emblem flex:1 with the photo at height:100% +
   object-fit:cover filling it completely (a taller photo; the
   round-4 natural-aspect rule is overridden). No internal voids,
   no stretched tiles; the Members card below still pins the
   column foot. Phone <=760px untouched. */
@media(min-width:1025px){
  .shell .two.hk-twocol-restore .social-body.community-portrait .community-emblem{flex:1 1 auto!important;height:auto!important;min-height:0!important}
  .shell .two.hk-twocol-restore .social-body.community-portrait .community-emblem img{width:100%!important;height:100%!important;aspect-ratio:auto!important;object-fit:cover!important;display:block!important}
  .shell .two.hk-twocol-restore .social-body.community-portrait .social-content{flex:0 0 auto!important;height:auto!important;justify-content:flex-start!important}
}
