/* =============================================================
   Site Cover / Splash screen
   Full-screen intro shown before entering the site.
   Per-event styling via .cover-<style> classes.
   ============================================================= */

/* Prevent background scroll while the cover is visible */
html.cover-active,
html.cover-active body {
    overflow: hidden;
}

.site-cover {
    position: fixed;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    width: auto;
    height: auto;
    z-index: 99999; /* above preloader and everything else */
    text-align: center;
    background-color: #111;
    background-size: contain; /* show the whole image, no cropping */
    background-position: center top;
    background-repeat: no-repeat;
    overflow-y: auto; /* allow scrolling down to reach the button */
    -webkit-overflow-scrolling: touch;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.site-cover.is-leaving {
    opacity: 0;
    pointer-events: none;
}

.site-cover__overlay {
    position: absolute;
    top: 50;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
}

/* Content fills the cover: centered block + bottom-anchored footer/button */
.site-cover__content {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 100%; /* grow with content so the button can be scrolled to */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

.site-cover__inner {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 720px;
}

.site-cover__footer {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 24px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.site-cover__logo {
    max-width: 160px;
    height: auto;
    margin: 0 auto 28px;
    display: block;
}

.site-cover__title {
    color: #fff;
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 42px;
    line-height: 1.25;
    margin: 0 0 16px;
    font-weight: 700;
}

.site-cover__subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 18px;
    line-height: 1.6;
    margin: 0 0 34px;
}

.site-cover__btn {
    display: inline-block;
    border: 2px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 13px 34px;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.site-cover__btn:hover {
    background: #fff;
    color: #111;
}

.site-cover__btn span {
    margin-left: 6px;
}

/* ---------- Event: Mourning (ไว้อาลัย) ---------- */
.cover-mourning {
    background-color: #000;
}

.cover-mourning .site-cover__overlay {
    background: rgba(60, 60, 60, 0);
}

/* Render any background image in grayscale for mourning */
.cover-mourning {
    filter: grayscale(100%);
}

.cover-mourning .site-cover__title {
    font-weight: 500;
    letter-spacing: 1px;
}

/* Black mourning ribbon (corner) */
.cover-mourning .site-cover__ribbon {
    position: fixed;
    top: 0;
    left: 0;
    width: 140px;
    height: 140px;
    overflow: hidden;
    z-index: 3;
}

.cover-mourning .site-cover__ribbon::before {
    content: "";
    position: absolute;
    top: 28px;
    left: -42px;
    width: 180px;
    height: 26px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    transform: rotate(-45deg);
}

/* ---------- Event: New Year ---------- */
.cover-newyear {
    background-color: #0b1f3a;
    background-image: linear-gradient(135deg, #0b1f3a 0%, #14375f 100%);
}

.cover-newyear .site-cover__overlay {
    background: rgba(11, 31, 58, 0.35);
}

.cover-newyear .site-cover__title {
    color: #ffd86b;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.cover-newyear .site-cover__btn {
    border-color: #ffd86b;
    color: #ffd86b;
}

.cover-newyear .site-cover__btn:hover {
    background: #ffd86b;
    color: #0b1f3a;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .site-cover__title { font-size: 32px; }
    .site-cover__subtitle { font-size: 17px; }
}

@media (max-width: 600px) {
    .site-cover__content { padding: 28px 18px; }
    .site-cover__title { font-size: 26px; }
    .site-cover__subtitle { font-size: 15px; margin-bottom: 24px; }
    .site-cover__logo { max-width: 120px; margin-bottom: 20px; }
    .site-cover__footer { padding-top: 18px; }
    .site-cover__btn {
        width: 100%;
        max-width: 320px;
        padding: 14px 20px;
    }
    .cover-mourning .site-cover__ribbon { width: 100px; height: 100px; }
}

/* Portrait / narrow screens: show the full image instead of heavy cropping */
@media (orientation: portrait), (max-width: 600px) {
    .site-cover {
        background-size: contain;
        background-position: center center;
    }
}

/* Short / landscape screens: keep everything visible without overflow */
@media (max-height: 480px) {
    .site-cover__content { padding: 16px; }
    .site-cover__logo { max-width: 90px; margin-bottom: 12px; }
    .site-cover__title { font-size: 22px; margin-bottom: 8px; }
    .site-cover__subtitle { font-size: 14px; margin-bottom: 12px; }
    .site-cover__footer { padding-top: 12px; }
}
