/*
* I hate !important but Astra and UAG are forcing styles on us...
*/
/* ============================================
   TRAILS PAGE — Public View Styling
   ============================================ */

/* Status Block */
.gp-trails-status-block {
    display: inline-block;
    padding: 6px 20px;
    background: #eef7ff;
    border: 1px solid #bcd5ff;
    margin-bottom: 16px;
    color: #003366;
    font-size: 0.95rem;
    border-radius: 4px;
}

/* Container */
#trailTableWrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 24px auto;
    padding: 0;
    font-size: 0.9rem;
    text-align: center;
}

/* Table */
#trailTableWrapper table {
    width: 100%;
    border-collapse: collapse;
}

/* TABLE HEADER */
#trailTableWrapper th {
    background-color: #1f4056;
    color: #fff;
    padding: 8px;
}

#gp-trail-table {
    table-layout: fixed;
    width: 100%;
}

/* TABLE CELLS */
.trailCell {
    padding: 8px 6px;
    border-bottom: 1px solid #ddd;
}

/* Desktop column sizing */
#gp-trail-table .trail-col-name {
    width: 275px;
}

#gp-trail-table .trail-col-day,
#gp-trail-table .trail-col-night {
    width: 125px;
}

#gp-trail-table .trail-col-surface {
    width: auto;
}

/* Name always left aligned */
.trail-col-name {
    text-align: left;
}

/* Open highlight */
.trail-open {
    background-color: #d4edda;
}

/* =================================================================
   FIX FOR PROD (Astra/UAG forces table header height constraints)
   ================================================================= */
#trailTableWrapper th {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    block-size: auto !important;
    line-height: normal !important;
    white-space: normal !important;
}

/* Ensure browser respects our widths */
#trailTableWrapper {
    table-layout: auto !important;
}

/* Hide mobile wrapper by default */
#gp-trails-mobile-wrapper {
    display: none;
}

/* ================================
   TRAILS LEGEND — DESKTOP
   ================================ */

#gp-trails-legend {
    display: block;
    font-size: 0.7rem;
    font-weight: bold;
    margin: 0 auto;    
    background: #eef7ff;
    border: 1px solid #b0c7db;
    color: #003366;
    border-radius: 4px;
    text-align: center;
    width: 50%;
}

/* Keep legend items inline on desktop */
#gp-trails-legend .legend-row {
    display: inline;
    margin-right: 25px;
}

/* Terrain Park indicator: Orange pill */
.trail-park-pill {
    display: inline-block;
    width: 14px;
    height: 8px;
    background-color: #ff9f1c;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}


/* Terrain Park indicator: Orange pill */
.trail-park-pill {
    display: inline-block;
    width: 14px;
    height: 8px;
    background-color: #ff9f1c;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Inline icons after trail name */
.trail-inline-icon {
    margin-left: 6px;
    vertical-align: middle;
}

/* ===========================================================
   MOBILE RESPONSIVE LAYOUT 
   =========================================================== */
@media (max-width: 600px) {

    /* ============================================
   TRAILS — Mobile Card Layout
   ============================================ */

    #trailTableWrapper table {
        display: none;
    }

    #gp-trails-mobile-wrapper {
        display: block;
        margin: 0 auto;                
        text-align: left;
    }

    /* Newline for "Trails Updated:" */
    .gp-trails-updated strong::after {
        content: "\A";
        white-space: pre;
    }

    /* ================================
    TRAILS LEGEND — MOBILE
    ================================ */

    #gp-trails-legend {
        padding-left: 10px;
        text-align: left;
    }

    /* Stack legend rows with aligned columns */
    #gp-trails-legend .legend-row {
        display: grid;
        grid-template-columns: 95px auto;
        align-items: center;
        margin: 6px 0;
    }
     #gp-trails-legend .legend-row:first-child {
        grid-template-columns: 90px auto;
     }
    
    .trail-mobile-card {
        padding: 14px 16px;
        margin: 12px 0;
        border: 1px solid #cdd9e2;
        border-radius: 6px;
        background: #fff;
        font-size: 0.7rem;
    }

    .trail-mobile-card.open {
        background: #e8f8ec;
        border-color: #b7d8c0;
    }

    /* Header */
    .trail-mobile-name {
        display: block;
        font-weight: bold;
        font-size: .8rem;
        margin-bottom: 6px;
        padding-bottom: 4px;
        border-bottom: 1px solid #a3b0be;
    }

    /* Row 2 layout */
    .trail-mobile-row {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 6px 0;
    }

    .trail-mobile-group {
        display: flex;
        align-items: center;
        gap: 4px;
        font-weight: bold;
    }

    .trail-mobile-icons {
        display: inline-block;        
        margin-left: 6px;
    }

    /* Surface row */
    .trail-mobile-surface {
        margin-top: 6px;
        font-size: 0.7rem;
    }

    /* ============================================
       Emoji indicators for Name column
       ============================================ */
    tr.snowmaking-yes .trail-col-name::after {
        content: " ❄️";
    }

    tr.groomed-yes .trail-col-name::after {
        content: " 🧹";
    }

    tr.snowmaking-yes.groomed-yes .trail-col-name::after {
        content: " ❄️🧹";
    }
}
