/* sensible defaults */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  background: black;
  overflow: hidden;
}



body {
  min-height: 80vh;
  max-height:95vh;
  display: flex;
  flex-direction: column;   /* stack main area + footer */
  padding-top: 0;
  
}

@media (max-aspect-ratio: 3/4) or (max-height: 720px) {
  body {
    padding-top: 10vh;
  }
}

/* main content area fills everything above the footer */
.pageSpace {
  position: relative;       /* containing block for absolute children */
  flex: 1 1 auto;           /* take remaining height */
  min-height: 0;            /* allow proper flex sizing */
  overflow: hidden;         /* avoid scrollbars if children overflow */
}

/* footer hugs its content and stays at bottom */
footer {
  margin-top: auto;         /* pushes footer to bottom of the page */
  padding: 1rem;
  text-align: center;
  /* optional: safe area for iOS home indicator */
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  height: 15%;
}

.footerFont{
    color:white;
    font-size: 2vh;
    text-align: center;
}

/* background image: fills parent, centered, keeps aspect ratio */
.scaleImg {
  position: absolute;
  inset: 0;                 /* top:0; right:0; bottom:0; left:0 */
  width: 100%;
  height: 100%;
  object-fit: contain;      /* maintain aspect ratio */
  object-position: center;  /* center within the box */
  display: block;
  padding:10%;
}

.overlay {
  background-color: transparent;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* overlay: fills parent and sits above the image */
.fillSpace {
  background-color: black;
  position: absolute;
  inset: 0;
  z-index: 2;               /* above the image */
  max-height: 100%;
  max-width: 100%;
  overflow: hidden;
  /* if you only want it clickable when visible, uncomment:
  pointer-events: none;
  */
}

/* fade support for overlay */
.faded,
.shown {
  transition: opacity 0.5s ease;
  will-change: opacity;
}

.faded {
  opacity: 0;
}

.shown {
  opacity: 1;
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .faded,
  .shown {
    transition: none;
  }
}

.noshow {
  display:none !important;
}

#grdChannelSpace{
  background-color: black;
  position: absolute;
  inset: 0;
  z-index: 2;               /* above the image */
  max-height: 100%;
  max-width: 100%;
  overflow: hidden;
}

#grdChannelList {
  display: grid;
  width:100%;
  height:100%;
  min-height:100%;
  grid-template-columns: repeat(4, 1fr); /* Default: 3 columns */
  background-color: black;
  overflow-y: auto;
}

.burger {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));   /* match logo's top margin & respect notches */
  left: calc(10px + env(safe-area-inset-left));
  z-index: 10;                                   /* ensure it paints above channelLogo */
  width: clamp(36px, 8vw, 64px);
  height: clamp(36px, 8vw, 64px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 15%;
  max-height: 15%;
  pointer-events: auto;
}

/* IMPORTANT: neutralize .scaleImg behavior *inside* the burger */
.burger > .scaleImg {
  position: static;       /* don't absolute-position the icon */
  inset: auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0;             /* remove the 10% padding from .scaleImg */
}

/* Optional: if the logo is purely decorative, let clicks pass through it */
#channelLogo {
  pointer-events: none;
}

.burger:focus,
.burger:hover{
  background-image:"/assets/burgerFocus.png";
  transform: scale(1.1);
}


.video{
  position: absolute;
  inset: 0;                 /* top:0; right:0; bottom:0; left:0 */
  width: 100%;
  height: 100%;
  object-fit: contain; 
  pointer-events: auto;
}

.videoOverlay{
  position: absolute;
  inset: 0;                 /* top:0; right:0; bottom:0; left:0 */
  width: 100%;
  height: 100%;
  background: transparent;  
}

.dropdown {
    display: inline-block;
    cursor: pointer;
    padding: 10px;
    background-color: transparent;
    color: white;
    border-radius: 5px;
    pointer-events: auto;
}

.dropdown-content {
    display: none;
    position: absolute;
    left:0;
    top:0;
    background-color: gray;
    min-width: 300px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    overflow: hidden;
    pointer-events: auto;
}

.dropdown-content show{
    display: block;
}

.dropdown-content a {
    display: block;
    font-size:1.5em;
    padding: 10px;
    text-decoration: none;
    color: black;
}

.dropdown-content a:focus,
.dropdown-content a:hover {
    background-color: #3498db;
    
}

.dropdown:focus .dropdown-content,
.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
    display: block;        
    margin-top:50px;
}

.channelEntry{
  position: flex;
  transition: transform 0.1s ease; /* smooth transition */
  max-height:75%;
  width:75%;
  margin:auto;
  padding:5px;
  border-radius: 120px 120px 120px 120px;
}

.channelEntry:active {
  transform: scale(0.9); /* slightly shrink the image */
}


.channelEntry:focus,
.channelEntry:hover {
  transform: scale(1.1);
}

#grdChannelPage {
  display: flex;
  flex-direction: column;
  align-items: center; /* centers the image horizontally */
  height: 85%;
  background-color: black;;
  /* if you want the content to scroll within this area, you can also add:
     overflow: auto; min-height: 0; */
}
/* Top image: back to normal flow, centered, 1/3 width, padded */
img.top-centered {
  position: static;          /* was absolute — put it back in flow */
  width:33%;            /* 1/3 of parent width */
  height: auto;              /* keep aspect ratio */
  max-height: 15vh;
  display: block;
  padding: 10px;             /* 10px padding all around */
  margin: 10px auto 0;       /* small top margin, centered horizontally */
  max-width: 30%;           /* be safe on tiny screens */
  max-height: 15%;           /* be safe on tiny screens */
  /* remove max-height:15%; so it can size correctly with width */
}

@media (max-aspect-ratio: 3/4) or (max-height: 720px) {
  img.top-centered {
    width:33%;            /* 1/3 of parent width */
    height: auto;              /* keep aspect ratio */
    max-height: 15vh;
  }
}

#epg {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;;
  font-size: 1rem; /* base for nested elements */
  border: 1px solid #ddd;
  width: 75vw;
  height: 12vh;
  background-color: black;
  display: flex;
  overflow-x: scroll;
  overflow-y: hidden;
  white-space: nowrap;
  margin: clamp(0.5rem, 2vh, 2rem) auto 0;
  visibility: visible;
  position: fixed;                 /* pin to viewport */
  left: 50%;
  transform: translateX(-50%);     /* center horizontally */
  bottom: calc(15vh + env(safe-area-inset-bottom));  /* fallback */
  bottom: calc(15svh + env(safe-area-inset-bottom)); /* modern viewport unit */
  margin: 0;                       /* cancel earlier auto-centering margin */
  z-index: 100;  
  pointer-events: auto;          
}

.program{
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 2vh;
  border-right: .25em solid #ccc;
  line-height: 1.2;
  padding: 10px;
  text-align: center; 
  background-color: transparent;
  position: relative;
  overflow-x: wrap;
  z-index: 1;
  color: white;
  pointer-events: auto;
}

.time {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 2vh;
  font-weight: bold;
  display: block;
  background-color: transparent;
  margin: auto;
  padding-top: 1em;
  color:white;
  pointer-events: auto;
}/* Make the EPG bar size fluid and center it */




.vodTitle{
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(0.3rem, 0.25rem + 0.25vw, 0.6rem);
  pointer-events: auto;
}



/* Panel geometry & look */
#vod{
  position: fixed;
  top: var(--overlay-top);
  left: clamp(36px, 8vw, 64px);
  width: 40vw;                    /* left 1/3 of screen */
  min-width: 20vw;                 /* optional: keeps it usable on TV */
  max-width: 50vw;                 /* optional cap */
  height: calc(100vh - var(--overlay-top) - var(--overlay-top));
  max-height: 50vh;
  overflow-y: auto;;
  background: #3a3a3a;              /* gray rectangle */
  border: 2px solid #ffffff;        /* white border */
  border-radius: var(--overlay-radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  z-index: 10000;
  display: none;                    /* hidden by default */
  font-size: 1em;
  pointer-events: auto;
}
@media (max-aspect-ratio: 3/4) or (max-height: 720px) {
  #vod{
    min-width: 75vw;
    width: 84vw;
    max-width: 90vw;
  }
}

/* Make the overlay visually present but not intercept clicks */


#vod.open{
   display:flex;
   flex-direction: row;
 }


#vod .menu-item {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  height: 10vh;             /* 1/10th of the viewport height */
  background: #9a9a9a;      /* gray rectangle */
  color: black;
  border-radius: 12px;      /* keep your rounded look if you want */
  overflow: hidden;         /* keeps the image from spilling */
  box-sizing: border-box;
  pointer-events: auto;
}

@media (max-aspect-ratio: 3/4) or (max-height: 720px) {
  #vod .menu-item {height:25vh;}
}

#vod .menu-item .vodLabel {
  flex: 0 0 66%;
  padding-left: 1.5%;       /* small left inset */
  display: flex;
  flex-direction: column;
  justify-content: center;  /* vertical center for the 2 lines */
  line-height: 1.2;
  font-size: 1.2rem;
  max-width: 50%;
}

#vod .menu-item .vodImage {
  flex: 0 0 44%;            /* use 34% to leave room for 1.5% padding x2 */
  height: 100%;
  width: 60%;
  object-fit: contain;      /* maintain aspect ratio */
  object-position: center;
  display: block;           /* avoid inline baseline quirks */
  box-sizing: border-box;
}

/* Toggle this class to show it */
#vod .menu-inner{
  display: flex;
  flex-direction: column;
  height: 100%;
  left: 0%;
  width: 100%;
  padding: 14px;
  gap: 12px;
}

/* Layout inside the panel */
#vod .menu-inner-left{
  display: flex;
  flex-direction: column;
  height: 100%;
  left: 0%;
  width: 66%;
  padding: 14px;
  gap: 12px;
}

#vod .menu-inner-right{
  display: flex;
  flex-direction: column;
  height: 100%;
  left: 33%;
  width: 66%;
  padding: 14px;
  gap: 12px;
}



/* Rounded single-line search bar */
#vod .menu-search input{
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 9999px;    /* pill shape */
  border: 2px solid #ffffff;
  background: #ffffff;
  color: #111;
  font-size: 18px;
  outline: none;
}

/* Focus styles (good for TV remotes) */
#vod .menu-search input:focus,
#vod .menu-item:focus{
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* Scrollable list area */
#vod .menu-list{
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px; /* tiny gutter for scrollbar */
}

/* Example item styling (you’ll replace with your own) */
#vod .menu-item{
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  color: #fff;
}

/* Optional: make sure the page behind it can’t scroll when open */
body.menu-open{
  overflow: hidden;
}


/* Optional: when the viewport is very wide, gently tighten things */


@media (orientation: portrait) {
  #grdChannelList {
      grid-template-columns: repeat(2, 1fr); /* Default: 3 columns */   
  }
}

