/*!
 * DGR Web — Duyuru çubuğu, yönetici bakım hatırlatması ve bakım sayfası
 * Dosyalar: app/views/front/partials/announcement.php, app/views/front/maintenance.php, assets/js/front/announce.js
 *
 * Duyuru çubuğu sayfa akışındadır (içeriği kendi yüksekliği kadar iter). Sabit menü (.nav, top: 12px)
 * aynı miktarda aşağı kayar; böylece menü ile ilk ekran arasındaki mesafe değişmez, hiçbir başlık menünün altında kalmaz.
 *   --announce-h   : çubuğun yüksekliği (JS gerçek yüksekliği ölçer; JS yoksa aşağıdaki tahmini değer)
 *   --announce-vis : çubuğun ekranda görünen kısmı (kaydırdıkça küçülür, JS ayarlar) → menü 12px'e geri döner
 */

:root {
    --announce-h: 40px;
}

@media (max-width: 719px) {
    :root {
        --announce-h: 56px;
    }
}

/* Menü kaydırma: JS sınıfı ve JS'siz yedek ayrı kurallar (":has" desteklemeyen tarayıcı tüm listeyi atmasın) */
html.has-announce .nav {
    top: calc(12px + var(--announce-vis, var(--announce-h)));
}

html:not([data-announce-closed]):has(> body > .announce) .nav {
    top: calc(12px + var(--announce-vis, var(--announce-h)));
}

/* Ziyaretçi daha önce bir duyuruyu kapattıysa (<head>'deki erken betik html'e data-announce-closed yazar)
   çubuk, announce.js bunun yeni bir duyuru olduğunu doğrulayana kadar gizli kalır: kapatılan duyuru bir an bile görünmez. */
html[data-announce-closed] .announce:not(.is-shown) {
    display: none;
}

/* JS kapalıyken: destekleyen tarayıcıda menü, kaydırma ilerledikçe (çubuk ekrandan çıkarken) CSS ile 12px'e döner */
@supports (animation-timeline: scroll()) {
    html:not(.has-announce):not([data-announce-closed]):has(> body > .announce) .nav {
        animation: announce-nav linear both;
        animation-timeline: scroll(root block);
        animation-range: 0 var(--announce-h);
    }
}

@keyframes announce-nav {
    from { top: calc(12px + var(--announce-h)); }
    to { top: 12px; }
}

html.announce-closing .nav {
    transition: top 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Duyuru çubuğu ---------- */
.announce {
    position: relative;
    z-index: 1;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: var(--announce-h);
    color: #fff;
    background: var(--ink, #141414);
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* Alt kenarda net turuncu çizgi (ışık lekesi yok) */
.announce::before {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: -1;
    height: 2px;
    background: var(--brand, #ff5a1f);
    pointer-events: none;
}

/* Yavaş ışıltı: birkaç saniyede bir çubuğun üzerinden geçen ince ışık */
.announce::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    z-index: -1;
    width: 40%;
    background: linear-gradient(100deg, transparent 0%, rgb(255 255 255 / 0.09) 45%, rgb(255 255 255 / 0.16) 50%, rgb(255 255 255 / 0.09) 55%, transparent 100%);
    transform: translateX(-120%);
    animation: announce-shimmer 7s 1.2s cubic-bezier(0.45, 0.05, 0.25, 1) infinite;
    pointer-events: none;
}

.announce__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: calc(var(--container, 72rem) + 2 * var(--gutter, 1.25rem));
    margin: 0 auto;
    padding: 0.5rem calc(var(--gutter, 1.25rem) + 2.25rem);
}

.announce__text {
    margin: 0;
    text-align: center;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.announce__dot {
    position: relative;
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 0.6rem;
    border-radius: 50%;
    vertical-align: 0.08em;
    background: var(--brand, #ff5a1f);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand, #ff5a1f) 55%, transparent);
    animation: announce-pulse 2.4s ease-out infinite;
}

.announce__msg {
    color: rgb(255 255 255 / 0.92);
}

.announce__link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.65rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    text-decoration: underline;
    text-decoration-color: rgb(255 255 255 / 0.35);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s, text-decoration-color 0.2s;
}

.announce__link:hover {
    color: color-mix(in oklab, var(--brand, #ff5a1f) 55%, #fff);
    text-decoration-color: currentColor;
}

.announce__arrow {
    width: 13px;
    height: 13px;
    flex: none;
    transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.announce__link:hover .announce__arrow {
    transform: translateX(3px);
}

.announce__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.announce__close {
    position: absolute;
    top: 50%;
    right: var(--gutter, 1.25rem);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: rgb(255 255 255 / 0.72);
    background: transparent;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

.announce__close[hidden] {
    display: none;
}

.announce__close:hover {
    color: #fff;
    background: rgb(255 255 255 / 0.12);
}

.announce__x {
    width: 15px;
    height: 15px;
}

.announce__link:focus-visible,
.announce__close:focus-visible {
    outline: 2px solid color-mix(in oklab, var(--brand, #ff5a1f) 70%, #fff);
    outline-offset: 2px;
    border-radius: 6px;
}

.announce__close:focus-visible {
    border-radius: 50%;
}

/* Kapatma: yükseklik sıfıra iner, menü aynı anda yukarı kayar */
.announce.is-closing {
    min-height: 0;
    height: var(--announce-close-from, var(--announce-h));
    transition: height 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.25s;
}

.announce.is-closing.is-collapsed {
    height: 0;
    opacity: 0;
}

@media (max-width: 719px) {
    .announce {
        font-size: 0.78rem;
    }

    .announce__inner {
        padding: 0.55rem calc(var(--gutter, 1.25rem) + 2rem) 0.55rem var(--gutter, 1.25rem);
    }

    .announce__text {
        text-align: left;
        text-wrap: pretty;
    }

    .announce__close {
        right: calc(var(--gutter, 1.25rem) - 0.5rem);
        width: 36px;
        height: 36px;
        margin-top: -18px;
    }
}

@keyframes announce-shimmer {
    0% { transform: translateX(-120%); }
    38%, 100% { transform: translateX(320%); }
}

@keyframes announce-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand, #ff5a1f) 55%, transparent); }
    70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

/* ---------- Yönetici için bakım hatırlatması (yalnızca giriş yapmış tarayıcıda) ---------- */
.mnt-pill {
    position: fixed;
    left: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: calc(100% - 96px);
    padding: 0.4rem 0.4rem 0.4rem 0.85rem;
    border: 1px solid rgb(255 255 255 / 0.08);
    border-radius: 999px;
    color: #fff;
    background: var(--ink);
    box-shadow: 0 11px 12px -5px rgb(20 20 20 / 0.55);
    font-size: 0.78rem;
    line-height: 1.3;
}

.mnt-pill__dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 0 rgb(245 158 11 / 0.6);
    animation: mnt-pill-pulse 2s ease-out infinite;
}

.mnt-pill__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mnt-pill__text strong {
    font-weight: 600;
}

.mnt-pill__more {
    color: rgb(255 255 255 / 0.72);
}

.mnt-pill__link {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    color: var(--ink, #141414);
    background: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.mnt-pill__link:hover {
    color: #fff;
    background: var(--brand, #ff5a1f);
}

.mnt-pill__link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.mnt-pill__icon {
    width: 13px;
    height: 13px;
}

@media (max-width: 719px) {
    .mnt-pill__more {
        display: none;
    }
}

@keyframes mnt-pill-pulse {
    0% { box-shadow: 0 0 0 0 rgb(245 158 11 / 0.6); }
    70%, 100% { box-shadow: 0 0 0 7px rgb(245 158 11 / 0); }
}

/* ---------- Bakım sayfası (bağımsız sayfa: app/views/front/maintenance.php) ---------- */
.mnt {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    color: var(--ink, #141414);
    background: #fff;
}

.mnt-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(52% 46% at 50% 0%, color-mix(in srgb, var(--brand, #ff5a1f) 16%, transparent) 0%, transparent 72%),
        linear-gradient(to right, rgb(20 20 20 / 0.055) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(to bottom, rgb(20 20 20 / 0.055) 1px, transparent 1px) 0 0 / 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 78% 72% at 50% 34%, #000 36%, transparent 82%);
    mask-image: radial-gradient(ellipse 78% 72% at 50% 34%, #000 36%, transparent 82%);
}

.mnt-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 48rem;
    margin: 0 auto;
    padding: clamp(3rem, 9vh, 6.5rem) 1.25rem 2rem;
    text-align: center;
}

.mnt-logo {
    display: inline-flex;
    margin-bottom: clamp(2.25rem, 7vh, 4rem);
    color: var(--ink, #141414);
    border-radius: 8px;
}

.mnt-logo__svg {
    display: block;
    width: 108px;
    height: auto;
}

.mnt-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.42rem 0.85rem;
    border: 1px solid var(--line, #ececec);
    border-radius: 999px;
    background: rgb(255 255 255 / 0.85);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted, #6b6b6b);
}

.mnt-chip__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand, #ff5a1f);
    animation: announce-pulse 2.4s ease-out infinite;
}

.mnt-title {
    margin: 2.4rem 0 0;
    font-size: clamp(2.1rem, 1.15rem + 3.9vw, 4.2rem);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.048em;
    text-wrap: balance;
}

/* Tasarım aracındaki seçim çerçevesi (ana sayfa başlığıyla aynı dil) */
.mnt-sel {
    position: relative;
    display: inline-block;
    padding: 0.06em 0.18em 0.12em;
}

.mnt-sel__frame {
    position: absolute;
    inset: 0;
    border: 2px solid var(--brand, #ff5a1f);
    pointer-events: none;
    animation: mnt-frame 0.6s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.mnt-sel__frame i {
    position: absolute;
    width: 11px;
    height: 11px;
    border: 2px solid var(--brand, #ff5a1f);
    background: #fff;
    animation: mnt-pop 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.mnt-sel__frame i:nth-child(1) { top: -6px; left: -6px; animation-delay: 0.55s; }
.mnt-sel__frame i:nth-child(2) { top: -6px; right: -6px; animation-delay: 0.62s; }
.mnt-sel__frame i:nth-child(3) { bottom: -6px; left: -6px; animation-delay: 0.69s; }
.mnt-sel__frame i:nth-child(4) { bottom: -6px; right: -6px; animation-delay: 0.76s; }

.mnt-sel__tag {
    position: absolute;
    left: -2px;
    bottom: calc(100% + 6px);
    padding: 0.3rem 0.55rem;
    border-radius: 6px 6px 6px 0;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--brand-600, #cc4819);
    animation: mnt-pop 0.35s 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.mnt-code {
    margin: 1.6rem 0 0;
    font-family: var(--mono);
    font-size: 0.92rem;
    color: var(--ink, #141414);
}

.mnt-code__dim {
    color: var(--muted, #6b6b6b);
}

.mnt-caret {
    display: inline-block;
    width: 0.55em;
    height: 1.15em;
    margin-left: 0.25em;
    vertical-align: -0.22em;
    background: var(--brand, #ff5a1f);
    animation: mnt-blink 1.1s steps(1, end) infinite;
}

.mnt-text {
    max-width: 34rem;
    margin: 1.2rem auto 0;
    font-size: clamp(1rem, 0.96rem + 0.25vw, 1.15rem);
    line-height: 1.6;
    color: var(--muted, #6b6b6b);
    text-wrap: pretty;
}

.mnt-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 2.1rem;
}

.mnt-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0 1.3rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.2s, border-color 0.2s, color 0.2s;
}

.mnt-btn:hover {
    transform: translateY(-2px);
}

.mnt-btn--ink {
    color: #fff;
    background: var(--ink, #141414);
}

.mnt-btn--ink:hover {
    background: var(--brand-700, #ad3d15);
}

.mnt-btn--ghost {
    border-color: var(--line-2, #e0e0e0);
    color: var(--ink, #141414);
    background: #fff;
}

.mnt-btn--ghost:hover {
    border-color: var(--ink, #141414);
}

.mnt-btn__icon {
    width: 16px;
    height: 16px;
}

.mnt-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.6rem;
    margin: 2.2rem 0 0;
    padding: 0;
    list-style: none;
    font-family: var(--mono);
    font-size: 0.84rem;
}

.mnt-contact a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ink, #141414);
    text-decoration: none;
    border-radius: 4px;
}

.mnt-contact a:hover span {
    text-decoration: underline;
    text-decoration-color: var(--brand, #ff5a1f);
    text-underline-offset: 3px;
}

.mnt-contact__icon {
    width: 15px;
    height: 15px;
    color: var(--brand, #ff5a1f);
}

.mnt-social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.4rem 0 0;
    padding: 0;
    list-style: none;
}

.mnt-social a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line, #ececec);
    border-radius: 50%;
    color: var(--ink, #141414);
    background: #fff;
    transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.2s, color 0.2s, border-color 0.2s;
}

.mnt-social a:hover {
    color: #fff;
    background: var(--ink, #141414);
    border-color: var(--ink, #141414);
    transform: translateY(-2px);
}

.mnt-social__icon {
    width: 17px;
    height: 17px;
}

.mnt-foot {
    padding: 1.5rem 1.25rem max(2rem, env(safe-area-inset-bottom));
    text-align: center;
    font-size: 0.8rem;
    color: var(--faint, #767676);
}

.mnt-logo:focus-visible,
.mnt-btn:focus-visible,
.mnt-contact a:focus-visible,
.mnt-social a:focus-visible,
.mnt-ribbon__link:focus-visible {
    outline: 2px solid var(--brand, #ff5a1f);
    outline-offset: 3px;
}

/* Yönetici önizleme şeridi */
.mnt-ribbon {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.8rem;
    padding: 0.55rem 1rem;
    color: #fff;
    background: var(--ink, #141414);
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
}

.mnt-ribbon__tag {
    padding: 0.18rem 0.45rem;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--brand-700, #ad3d15);
}

.mnt-ribbon__text {
    color: rgb(255 255 255 / 0.85);
}

.mnt-ribbon__link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    color: #fff;
    text-underline-offset: 3px;
    border-radius: 4px;
}

.mnt-ribbon__link:focus-visible {
    outline-color: #fff;
}

.mnt-ribbon__icon {
    width: 14px;
    height: 14px;
}

@keyframes mnt-frame {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: none; }
}

@keyframes mnt-pop {
    from { opacity: 0; transform: scale(0.4); }
    to { opacity: 1; transform: none; }
}

@keyframes mnt-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .announce::after {
        display: none;
    }

    .announce__dot,
    .mnt-pill__dot,
    .mnt-chip__dot,
    .mnt-caret {
        animation: none;
    }

    .mnt-sel__frame,
    .mnt-sel__frame i,
    .mnt-sel__tag {
        animation: none;
    }

    html.announce-closing .nav,
    .announce.is-closing,
    .announce__arrow,
    .mnt-btn,
    .mnt-social a {
        transition: none;
    }
}

@media print {
    .announce,
    .mnt-pill,
    .mnt-ribbon {
        display: none !important;
    }

    html.has-announce .nav {
        top: 12px;
    }

    html:has(> body > .announce) .nav {
        top: 12px;
    }
}
