/* Loaded after site.css.
 *
 * site.css sets .navbar-wrapper { position: absolute }, taking the header out
 * of flow. The legacy page compensated with repositionHeaderFooter() in
 * jQuery, which measured the navbar and set #headerspace's height to match on
 * every resize. That is layout-by-JavaScript: it overlaps content before the
 * script runs, and breaks when the nav wraps to two lines on a phone.
 *
 * Putting the header back in normal flow achieves the same result -- the
 * spacer existed only to reserve exactly the space the header occupies. */
.navbar-wrapper {
  position: relative;
}

/* The spacer is now redundant; leave the element for markup parity. */
#headerspace {
  height: auto !important;
}

/* site.css fixes .carousel and .carousel .item at 500px while the slide image
 * inside is position:absolute with height:auto -- so the image floats over a
 * 500px #777 box it never fills, leaving a large empty block above the page
 * content. The legacy site papered over this in repositionHeaderFooter(),
 * which measured $("#first-slide").height() and resized on every tick.
 *
 * Taking the image out of absolute positioning lets the carousel hug it at
 * any width, with no JS and nothing to crop. */
.carousel,
.carousel .item {
  height: auto !important;
}

.carousel .item {
  background-color: transparent !important;
}

.carousel-inner > .item > img {
  position: relative !important;
  width: 100%;
  height: auto !important;
}

/* Menu rows: the 80px float needs clearing or descriptions stack oddly. */
#selectable > li.ui-state-default {
  list-style: none;
  overflow: hidden;
  padding: 6px;
  margin-bottom: 4px;
}
#selectable > li.ui-state-default .proddesc {
  margin-left: 92px;
}
#selectable { padding-left: 0; }

/* site.css sets .carousel.slide { width: 85% }, so the carousel sat narrower
 * than the header and page content. Match the container instead. */
.carousel.slide {
  width: 100%;
}

/* The navbar is absolutely positioned inside .navbar-wrapper in site.css and
 * the logo is 360px wide; on a phone that collides with the toggle button. */
@media (max-width: 767px) {
  .navbar-brand > img {
    max-width: 200px;
    height: auto;
  }
  .navbar-brand {
    height: auto;
    padding: 8px 15px;
  }
  #navbar.navbar-collapse {
    max-height: none;
  }
}

/* Legacy CMS content carries fixed pixel widths (the homepage body has a
 * width:660 element), which overflowed the viewport on a phone and pushed the
 * right-floated hamburger off-screen. */
.legacy-content img,
.legacy-content table,
.legacy-content div,
.legacy-content iframe {
  max-width: 100% !important;
  height: auto;
}

.legacy-content {
  overflow-wrap: break-word;
}

/* Keep the toggle reachable regardless of what the content does. */
@media (max-width: 767px) {
  .navbar-toggle {
    display: block;
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 30;
    margin: 0;
  }
  .navbar-header {
    position: static;
  }
}

/* site.css puts #footer-wrapper at position:absolute; bottom:0, which the
 * legacy page compensated for in JS. Keep the footer in normal flow. */
#footer {
  position: static !important;
  width: 100%;
  margin-top: 30px;
}

/* .inner is width:960px in site.css, which overflows a phone. */
#footer .inner {
  width: auto;
  max-width: 960px;
  padding: 14px 15px;
  overflow: hidden;
}
#footer .copyleft { float: left; }
#footer .atpsocials { float: right; }
#footer .atpsocials ul { list-style: none; margin: 0; padding: 0; }
#footer h5 { margin: 0; line-height: 1.5; }
#footer .clear { clear: both; }

@media (max-width: 767px) {
  #footer .copyleft,
  #footer .atpsocials { float: none; text-align: center; }
  #footer .atpsocials { margin-top: 8px; }
}

/* The white content panel only reads as a panel with some breathing room. */
#container_row {
  padding: 20px 15px 30px;
}

/* Sticky social strip, ported verbatim from the <style> block in
 * includes/left_panel_NEW.php. Pinned to the right edge at right:-119px so
 * only the icons show; each row slides out on hover. */
/* The strip is 200px wide and parked off the right edge; what is left
 * showing is 200 minus this offset. The legacy site parks it at -119px,
 * leaving 81px -- the 32px icon, its 15px of margin, and then 34px of the
 * label sticking out, so every page shows "Face", "Twit", "Inst" down the
 * side. -148px leaves 52px, which is the icon and its margins and nothing
 * else. The hover shift below is moved by the same amount, so the width
 * revealed on hover is unchanged. */
.sticky-container {
  padding: 0;
  margin: 0;
  position: fixed;
  right: -148px;
  top: 203px;
  width: 200px;
  z-index: 100000;
}

@media (max-width: 768px) {
  .sticky-container {
    top: 133px;
  }
}

.sticky {
  padding: 0;
  margin: 0;
}

.sticky li {
  list-style-type: none;
  background-color: rgba(15, 15, 14, 0.62);
  color: #efefef;
  height: 43px;
  padding: 0;
  margin: 0 0 1px 0;
  transition: all 0.45s ease-in-out;
  cursor: pointer;
}

/* -125px in the legacy, where 81px already showed: 81 + 125 = 206, so the
 * whole 200px strip is out. From 52px at rest, -148px reaches the same
 * place. */
.sticky li:hover {
  margin-left: -148px;
}

.sticky li img {
  float: left;
  margin: 5px;
  margin-right: 10px;
}

.sticky li p {
  padding: 0;
  margin: 0;
  line-height: 43px;
  width: 200px;
  /* left_panel_NEW.php sets these inline on each <p>. */
  font-size: 1.3em;
  color: #eee;
  white-space: nowrap;
}

.sticky a { color: #333; }
.sticky a:hover { color: #fff; }

/* site.css hides the homepage body sections with opacity:0 and reveals them
 * from JS (the same pattern as body{opacity:0} and the carousel spacer). The
 * branch panels and welcome copy are therefore invisible without JavaScript --
 * which is what a crawler sees on the live site today. */
#home_sec1_cover,
#home_sec2_cover,
#side_sec1_cover,
#side_sec2_cover {
  opacity: 1 !important;
}

/* ---- Gallery grid + lightbox ---- */
.nv-gallery-grid { list-style: none; padding-left: 0; }
.nv-gallery-figure { margin-bottom: 16px; }

.nv-gallery-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.nv-gallery-btn:focus-visible { outline: 3px solid #930036; outline-offset: 2px; }

.nv-gallery-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.nv-lb {
  position: fixed;
  inset: 0;
  z-index: 200000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Only enough side room for the arrows to sit clear of the photo. */
  padding: 12px 64px;
}

.nv-lb-figure {
  margin: 0;
  width: 100%;
  max-height: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* The stage is the space the photo may use; the image fills it and letterboxes
 * itself via object-fit. Sizing the box rather than the <img> is what lets a
 * photo scale UP -- max-width/max-height alone only ever shrink it. */
.nv-lb-stage {
  position: relative;
  width: 100%;
  height: calc(100vh - 76px);
}

.nv-lb-img {
  object-fit: contain;
  border-radius: 4px;
}

.nv-lb-caption {
  margin-top: 12px;
  color: #f2f2f2;
  font-size: 15px;
}
.nv-lb-count { color: #b9b9b9; margin-left: 8px; }

.nv-lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}
.nv-lb-arrow:hover { background: rgba(255, 255, 255, 0.3); }
.nv-lb-arrow:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.nv-lb-prev { left: 12px; }
.nv-lb-next { right: 12px; }

.nv-lb-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.nv-lb-close:hover { background: rgba(255, 255, 255, 0.3); }
.nv-lb-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

@media (max-width: 767px) {
  .nv-lb { padding: 16px 8px 8px; }
  .nv-lb-arrow { width: 44px; height: 44px; font-size: 28px; }
  .nv-lb-prev { left: 4px; }
  .nv-lb-next { right: 4px; }
  .nv-lb-stage { height: calc(100vh - 104px); }
}
