/* Shared social controls for every template opting into fo-social-share. */
body.fo-social-share .fo-article-share { margin: 0; }
body.fo-social-share .fo-article-share__label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.4;
    color: #4F4B4B;
}

body.fo-social-share .fo-article-share__links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

body.fo-social-share .fo-article-share__links :is(a, button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    padding: 10px;
    border: 1px solid #767676;
    border-radius: 4px;
    background: #fff;
    color: #767676;
    text-decoration: none;
    cursor: pointer;
}

body.fo-social-share .fo-article-share__links :is(a, button):hover {
    color: #df0000;
    border-color: #df0000;
}

body.fo-social-share .fo-article-share__status {
    font-weight: 400;
    font-size: 13px;
    line-height: 1.5;
    margin: 8px 0;
}
body.fo-social-share .fo-article-share__status:empty { display: none; }
body.fo-social-share .fo-article-share__copy-field { box-sizing: border-box; width: 100%; margin-top: 8px; }
body.fo-social-share .fo-article-share__copy-field[hidden] { display: none; }

body.fo-social-share .fo-article-share__links svg { width: 24px; height: 24px; }
body.fo-social-share .fo-article-share :is(a, button, input):focus-visible { outline: 2px solid #df0000; outline-offset: 4px; }
body.fo-social-share .fo-article-native-share { display: none; }

/* Placement within each template; button styling stays common. */
body.fo-newsletter-share .fo-article-share { width: 100%; margin: 18px 0 0; padding-bottom: 24px; text-align: left; }
body.fo-newsletter-share .entry-content.full_post > .social_medai_share { display: none; }
body.fo-content-controls .bottom-social-menu { display: none !important; }

@media (max-width: 768px) {
    body.fo-newsletter-share .bottom-social-menu { display: none !important; }
    body.fo-social-share .fo-article-share__label{font-size: 14px;}
}

/* 480px and wider keep the icon row; native/fallback sharing is phone-only. */
@media (max-width: 479px) {
    body.fo-social-share .fo-article-share { display: none !important; }
    body.fo-social-share .fo-article-native-share { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 44px; height: 44px; flex: 0 0 44px; margin-left: auto; padding: 10px; background: transparent; border: 0; border-radius: 0; color: #222; cursor: pointer; -webkit-tap-highlight-color: transparent; }
    body.fo-social-share .fo-article-native-share:active { opacity: .65; }
    body.fo-social-share .fo-article-native-share svg { width: 22px; height: 22px; }
    body.fo-social-share .fo-article-native-share:focus-visible { outline: 2px solid #df0000; outline-offset: 3px; }
    body.fo-newsletter-share .date-time-bookmark { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-bottom: 12px; }
    body.fo-newsletter-share .date-time-bookmark .posted-on-single-post { margin: 0; }
}

/* Used only when the device cannot open its own native share sheet. */
body.fo-social-share.fo-share-sheet-open { overflow: hidden; }
body.fo-social-share .fo-article-share-sheet:not([open]) { display: none; }
body.fo-social-share .fo-article-share-sheet[open] {
    display: block;
    position: fixed;
    inset: auto 0 0;
    width: min(100%, 520px);
    max-width: 100%;
    max-height: 85vh;
    max-height: 85dvh;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 10px 22px calc(22px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 24px 24px 0 0;
    background: #fff;
    color: #222;
    box-shadow: 0 -8px 40px #0002;
    animation: fo-share-sheet-enter .2s ease-out;
}
body.fo-social-share .fo-article-share-sheet::backdrop { background: rgb(0 0 0 / 42%); }
body.fo-social-share .fo-article-share-sheet__handle { width: 36px; height: 4px; margin: 0 auto 12px; border-radius: 4px; background: #d1d1d1; }
body.fo-social-share .fo-article-share-sheet__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body.fo-social-share .fo-article-share-sheet__header h2 { margin: 0; padding: 0; font-size: 22px; font-weight: 700; line-height: 1.3; }
body.fo-social-share .fo-article-share-sheet__close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; padding: 9px; border: 0; border-radius: 50%; color: #555; background: #f1f1f1; cursor: pointer; }
body.fo-social-share .fo-article-share-sheet__title { margin: 6px 0 20px; color: #666; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
body.fo-social-share .fo-article-share-sheet__apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; margin-bottom: 22px; }
body.fo-social-share .fo-article-share-sheet__apps :is(a, button) { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; color: #333; text-decoration: none; font-size: 13px; line-height: 1.3; cursor: pointer; }
body.fo-social-share .fo-article-share-sheet__app-icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px; background: #f2f3f5; }
body.fo-social-share .fo-article-share-sheet__app-icon svg { width: 25px; height: 25px; }
body.fo-social-share .fo-article-share-sheet__copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px; box-sizing: border-box; padding: 12px 16px; border: 0; border-radius: 12px; color: #222; background: #f2f3f5; font-size: 16px; font-weight: 600; cursor: pointer; }
body.fo-social-share .fo-article-share-sheet__copy svg { order: 1; width: 22px; height: 22px; }
body.fo-social-share .fo-article-share-sheet__status { margin: 12px 0 0; font-size: 13px; line-height: 1.4; color: #555; }
body.fo-social-share .fo-article-share-sheet__status:empty { display: none; }
body.fo-social-share .fo-article-share-sheet__url { width: 100%; box-sizing: border-box; margin: 12px 0 0; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; }
body.fo-social-share .fo-article-share-sheet__url[hidden] { display: none; }
body.fo-social-share .fo-article-share-sheet :is(a, button, input):focus-visible { outline: 2px solid #333; outline-offset: 3px; }
@keyframes fo-share-sheet-enter { from { transform: translateY(32px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.fo-social-share .fo-article-share-sheet[open] { animation: none; } }


@media print {
    body.fo-social-share :is(.fo-article-share, .fo-article-share-sheet, .fo-article-native-share) { display: none !important; }
}
