/* Sharing starts after the header: a left rail on desktop, a row on small screens. */
.bhm-share-section { margin: 0; background: #fff; color: var(--bhm-ink); }
.bhm-share-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; padding-block: 12px 18px; border-bottom: 1px solid var(--bhm-line); }
.bhm-share-inner h2 { flex: 0 0 auto; margin: 0; color: var(--bhm-ink); font-size: 14px; font-weight: 650; line-height: 1.3; letter-spacing: 0; }
.bhm-share-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.bhm-editorial .bhm-share-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; min-width: 44px; margin: 0; padding: 10px 13px; border: 1px solid #cbd0d6; border-radius: 0; background: #fff; color: #2d3440; font: 600 13px/1.3 var(--bhm-font); text-decoration: none; cursor: pointer; }
.bhm-editorial .bhm-share-button:hover { color: var(--bhm-dark-red); border-color: var(--bhm-red); background: #fff8f8; }
.bhm-share-button svg { display: block; flex: 0 0 20px; width: 20px; height: 20px; }
.bhm-share-button--facebook svg { color: #0866ff; }
.bhm-share-button--linkedin svg { color: #0a66c2; }
.bhm-share-button--whatsapp svg { color: #087f44; }
.bhm-share-status { flex-basis: 100%; width: 100%; margin: 0; color: var(--bhm-dark-red); font-size: 13px; line-height: 1.5; }
.bhm-share-status:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.bhm-share-fallback { position: relative; flex-basis: 100%; max-width: 740px; width: 100%; }
.bhm-share-fallback label { display: block; min-height: 28px; margin-bottom: 6px; padding-right: 30px; font-size: 13px; font-weight: 650; }
.bhm-editorial .bhm-share-copy-close { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 28px; min-width: 28px; height: 28px; min-height: 28px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--bhm-ink); font-size: 23px; line-height: 1; cursor: pointer; }
.bhm-share-fallback input { display: block; width: 100%; min-height: 44px; padding: 10px 12px; margin: 0; color: var(--bhm-ink); background: #fff; border: 1px solid #aab1bb; border-radius: 0; font: 14px/1.4 var(--bhm-font); }
.bhm-share-fallback p { margin: 8px 0 0; color: var(--bhm-muted); font-size: 13px; line-height: 1.5; }
@media (min-width: 1200px) {
  /* Reserve a real gutter, keeping the masthead, menus and page content aligned.
     Wider screens retain the original 1360px reading shell. */
  body.bhm-editorial:has(> .bhm-share-section) .bhm-shell,
  body.bhm-editorial:has(> .bhm-share-section) .container {
    width: calc(100% - 160px);
  }
  .bhm-share-section {
    position: sticky;
    top: 20px;
    z-index: 10;
    width: 44px;
    height: 0;
    margin: 0 0 0 max(8px, calc((100% - var(--bhm-page-width)) / 2 - 72px));
    background: transparent;
    pointer-events: none;
  }
  .admin-bar .bhm-share-section { top: calc(var(--wp-admin--admin-bar--height, 32px) + 20px); }
  body.bhm-editorial .bhm-share-section > .bhm-share-inner {
    position: relative;
    /* Give the rail breathing room below the header without moving the content. */
    top: 28px;
    display: block;
    width: 44px;
    max-width: 44px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .bhm-share-inner h2 {
    margin: 0 0 12px;
    color: var(--bhm-muted);
    font-size: 9px;
    font-weight: 650;
    line-height: 1.4;
    letter-spacing: .1em;
    text-align: center;
    text-transform: uppercase;
  }
  .bhm-share-title-tail,
  .bhm-share-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
  .bhm-share-buttons { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 8px; }
  .bhm-editorial .bhm-share-button {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 10px;
    pointer-events: auto;
  }
  .bhm-share-button:is(:hover, :focus-visible) span {
    z-index: 1;
    top: 50%;
    left: calc(100% + 12px);
    width: max-content;
    height: auto;
    margin: 0;
    padding: 7px 10px;
    overflow: visible;
    clip: auto;
    transform: translateY(-50%);
    color: #fff;
    background: var(--bhm-ink);
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
  }
  .bhm-share-status:not(:empty),
  .bhm-share-fallback:not([hidden]) {
    position: absolute;
    top: 0;
    left: 56px;
    width: 290px;
    max-width: calc(100vw - 96px);
    padding: 12px 14px;
    border: 1px solid var(--bhm-line);
    background: #fff;
    box-shadow: 0 5px 18px #22263014;
    pointer-events: auto;
  }
  .bhm-share-fallback .bhm-share-copy-close { top: 7px; right: 7px; }
  .bhm-share-inner:has(.bhm-share-fallback:not([hidden])) .bhm-share-status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
  }
}
@media (min-width: 1200px) and (max-height: 430px) {
  /* Keep every icon reachable on a short landscape window. */
  .bhm-share-buttons {
    width: 56px;
    max-height: calc(100vh - 94px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    pointer-events: auto;
  }
  .admin-bar .bhm-share-buttons { max-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px) - 94px); }
  .bhm-editorial .bhm-share-button { flex-shrink: 0; }
}
@media (max-width: 599px) {
  .bhm-share-inner { display: block; padding-block: 10px 16px; }
  .bhm-share-inner h2 { margin-bottom: 9px; font-size: 12px; }
  .bhm-share-buttons { display: flex; flex-wrap: nowrap; gap: 4px; }
  .bhm-editorial .bhm-share-button { justify-content: center; min-width: 44px; padding: 10px; }
  .bhm-share-button span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .bhm-share-status:not(:empty), .bhm-share-fallback { margin-top: 14px; }
}
@media print { .bhm-share-section { display: none !important; } }
