/**
 * WP Sitewide Notices - Frontend Styles
 * Version: 1.3.0
 */

/* ==========================================================
   SITEWIDE BANNER - BASE
   ========================================================== */

.wpsn-banner {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 15px 20px;
    text-align: center;
    z-index: 99999;
}

.wpsn-banner__inner {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.wpsn-banner__main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.wpsn-banner__content {
    flex: 1;
    min-width: 0;
    position: relative;
}

.wpsn-banner__content p {
    margin: 0;
}

.wpsn-banner a {
    text-decoration: underline;
}

/* Dismiss Button - Below content */
.wpsn-banner__close {
    display: inline-block;
    padding: 8px 18px;
    cursor: pointer;
    line-height: 1.4;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.wpsn-banner__close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Hidden state */
.wpsn-banner.wpsn-hidden {
    display: none;
}


/* ==========================================================
   BANNER - CAROUSEL MODE
   ========================================================== */

.wpsn-banner--carousel .wpsn-banner__slide {
    display: none;
    animation: wpsnFadeIn 0.4s ease;
}

.wpsn-banner--carousel .wpsn-banner__slide.is-active {
    display: block;
}

@keyframes wpsnFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Navigation arrows */
.wpsn-banner__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.wpsn-banner__nav:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Dots navigation */
.wpsn-banner__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.wpsn-banner__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.wpsn-banner__dot:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}


/* ==========================================================
   BANNER - MARQUEE MODE
   ========================================================== */

.wpsn-banner--marquee {
    overflow: hidden;
    padding: 12px 0;
}

.wpsn-marquee {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.wpsn-marquee__content {
    display: inline-flex;
    animation: wpsnMarquee linear infinite;
}

.wpsn-marquee__text {
    display: inline-block;
    padding-right: 80px;
    white-space: nowrap;
}

@keyframes wpsnMarquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-25%);
    }
}

/* Pause on hover */
.wpsn-banner--marquee:hover .wpsn-marquee__content {
    animation-play-state: paused;
}


/* ==========================================================
   BANNER - STATIC MODE
   ========================================================== */

.wpsn-banner--static .wpsn-banner__slide {
    display: block;
}


/* ==========================================================
   HOMEPAGE MODAL
   ========================================================== */

.wpsn-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.wpsn-modal-overlay.is-open {
    display: flex;
}

.wpsn-modal {
    position: relative;
    border-radius: 10px;
    max-height: 85vh;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    margin: 0 16px;
}

/* Modal widths by breakpoint */
@media screen and (min-width: 768px) and (max-width: 1079px) {
    .wpsn-modal {
        width: 75%;
        margin: 0;
    }
}

@media only screen and (min-width: 1080px) {
    .wpsn-modal {
        width: 50%;
        margin: 0;
    }
}

/* Modal header & title */
.wpsn-modal__header {
    padding: 30px 30px 0 30px;
}

.wpsn-modal__title {
    margin: 0 50px 15px 0;
    font-size: 1.5rem;
    line-height: 1.25;
}

/* Close button */
.wpsn-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 44px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.wpsn-modal__close:hover,
.wpsn-modal__close:focus {
    outline: none;
}

/* Modal body */
.wpsn-modal__body {
    padding: 0 30px 30px 30px;
}

.wpsn-modal__body p {
    margin: 0 0 1em;
}

.wpsn-modal__body p:last-child {
    margin-bottom: 0;
}

.wpsn-modal__body a {
    text-decoration: underline;
}

/* Prevent page scroll when modal is open */
body.wpsn-modal-open {
    overflow: hidden;
}


/* ==========================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================== */

@media screen and (max-width: 600px) {
    .wpsn-banner__main {
        flex-direction: column;
        gap: 10px;
    }

    .wpsn-banner__nav {
        display: none;
    }
}
