/*
  Responsive layout of the public site.

  Default.css describes the fixed 980px desktop layout. Everything here except the
  first few rules lives in max-width media queries, so the desktop layout is unchanged.
  Many sizes are set inline by the PHP controls (Style['width'] ...), therefore they
  are overridden with !important.

  Breakpoints:  <= 999px  fluid two-column layout (tablets, small laptops)
                <= 767px  single column, hamburger menu (phones)
*/

/* Mobile menu button - hidden on desktop */
.MenuToggle
{
  display: none;
}

/* YouTube players (Video.php) - 16:9 and as wide as their container */
.VideoEmbed
{
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background-color: #000000;
}
.VideoEmbed IFRAME
{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ------------------------------------------------------------------ */
/* Tablets and small laptops: the 980px layout becomes fluid           */
/* ------------------------------------------------------------------ */
@media (max-width: 999px)
{
  .MainDiv
  {
    width: auto;
    padding: 0px 10px;
  }
  .HeaderContainer,
  .MainContainer,
  #Footer
  {
    width: auto;
  }
  .HeaderContainer
  {
    height: auto;
    min-height: 200px;
    overflow: hidden;
  }
  A.Logo, A.Logo:link, A.Logo:visited
  {
    margin-left: 20px;
  }
  .HeaderSpan
  {
    width: auto;
    float: none;
    overflow: hidden;
    margin-top: 40px;
    padding-left: 30px;
  }

  /* content 70% / right column 28%, like 700px / 255px of 980px */
  .SiteMainContainer
  {
    width: 70%;
  }
  .SiteInnerMainContainer
  {
    box-sizing: border-box;
    width: 70%;
  }
  .RightMenuContainer
  {
    width: 27%;
  }

  li.TopMenuElement A
  {
    font-size: 18px;
  }

  /* images and embeds never wider than their column */
  IMG, OBJECT, EMBED, IFRAME, VIDEO
  {
    max-width: 100%;
  }
  IMG
  {
    height: auto;
  }
  .SiteMainContainerTemplateHolder,
  .SiteInnerMainContainer
  {
    overflow-wrap: break-word;
  }

  /* home page blocks (HPEventsBlock / HPWayBlock: inline width 300px) */
  .HPEventsBlock,
  .HPWayBlock
  {
    box-sizing: border-box;
    width: 48% !important;
  }
  .HPWayBlock
  {
    height: auto !important;
    min-height: 372px;
  }
  /* the :link/:visited selectors in Default.css set float:right, so they must be repeated here */
  A.DarkContainerLink, A.DarkContainerLink:link, A.DarkContainerLink:visited
  {
    width: auto !important;
    float: none;
    overflow: hidden;
  }
  .HPWayBlock .ListLogo
  {
    margin-right: 10px;
  }

  /* lists of cabinets / pharmacies (inline 320px), cities (220px), videos (315px) */
  .CabinetItem,
  .VideoItem
  {
    box-sizing: border-box;
    width: 50% !important;
    margin-right: 0px !important;
    padding-right: 15px;
  }
  .CityItem
  {
    width: 33% !important;
  }

  /* CMS content: tables keep their layout and scroll sideways if they do not fit */
  .SiteMainContainerTemplateHolder TABLE,
  .LightContainer TABLE
  {
    max-width: 100%;
  }

  /* poll: the inline 80% / max 700px container */
  .PollBody .MainDiv
  {
    width: auto !important;
  }
}

/* ------------------------------------------------------------------ */
/* Phones: one column, hamburger menu                                  */
/* ------------------------------------------------------------------ */
@media (max-width: 767px)
{
  BODY
  {
    background-image: none;
  }
  .MainDiv
  {
    padding: 0px;
  }

  /* header: logo and title side by side, smaller */
  .HeaderContainer
  {
    min-height: 0px;
    padding: 10px 10px 12px 10px;
  }
  A.Logo, A.Logo:link, A.Logo:visited
  {
    margin: 0px 12px 0px 0px;
  }
  A.Logo IMG
  {
    width: 64px;
  }
  .HeaderSpan
  {
    margin-top: 4px;
    padding-left: 0px;
  }
  .HeaderName
  {
    font-size: 34px;
    line-height: 38px;
  }
  .HeaderText
  {
    font-size: 17px;
    line-height: 21px;
  }
  .HeaderText BR
  {
    display: none;
  }

  /* hamburger menu */
  .MenuToggle
  {
    display: block;
    width: 100%;
    border: 0;
    background-color: #dc2325;
    color: #FFFFFF;
    font-family: 'Open Sans Condensed', sans-serif;
    font-size: 22px;
    line-height: 48px;
    text-align: left;
    text-transform: lowercase;
    padding: 0px 15px;
    cursor: pointer;
  }
  .MenuToggleIcon
  {
    font-size: 24px;
    margin-right: 6px;
  }
  .TopMenu UL
  {
    display: none;
  }
  .TopMenu.Open UL
  {
    display: block;
  }
  li.TopMenuElement
  {
    float: none;
    width: auto !important;
    height: auto !important;
    margin-bottom: 0px;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
  }
  li.TopMenuElement A
  {
    font-size: 20px;
    line-height: 46px;
    padding: 0px 15px;
    white-space: normal;
  }

  /* one column: content first, right column below it */
  .SiteMainContainer,
  .SiteInnerMainContainer,
  .RightMenuContainer
  {
    float: none;
    width: auto;
  }
  .SiteInnerMainContainer
  {
    margin: 10px;
    padding: 15px;
  }
  .SiteMainContainer
  {
    margin: 0px 10px;
  }
  .RightMenuContainer
  {
    margin: 20px 10px 0px 10px;
  }
  .SiteMainContainerTemplateHolder
  {
    min-height: 0px;
  }
  .LightContainer,
  .DarkContainer
  {
    padding: 15px;
  }

  H1
  {
    font-size: 28px;
    line-height: 34px;
  }
  H2
  {
    font-size: 22px;
    line-height: 30px;
  }
  .BlockHeader
  {
    font-size: 26px;
    line-height: 30px;
  }

  /* forum block: buttons under the text, side by side */
  .ForumHero
  {
    display: block;
    padding: 15px;
  }
  .ForumHeroTitle
  {
    font-size: 25px;
    line-height: 30px;
  }
  .ForumHeroButtons
  {
    display: flex;
    gap: 10px;
    width: auto;
    margin: 12px 0px 0px 0px;
  }
  A.ForumButton, A.ForumButton:link, A.ForumButton:visited
  {
    flex: 1;
    margin: 0px;
  }
  .ForumTopics
  {
    padding: 10px 15px 12px 15px;
  }
  .ForumTopics LI
  {
    display: block;
  }
  .ForumTopics .Date
  {
    display: block;
    margin-left: 0px;
  }

  /* home page blocks one under the other */
  .HPEventsBlock,
  .HPWayBlock,
  .HPMaterialsBlock
  {
    float: none !important;
    width: auto !important;
    margin-bottom: 15px;
  }
  .HPWayBlock
  {
    min-height: 0px;
  }
  .HPMaterialsBlock
  {
    margin-top: 0px !important;
  }

  .CabinetItem,
  .VideoItem,
  .CityItem
  {
    float: none !important;
    width: auto !important;
    height: auto !important;
    padding-right: 0px;
  }
  .CityItem
  {
    margin-bottom: 12px !important;
  }

  /* CMS tables wider than the screen scroll sideways */
  .SiteMainContainerTemplateHolder TABLE,
  .LightContainer TABLE
  {
    display: block;
    overflow-x: auto;
  }
  /* layout tables (tables that contain tables, e.g. the organisations on /kabineti/):
     cells one under the other. Browsers without :has() keep the sideways scroll above. */
  .SiteMainContainerTemplateHolder TABLE:has(TABLE) > TBODY > TR > TD,
  .LightContainer TABLE:has(TABLE) > TBODY > TR > TD
  {
    display: block;
    width: auto !important;
    padding: 0px 0px 15px 0px;
  }

  /* right column: logos and banner centred (the menu items keep text-align:left) */
  .RightMenuContainer
  {
    text-align: center;
  }

  /* footer */
  #Footer
  {
    padding: 15px;
    margin-top: 20px;
  }
  A.ViveltWebSolutions, A.SymbolMedia
  {
    float: none !important;
    display: inline-block;
    margin: 10px 10px 0px 0px !important;
  }

  /* poll */
  .PollBody .MainDiv
  {
    margin: 0px 10px;
  }
  .PollMainContainer
  {
    padding: 15px;
  }
  h1.PollTitle
  {
    margin-left: 0px;
    vertical-align: baseline;
  }
}
