/* ============================================================
   layout.css — minimal layout layer for COG-MHEAR
   ------------------------------------------------------------
   Replaces the Bootstrap 4.5 CSS (grid/reboot/utilities) that
   the markup actually uses, plus the small carousel-core subset
   that the old Owl Carousel CSS provided. Loaded first, exactly
   where bootstrap.min.css used to sit, so style.css,
   custom.css and colors/minimal.css keep overriding it.

   Derived from a scan of every class attribute in the built
   site (135 pages). Only what is used is defined here.
   ============================================================ */

/* ------------------------------------------------------------
   1. Minimal reboot (what the markup needs from Bootstrap's)
   ------------------------------------------------------------ */

html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
}

/* Bootstrap's reboot reset top margins on text elements; the
   theme's style.css then restyles most of them (p margin-bottom,
   h1-h4 sizes and margins), so only the top-margin reset and the
   list bottom margin are needed to keep identical rhythm. */
p {
  margin-top: 0;
  margin-bottom: 1rem;
}

ol,
ul,
dl {
  margin-top: 0;
  margin-bottom: 1rem;
}

img {
  vertical-align: middle;
  border-style: none;
}

hr {
  margin-top: 1rem;
  margin-bottom: 1rem;
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-sizing: content-box;
  height: 0;
  overflow: visible;
}

/* Bootstrap's reboot defaults for headings. The theme restyles
   sizes, weights and margins for h1-h4 (style.css wins, being
   later), but nothing else on the site declares heading
   line-height, so this block is what keeps headings compact. */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 500;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* ------------------------------------------------------------
   2. Grid (Bootstrap 4.5 semantics, used classes only)
   container / row / col-sm-12 / col-md-2..12 / offset-md-1,2
   ------------------------------------------------------------ */

.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

/* Base column behaviour: full width (stacked) below the md
   breakpoint, exactly like Bootstrap's col classes. */
.col-sm-12,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-6,
.col-md-8,
.col-md-9,
.col-md-10,
.col-md-12 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

@media (min-width: 576px) {
  .container { max-width: 540px; }
  .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 768px) {
  .container { max-width: 720px; }
  .col-md-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-3  { flex: 0 0 25%;         max-width: 25%; }
  .col-md-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-6  { flex: 0 0 50%;        max-width: 50%; }
  .col-md-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-9  { flex: 0 0 75%;        max-width: 75%; }
  .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-md-12 { flex: 0 0 100%;       max-width: 100%; }
  .offset-md-1 { margin-left: 8.333333%; }
  .offset-md-2 { margin-left: 16.666667%; }
}

@media (min-width: 992px) {
  .container { max-width: 960px; }
}

@media (min-width: 1200px) {
  .container { max-width: 1140px; }
}

/* ------------------------------------------------------------
   3. Utilities actually used by the markup
   ------------------------------------------------------------ */

.text-center { text-align: center !important; }
.text-justify { text-align: justify !important; }

.lead {
  font-size: 1.25rem;
  font-weight: 300;
}

.clearfix::after {
  display: block;
  clear: both;
  content: "";
}

.d-block { display: block !important; }

@media (min-width: 576px) {
  .d-sm-none { display: none !important; }
}

@media (min-width: 768px) {
  .d-md-block { display: block !important; }
}

/* ------------------------------------------------------------
   4. Carousel core (subset of the old owl.carousel.css)
   The hero slider is a single static slide (#custom-owl-slider
   is fully styled by style.css). This keeps the .owl-carousel /
   .item contract alive for the sponsors rows on /partners,
   which colors/minimal.css hides on desktop and custom.css
   styles on mobile.
   ------------------------------------------------------------ */

.owl-carousel {
  display: block;
  width: 100%;
  position: relative;
  z-index: 1;
}

.owl-carousel .item img {
  display: block;
  width: 100%;
}

/* Mobile sponsor rows: the old markup relied on Owl's generated
   .owl-stage (flex) and .owl-stage-outer (overflow hidden)
   wrappers. Without Owl, lay the items out as one cropped row,
   matching the previous rendering (logos side by side, edges
   cropped). Specificity is kept above custom.css's
   "#section-clients .owl-carousel { display: block !important }"
   on purpose. */
@media (max-width: 767px) {
  #section-clients .owl-carousel.owl-sponsors {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    overflow: hidden;
  }
  #section-clients .owl-carousel.owl-sponsors .item {
    flex: 0 0 auto;
  }
}

/* ------------------------------------------------------------
   5. Lightbox (replaces Magnific Popup markup)
   Triggered only by .image-popup / .zoom-gallery / .images-group
   anchors; no current page uses them, kept for parity with the
   old wiring in designesia.js.
   ------------------------------------------------------------ */

.site-lightbox {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.9);
  border: 0;
  max-width: 100%;
  max-height: 100%;
}

.site-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.9);
}

.site-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.site-lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 0;
  color: #fff;
  font-family: "Quicksand", Arial, Helvetica, sans-serif;
  font-size: 28px;
  line-height: 40px;
  cursor: pointer;
}

.site-lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  margin: 0;
  text-align: center;
  color: #eee;
  font-size: 13px;
  letter-spacing: 1px;
}

.site-lightbox[open] {
  animation: site-lightbox-fade 160ms ease-out;
}

@keyframes site-lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
