/* =====================================================================================================
   Article actions (board Components › 17; ArticleActions, MobileArticleActions, ArabicArticleActions,
   RestrictedArticleActions, ShareMenu). Loaded by content/article. Markup: content/partials/article-actions and
   article-share; behaviour: public/js/article-actions.js. Print: article-print.css.
   .article__meta-row (badges + the head group) · .article-actions (+ --head | --row | --rail | --end) · .act-btn
   (+ --icon; __star, __share, __done, __chev; [aria-pressed="true"], [aria-expanded="true"], .is-copied) · .act-tip
   · .act-share (anchor for the menu) · .article-keep (+ --always; __label) · .share-pop (+ --menu | --dialog |
   --fallback, .is-above; __head, __title, __close, __copy, __note, __label, __field, __help) · .share-menu (__item,
   __sep, __ext) · .share-scrim · .section-head (+ --h2 | --h3) · .section-link (__link, __done, __tip; .is-copied)
   ===================================================================================================== */

.article-actions[hidden], .article-keep[hidden], .share-pop[hidden], .share-scrim[hidden] { display: none !important; }
/* Only print shows these (article-print.css). */
.print-only { display: none; }

/* ---- The head: badges on the start, the actions at the top end; the badges wrap, the group never does */
.article__meta-row { display: flex; align-items: flex-start; gap: var(--sp-16); }
.article__meta-row > .article__meta { flex: 1 1 auto; min-width: 0; min-height: 36px; align-content: center; }
.article-actions { display: flex; align-items: center; gap: var(--sp-8); }
.article-actions--head { flex: none; }
.article-actions--row { display: none; }

/* ---- Buttons: 36px tall in a 44px hit area, 14/500, r8, #7d89a3 border */
.act-share { position: relative; display: inline-flex; }
.act-btn {
    position: relative; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 0 var(--sp-12); border: 1px solid var(--c-control); border-radius: var(--r-control); background: #ffffff;
    color: var(--c-primary); font: 500 var(--fs-14)/1 var(--font-body); white-space: nowrap; cursor: pointer;
}
.act-btn::before { content: ""; position: absolute; inset: -4px; }
.act-btn:hover { background: var(--c-subtle); color: var(--c-primary); }
.act-btn[aria-pressed="true"], .act-btn[aria-expanded="true"] { background: var(--c-selected); border-color: var(--c-primary); }
.act-btn[aria-pressed="true"] .act-btn__star { fill: currentColor; }
.act-btn[aria-expanded="true"] .act-btn__chev { transform: rotate(180deg); }
.act-btn__done { display: none; }
.act-btn.is-copied { background: var(--c-green-tint); border-color: var(--c-green); color: var(--c-green); }
.act-btn.is-copied .act-btn__share, .act-btn.is-copied .act-btn__chev { display: none; }
.act-btn.is-copied .act-btn__done { display: inline; }

/* Icon only (the rail): 44px, the name in a tooltip on pointer over and focus. */
.act-btn--icon { width: 44px; height: 44px; padding: 0; }
.act-btn--icon::before { content: none; }
.act-tip {
    position: absolute; z-index: 30; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); display: none;
    padding: 4px 8px; border-radius: var(--r-badge); background: var(--c-navy); color: #ffffff; box-shadow: var(--shadow-2);
    font-size: var(--fs-12); font-weight: 500; line-height: var(--lh-ui); white-space: nowrap; pointer-events: none;
}
.act-btn--icon:hover .act-tip, .act-btn--icon:focus-visible .act-tip, .act-btn--icon.is-copied .act-tip { display: block; }
.act-btn--icon[aria-expanded="true"] .act-tip { display: none; }

/* ---- The rail: the same three as icons, above "On this page", only once the head has scrolled away */
.article-actions--rail { gap: var(--sp-8); }

/* ---- "Keep this article": where there is no rail, after the feedback question and a rule */
.article-keep { display: none; flex-wrap: wrap; align-items: center; gap: var(--sp-12) var(--sp-16); padding-top: var(--sp-24); border-top: 1px solid var(--c-border); }
.article-keep--always { display: flex; }
.article-keep__label { font-size: var(--fs-14); font-weight: 500; line-height: var(--lh-ui); color: var(--c-muted); }
@media (max-width: 1023px) {
    .article-keep { display: flex; }
}

/* ---- Share menu (248px), the restricted dialog and the copy fallback: below the button, end-aligned */
.share-pop {
    position: absolute; z-index: 40; top: calc(100% + 8px); inset-inline-end: 0; width: 248px; padding: var(--sp-8);
    background: #ffffff; border: 1px solid var(--c-border-strong); border-radius: var(--r-card); box-shadow: var(--shadow-2);
    color: var(--c-body); text-align: start; white-space: normal;
}
.share-pop.is-above { top: auto; bottom: calc(100% + 8px); }
.share-pop__head { display: none; }
.share-menu { display: flex; flex-direction: column; }
.share-menu__item {
    min-height: 44px; display: flex; align-items: center; gap: var(--sp-12); padding: 0 var(--sp-12); border: 0; border-radius: var(--r-control);
    background: transparent; color: var(--c-strong); font: 500 var(--fs-15)/var(--lh-ui) var(--font-body); text-align: start; text-decoration: none; cursor: pointer;
}
.share-menu__item > .icon:first-child { color: var(--c-body); }
.share-menu__item:hover, .share-menu__item:focus { background: var(--c-selected); color: var(--c-primary); }
.share-menu__item:focus-visible { outline-offset: -2px; }
.share-menu__ext { margin-inline-start: auto; color: var(--c-muted); }
.share-menu__sep { height: 1px; margin: var(--sp-4) 0; background: var(--c-border); }

.share-pop--dialog { width: 300px; padding: var(--sp-16); display: flex; flex-direction: column; gap: var(--sp-12); }
.share-pop__copy { height: 44px; }
.share-pop__note { margin: 0; display: flex; gap: var(--sp-8); align-items: flex-start; font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-muted); }
.share-pop__note .icon { flex: none; margin-top: 2px; }

.share-pop--fallback { width: 320px; padding: var(--sp-16); display: flex; flex-direction: column; gap: var(--sp-8); }
.share-pop__label { margin: 0; font-size: var(--fs-14); font-weight: 700; color: var(--c-strong); }
.share-pop__field {
    width: 100%; height: 44px; padding: 0 var(--sp-12); border: 1px solid var(--c-control); border-radius: var(--r-control);
    background: #ffffff; color: var(--c-strong); font: 400 var(--fs-13)/1 var(--font-mono);
}
.share-pop__field:focus { outline: 2px solid var(--c-primary); outline-offset: 0; }
.share-pop__help { margin: 0; font-size: var(--fs-13); line-height: var(--lh-ui); color: var(--c-muted); }
.share-pop__help kbd { font-size: var(--fs-12); }

.share-scrim { position: fixed; inset: 0; z-index: 61; background: var(--c-scrim); }

/* ---- Section links: a 32px button after each H2 and H3 (a sibling, never part of the heading's name) */
.prose > .section-head { margin-top: var(--sp-40); line-height: var(--lh-head); }
.prose > .section-head--h3 { margin-top: var(--sp-32); }
.prose > .section-head:first-child { margin-top: 0; }
.prose > .section-head--h3 + * { margin-top: var(--sp-8); }
.section-head > h2, .section-head > h3 { display: inline; margin: 0; scroll-margin-top: var(--sp-24); }
.section-link {
    position: relative; width: 32px; height: 32px; margin-inline-start: var(--sp-4); padding: 0; display: inline-flex; align-items: center; justify-content: center;
    vertical-align: middle; border: 0; border-radius: var(--r-control); background: transparent; color: var(--c-muted); cursor: pointer; opacity: 0;
}
.section-link::before { content: ""; position: absolute; inset: -6px; }
.section-head:hover .section-link, .section-link:focus-visible, .section-link.is-copied { opacity: 1; }
.section-link:hover { background: var(--c-subtle); color: var(--c-primary); }
.section-link .section-link__done { display: none; }
.section-link.is-copied { background: var(--c-green-tint); color: var(--c-green); }
.section-link.is-copied .section-link__link { display: none; }
.section-link.is-copied .section-link__done { display: inline; }
.section-link__tip {
    position: absolute; z-index: 30; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); display: none;
    padding: 4px 8px; border-radius: var(--r-badge); background: var(--c-navy); color: #ffffff; box-shadow: var(--shadow-2);
    font: 500 var(--fs-12)/var(--lh-ui) var(--font-body); white-space: nowrap; pointer-events: none;
}
.section-link:hover .section-link__tip, .section-link:focus-visible .section-link__tip, .section-link.is-copied .section-link__tip { display: block; }
.section-head .share-pop { top: calc(100% + 8px); }

@media (prefers-reduced-motion: no-preference) {
    .section-link { transition: opacity .12s; }
    .share-pop:not([hidden]) { animation: lhc-fade .12s ease-out; }
}

/* ---- Phones: the action row under the summary (equal widths, 44px), the sheets, H2 links always shown */
@media (max-width: 640px) {
    .article-actions--head { display: none !important; }
    .article-actions--row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-8); margin-top: var(--sp-8); }
    .article-actions--row[hidden] { display: none; }
    .article-actions--row .act-share { display: flex; }
    .article-actions--row .act-btn, .article-actions--end .act-btn { width: 100%; height: 44px; }
    .article-actions--row .act-btn::before, .article-actions--end .act-btn::before { content: none; }
    .act-btn__chev { display: none; }
    .article-keep { flex-direction: column; align-items: stretch; gap: var(--sp-8); padding-top: var(--sp-16); }
    .article-actions--end { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .article-actions--end .act-share { display: flex; }

    .share-pop, .share-pop.is-above, .section-head .share-pop {
        position: fixed; z-index: 62; top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 85vh; overflow-y: auto;
        padding: var(--sp-8) var(--sp-16) calc(var(--sp-16) + env(safe-area-inset-bottom, 0px)); border-radius: var(--r-dialog) var(--r-dialog) 0 0; box-shadow: var(--shadow-3);
    }
    .share-pop__head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; margin-bottom: var(--sp-8); }
    .share-pop__title { font: 800 var(--fs-20)/var(--lh-head) var(--font-head); color: var(--c-strong); }
    .share-pop__close { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-control); background: var(--c-subtle); color: var(--c-strong); cursor: pointer; }
    .share-menu__item { min-height: 48px; }
}
@media (max-width: 640px), (hover: none) {
    .section-head--h2 { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-8); }
    .section-head--h2 > h2 { display: block; min-width: 0; padding-top: 6px; }
    .section-head--h2 > .section-link { flex: none; width: 44px; height: 44px; margin: 0; opacity: 1; }
    .section-head--h2 > .section-link::before { content: none; }
    .section-head--h3 > .section-link { display: none; }
}
@media (max-width: 1023px) {
    .article-actions--rail { display: none !important; }
}
