/* General Styles */
.harrier-error {
    color: red;
    font-weight: bold;
}

/* Apply box-sizing to all elements within the gallery and related components */
.harrier-runs-wrapper *,
.harrier-runs-wrapper *::before,
.harrier-runs-wrapper *::after,
.harrier-gallery-wrapper *,
.harrier-gallery-wrapper *::before,
.harrier-gallery-wrapper *::after,
.harrier-grid-wrapper *,
.harrier-grid-wrapper *::before,
.harrier-grid-wrapper *::after {
    box-sizing: border-box;
}

/* [harrier_runs] Shortcode Styles */
.harrier-runs-wrapper {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: var(--bgcolor);
    font-family: var(--fontfamily);
    color: var(--fontcolor);
}

.harrier-runs-list {
    width: 300px;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.harrier-run-tile {
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    padding: 10px;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.harrier-run-tile:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.harrier-runs-details {
    flex: 1;
    max-height: 100vh;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 16px;
    background-color: #f9f9f9;
}

.harrier-run-detail-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

.harrier-open-map-button {
    display: inline-block;
    padding: 5px 10px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.harrier-open-map-button:hover {
    background-color: #0056b3;
}

.harrier-next-run {
    background-color: var(--bgcolor);
    font-family: var(--fontfamily);
    color: var(--fontcolor);
    padding: 20px;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
}

.harrier-next-run-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.harrier-next-run-title {
    margin-top: 0;
}

.harrier-prices {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.harrier-tags-container {
    margin-top: 20px;
}

.harrier-tags-list {
    list-style-type: disc;
    margin: 10px 0 0 20px;
}

/* [harrier_gallery] Shortcode Styles */
.harrier-gallery-wrapper {
    background-color: var(--bgcolor);
    font-family: var(--fontfamily);
    color: var(--fontcolor);
    padding: 20px;
}

.harrier-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Default to 3 columns */
    gap: 20px; /* Gap between tiles */
}

/* Column Classes */
.harrier-gallery-wrapper.columns-1 .harrier-gallery-grid {
    grid-template-columns: 1fr;
}

.harrier-gallery-wrapper.columns-2 .harrier-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
}

.harrier-gallery-wrapper.columns-3 .harrier-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
}

.harrier-gallery-wrapper.columns-4 .harrier-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Media Queries for Responsive Design */

/* Large Desktops (1200px and up) */
@media (min-width: 1200px) {
    .harrier-gallery-wrapper.columns-4 .harrier-gallery-grid,
    .harrier-gallery-wrapper.columns-3 .harrier-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktops (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .harrier-gallery-wrapper.columns-4 .harrier-gallery-grid,
    .harrier-gallery-wrapper.columns-3 .harrier-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .harrier-gallery-wrapper.columns-4 .harrier-gallery-grid,
    .harrier-gallery-wrapper.columns-3 .harrier-gallery-grid,
    .harrier-gallery-wrapper.columns-2 .harrier-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Devices (below 768px) */
@media (max-width: 767px) {
    .harrier-gallery-wrapper.columns-1 .harrier-gallery-grid,
    .harrier-gallery-wrapper.columns-2 .harrier-gallery-grid,
    .harrier-gallery-wrapper.columns-3 .harrier-gallery-grid,
    .harrier-gallery-wrapper.columns-4 .harrier-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    /* Adjust padding for smaller screens */
    .harrier-runs-wrapper,
    .harrier-gallery-wrapper,
    .harrier-grid-wrapper {
        padding: 10px;
    }
}

/* [harrier_gallery] Shortcode Tile Styles */
.harrier-gallery-tile {
    padding: 10px; /* Internal spacing */
    background-color: #fefefe; /* Different background for tiles */
    border: 1px solid #ddd; /* Border around tiles */
    border-radius: 4px; /* Rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for separation */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Hover effects */
}

.harrier-gallery-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Ensure images are responsive */
.harrier-gallery-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px; /* Aesthetics */
}

/* Handle long text gracefully */
.harrier-gallery-tile p {
    word-break: break-word;
}

/* [harrier_grid] Shortcode Styles */
.harrier-grid-wrapper {
    background-color: var(--bgcolor);
    font-family: var(--fontfamily);
    color: var(--fontcolor);
    padding: 20px;
}

.harrier-grid-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.harrier-grid-table th,
.harrier-grid-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.harrier-grid-table th {
    background-color: #f9f9f9;
}

.harrier-grid-table tbody tr {
    cursor: pointer; /* Change cursor to pointer */
    transition: background-color 0.3s ease; /* Smooth hover effect */
}
.harrier-grid-table tbody tr:hover {
    background-color: #f0f0f0; /* Highlight row on hover */
}


.harrier-map-button-cell {
    text-align: center;
}

.harrier-grid-table a.harrier-open-map-button {
    display: inline-block;
    padding: 5px 10px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.harrier-grid-table a.harrier-open-map-button:hover {
    background-color: #0056b3;
}

/* [harrier_leaderboard] Shortcode Styles */

/* Center align all table headers */
.harrier-leaderboard-table th {
    text-align: center;
}

.harrier-leaderboard-wrapper {
    overflow-x: auto; /* Enable horizontal scroll on small screens */
    padding: 20px;
    background-color: var(--bgcolor);
    font-family: var(--fontfamily);
    color: var(--fontcolor);
}

.harrier-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
}

.harrier-leaderboard-table th,
.harrier-leaderboard-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: center;
}

.harrier-leaderboard-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.harrier-leaderboard-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.harrier-leaderboard-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Align the Name column to the left. By class, not position (1.0): the
   shortcode's `hide` can leave Rank out, which moves Name to the first place. */
.harrier-leaderboard-table td.hc-col-name {
    text-align: left;
}

.harrier-leaderboard-table td.hc-col-rank {
    text-align: center;
}

/* Highlight the sorted column header using DataTables classes */
.harrier-leaderboard-table th.sorting_asc,
.harrier-leaderboard-table th.sorting_desc {
    background-color: #d9edf7; /* Light blue background */
    color: #31708f; /* Dark blue text */
}


/* Responsive Adjustments for Leaderboard */
@media (max-width: 767px) {
    .harrier-leaderboard-wrapper {
        padding: 10px;
    }

    .harrier-leaderboard-table th,
    .harrier-leaderboard-table td {
        padding: 8px 10px;
    }
}

/* Style the export buttons */
.dt-buttons .dt-button {
    background-color: #007bff; /* Primary color */
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    margin-right: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
}

.dt-buttons .dt-button:hover {
    background-color: #0056b3;
}

/* Style PNG icons within export buttons */
.dt-buttons .dt-button img.button-icon {
    width: 32px; /* Set width to 16px */
    height: 32px; /* Set height to 16px */
    margin-right: 5px; /* Space between icon and text */
    vertical-align: middle; /* Align icon vertically with text */
}




/* ── 1.1: run buttons, map, photos ─────────────────────────────────────── */
.harrier-run-button { margin-left: 8px; }
.harrier-map { width: 100%; border-radius: 8px; z-index: 0; }
.harrier-map-placeholder { padding: 24px; border: 1px dashed #999; text-align: center; }
.harrier-photos-run { margin-bottom: 24px; }
.harrier-photos-title { margin: 0 0 8px; }
.harrier-photos-title small { font-weight: normal; opacity: 0.75; margin-left: 8px; }
/* One line of photos, each whole and at its own shape: a photo that does not
   fit the row drops out whole (it wraps onto a line that is hidden). */
.harrier-photos-row { display: flex; flex-wrap: wrap; gap: 6px; overflow: hidden; }
.harrier-photos-row a { display: block; line-height: 0; }
.harrier-photos-row img { width: auto; max-width: none; border-radius: 4px; display: block; }
