/* =========================================================
   TIOSH – WordPress / WPLMS / Elementor compatibility layer
   Loaded after tiosh.css. Keeps the parent theme's global
   element styles out of the design, and makes the design
   work when every section is its own Elementor widget.
   ========================================================= */

/* Neutralise WPLMS bare-element styles (low specificity via :where so
   the design's own .t- classes still win). */
:where(.t-page) :is(h1, h2, h3, h4, h5, h6) { font-family: inherit; color: inherit; line-height: 1.3; letter-spacing: normal; text-transform: none; }
:where(.t-page) h1 { margin: 0; }
:where(.t-page) blockquote { padding: 0; border: 0; font-size: inherit; }
:where(.t-page) figure { margin: 0; }
:where(.t-page) :is(p + p, p + ul, ul + p, h3 + p, p + h3) { margin-top: 0; }
:where(.t-page) input[type="search"] { box-shadow: none; outline-offset: 0; border-radius: 0; }
.t-page .t-hero__search input:focus { outline: none; box-shadow: none; }

/* WPLMS "fixed footer" option prints footer{position:fixed;z-index:-1;min-height:300px},
   plus padding/background on every <footer> – which hid the TIOSH footer behind the page. */
.t-page footer.t-footer { position: relative; inset: auto; width: auto; z-index: auto; min-height: 0; padding: 0; clear: none; font-size: inherit; color: #fff; margin-top: 0; }
/* The design's 56px gap above the footer, as white space instead of a margin
   (a margin would show the grey WPLMS page background). */
.t-page:has(> .t-footer) { padding-top: 56px; }

/* Elementor sets img { height:auto } – images in the design fill their box. */
.t-page .t-ph img { width: 100%; height: 100%; max-width: 100%; object-fit: cover; border-radius: 0; }
.t-page .t-brand img { max-height: 48px; width: auto; height: auto; }
.t-page .t-bodies__logo img { max-height: 36px; width: auto; height: auto; }
.t-page .t-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Each TIOSH widget fills its Elementor container. */
.elementor-widget[class*="elementor-widget-tiosh-"] { width: 100%; max-width: 100%; }

/* Sticky header: the widget sits inside an Elementor container, so the
   container is what has to stick. */
.e-con:has(> .elementor-widget-tiosh-header),
.e-con:has(> .e-con-inner > .elementor-widget-tiosh-header),
.elementor-section:has(.elementor-widget-tiosh-header) { position: sticky; top: 0; z-index: 99; }
body.admin-bar .e-con:has(> .elementor-widget-tiosh-header),
body.admin-bar .e-con:has(> .e-con-inner > .elementor-widget-tiosh-header),
body.admin-bar .elementor-section:has(.elementor-widget-tiosh-header) { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .e-con:has(> .elementor-widget-tiosh-header),
  body.admin-bar .e-con:has(> .e-con-inner > .elementor-widget-tiosh-header),
  body.admin-bar .elementor-section:has(.elementor-widget-tiosh-header) { top: 46px; }
}
@media (max-width: 600px) {
  body.admin-bar .e-con:has(> .elementor-widget-tiosh-header),
  body.admin-bar .e-con:has(> .e-con-inner > .elementor-widget-tiosh-header),
  body.admin-bar .elementor-section:has(.elementor-widget-tiosh-header) { top: 0; }
}

/* Employers block placed straight after "About us" – same spacing as the design. */
.t-section--flush { padding-top: 0; }
.t-section--flush .t-orgs { margin-top: 16px; }

/* Blog: real post images inside the placeholder boxes. */
.t-post--featured > a.t-ph { display: flex; flex: 1; min-height: 260px; border-radius: var(--t-radius); }
.t-post > a.t-ph--thumb { display: flex; }

/* Editor-only hint when a dynamic widget has nothing to show. */
.t-empty { padding: 24px; border: 1px dashed var(--t-tint-2); border-radius: var(--t-radius); color: var(--t-body); text-align: center; }

/* ---------- Site-wide TIOSH header/footer on WPLMS pages (inc/site-chrome.php) ---------- */
.tiosh-chrome section#content { margin-bottom: 0; }
.tiosh-site-header { position: sticky; top: 0; z-index: 100; }
.tiosh-site-header .t-header { position: static; }
.admin-bar .tiosh-site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tiosh-site-header { top: 0; } }
.tiosh-site-footer .t-footer { margin-top: 0; }
.tiosh-site-header .elementor-widget-container, .tiosh-site-footer .elementor-widget-container { margin: 0; padding: 0; }
/* WPLMS sets a global "nav { float: right }" – undo it inside TIOSH markup. */
.t-page nav { float: none; }
/* Mobile header: WPLMS pads every <button>, squeezing the menu icon to 0 width. */
.t-page .t-menu-toggle { padding: 0; min-width: 44px; }
.t-page .t-menu-toggle svg { flex-shrink: 0; width: 20px; height: 20px; }
@media (max-width: 600px) {
  .t-header__inner { gap: 12px; }
  .t-header__actions .t-btn { padding: 0 14px; }
}
@media (max-width: 440px) {
  .t-header .t-brand__div, .t-header .t-brand__sub { display: none; }
}
