/* =====================================================================
   TEDY v55 — መነሻው (dashboard) ሙሉ ለሙሉ በተፈቀደው ፖስተር ላይ ተተክቷል።
   The approved poster IS the opening screen: full-bleed on phones, nothing
   cropped, no colour filter, no overlay. The old top-bar buttons are taken
   off the dashboard (the poster carries its own «መግቢያ» pill which opens the
   menu, and «ምርቶቻችን» which opens the product list). Catalogue, AI designer,
   login, owner pages, ERP and every data layer are untouched.
   This is the last stylesheet in the cascade, so it wins over v52/v54.
   ===================================================================== */
:root {
  --tedyy-v55-stage: 100vh;
  --tedyy-v55-safe-top: env(safe-area-inset-top, 0px);
  --tedyy-v55-safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Poster geometry: 864 x 1536 = exactly 9 / 16 */
  --tedyy-v55-ratio: 0.5625;
}
@supports (height: 100dvh) {
  :root { --tedyy-v55-stage: 100dvh; }
}

/* ------------------------------------------------------------------ 1
   The dashboard shows nothing but the poster. The old banner, the text
   strip, the branch line, the promises and the footer stay in the
   document (screen readers, SEO) but are not painted on this screen.
--------------------------------------------------------------------- */
#page-home.home-page .home-masthead,
#page-home.home-page .home-quick-links,
#page-home.home-page .quick-actions,
#page-home.home-page .home-category-chooser,
#page-home.home-page .quick-location,
#page-home.home-page .home-promises,
#page-home.home-page .tedy-system-credit,
#page-home.home-page .tedy-dashboard-footer {
  display: none !important;
}

/* ------------------------------------------------------------------ 2
   Old top-bar buttons (menu pill, install button, clock) are removed from
   the dashboard only. They come back automatically on every other page,
   so nothing else in the site loses its controls. Two independent hooks are
   used: the CSS :has() state and the body class set by tedyy-v55-hero.js.
--------------------------------------------------------------------- */
body:has(#page-home.home-page.is-active) .topbar,
body.tedy-home-poster .topbar {
  display: none !important;
}
body:has(#page-home.home-page.is-active) main,
body.tedy-home-poster main {
  padding-top: 0 !important;
}

/* ------------------------------------------------------------------ 3
   The home section becomes exactly one viewport tall, with no scroll.
--------------------------------------------------------------------- */
#page-home.home-page.is-active,
body[data-tedy-bright] #page-home.home-page.is-active {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  height: var(--tedyy-v55-stage) !important;
  min-height: 0 !important;
  max-height: var(--tedyy-v55-stage) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #040302 !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* ------------------------------------------------------------------ 4
   Poster stage: the whole screen.
--------------------------------------------------------------------- */
#page-home.home-page .home-hero,
body[data-tedy-bright] #page-home.home-page .home-hero {
  position: relative !important;
  display: block !important;
  width: 100vw !important;
  max-width: none !important;
  height: var(--tedyy-v55-stage) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  filter: none !important;
  background: #040302 !important;
  overflow: hidden !important;
  line-height: 0 !important;
  aspect-ratio: auto !important;
}
#page-home.home-page .home-hero::before,
#page-home.home-page .home-hero::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

/* ------------------------------------------------------------------ 5
   Ambient bleed: the SAME poster file, scaled to cover the screen,
   blurred and darkened, so a phone taller than 9:16 shows no empty band
   and the artwork itself is never cropped or stretched.
--------------------------------------------------------------------- */
#page-home.home-page .home-poster-bleed,
body[data-tedy-bright] #page-home.home-page .home-poster-bleed {
  position: absolute !important;
  inset: -9% !important;
  z-index: 1 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background-color: #040302 !important;
  background-image:
    linear-gradient(180deg, rgba(4,3,2,.90) 0%, rgba(4,3,2,.46) 17%, rgba(4,3,2,0) 38%,
                      rgba(4,3,2,0) 62%, rgba(4,3,2,.55) 83%, rgba(4,3,2,.94) 100%),
    url(tedy-v55-hero-poster.webp) !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-position: center center !important;
  filter: blur(30px) brightness(.42) saturate(1.04) !important;
  transform: scale(1.05) !important;
  opacity: 1 !important;
}

/* ------------------------------------------------------------------ 6
   Exact-artwork frame: sized so the poster is always fully visible at its
   own 9:16 ratio, centred on the bleed. Status bar / navigation bar safe
   areas are taken off the available height so the «መግቢያ» pill is never
   hidden under the phone chrome.
--------------------------------------------------------------------- */
#page-home.home-page .home-poster-frame,
body[data-tedy-bright] #page-home.home-page .home-poster-frame {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(100vw, calc((var(--tedyy-v55-stage) - var(--tedyy-v55-safe-top) - var(--tedyy-v55-safe-bottom)) * var(--tedyy-v55-ratio))) !important;
  height: auto !important;
  max-width: 100vw !important;
  max-height: var(--tedyy-v55-stage) !important;
  aspect-ratio: 9 / 16 !important;
  z-index: 2 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  line-height: 0 !important;
  overflow: visible !important;
}

/* ------------------------------------------------------------------ 7
   The artwork exactly as supplied — colour management only, no creative
   change, no filter, no crop, no rounding.
--------------------------------------------------------------------- */
#page-home.home-page .home-poster-frame img,
#page-home.home-page img.home-poster,
body[data-tedy-bright] #page-home.home-page .home-poster-frame img,
body[data-tedy-bright] #page-home.home-page img.home-poster {
  display: block !important;
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 9 / 16 !important;
  object-fit: contain !important;
  object-position: center center !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  background: transparent !important;
  image-rendering: auto !important;
}

/* ------------------------------------------------------------------ 8
   The two gold pills printed on the poster become real controls.
   Rectangles were measured from the artwork itself (864 x 1536 source):
     «መግቢያ» pill  x 27..262 px, y 31..112 px
     «ምርቶቻችን» pill x 234..630 px, y 1344..1487 px
--------------------------------------------------------------------- */
#page-home.home-page .home-poster-menu,
#page-home.home-page .home-poster-cta {
  position: absolute !important;
  display: block !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  z-index: 4 !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
}
#page-home.home-page .home-poster-menu {
  left: 1.0% !important;
  top: 1.0% !important;
  width: 31.0% !important;
  height: 6.6% !important;
}
#page-home.home-page .home-poster-cta {
  left: 24.5% !important;
  top: 86.5% !important;
  width: 51.0% !important;
  height: 11.5% !important;
}
#page-home.home-page .home-poster-menu:focus-visible,
#page-home.home-page .home-poster-cta:focus-visible {
  outline: 2px solid #ffd23f !important;
  outline-offset: 3px !important;
  border-radius: 999px !important;
}
#page-home.home-page .home-poster-menu:hover,
#page-home.home-page .home-poster-cta:hover {
  background: rgba(255, 214, 120, .045) !important;
  border-radius: 999px !important;
}

/* ------------------------------------------------------------------ 9
   Very short windows (landscape phones, split screen): the poster still
   fits by height and the bleed keeps the screen filled.
--------------------------------------------------------------------- */
@media (max-height: 520px) {
  #page-home.home-page .home-poster-frame,
  body[data-tedy-bright] #page-home.home-page .home-poster-frame {
    width: min(100vw, calc(var(--tedyy-v55-stage) * var(--tedyy-v55-ratio))) !important;
  }
}

/* ----------------------------------------------------------------- 10
   Reduced motion: the bleed never animates.
--------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #page-home.home-page,
  #page-home.home-page .home-hero,
  #page-home.home-page .home-poster-bleed,
  #page-home.home-page .home-poster-frame,
  #page-home.home-page .home-poster-frame img,
  #page-home.home-page .home-poster-menu,
  #page-home.home-page .home-poster-cta {
    animation: none !important;
    transition: none !important;
  }
}

/* ----------------------------------------------------------------- 11
   The install entry moved out of the hidden top bar into the menu drawer,
   so installing the Android app still works while the dashboard shows
   nothing but the poster.
--------------------------------------------------------------------- */
a.drawer-link,
a.drawer-link:hover,
a.drawer-link:focus {
  text-decoration: none !important;
  color: #f7ebd5 !important;
}
