/* ==========================================================================
   Shasthya Hospital — homepage designs, shared rules (v3.1.2)
   --------------------------------------------------------------------------
   v3.1.2 SPLIT (2026-12-04, speed fix): the old single home-designs.css
   (118 KB, all 8 designs) is split so a page loads ONLY its own design:
   - home-designs-shared.css (this file): rules shared by every design —
     the hero search/book hide + inner layout, image guard, topbar
     hotline, word-wrap, focus ring, and the v3.1.0 shared flex-main /
     DOM order map, hero clearance, anchor offset and grey duty badges.
   - home-design-N.css (N = 1..8): the v3.0.x + v3.1.0 rules for that
     design only. functions.php enqueues the shared file plus the
     active design's file; in the Customizer preview all 8 load so the
     live design switcher keeps working.
   Every rule is still scoped under body.sh-home-N (or the generic
   body[class*="sh-home-"]), and each design file keeps its v3.0.x block
   before its v3.1.0 block, so the cascade for every design is unchanged
   (verified by the v3.1.2 harness: rule-for-rule identical per design).
   ========================================================================== */

/* ---------- Shared helpers ---------- */

/* Hero search / quick-book: hidden everywhere by default. The show rules
   live inside the Home 2 / Home 7 / Home 8 (search) and Home 4 (book)
   blocks below, later in this file, with equal specificity so they win. */
.sh-hero-search,
.sh-hero-book{display:none}
body[class*="sh-home-"] .sh-hero-search,
body[class*="sh-home-"] .sh-hero-book{display:none!important}

/* Shared image guard (also required by the task). */
body[class*="sh-home-"] img{max-width:100%;height:auto}

/* Verification fix (2026-12-03): at ~1024px the topbar hotline number
   wrapped mid-number ("01XXX-" / "XXXXXX") because main.css only sets
   white-space:nowrap on it below 480px. Keep it whole on every width in
   every design; the flex row has room (badge + welcome shrink/wrap first,
   and the row wraps below 768px). */
body[class*="sh-home-"] .topbar .hotline{white-space:nowrap}

/* Long words (headlines, titles, doctor names) must wrap, never clip. */
body[class*="sh-home-"] .hero-slide h2,
body[class*="sh-home-"] .section-title,
body[class*="sh-home-"] .card-title,
body[class*="sh-home-"] .doctor-card h3,
body[class*="sh-home-"] .spec-tile,
body[class*="sh-home-"] .quick-tile .tile-label{overflow-wrap:break-word}

/* Visible keyboard focus in each design's accent colour. */
body[class*="sh-home-"] :focus-visible{outline:3px solid var(--hd-accent,#0284C7);outline-offset:2px}

/* Search / book fields can never force the hero wider than the screen. */
body[class*="sh-home-"] .sh-hero-search input,
body[class*="sh-home-"] .sh-hero-search select,
body[class*="sh-home-"] .sh-hero-book input,
body[class*="sh-home-"] .sh-hero-book select,
body[class*="sh-home-"] .sh-hero-search button,
body[class*="sh-home-"] .sh-hero-book button{max-width:100%}

/* Shared hero-search inner layout (only visible in designs 2 & 7). */
body[class*="sh-home-"] .sh-hero-search input,
body[class*="sh-home-"] .sh-hero-search select{flex:1 1 auto;min-width:0;border:0;background:transparent;padding:.8rem .6rem;font-size:1rem;color:inherit}
body[class*="sh-home-"] .sh-hero-search button{flex:none;min-height:48px;border:0;border-radius:10px;padding:.7rem 1.4rem;font-size:1rem;font-weight:700;cursor:pointer}

/* Shared hero-book inner layout (only visible in design 4). */
body[class*="sh-home-"] .sh-hero-book label{display:block;font-size:.85rem;font-weight:700;margin:.7rem 0 .3rem}
body[class*="sh-home-"] .sh-hero-book input,
body[class*="sh-home-"] .sh-hero-book select{width:100%;padding:.7rem .8rem;border:1px solid #CBD5F5;border-radius:10px;font-size:1rem;background:#fff;color:#1E2A5A}
body[class*="sh-home-"] .sh-hero-book button{width:100%;min-height:48px;margin-top:1rem}

/* ==========================================================================
   v3.1.0 — DEMO-STYLE rebuild (2026-12-03)
   --------------------------------------------------------------------------
   v3.0.x only recoloured the same sections. v3.1.0 makes each design change
   the WHOLE homepage look — hero shape, section order, card styles — to
   match the 8 AI demo images (layout, not just palette). Everything below
   is appended AFTER the v3.0.2 rules, so it wins on equal specificity;
   one v3.0.2 rule was also edited: the H8 slider hide
   (`body.sh-home-8 #specialities .spec-slider, ... .spec-nav{display:none}`,
   near the other H8 spec rules) — the brief hides the photo-slider column
   in H8, and v3.0.2 had left it visible.
   - SPEC-TILE JS TRAP: main.js paginates the speciality tiles 10/page and
     sets INLINE `display:flex` on visible tiles. A stylesheet `display:grid`
     on .spec-tile CANNOT beat that without `!important` (H2's horizontal
     icon-left cards use `display:grid!important`), and the grid rule must
     live inside @media(min-width:1024px) — at 360px the 56px icon column +
     longest word overflowed the 2-col mobile grid. H8's plain list works
     BECAUSE of the inline flex (its rule only changes flex-direction).

   How it works:
   - SECTION ORDER IS CSS `order` ONLY. `body.home main#main` is a wrapping
     flex row; every homepage section is a 100%-wide flex item by default
     (DOM order preserved by the shared order map). Each design overrides
     `order` for the sections it moves, and gives side-by-side pairs a
     ~50% / ~33% flex-basis. PHP order is untouched, so the Customizer
     live preview (postMessage body-class swap) re-flows instantly.
     Pairs are scoped to min-width:1024px, so <=1023px everything is a
     single column (the task requires <=768px; tablet is single-column too).
   - HERO SPLITS (min-width:1024px only; <=1023px the base full-bleed photo
     + overlay text is kept). The slide photo is an INLINE background-image
     (hero.php), so a plain stylesheet rule cannot move it: split heroes
     use `background-size/position !important` (H5, photo left) or a
     ::before solid-colour cover + ::after `background-image:inherit`
     photo panel (H1/H2/H3/H6/H7/H8). The ::after inherits the slide's
     computed background-image — the INLINE url — because the slide's own
     image is covered by ::before, not removed. H4 hides the photo
     entirely (`background-image:none!important`) to match its
     photo-free demo hero (v3.1.1: H7's photo was restored the same way).
   - DOCTOR CAROUSEL: main.js positions .curve-card with INLINE transforms
     and hides far cards (opacity/visibility). Where a design turns the
     carousel into a flat list (H7, H8), the card rules use !important to
     beat those inline styles, and .is-far gets pointer-events:auto back.
     H5/H6 keep the live carousel inside their narrower columns (the stage
     clips the arc sides, centre card stays visible).
   - PAIR TOP-ALIGNMENT: `.container-md` / `.container-lg` set
     `margin:auto`, i.e. `margin-top:auto`. On a 100%-wide section that is
     harmless (no free space on its line), but on a PAIRED section the auto
     top margin eats the whole free space and pushes the shorter column to
     the BOTTOM of its row (and disables stretch). Every pair rule below
     therefore also sets `margin-top:0`, which restores top alignment and
     equal-height (stretched) columns. Do NOT "simplify" the pair rules by
     dropping it, and do NOT put `margin-top:0` on the shared `main>*`
     rule — that would kill the quick-tiles' -124px hero overlap.
   - FIXED IN v3.1.0 (pre-existing v3.0.2 bug, found by the v3.1.0 harness):
     at >=1024px the quick-tiles (pulled up 124px over the hero bottom)
     COVERED the hero search bar (H2/H7) and the glass book card (H4),
     which sit below the slide inside .hero. Those three designs now give
     .hero 140px bottom padding and put the hero dots back in normal flow,
     so the search/book clears the tiles.
   - No feature, menu, label or data-flow change anywhere in this file.
   ========================================================================== */

/* ---------- v3.1.0 shared: flex main + DOM order map ---------- */
body.home[class*="sh-home-"] main#main{display:flex;flex-direction:row;flex-wrap:wrap;align-content:flex-start}
body.home[class*="sh-home-"] main#main>*{flex:0 0 100%;min-width:0}
body.home[class*="sh-home-"] main#main>.hero{order:1}
body.home[class*="sh-home-"] main#main>.quick-tiles{order:2}
body.home[class*="sh-home-"] main#main>#why-choose{order:3}
body.home[class*="sh-home-"] main#main>#duty-doctors{order:4}
body.home[class*="sh-home-"] main#main>#stats-band{order:5}
body.home[class*="sh-home-"] main#main>#specialities{order:6}
body.home[class*="sh-home-"] main#main>#home-doctors{order:7}
body.home[class*="sh-home-"] main#main>#home-appointment{order:8}
body.home[class*="sh-home-"] main#main>#emergency-strip{order:9}
body.home[class*="sh-home-"] main#main>#packages{order:10}
body.home[class*="sh-home-"] main#main>.ask-banner{order:11}
body.home[class*="sh-home-"] main#main>#stories{order:12}
body.home[class*="sh-home-"] main#main>#testimonials{order:13}
body.home[class*="sh-home-"] main#main>#health-talks{order:14}
body.home[class*="sh-home-"] main#main>#faq{order:15}
body.home[class*="sh-home-"] main#main>#blog{order:16}
body.home[class*="sh-home-"] main#main>#corporate{order:17}
body.home[class*="sh-home-"] main#main>#news{order:18}
body.home[class*="sh-home-"] main#main>#map-section{order:19}

/* ---------- v3.1.0 shared: hero search/book must clear the tiles (>=1024) ---------- */
/* v3.1.1: Home 8 added — its search bar (new in v3.1.1) needs the same
   clearance, and its dots must go back to normal flow for the same reason. */
@media(min-width:1024px){
  body.sh-home-2 .hero,body.sh-home-4 .hero,body.sh-home-7 .hero,body.sh-home-8 .hero{padding-bottom:140px}
  body.sh-home-2 .hero-dots,body.sh-home-4 .hero-dots,body.sh-home-7 .hero-dots,body.sh-home-8 .hero-dots{position:static;z-index:auto}
}

/* ---------- v3.1.1 shared: anchor offset under the sticky header ----------
   The sticky .site-header (topbar + mainnav, ~115px desktop, taller on
   phones where the topbar wraps) used to cover section headings on
   in-page anchor jumps. scroll-margin-top only affects scroll position,
   never layout, so no design — Home 1 included — renders differently. */
body.home[class*="sh-home-"] main#main>section[id],body.home[class*="sh-home-"] main#main>.hero,body.home[class*="sh-home-"] main#main>.quick-tiles,body.home[class*="sh-home-"] main#main>.ask-banner{scroll-margin-top:130px}
@media(max-width:768px){
  body.home[class*="sh-home-"] main#main>section[id],body.home[class*="sh-home-"] main#main>.hero,body.home[class*="sh-home-"] main#main>.quick-tiles,body.home[class*="sh-home-"] main#main>.ask-banner{scroll-margin-top:180px}
}
/* v3.1.1 — grey duty badge for doctors not on duty right now (live
   countdown, "On Leave", "No Duty Scheduled"). The per-design rules
   below set .sh-duty-badge to each design's green/teal/black, which
   would recolour the off/leave badge too; this shared rule (higher
   specificity) keeps it grey in every design. */
body[class*="sh-home-"] .sh-duty-badge.off,body[class*="sh-home-"] .sh-duty-badge.leave{background:#6B7280;color:#fff}

/* ==========================================================================
   v3.1.3 — MOBILE BREATHING ROOM (all designs, Anthin's order)
   --------------------------------------------------------------------------
   On phones the content sat too close to the screen edges (the base
   .container-md padding is only 1rem / 16px, and the hero button was
   auto-width above 480px). At <=768px every homepage section now keeps
   at least 20px of side space, content stays centred, hero buttons
   stack full-width in one column, and nothing may touch the screen
   edge. Desktop is untouched: this block only fires at <=768px, and
   the only desktop-visible change is none at all.
   Home 1 note: at 360px the container padding changes 16px -> 20px —
   that IS the ordered fix (see v313-verification.md); the desktop
   render of Home 1 is pixel-identical to v3.1.2.
   ========================================================================== */
@media(max-width:768px){
  /* Side space: containers carry the 20px; sections that pad their own
     inner content keep their own padding on top of it (hero slide) or
     get it explicitly (ask banner, stats, partner panel). */
  body[class*="sh-home-"] .container-md,
  body[class*="sh-home-"] .container-lg,
  body[class*="sh-home-"] .container-sm{padding-left:20px;padding-right:20px}
  /* Hero: text block already sits inside .container-md (20px) + the
     slide's own 1rem padding; keep the slide padding so the photo edge
     never meets the text. Buttons go full-width, one column. */
  body[class*="sh-home-"] .hero-slide .btn{width:100%;max-width:340px}
  body[class*="sh-home-"] .hero-slide .container-md{max-width:100%}
  /* Quick-action tiles: already a column below 1024px; make sure the
     row never squeezes them against the edge. */
  body[class*="sh-home-"] .quick-tiles .row{gap:.75rem}
  /* Forms, search and book fields: full width, no edge contact. */
  body[class*="sh-home-"] .sh-form input,
  body[class*="sh-home-"] .sh-form textarea,
  body[class*="sh-home-"] .sh-form select,
  body[class*="sh-home-"] .sh-form button{max-width:100%}
  /* Filter pills wrap (they already do) and never overflow. */
  body[class*="sh-home-"] .home-doctors-filter{padding-left:0;padding-right:0}
  /* Footer / header inner rows keep the same 20px via .container-md. */
  body[class*="sh-home-"] .footer-bottom{padding-left:20px;padding-right:20px}
}

