/*
 * IslamBook
 * Copyright (c) 2026 Dr. Ahmed Gouda. All rights reserved.
 * Email: webmaster@islambook.com
 * Website: www.islambook.com
 */

:is(#top-area-container, #bottom-area-container) [data-nav-tooltip] {
    position: relative;
}
:is(#top-area-container, #bottom-area-container) [data-nav-tooltip]::after,
:is(#top-area-container, #bottom-area-container) [data-nav-tooltip]::before {
    position: absolute;
    left: 50%;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}
:is(#top-area-container, #bottom-area-container) [data-nav-tooltip]::after {
    content: attr(data-nav-tooltip);
    width: max-content;
    max-width: min(18rem, 75vw);
    padding: .35rem 1.4rem;
    border: 1px solid var(--gold, #c5a45d);
    border-radius: .65rem;
    background: linear-gradient(145deg, var(--card, #fff), var(--wash, #f2f6ee));
    color: var(--ink, #173f35);
    box-shadow: 0 0 0 2px #ffd54a99, 0 0 8px 2px #ffc928a6, 0 0 14px 3px #ffde5459, 0 0 9px 1px color-mix(in srgb, var(--green, #185447) 32%, transparent), 0 8px 20px #0004, 0 2px 5px #0002, inset 0 1px #fff8;
    font: 600 1.125rem/1.35 var(--font-body, sans-serif);
    display: grid;
    place-items: center;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}
:is(#top-area-container, #bottom-area-container) [data-nav-tooltip]::before {
    content: '';
    width: .55rem;
    height: .55rem;
    border: solid var(--gold, #c5a45d);
    background: var(--card, #fff);
}
#top-area-container [data-nav-tooltip]::after {
    top: calc(100% + .65rem);
    transform: translate(-50%, -.2rem);
}
#top-area-container [data-nav-tooltip]::before {
    top: calc(100% + .38rem);
    border-width: 1px 0 0 1px;
    transform: translateX(-50%) rotate(45deg);
}
#bottom-area-container [data-nav-tooltip]::after {
    bottom: calc(100% + .65rem);
    transform: translate(-50%, .2rem);
}
#bottom-area-container [data-nav-tooltip]::before {
    bottom: calc(100% + .38rem);
    border-width: 0 1px 1px 0;
    transform: translateX(-50%) rotate(45deg);
}
@media (hover: hover) {
    :is(#top-area-container, #bottom-area-container) [data-nav-tooltip]:hover::after,
    :is(#top-area-container, #bottom-area-container) [data-nav-tooltip]:hover::before {
        opacity: 1;
        visibility: visible;
    }
    #top-area-container [data-nav-tooltip]:hover::after,
    #bottom-area-container [data-nav-tooltip]:hover::after { transform: translate(-50%, 0); }
}
:is(#top-area-container, #bottom-area-container) [data-nav-tooltip]:focus-visible::after,
:is(#top-area-container, #bottom-area-container) [data-nav-tooltip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
}
#top-area-container [data-nav-tooltip]:focus-visible::after,
#bottom-area-container [data-nav-tooltip]:focus-visible::after { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
    :is(#top-area-container, #bottom-area-container) [data-nav-tooltip]::after,
    :is(#top-area-container, #bottom-area-container) [data-nav-tooltip]::before { transition: none; }
}
