/* ==========================================================================
   Additions for the page bodies (everything except the homepage).
   The original theme/plugin styles come from content.css, js_composer.css
   and plugins.css; this file only covers what those cannot:
   rebuilt post grids, the share-icon fallback, form notices, the lightbox.
   ========================================================================== */

/* Rebuilt News / Case Studies grids (WPBakery lazy masonry, 3 columns in a 3/4 column) */
#mid .news-grid--listing {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
}
#mid .news-grid--listing .news-card[hidden] { display: none; }
/* latest-news.css is unscoped; restate what the #mid-scoped theme rules would override */
#mid .news-card__title { margin: 0 0 6px; font-size: 16px; font-weight: bold; line-height: 1.3; }
#mid .news-card__title a { color: #201547; }
#mid .news-card__title a:hover { color: #475577; }
#mid .news-card__date { margin: 0 0 8px; }
#mid .news-card__excerpt { margin: 0 0 15px; }
#mid .news-card__more { color: #666; }
#mid .news-card__more:hover { color: #fff; }
@media (max-width: 1024px) {
  #mid .news-grid--listing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  #mid .news-grid--listing { grid-template-columns: minmax(0, 1fr); }
}
.news-grid__sentinel { height: 1px; }

/* AddToAny buttons: square brand-coloured icons (AddToAny's default look) */
/* spacing comes from AddToAny's own "padding: 0 4px"; no margins, so WPBakery's
   ".wpb_text_column :last-child { margin-bottom: 0 }" cannot shift the last icon */
#mid .a2a_kit a { display: inline-block; margin: 0; line-height: 0; }
#mid .a2a-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: #fff;
  font-size: 15px;
  line-height: 24px;
  text-align: center;
  box-sizing: border-box;
}
#mid .a2a-icon--facebook { background: #0866ff; }
#mid .a2a-icon--linkedin { background: #007bb5; }
#mid .a2a-icon--twitter,
#mid .a2a-icon--x { background: #101010; }
#mid .a2a-icon--email { background: #888990; }
#mid .a2a-icon--instagram { background: #e4405f; }
#mid .a2a_kit a:hover .a2a-icon { opacity: .7; }
/* the share kit sits in a <pre><code> on the original pages: neutralise the monospace box */
#mid pre:has(> code > .addtoany_shortcode) { margin: 0; white-space: normal; font-family: inherit; }

/* Form notices (shown instead of pretending a submission worked) */
.form-notice {
  margin: 0 0 20px;
  padding: 15px 20px;
  border-left: 4px solid;
  font-size: 15px;
  line-height: 1.5;
}
.form-notice--error   { border-color: #d63637; background: #fcf0f1; color: #6a1b1b; }
.form-notice--success { border-color: #00a32a; background: #edfaef; color: #1d4d29; }
#mid em.wpforms-error { display: block; margin-top: 6px; color: #d63637; font-size: 14px; font-style: normal; }

/* Lightbox for image links */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 60px;
  background: rgba(0, 0, 0, .85);
}
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.lightbox__img { display: block; max-width: 100%; max-height: calc(100vh - 120px); margin: 0 auto; }
.lightbox__caption { margin-top: 10px; color: #ddd; font-size: 14px; }
.lightbox button {
  position: absolute;
  border: 0;
  background: none;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  opacity: .8;
}
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; }
.lightbox__close { top: 10px; right: 15px; }
.lightbox__prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 10px; top: 50%; transform: translateY(-50%); }
.lightbox--single .lightbox__prev,
.lightbox--single .lightbox__next { display: none; }

/* Embedded maps and videos never overflow on small screens */
#mid iframe { max-width: 100%; }

/* Visual Composer "single image" (in posts built with Visual Composer, e.g. the Amrita hospital post).
   cosign.be inlined this element's CSS in each page's <head> (style "vcv:assets:front:style:…"),
   so it is not part of the theme stylesheets. These are its original rules: the image stays inside
   the content column, the figure has no browser default side margins, the photo fills its
   aspect-ratio box (no empty space below it) and the element keeps its 30px bottom spacing. */
#mid .vce-single-image-inner,
#mid .vce-single-image-wrapper { display: inline-block; max-width: 100%; vertical-align: top; }
#mid .vce-single-image-wrapper { overflow: hidden; }
#mid .vce-single-image-wrapper img { max-width: 100%; vertical-align: top; }
#mid .vce-single-image-inner { position: relative; line-height: 1; }
#mid .vce-single-image-figure-inner { display: inline-block; max-width: 100%; }
#mid .vce-single-image-wrapper figure { margin: 0; }
#mid .vce-single-image-wrapper figcaption { margin-top: 10px; font-style: italic; }
#mid .vce-single-image-wrapper figcaption[hidden] { display: none; }
#mid .vce-single-image--align-left { text-align: left; }
#mid .vce-single-image--align-center { text-align: center; }
#mid .vce-single-image--align-right { text-align: right; }
#mid .vce-single-image-inner.vce-single-image--absolute .vce-single-image:not([data-dynamic-natural-size=true]) {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
}
#mid .vce.vce-single-image-wrapper { margin-bottom: 30px; }
