/* ==========================================================================
   TankAndBarrel.com - manufacturer (brand) pages (tb_brand)
   2026-11-28  -  CSS only. Same links, same names, same alt text, same images.
   No new customer-facing text. No PHP, no JavaScript.

   Scope: ONLY the manufacturer listing page (index.php?manufacturers_id=N,
   e.g. /norwesco-m-50.html). That page is the only page on the site whose
   #bodyContent > .contentContainer has this shape:

       .contentContainer
         .text-center            <- brand logo (a brand with no logo is covered too)
         .well.well-sm           <- brand description
         .row                    <- the category tiles (or the "populating" note)

   Every rule below starts with that test, so category, product, cart,
   checkout, account and information pages are never touched. Browsers that
   do not understand :has() simply keep today's look (the file does nothing).

   What it does
   - Brand header: logo in a white card next to the description card
     (stacked on phones). Description gets a navy accent bar, comfortable
     line length and styled links / paragraphs.
   - Plain-text descriptions (line breaks typed in the admin box with no <p>
     tags) now show their paragraph breaks instead of one run-on block.
     Descriptions that use <p>, <br> or lists are left alone.
   - Tile grid: the same card look as the modern category grid
     (tb_catgrid) - equal-height cards, fixed photo well, 2-line name space,
     whole card is the link, hover and keyboard focus ring.
     4 across on desktop, 3 on tablets / sideways phones, 2 on phones.
   ========================================================================== */

/* ---- page title ---- */
#bodyContent:has(> .contentContainer > :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .page-header {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}
#bodyContent:has(> .contentContainer > :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .page-header h1 {
  margin: 0 !important;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 28px !important;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #13253a;
}

/* ---- the page body: logo + description header, then the grid ---- */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) {
  display: -ms-grid;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px 22px;
  align-items: stretch;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #33475b;
}

/* ---- logo card ---- */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .text-center:first-child {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
          align-items: center;
  -webkit-justify-content: center;
          justify-content: center;
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  -webkit-box-shadow: 0 1px 3px rgba(19, 37, 58, .06);
          box-shadow: 0 1px 3px rgba(19, 37, 58, .06);
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .text-center:first-child img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  max-height: 170px;
  margin: 0 auto;
  object-fit: contain;
}

/* a brand with no logo on file: the description spans the full width */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm:first-child {
  grid-column: 1 / -1;
}

/* ---- description card ---- */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm {
  min-width: 0;
  margin: 0;
  padding: 18px 22px;
  background: #f7f9fc;
  border: 1px solid #e3e8ee;
  border-left: 4px solid #1f3a93;
  border-radius: 8px;
  -webkit-box-shadow: none;
          box-shadow: none;
  font-size: 15.5px;
  line-height: 1.65;
  color: #33475b;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm p,
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm ul,
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm ol {
  margin: 0 0 .85em;
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm > :last-child {
  margin-bottom: 0;
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm b,
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm strong {
  color: #13253a;
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm a {
  color: #1e6fc4;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(30, 111, 196, .35);
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm a:hover,
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm a:focus {
  color: #13253a;
  border-bottom-color: #13253a;
}
/* Plain-text description (no <p>, <br>, lists or other blocks): show the
   paragraph breaks that were typed in. The template puts one newline before
   the text; the ::before pulls it back up so there is no empty first line. */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm:not(:has(p, br, ul, ol, div, table, h2, h3, h4)) {
  white-space: pre-line;
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm:not(:has(p, br, ul, ol, div, table, h2, h3, h4))::before {
  content: "";
  display: block;
  height: 0;
  margin-bottom: -1.65em;
}

/* ---- the tile grid ---- */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row {
  display: -ms-grid;
  display: grid !important;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 !important;
  padding: 0;
}
/* Bootstrap clearfix pseudo-elements and the inline clearfix divs would
   otherwise become (empty) grid cells */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row::before,
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row::after,
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > .clearfix {
  content: none !important;
  display: none !important;
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] {
  display: -webkit-flex;
  display: flex;
  float: none;
  width: auto !important;
  min-width: 0;
  margin: 0;
  padding: 0;
}

/* the card = the link, so the whole tile is one click target */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
          flex-direction: column;
  -webkit-flex: 1 1 auto;
          flex: 1 1 auto;
  min-width: 0;
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  -webkit-box-shadow: 0 1px 3px rgba(19, 37, 58, .06);
          box-shadow: 0 1px 3px rgba(19, 37, 58, .06);
  overflow: hidden;
  text-decoration: none !important;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  -webkit-transition: border-color .15s ease, box-shadow .15s ease;
          transition: border-color .15s ease, box-shadow .15s ease;
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a:hover,
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a:focus-visible {
  border-color: #1e6fc4;
  -webkit-box-shadow: 0 4px 12px rgba(19, 37, 58, .12);
          box-shadow: 0 4px 12px rgba(19, 37, 58, .12);
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a:focus-visible {
  outline: 2px solid #1e6fc4;
  outline-offset: 2px;
}

/* fixed-height photo well; photos sit on white and are never cropped */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a > img {
  display: block;
  -webkit-flex: 0 0 168px;
          flex: 0 0 168px;
  width: 100% !important;
  height: 168px !important;
  max-width: 100%;
  margin: 0;
  padding: 10px 12px 0;
  object-fit: contain;
  object-position: center;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

/* name: reserved 2-line height so a row of cards lines up */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a > h4 {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
          align-items: center;
  -webkit-justify-content: center;
          justify-content: center;
  -webkit-flex: 1 1 auto;
          flex: 1 1 auto;
  min-height: 64px;
  margin: 0;
  padding: 8px 12px 14px;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  color: #13253a;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a:hover > h4,
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a:focus-visible > h4 {
  color: #1e6fc4;
}

/* the "we are populating our inventory" note on a brand with no tiles yet */
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > .col-xs-12 {
  grid-column: 1 / -1;
}
#bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > .col-xs-12 > p {
  width: 100%;
  margin: 0;
  padding: 22px 18px;
  background: #f7f9fc;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  color: #5b6b7d;
}

/* --------------------------------------------------------------------------
   Tablet / sideways phone (768-991): 3 across, slimmer logo column
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 991px) {
  #bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  #bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a > h4 {
    min-height: 82px;
  }
}

/* --------------------------------------------------------------------------
   Phone (up to 767): one-column header, 2 across
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  #bodyContent:has(> .contentContainer > :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .page-header h1 {
    font-size: 24px !important;
  }
  #bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  #bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .text-center:first-child {
    padding: 12px;
  }
  #bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .text-center:first-child img {
    max-height: 110px;
  }
  #bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .well.well-sm {
    padding: 14px 16px;
    font-size: 14.5px;
    line-height: 1.6;
  }
  #bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a > img {
    -webkit-flex-basis: 124px;
            flex-basis: 124px;
    height: 124px !important;
    padding: 8px 8px 0;
  }
  #bodyContent > .contentContainer:has(> :is(.text-center:first-child + .well.well-sm, .well.well-sm:first-child) + .row) > .row > [class*="col-"] > a > h4 {
    min-height: 70px;
    padding: 6px 8px 10px;
    font-size: 13px;
  }
}
