/* ---------------------------------------------------------
   ØMK – Søkekalender Frontend CSS
   Viking/Norse Dark Theme – Modernized
--------------------------------------------------------- */

/* GRID */
.cj-calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* CARD */
.cj-card {
    background: #0d0d0d;
    border: 2px solid #4a371d;
    border-radius: 8px;
    padding: 18px;
    color: #fff;
    box-shadow: 0 0 14px rgba(0,0,0,0.7);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cj-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 22px rgba(255,215,0,0.28);
}

/* CARD HEADER */
.cj-card-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    letter-spacing: 2px;
    margin-bottom: 6px;
    color: #f5e9c9;
    text-shadow: 0 0 4px rgba(255,255,255,0.2);
}

.cj-card-header span {
    color: #c0b090;
    font-size: 14px;
}

/* FULL FLAG */
.cj-full-flag {
    background: #8b0000;
    color: #fff;
    padding: 6px 12px;
    display: inline-block;
    font-weight: bold;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* INFO BUTTON */
.cj-info-btn {
    background: #3a2a14;
    color: #f5e9c9;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    cursor: pointer;
    margin-top: 14px;
    width: 100%;
    transition: background 0.25s ease, transform 0.2s ease;
}

.cj-info-btn:hover {
    background: #5a3a18;
    transform: translateY(-2px);
}

/* MAP */
.cj-card iframe {
    border-radius: 6px;
    margin-top: 14px;
}

/* ---------------------------------------------------------
   POPUP – Centered, Modern, Viking Style
--------------------------------------------------------- */

#cj-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
}

#cj-popup-inner {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 12px;
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 25px rgba(0,0,0,0.7);
    position: relative;
    border: 2px solid #4a371d;
}

/* CLOSE BUTTON */
#cj-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #3a2a14;
    color: #f5e9c9;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
}

#cj-popup-close:hover {
    background: #5a3a18;
}

/* TITLE */
#cj-popup-title {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    margin-bottom: 14px;
    text-align: center;
    color: #f5e9c9;
    text-shadow: 0 0 6px rgba(255,255,255,0.25);
}

/* DESCRIPTION */
#cj-popup-info {
    font-size: 16px;
    line-height: 1.6;
    color: #e6e6e6;
    margin-bottom: 20px;
}

#cj-popup-info p {
    margin-bottom: 12px;
}

/* GALLERY */
#cj-popup-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
}

#cj-popup-main-image {
    max-width: 100%;
    max-height: 340px;
    border-radius: 6px;
    border: 2px solid #4a371d;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#cj-popup-prev,
#cj-popup-next {
    background: #3a2a14;
    color: #f5e9c9;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 22px;
    font-family: 'Cinzel', serif;
}

#cj-popup-prev:hover,
#cj-popup-next:hover {
    background: #5a3a18;
}

/* THUMBNAILS */
#cj-popup-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

#cj-popup-thumbs img {
    border: 2px solid #4a371d;
    border-radius: 6px;
    cursor: pointer;
    width: 70px;
    height: 70px;
    object-fit: cover;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#cj-popup-thumbs img:hover {
    opacity: 0.75;
    transform: scale(1.05);
}

/* ACTION BUTTONS */
#cj-popup-actions {
    margin-top: 25px;
    display: flex;
    gap: 14px;
    justify-content: center;
}

#cj-popup-actions button {
    background: #3a2a14;
    color: #f5e9c9;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    width: 48%;
    font-size: 16px;
    transition: background 0.25s ease, transform 0.2s ease;
}

#cj-popup-actions button:hover {
    background: #5a3a18;
    transform: translateY(-2px);
}

/* FULL FLAG */
#cj-popup-full {
    margin-top: 18px;
    text-align: center;
    font-size: 18px;
    color: #ff4444;
    font-weight: bold;
}

/* MOBILE */
@media (max-width: 600px) {
    #cj-popup-inner {
        max-width: 95%;
        padding: 18px;
    }

    #cj-popup-gallery {
        flex-direction: column;
    }

    #cj-popup-prev,
    #cj-popup-next {
        width: 100%;
    }

    #cj-popup-thumbs img {
        width: 60px;
        height: 60px;
    }
}

/* Hide top blocks on Søkekalender page */
.page-id-405 .wp-block-image,
.page-id-405 .wp-block-button {
    display: none !important;
}

#cj-popup {
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
    z-index:999999;
    animation: fadeIn 0.3s ease-out;
}

#cj-popup-inner {
    background:#0e0e0e;
    border:2px solid #d4af37; /* Gull */
    border-radius:12px;
    width:90%;
    max-width:600px;
    margin:60px auto;
    padding:25px;
    box-shadow:0 0 25px rgba(212,175,55,0.4);
    font-family: "Cinzel", serif; /* Episk font */
    color:#f5f5f5;
    animation: popupRise 0.35s ease-out;
}

@keyframes fadeIn {
    from { opacity:0; }
    to   { opacity:1; }
}

@keyframes popupRise {
    from { transform:translateY(40px); opacity:0; }
    to   { transform:translateY(0); opacity:1; }
}

#cj-popup-join, #cj-popup-leave {
    background:#d4af37;
    color:#000;
    padding:12px 18px;
    border:none;
    border-radius:6px;
    font-weight:bold;
    font-family:"Cinzel", serif;
    letter-spacing:1px;
    cursor:pointer;
    transition:0.2s;
}

#cj-popup-join:hover, #cj-popup-leave:hover {
    background:#f1d97c;
    box-shadow:0 0 10px rgba(212,175,55,0.6);
}

<div id="cj-popup-banner" style="
    display:none;
    background:#1b1b1b;
    border-left:4px solid #d4af37;
    padding:12px 15px;
    margin-bottom:15px;
    font-family:'Cinzel', serif;
    color:#d4af37;
    font-size:18px;
">
</div>
