/* Site popup'ı (elements/popup.ctp + custom/popup.js)
   Sade bir modal: yalnızca içerik ve kapatma düğmesi görünür. */

.popup {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 10, 12, 0.82);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.popup[hidden] {
    display: none;
}

.popup.open {
    opacity: 1;
}

.popup-box {
    position: relative;
    /* Kutu içeriği kadar yer kaplar; kapatma düğmesi her türde içeriğin sağ üst köşesine oturur */
    width: -moz-fit-content;
    width: fit-content;
    max-width: min(92vw, 1000px);
    line-height: 0;
}

/* Kapatma düğmesi: ikon dosyası gerektirmez, çarpı CSS ile çizilir */
.popup-close {
    position: absolute;
    top: -16px;
    right: -16px;
    z-index: 2;
    width: 38px;
    height: 38px;
    padding: 0;
    background: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.25s ease;
}

.popup-close::before,
.popup-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background: #111;
    border-radius: 2px;
}

.popup-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.popup-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.popup-close:hover {
    transform: rotate(90deg);
}

/* Resim */
.popup-box img {
    display: block;
    max-width: 100%;
    max-height: 86vh;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.popup-box a {
    display: block;
}

/* YouTube: yalnızca video */
.popup-video {
    position: relative;
    width: min(92vw, 1000px);
    max-width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

/* Kapsayıcıda kırpma (overflow) ve dönüşüm (transform) bilerek yok: ikisi birlikte bazı
   tarayıcılarda gömülü videonun sesini oynatıp görüntüsünü çizmemesine yol açıyor */
.popup-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 14px;
}

/* Videonun üstündeki görünmez katman: YouTube'un kendi düğmelerinin fareyle çıkmasını
   engeller; tıklanınca ses kapalıysa açılır, açıksa oynat / duraklat yapar */
.popup-tap {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    cursor: pointer;
}

/* Ses açma / kapama düğmesi: video sessiz başlar, simge sesin durumunu gösterir */
.popup-sound {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4V5z'/%3E%3Cpath d='m23 9-6 6M17 9l6 6'/%3E%3C/svg%3E") center / 20px no-repeat;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.popup-sound.on {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4V5z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M19 5a10 10 0 0 1 0 14'/%3E%3C/svg%3E");
}

.popup-sound:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Özel HTML */
.popup-html {
    line-height: 1.6;
    max-height: 86vh;
    padding: 32px;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

/* Popup açıkken sayfa kaymaz */
.popup-lock {
    overflow: hidden;
}

@media (max-width: 575px) {
    .popup {
        padding: 14px;
    }

    .popup-close {
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
    }

    .popup-html {
        padding: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .popup,
    .popup-close {
        transition: none;
    }
}
