/* ============================================================
   Site announcement drawer (includes/components/announcement.php)

   Design goals, in order:
     1. Half the screen, never the whole screen. The site stays visible and
        usable behind a scrim, so it reads as a promo tab rather than a
        interstitial takeover.
     2. Never traps the visitor. No focus trap, aria-modal="false", the scrim
        is clickable and Escape closes it. Every exit is a dismissal.
     3. Colours come from the site tokens so it does not look bolted on.
   ============================================================ */

.kt-ann[hidden] { display: none; }

.kt-ann {
    position: fixed;
    inset: 0;
    z-index: 1400;              /* above the header, modals sit at 1200 */
}

/* Keeps the page behind from scrolling while the drawer is up, without the
   layout shift that comes from the scrollbar disappearing. */
html.kt-ann-active { overflow: hidden; }

/* ---------- scrim : dims the site, does not cover it opaquely ---------- */
.kt-ann__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 14, 19, 0.72), rgba(9, 14, 19, 0.86));
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.kt-ann.is-open .kt-ann__scrim { opacity: 1; }

/* ---------- panel : 50% width, full height, anchored to one edge ---------- */
.kt-ann__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(50%, 680px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
        radial-gradient(120% 60% at 100% 0%, rgba(248, 197, 36, 0.10), transparent 62%),
        linear-gradient(200deg, #16202a 0%, #101820 58%, #0d141b 100%);
    border-left: 1px solid rgba(248, 197, 36, 0.22);
    box-shadow: -30px 0 70px rgba(0, 0, 0, 0.55);
    transform: translateX(100%);
    transition: transform 0.34s cubic-bezier(0.22, 0.68, 0.24, 1);
    will-change: transform;
}
.kt-ann.is-open .kt-ann__panel { transform: translateX(0); }

/* data-ann-dir="start" flips the anchor and the slide. Set by the admin page. */
.kt-ann[data-ann-dir="start"] .kt-ann__panel {
    right: auto;
    left: 0;
    border-left: 0;
    border-right: 1px solid rgba(248, 197, 36, 0.22);
    box-shadow: 30px 0 70px rgba(0, 0, 0, 0.55);
    transform: translateX(-100%);
}
.kt-ann[data-ann-dir="start"].is-open .kt-ann__panel { transform: translateX(0); }

/* ---------- close (X) ---------- */
.kt-ann__x {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #cfd8e3;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.kt-ann__x:hover {
    background: rgba(248, 197, 36, 0.16);
    border-color: rgba(248, 197, 36, 0.5);
    color: #f8c524;
}
/* Arabic pages read right-to-left, so the close control moves with the text. */
.kt-ann__panel--rtl .kt-ann__x { right: auto; left: 18px; }

/* ---------- body copy ---------- */
.kt-ann__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 76px 44px 30px;
    text-align: center;
}
.kt-ann__panel--rtl .kt-ann__body { text-align: center; }

.kt-ann__eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(248, 197, 36, 0.22), rgba(248, 197, 36, 0.06));
    border: 1px solid rgba(248, 197, 36, 0.32);
    color: #f8c524;
}

.kt-ann__title {
    margin: 0;
    color: #f4f7fb;
    font-family: Roboto, 'Cairo', system-ui, sans-serif;
    font-size: clamp(20px, 2.1vw, 27px);
    font-weight: 800;
    line-height: 1.32;
    letter-spacing: 0.01em;
}
.kt-ann__panel--rtl .kt-ann__title { line-height: 1.5; }

.kt-ann__text {
    margin: 0;
    color: rgba(226, 234, 242, 0.9);
    font-family: Roboto, 'Cairo', system-ui, sans-serif;
    font-size: clamp(14px, 1.15vw, 16px);
    font-weight: 400;
    line-height: 1.85;
    max-width: 44ch;
    margin-inline: auto;
}
.kt-ann__panel--rtl .kt-ann__text { line-height: 2; }

/* ---------- telegram chip ---------- */
.kt-ann__tg {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    align-self: center;
    padding: 11px 18px 11px 14px;
    border: 1px solid rgba(42, 171, 238, 0.34);
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(42, 171, 238, 0.16), rgba(42, 171, 238, 0.05));
    color: #eaf6ff;
    text-decoration: none;
    transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}
.kt-ann__tg:hover {
    border-color: rgba(42, 171, 238, 0.65);
    background: linear-gradient(160deg, rgba(42, 171, 238, 0.26), rgba(42, 171, 238, 0.1));
    transform: translateY(-1px);
}
.kt-ann__tg-ico { display: inline-flex; color: #2aabee; }
.kt-ann__tg-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }
.kt-ann__panel--rtl .kt-ann__tg-txt { align-items: flex-end; }
.kt-ann__tg-txt small {
    color: rgba(234, 246, 255, 0.62);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.kt-ann__tg-txt strong {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

/* ---------- footer : the Continue control ---------- */
.kt-ann__foot {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 44px 34px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.22);
}

.kt-ann__cta {
    width: 100%;
    max-width: 340px;
    min-height: 50px;
    padding: 14px 26px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8c524 0%, #e0a90c 100%);
    color: #1d1600;
    font-family: Roboto, 'Cairo', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(248, 197, 36, 0.22);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.kt-ann__cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 14px 32px rgba(248, 197, 36, 0.3);
}
.kt-ann__cta:active { transform: translateY(0); }
.kt-ann__cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.kt-ann__hint {
    color: rgba(226, 234, 242, 0.5);
    font-size: 12px;
    letter-spacing: 0.02em;
}

/* ============================================================
   Narrow screens: the operator does NOT want a full-screen takeover.
   The panel becomes a rounded card that is inset from every edge, so
   the site stays visible on the left, the top and the bottom. 88% of
   the width leaves a clear strip of the page showing beside it, which
   is the point -- this must never read as an interstitial takeover.
   ============================================================ */
@media screen and (max-width: 820px) {
    .kt-ann__panel,
    .kt-ann[data-ann-dir="start"] .kt-ann__panel {
        width: 88%;
        max-width: none;
        top: 6%;
        bottom: 6%;
        border-radius: 16px;
        border: 1px solid rgba(248, 197, 36, 0.22);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    }
    .kt-ann__body { padding: 58px 20px 20px; }
    .kt-ann__foot { padding: 16px 20px 22px; }
    .kt-ann__cta { max-width: none; }
}

/* Very narrow phones: the card is small, so tighten the type and padding.
   padding-top is reduced from the 820px block because the panel now starts 6%
   down the screen, so there is already room above the copy. */
@media screen and (max-width: 420px) {
    .kt-ann__body { padding-top: 46px; gap: 13px; }
    .kt-ann__title { font-size: 18px; }
    .kt-ann__text { font-size: 13px; line-height: 1.75; }
    .kt-ann__panel--rtl .kt-ann__text { line-height: 1.9; }
    .kt-ann__foot { padding: 14px 18px 18px; }
    .kt-ann__tg { padding: 9px 14px 9px 12px; }
    .kt-ann__tg-txt strong { font-size: 14px; }
    .kt-ann__x { top: 12px; right: 12px; width: 32px; height: 32px; }
    .kt-ann__panel--rtl .kt-ann__x { left: 12px; }
}

/* Short landscape windows: the copy must not push Continue off screen. */
@media screen and (max-height: 560px) {
    .kt-ann__panel { top: 3%; bottom: 3%; }
    .kt-ann__body { padding-top: 46px; padding-bottom: 12px; justify-content: flex-start; gap: 10px; }
    .kt-ann__eyebrow { width: 30px; height: 30px; border-radius: 9px; }
    .kt-ann__title { font-size: 17px; }
    .kt-ann__text { font-size: 12.5px; line-height: 1.65; }
    .kt-ann__foot { padding-top: 12px; padding-bottom: 14px; }
    .kt-ann__cta { min-height: 42px; padding: 10px 18px; font-size: 14px; }
    .kt-ann__hint { display: none; }
    .kt-ann__tg { padding: 7px 13px 7px 11px; }
    .kt-ann__tg-txt small { display: none; }
}

/* Users who asked for less motion get the drawer with no slide. */
@media (prefers-reduced-motion: reduce) {
    .kt-ann__panel,
    .kt-ann[data-ann-dir="start"] .kt-ann__panel,
    .kt-ann__scrim { transition: none; }
}
