/* Map Leaderboard Styles */

.il-ml-map-block {
}

/* Map Hover Tooltip */
.il-ml-map-tooltip {
    font-family: inherit;
}

.il-ml-tooltip-content {
    position: relative;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-width: 360px;
    padding: 2px;
    clip-path: polygon(0 0, calc(100% - 40px) 0, 100% 50%, calc(100% - 40px) 100%, 0 100%);
}

.il-ml-tooltip-inner-wrap {
    background: #000000;
    padding: 20px 58px 20px 22px;
    clip-path: polygon(0 0, calc(100% - 38px) 0, 100% 50%, calc(100% - 38px) 100%, 0 100%);
}

.il-ml-map-tooltip.il-ml-tooltip-left .il-ml-tooltip-content {
    clip-path: polygon(40px 0, 100% 0, 100% 100%, 40px 100%, 0 50%);
}

.il-ml-map-tooltip.il-ml-tooltip-left .il-ml-tooltip-inner-wrap {
    padding: 20px 22px 20px 58px;
    clip-path: polygon(38px 0, 100% 0, 100% 100%, 38px 100%, 0 50%);
}

.il-ml-tooltip-state-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.il-ml-tooltip-link {
    display: inline-block;
    color: #ffffff;
    font-size: 0.875rem;
    text-decoration: underline;
    margin-bottom: 16px;
}

.il-ml-tooltip-rank {
    display: flex;
    align-items: center;
    gap: 12px;
}

.il-ml-tooltip-image {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    margin: 0;
}

.il-ml-tooltip-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.il-ml-tooltip-text {
    flex: 1;
    min-width: 0;
}

.il-ml-tooltip-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
}

.il-ml-tooltip-value {
    font-size: 0.9rem;
    color: #ffffff;
    margin-top: 6px;
    line-height: 1.4;
}

.il-ml-tooltip-arrow {
    display: none;
}

#il-ml-map-container svg {
    display: block;
}

.il-ml-state {
    transition: fill 0.15s ease;
}

/* Map wrapper for positioning small states */
.il-ml-map-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

#il-ml-map-container {
    flex: 1;
}

/* Small states - vertical column on right */
.il-ml-small-states {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.il-ml-small-state-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.il-ml-small-state-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.il-ml-small-state-btn.is-dark {
    box-shadow: 0 0 0 3px #000;
}

.il-ml-small-state-btn {
    transition: background-color 0.15s ease;
}

.il-ml-small-state-btn:hover {
    background-color: #dbdbdb;
}

/* Info panel */
#il-ml-info-panel {
    position: sticky;
    top: 2rem;
}

.il-ml-icon-container img {
    object-fit: contain;
}

.il-ml-panel-empty {
    padding: 2rem 1rem 2rem 0;
}

.il-ml-state-content {
    margin-bottom: 1.5rem;
}

/* Items display */
.il-ml-items-container {
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.il-ml-item {
    padding: 0.75rem 0;
}

.il-ml-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.il-ml-items-carousel .il-ml-item {
    border-bottom: none;
    padding-bottom: 0;
}

.il-ml-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.il-ml-carousel-indicator {
    font-size: 0.875rem;
    color: #666;
}

/* Tablet and mobile adjustments */
@media screen and (max-width: 1023px) {
    #il-ml-info-panel {
        position: static;
        margin-top: 1.5rem;
    }

    /* Make columns full-width when stacked */
    .il-ml-map-block .column.is-4,
    .il-ml-map-block .column.is-8 {
        flex: none;
        width: 100%;
    }
}

/* State Outline Block */
.il-ml-state-outline {
    width: 100%;
    max-width: 300px;
}

.il-ml-state-outline-container {
    width: 100%;
    aspect-ratio: 1;
}

.il-ml-state-outline svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Rank Title Block */
.il-ml-rank-title {
    display: inline-block;
}

/* Items Table Block */
.il-ml-items-table-wrapper {
    margin: 1rem 0;
}

.il-ml-items-table-wrapper .table {
    margin-bottom: 0;
}

/* Category groups */
.il-ml-items-table .il-ml-category-group {
    border-bottom: 1.5rem solid transparent; /* Gap between groups */
}

.il-ml-items-table .il-ml-category-group:last-child {
    border-bottom: none;
}

.il-ml-items-table .il-ml-category-header td {
    font-weight: 700;
    font-size: 23px;
    text-transform: uppercase;
    padding-top: 0;
}

.il-ml-items-table td,
.il-ml-items-table th,
.il-ml-items-table tr {
    border-color: #555 !important;
}

/* Data rows padding */
.il-ml-items-table tr:not(.il-ml-category-header) td {
    padding-top: 20px;
    padding-bottom: 20px;
}

/* Remove left padding on first column */
.il-ml-items-table td:first-child,
.il-ml-items-table .il-ml-category-header td {
    padding-left: 0;
}

/* Center score column */
.il-ml-items-table .il-ml-item-score {
    text-align: center;
}

/* Score value styling */
.il-ml-score-value {
    font-weight: 700;
    text-transform: uppercase;
}

.il-ml-score-icon {
    display: block;
    margin: 0 auto 0.25em;
}

.il-ml-item-score .il-ml-score-value,
.il-ml-score-col .il-ml-score-value {
    vertical-align: middle;
}


/* Featured toggle buttons */
.il-ml-items-toggle {
    margin-bottom: 1rem;
}

.il-ml-items-toggle .button {
    margin-bottom: 0;
}

/* Items List Block */
.il-ml-items-list-wrapper {
    margin: 1rem 0;
}

.il-ml-items-list-wrapper .il-ml-category-group {
    margin-bottom: 1.5rem;
}

.il-ml-items-list-wrapper .il-ml-category-name {
    font-size: 23px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.il-ml-items-list {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0;
}

.il-ml-items-list li {
    padding: 0.25rem 0;
    line-height: 1.5;
}

/* Map Key Block */
.il-ml-map-key {
}

.il-ml-map-key .column {
    flex: 1 1 0;
    min-width: 0;
}

.il-ml-map-key-title {
    white-space: normal;
}

.il-ml-map-key-item {
    padding: 1rem;
}

.il-ml-map-key-item .image {
    width: clamp(48px, 8vw, 96px);
    height: clamp(48px, 8vw, 96px);
    flex-shrink: 0;
}

.il-ml-map-key-item .image img {
    margin: 0 auto;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Map Key - Tablet */
@media screen and (min-width: 769px) and (max-width: 1023px) {
    .il-ml-map-key-title {
        font-size: 16px !important;
    }
    .il-ml-map-key-value {
        font-size: 14px;
    }
}

/* Map Key - Mobile (2x2 grid) */
@media screen and (max-width: 768px) {
    .il-ml-map-key .column {
        flex: 0 0 50%;
    }
    .il-ml-map-key-item {
        padding: 0;
    }
    .il-ml-map-key-item .image.mr-3 {
        margin-right: 0.5rem !important;
    }
    .il-ml-map-key-title {
        font-size: 15px !important;
        line-height: 1.2rem;
    }
    .il-ml-map-key-value {
        font-size: 0.9rem;
    }
    .il-ml-map-key-value.mt-2 {
        margin-top: 0 !important;
    }
}

/* State Comparison Block */
.il-ml-state-comparison {
    margin: 2rem 0;
}

.il-ml-state-selector-wrapper {
    margin-bottom: 1.5rem;
}

/* Hide duplicate arrows on select - keep only one indicator */
.il-ml-state-selector-wrapper .select::after {
    display: none !important;
}

.il-ml-state-selector-wrapper .select select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.5em;
}

.il-ml-comparison-outline {
    max-width: 200px;
    margin: 0 auto 1rem;
}

.il-ml-comparison-outline .il-ml-state-outline-container {
    width: 100%;
    aspect-ratio: 1;
}

.il-ml-comparison-info {
    min-height: 60px;
    margin-bottom: 1rem;
}

.il-ml-comparison-rank {
    font-size: 1.1rem;
    color: #666;
}

.il-ml-comparison-score {
    font-size: 0.9rem;
    color: #888;
    margin-left: 0.25rem;
}

.il-ml-state-link {
    color: inherit;
    text-decoration: none;
}

.il-ml-state-link:hover {
    text-decoration: underline;
}

.il-ml-comparison-table {
    margin-top: 2rem;
}

.il-ml-comparison-table td,
.il-ml-comparison-table th,
.il-ml-comparison-table tr {
    border-color: #555 !important;
}

.il-ml-comparison-table tr:not(.il-ml-category-header) td {
    padding-top: 20px;
    padding-bottom: 20px;
}

.il-ml-comparison-table .il-ml-category-header td {
    font-size: 30px;
    font-weight: 700;
    text-transform: uppercase;
    padding-top: 0;
}

.il-ml-comparison-table .il-ml-score-col {
    width: 15%;
    white-space: nowrap;
}

.il-ml-comparison-empty {
    padding: 3rem 1rem;
    text-align: center;
    background: #f5f5f5;
    border-radius: 4px;
    margin-top: 2rem;
}

/* State Compare Link Block */
.il-ml-state-compare-link {
    display: flex;
    justify-content: center;
}

/* Mobile tooltip - centered rectangle modal */
@media screen and (max-width: 768px) {
    .il-ml-map-tooltip {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
        pointer-events: auto;
    }

    .il-ml-map-tooltip .il-ml-tooltip-content {
        clip-path: none;
        border-radius: 0;
        border-width: 3px;
    }

    .il-ml-map-tooltip .il-ml-tooltip-inner-wrap {
        clip-path: none;
        border-radius: 0;
        padding: 20px;
    }

    .il-ml-map-tooltip.il-ml-tooltip-left .il-ml-tooltip-content {
        clip-path: none;
        padding: 3px;
    }

    .il-ml-map-tooltip.il-ml-tooltip-left .il-ml-tooltip-inner-wrap {
        clip-path: none;
        padding: 20px;
    }

    .il-ml-tooltip-close {
        display: block;
    }

}

/* Tooltip close button - hidden by default, shown on touch/click open */
.il-ml-tooltip-close {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
}

.il-ml-tooltip-close:hover {
}

.il-ml-map-tooltip.is-touch-open .il-ml-tooltip-close {
    display: block;
}

/* Mobile adjustments for comparison */
@media screen and (max-width: 768px) {
    .il-ml-comparison-outline {
        max-width: 150px;
    }

    .il-ml-comparison-table .il-ml-score-col {
        width: 20%;
    }

    /* Reorder comparison info: score on own line, icon + rank together below */
    .il-ml-state-rank-item {
        flex-wrap: wrap;
        justify-content: center;
    }

    .il-ml-state-rank-content {
        display: contents;
    }

    .il-ml-state-rank-value {
        order: 1;
        width: 100%;
        text-align: center;
        font-size: 24px !important;
        margin-bottom: 0.5rem;
    }

    .il-ml-state-rank-item figure.image {
        order: 2;
        margin-right: 0.5rem !important;
        width: 48px !important;
        height: 48px !important;
    }

    .il-ml-state-rank-title {
        order: 3;
        display: flex;
        align-items: center;
    }
}

/* Single state page - Bulma Box with rank color border (only main content, not footer) */
.single-map_leader .wp-site-blocks > .wp-block-ironlight-bulma-section .wp-block-ironlight-bulma-box.box {
    border: 3px solid var(--il-ml-rank-color, transparent);
}

/* Fix columns inside box */
.single-map_leader .wp-block-ironlight-bulma-box.box .columns {
    margin-inline-start: 0;
    margin-inline-end: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.single-map_leader .wp-block-ironlight-bulma-box.box .column {
    flex-shrink: 1;
}

/* All States List Block */
.il-ml-all-states-table.table td,
.il-ml-all-states-table.table th {
    vertical-align: middle;
}

.il-ml-all-states-table .title.is-2 {
    margin-bottom: 0;
    margin-top: 0;
    line-height: 1;
    font-size: 1.75rem;
}

@media screen and (max-width: 768px) {
    .il-ml-all-states-table .title.is-2 {
        font-size: 0.875rem;
    }
}

.il-ml-all-states-table .il-ml-score-value {
    font-size: 1.5rem;
}

.il-ml-all-states-table .il-ml-icon-col figure {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.il-ml-all-states-table .il-ml-score-col {
    line-height: 1;
}

.il-ml-all-states-table tr.is-clickable {
    cursor: pointer;
}

.il-ml-all-states-table .title a {
    font-family: inherit;
    text-decoration: none;
}

.il-ml-all-states-table .il-ml-icon-col {
    width: 60px;
}

.il-ml-all-states-table .il-ml-score-col {
    width: 80px;
}

.il-ml-all-states-table tbody tr:first-child td {
    border-top: 1px solid #dbdbdb;
}

