/* ============================================================
   Nomme Raadio - Responsive Overrides
   Loaded AFTER structure_css.css and template_css.css.
   Desktop (>800px) is untouched; changes kick in below 800px.
   ============================================================ */

/* --- Global fluid-image safety net --- */
img {
  max-width: 100%;
  height: auto;
}

/* --- Hamburger button (hidden on desktop) --- */
#mobile_menu_toggle {
  display: none;
  background: #AFCF40;
  color: #fff;
  border: none;
  font-size: 28px;
  line-height: 1;
  padding: 8px 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
#mobile_menu_toggle.active {
  background: #8EB520;
}

/* ============================================================
   TABLET  –  max-width: 800px
   ============================================================ */
@media screen and (max-width: 800px) {

  /* --- Main wrapper: fluid --- */
  #hs_mf {
    width: 100% !important;
    max-width: 765px;
    overflow-x: hidden;
  }

  /* --- HEADER --- */
  #hs_mf #hs_header {
    width: 100% !important;
    height: auto !important;
    float: none;
    background-image: none;
  }

  #hs_mf #hs_header #hs_hdr_ifr {
    width: 100% !important;
    height: auto !important;
    margin-left: 0;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    background-image: none;
  }

  /* Logo */
  #hs_mf #hs_header #hs_hdr_ifr #hs_headerlogo {
    position: static;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    order: 0;
  }
  #hs_headerlogo img {
    width: 150px;
    height: auto;
  }

  /* Banner area (right of logo on tablet) */
  #hs_mf #hs_header #hs_hdr_ifr #hs_headerbanner {
    position: static;
    width: auto;
    height: auto;
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-size: cover;
    order: 1;
  }
  #hs_headerbanner iframe {
    max-width: 100%;
  }

  /* Header buttons */
  #hs_mf #hs_header #hs_hdr_ifr #hs_headerbuttons {
    position: static;
    width: 100%;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background-size: cover;
    order: 2;
  }
  #hs_headerbuttons a {
    float: none !important;
    flex: 0 0 auto;
  }
  #hs_headerbuttons img {
    float: none !important;
    width: 80px;
    height: 80px;
  }

  /* Scroller strip under logo – decorative only, hide on small screens */
  #hs_mf #hs_header #hs_hdr_ifr #hs_headerscroller {
    display: none;
  }

  /* Pathway breadcrumb */
  #hs_mf #hs_header #hs_hdr_ifr #hs_pathway {
    position: static;
    width: 100%;
    height: auto;
    order: 3;
  }
  #hs_mf #hs_header #hs_hdr_ifr #hs_pathway #hs_pathway_tbl,
  #hs_mf #hs_header #hs_hdr_ifr #hs_pathway #hs_pathway_tbl td {
    width: 100%;
  }

  /* --- BODY --- */
  #hs_mf #hs_body {
    width: 100% !important;
    float: none;
    display: flex;
    flex-wrap: wrap;
    background-image: none;
    background-color: #ffffff;
  }

  /* Spacer is unnecessary on mobile */
  #hs_mf #hs_body #hs_col_spacer {
    display: none;
  }

  /* Show hamburger */
  #mobile_menu_toggle {
    display: block;
    order: 0;
  }

  /* Sidebar: hidden by default, shown when toggled */
  #hs_mf #hs_body #hs_col_left {
    float: none;
    width: 100% !important;
    order: 1;
    display: none;
  }
  #hs_mf #hs_body #hs_col_left.mobile-open {
    display: block;
  }

  /* Main content */
  #hs_mf #hs_body #hs_col_main {
    float: none;
    width: 100% !important;
    margin-left: 0;
    padding: 10px;
    order: 2;
    box-sizing: border-box;
  }

  /* Facebook widget: flow into page */
  #parembanner {
    position: static !important;
    width: 100% !important;
    max-width: 300px;
    height: auto !important;
    margin: 15px auto;
    padding: 7px;
    order: 3;
    left: auto !important;
    top: auto !important;
  }
  #parembanner #likebox-frame {
    width: 100% !important;
    max-width: 300px;
    height: auto !important;
    overflow: hidden;
    margin: 0 auto;
  }
  #parembanner #likebox-frame iframe {
    width: 100% !important;
    max-width: 300px;
    height: 355px;
    margin: 0;
  }

  /* Spacer div after sidebar */
  div.c13 {
    display: none;
  }

  /* --- FOOTER --- */
  #hs_mf #hs_footer {
    width: 100% !important;
    float: none;
    height: auto !important;
    background-image: none;
  }
  #hs_mf #hs_footer #hs_ftr_ifr {
    width: 100% !important;
    margin-left: 0;
    height: auto !important;
    background-image: none;
  }
  #hs_mf #hs_footer #hs_ftr_ifr #hs_ftr_cont {
    width: 100% !important;
    height: auto !important;
  }
  #hs_ftr_cont > img.c18 {
    width: 100%;
    height: auto;
    float: none;
  }
  #hs_mf #hs_footer #hs_ftr_ifr #hs_ftr_cont #hs_ftr_buttons {
    width: 100% !important;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  #hs_ftr_buttons img {
    float: none !important;
    height: auto;
  }
  #hs_ftr_buttons a {
    float: none !important;
  }

  /* --- Content tables (attribute + class selectors) --- */
  table[width],
  table.contentpaneopen,
  table.c9,
  table.c11 {
    width: 100% !important;
    max-width: 100%;
  }
  td[width] {
    width: auto !important;
  }

  /* --- Audiolist items --- */
  .audiolist_item,
  .audiolist_item2,
  .audiolist_item_header,
  .audiolist_item_bottom {
    width: 100% !important;
    max-width: 478px;
    box-sizing: border-box;
    background-size: 100% auto;
  }
  .audioitem_item_desc {
    width: auto !important;
    margin-left: 50px;
    margin-right: 10px;
  }
  .audiolist_item_bt_play {
    left: auto !important;
    right: 36px;
  }
  .audiolist_item_bt_save {
    left: auto !important;
    right: 10px;
  }
  .audiolist_item_label {
    max-width: calc(100% - 120px);
  }

  /* Embedded objects / iframes */
  object.c16,
  embed.c15 {
    width: 100% !important;
    height: auto !important;
  }
  iframe.c12 {
    max-width: 100%;
  }
}

/* ============================================================
   PHONE  –  max-width: 480px
   ============================================================ */
@media screen and (max-width: 480px) {

  /* Logo smaller on phone */
  #hs_headerlogo img {
    width: 120px;
    height: auto;
  }

  /* Header buttons smaller */
  #hs_headerbuttons img {
    width: 64px;
    height: 64px;
  }

  /* Banner iframe may clip but we contain it */
  #hs_headerbanner iframe {
    width: 100%;
    max-width: 320px;
    height: 50px;
  }

  /* Pathway table */
  #hs_pathway_tbl,
  #hs_pathway_tbl td {
    width: 100% !important;
  }

  /* Sidebar debt-clock tables */
  table.c9,
  table.c11 {
    width: 100% !important;
  }

  /* Audiolist: stack play/save below label */
  .audiolist_item_header {
    height: auto !important;
    min-height: 64px;
  }
  .audiolist_item_bt_play {
    right: 36px;
    top: auto;
    bottom: 8px;
  }
  .audiolist_item_bt_save {
    right: 10px;
    top: auto;
    bottom: 8px;
  }
  .audiolist_item_label {
    max-width: calc(100% - 70px);
    font-size: 12px;
  }
  .audioitem_item_desc {
    margin-left: 15px;
    margin-right: 10px;
    font-size: 12px;
  }

  /* Body text slightly smaller */
  body, td, th {
    font-size: 13px;
    line-height: 20px;
  }

  /* Footer buttons wrap nicely */
  #hs_ftr_buttons {
    gap: 2px;
  }

  /* Facebook widget */
  #parembanner {
    max-width: 100%;
  }
  #parembanner #likebox-frame,
  #parembanner #likebox-frame iframe {
    max-width: 100%;
  }

  /* Fixed-width tables from content views */
  table[width] {
    width: 100% !important;
    max-width: 100%;
  }
  td[width] {
    width: auto !important;
  }
}
