/* The session block is absolutely positioned, with a fixed height. */
.spm-session-block {
    position: absolute;
    left: 0;
    width: 100%;
    /* The row_height-based "height: Xpx" is set inline by PHP. */
    overflow: hidden; /* default: clip any text that doesn't fit in height. */
    box-sizing: border-box;
    transition: all 0.2s ease-in-out; /* a smooth expansion on hover. */
    border-bottom: 1px solid #fff;
}

/* Sessions that don't start on :00 or :30 need top borders */
.spm-session-block.spm-needs-top-border {
    border-top: 1px solid #fff;
}

/* The session content is just normal text. No special overflow here. */
.spm-session-content {
    margin: 0;
    padding: 0;
}

/* On hover, we let the block auto-size. 
   This effectively shows all text while floating over adjacent placeholders. */
.spm-session-block:hover {
    height: auto;         /* remove the forced fixed height. */
    overflow: visible;    /* reveal all text. */
    z-index: 99999 !important;        /* ensure it appears above ALL other sessions. */
}

/* Optional: if you want a “bubble” effect on hover, add a background, padding, etc. 
   For example:
.spm-session-block:hover {
    background-color: rgba(0,0,0,0.8);
    color: #fff;
    padding: 10px;
    z-index: 9999;
    height: auto;
    overflow: visible;
    transition: all 0.2s ease-in-out;
}
*/
.spm-time-span{
	color:#fff;
}

/* === Background Session Styling === */
.spm-background-session-block {
    opacity: 0.9;
    font-size: 0.9em;
    z-index: 1;
}

/* On hover, bring background sessions to the front */
.spm-background-session-block:hover {
    z-index: 99999 !important;
    overflow: visible;
}


.spm-background-session-block .spm-session-content {
    background: transparent !important;
}

/* Optional hover effect for debugging (can be removed later) 
.spm-background-session-block:hover {
    outline: .5px dashed #fff;
    z-index: 20 !important;
}*/

.spm-diagonal-stripes {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 0,
        rgba(255, 255, 255, 0.15) 3px,
        transparent 3px,
        transparent 6px
    );
}

.spm-session-block:hover .spm-session-content {
    z-index: 99999 !important; /* ensures it appears above placeholders or other sessions */
    border-bottom: 1px solid #fff; /* Border at bottom of expanded content */
    padding-bottom: 5px; /* Add some padding so border is visible */
    /* Ensure the content has background so border is visible */
    background-color: inherit; 
}

/* Override for offset sessions - remove the general content border behavior */
.spm-session-block.spm-offset:hover .spm-session-content {
    border: none !important; /* No border on content - let session block handle it */
    padding-bottom: 0 !important; /* Remove the extra padding from general rule */
}

/* Offset sessions should have a full border always, not just on hover */
.spm-session-block.spm-offset {
    border: 1px solid #fff;
    top: calc(var(--topOffset) + 20px);
    left: 20px;
    width: calc(100% - 20px)!important;
    z-index: 15 !important; /* Higher than regular sessions (which have z-index: 10) */
}

/* Maintain full border on offset sessions even when hovered */
.spm-session-block.spm-offset:hover {
    border: 1px solid #fff !important; /* Keep the session block border */
    z-index: 99999 !important; /* Ensure offset sessions also appear on top when hovered */
    height: auto !important; /* Make the session block expand to fit its content */
    min-height: var(--original-height) !important; /* Don't shrink below original PHP height */
    overflow: visible !important; /* Allow content to be visible */
}

@media (hover: none) and (pointer: coarse) {
    .spm-background-session-block {
        z-index: 2 !important; /* Bring above placeholder rows */
        overflow: visible;
        /* Remove height: auto so background sessions keep their full timeslot height */
    }

    .spm-background-session-block .spm-session-content {
        background: transparent !important; /* Keep content transparent */
        padding: 5px;
        border: 0px solid #fff;
    }
    
    /* On mobile, apply stripes to the entire background session block (overlay on the original color) */
    .spm-background-session-block.spm-diagonal-stripes {
        background-image: repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.15) 0,
            rgba(255, 255, 255, 0.15) 3px,
            transparent 3px,
            transparent 6px
        ) !important;
        /* Keep the original background color but add stripes on top */
    }
}

/* @media (hover: none) and (pointer: coarse) {
    body::after {
        content: '✅ MOBILE CSS ACTIVE';
        display: block;
        background:magenta;
        color: white;
        font-weight: bold;
        text-align: center;
        padding: 10px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 99999;
    }
} */

/* ===============================================
   MINISTRY ARCHIVE PAGE STYLING
   =============================================== */

/* Hide the site title/header on ministry archive pages */
.tax-ministry .site-title,
.tax-ministry .site-header,
.tax-ministry .entry-header,
.tax-ministry .page-header {
    display: none !important;
}

/* Ministry archive wrapper - full viewport with ministry color background */
.spm-ministry-archive-wrapper {
    min-height: 100vh;
    box-sizing: border-box;
}

/* Content container with white background and margins */
.spm-ministry-archive-content {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 85vh;
}

/* Ministry header styling */
.spm-ministry-header {
    border-radius: 8px 8px 0 0;
}

.spm-ministry-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.spm-ministry-logo img {
    max-width: 120px;
    height: auto;
    border-radius: 8px;
}

.spm-ministry-title {
    margin: 0;
    font-size: 2.5em;
    font-weight: bold;
}

.spm-ministry-tent {
    margin: 0;
    font-size: 1.2em;
    opacity: 0.9;
}

/* Description section styling */
.spm-ministry-description {
    border-bottom: 1px solid #eee;
    padding: 20px;
}

.spm-ministry-description h2 {
    margin: 0 0 15px 0;
    font-size: 1.8em;
    color: #333;
}

/* Sessions section styling */
.spm-ministry-sessions h2 {
    margin: 0 0 20px 0;
    font-size: 1.8em;
    color: #333;
}

/* Sessions by day layout */
.spm-sessions-by-day {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.spm-day-column {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.spm-day-heading {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #333;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
    font-weight: bold;
}

.spm-day-sessions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spm-sessions-list {
    display: grid;
    gap: 15px;
}

.spm-session-item {
    border-radius: 8px;
    transition: all 0.3s ease;
}

.spm-session-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.spm-session-title {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2em;
}

.spm-session-title a {
    text-decoration: none;
    color: inherit;
}

.spm-session-title a:hover {
    color: #0073aa;
}

.spm-session-meta {
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.spm-session-meta span {
    display: inline-block;
    margin-right: 20px;
}

.spm-session-content {
    margin-top: 15px;
    line-height: 1.6;
}

.spm-background-badge {
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ministry header links in timetable widget */
.spm-ministry-header a {
    color: #fff !important;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.spm-ministry-header a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Additional timetable widget styling */
.spm-tent-row {
    padding-top: 0 !important; /* Remove padding at top of tent row */
    margin-top: 0 !important; /* Also remove any margin */
}

/* Remove border from ministry tent cells, but keep it on the time corner */
.spm-tent-row .spm-ministry-tent {
    border-top: none !important;
}

/* Ministry header links styling - stronger visual cue */
.spm-ministry-header a {
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
}

.spm-ministry-header a::after {
    content: " →"; /* Right arrow icon for visual cue */
    opacity: 0.7;
    font-size: 0.9em;
    margin-left: 5px;
}

.spm-ministry-header a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: underline;
    opacity: 0.9;
}

.spm-ministry-header a:hover::after {
    opacity: 1;
}

/* Fix location cell transparency and ensure both corner cells match */
.spm-tent-corner,
.spm-time-corner {
    opacity: 1 !important;
    background-color: #BEBBBB !important;
}

/* Responsive design for ministry archive */
@media (max-width: 768px) {
    .spm-ministry-archive-wrapper {
        padding: 3% 2%;
    }
    
    .spm-ministry-header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .spm-ministry-title {
        font-size: 2em;
    }
    
    .spm-ministry-tent {
        font-size: 1.1em;
    }
    
    .spm-ministry-logo img {
        max-width: 100px;
    }
    
    .spm-session-meta span {
        display: block;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    /* Mobile sessions layout - single column */
    .spm-sessions-by-day {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .spm-day-column {
        margin-bottom: 10px;
    }
    
    .spm-day-heading {
        font-size: 1.1em;
        text-align: left;
    }
}


