/* Mobile Responsive Styles for Ted B Hale website */

/* ---- Hamburger Menu Styles ---- */
#nav-hamburger {
  display: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 24px;
  line-height: 32px;
  background: none;
  border: none;
  color: black;
  float: right;
}

#nav-links {
  display: inline;
}

/* ---- Responsive breakpoint ---- */
@media screen and (max-width: 820px) {

  /* Make the viewport fill the screen */
  body {
    background-size: cover !important;
    background-attachment: fixed;
    margin: 0;
    padding: 0;
  }

  /* Navigation bar */
  #navigation {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    height: auto !important;
    padding: 0 8px;
    position: relative;
  }

  /* Logo */
  #navigation > div:first-child,
  #nav-logo {
    float: left !important;
  }

  /* Show hamburger, hide inline links */
  #nav-hamburger {
    display: block;
  }

  #nav-links {
    display: none;
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    background-color: white;
    z-index: 1000;
    border-top: 1px solid #ccc;
    padding: 0;
  }

  #nav-links.open {
    display: block;
  }

  #nav-links a {
    display: block !important;
    padding: 14px 20px !important;
    font-size: 20px !important;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: black !important;
  }

  #nav-links a:hover {
    background-color: #f5f5f5;
  }

  /* Content areas */
  #content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 5px !important;
    margin: 0 auto !important;
  }

  #main {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    margin: 8px 0 !important;
  }

  #innermain, #innermain2 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    position: static !important;
    top: auto !important;
    right: auto !important;
    padding: 10px !important;
  }

  #bottom {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px !important;
    height: auto !important;
  }

  /* Index page specific */
  #magnet {
    float: none !important;
    position: static !important;
    width: 100% !important;
    right: auto !important;
    text-align: center;
    padding: 5px !important;
  }

  #magnet CENTER, #magnet center {
    display: block;
  }

  #magnet P, #magnet p {
    width: auto !important;
    max-width: 100%;
  }

  #brag {
    float: none !important;
    position: static !important;
    width: auto !important;
    right: auto !important;
    margin: 10px 0 !important;
    padding: 10px !important;
  }

  #about {
    position: static !important;
    top: auto !important;
    width: auto !important;
    max-width: 100%;
    margin: 15px 0 !important;
    box-sizing: border-box;
  }

  /* Images */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Tables — switch to block layout on mobile */
  table, tbody, tr, td, th {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  td {
    padding: 6px 0 !important;
  }

  /* Books page: center the buy links */
  #main td[style*="text-align:center"],
  #main td[style*="text-align: center"] {
    text-align: center;
  }

  /* Newsletter page floats */
  #main div[style*="float: left"],
  #main div[style*="float:left"],
  #main div[style*="float: right"],
  #main div[style*="float:right"] {
    float: none !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Bottom footer table */
  #bottom table,
  #bottom table tr,
  #bottom table td {
    display: block !important;
    width: 100% !important;
  }

  /* Fix &nbsp; spacing in nav links */
  .nav-spacer {
    display: none;
  }
}

/* ---- Desktop: nav-links inline ---- */
@media screen and (min-width: 821px) {
  #nav-links {
    display: inline-block;
    line-height: 32px;
    margin-left: 20px;
  }

  #nav-links a {
    display: inline !important;
    margin-right: 28px;
    text-decoration: none;
    color: black;
    font-size: 18px;
  }

  #nav-links a:hover {
    color: #555;
  }
}
