/* ============================================
   Compare Towns — Styles
   Append to living-in-italy.css or enqueue separately
   ============================================ */

/* ---- Header ---- */
.lit-compare-header {
    background: linear-gradient(135deg, var(--lit-blue) 0%, var(--lit-blue-light) 100%);
    padding: 48px 0 40px;
    text-align: center;
}

.lit-compare-title {
    font-family: var(--lit-font-heading);
    font-size: 40px;
    font-weight: 700;
    color: var(--lit-white);
    margin: 0 0 8px 0;
}

.lit-compare-subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    margin: 0;
}

/* ---- Body ---- */
.lit-compare-body {
    padding-top: 32px;
    padding-bottom: 60px;
}

/* ---- Town Selectors Row ---- */
.lit-compare-selectors {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
}

.lit-selector {
    flex: 1;
    position: relative;
}

.lit-selector-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--lit-charcoal);
    margin-bottom: 8px;
}

.lit-optional-tag {
    font-weight: 400;
    text-transform: none;
    font-size: 12px;
    color: var(--lit-grey-light);
}

.lit-selector-input-wrap {
    position: relative;
}

.lit-selector-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--lit-stone);
    border-radius: var(--lit-radius-sm);
    font-size: 15px;
    font-family: var(--lit-font-body);
    color: var(--lit-charcoal);
    background: var(--lit-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.lit-selector-input:focus {
    outline: none;
    border-color: var(--lit-blue);
    box-shadow: 0 0 0 3px rgba(27, 73, 101, 0.12);
}

.lit-selector-input[readonly] {
    background: var(--lit-cream);
    border-color: var(--lit-blue);
    color: var(--lit-blue);
    font-weight: 600;
}

.lit-selector-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--lit-stone);
    color: var(--lit-grey);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.lit-selector-clear:hover {
    background: var(--lit-red);
    color: var(--lit-white);
}

/* VS divider */
.lit-selector-vs {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 28px;
    font-weight: 800;
    font-size: 16px;
    color: var(--lit-grey-light);
    letter-spacing: 1px;
}

/* ---- Dropdown ---- */
.lit-selector-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--lit-white);
    border: 1px solid var(--lit-stone);
    border-radius: var(--lit-radius-sm);
    box-shadow: var(--lit-shadow-lg);
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
}

.lit-dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.lit-dropdown-item:hover,
.lit-dropdown-item-active {
    background: var(--lit-cream);
}

.lit-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--lit-charcoal);
}

.lit-dropdown-meta {
    font-size: 12px;
    color: var(--lit-grey);
    margin-top: 2px;
}

.lit-dropdown-empty {
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--lit-grey);
}

/* Selected badge */
.lit-selector-selected {
    margin-top: 6px;
    min-height: 24px;
}

.lit-selected-badge {
    display: inline-block;
    padding: 3px 12px;
    background: rgba(27, 73, 101, 0.08);
    color: var(--lit-blue);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

/* ---- Share ---- */
.lit-compare-share {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.lit-share-copied {
    font-size: 13px;
    color: var(--lit-green);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
}

.lit-share-copied-show {
    opacity: 1;
}

/* ---- Map ---- */
.lit-compare-map-wrap {
    margin-bottom: 24px;
    border-radius: var(--lit-radius);
    overflow: hidden;
    border: 1px solid var(--lit-stone);
    box-shadow: var(--lit-shadow);
}

.lit-map-marker {
    background: none !important;
    border: none !important;
}

/* ---- Comparison Table ---- */
.lit-compare-table-wrap {
    background: var(--lit-white);
    border-radius: var(--lit-radius);
    border: 1px solid var(--lit-stone);
    box-shadow: var(--lit-shadow);
    overflow-x: auto;
}

.lit-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.lit-compare-table thead th {
    padding: 16px 20px;
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    color: var(--lit-charcoal);
    background: var(--lit-cream);
    border-bottom: 2px solid var(--lit-stone);
    position: sticky;
    top: 0;
    z-index: 2;
}

.lit-compare-table thead th a {
    color: var(--lit-blue);
    text-decoration: none;
    font-family: var(--lit-font-heading);
    font-size: 17px;
}

.lit-compare-table thead th a:hover {
    text-decoration: underline;
}

.lit-ct-town-loc {
    font-size: 12px;
    font-weight: 400;
    color: var(--lit-grey);
    margin-top: 2px;
}

.lit-ct-metric {
    width: 200px;
    min-width: 180px;
}



.lit-compare-table tbody td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--lit-cream);
    vertical-align: middle;
}

.lit-compare-table tbody tr:hover {
    background: rgba(27, 73, 101, 0.02);
}

.lit-ct-metric-cell {
    font-weight: 600;
    color: var(--lit-charcoal);
    white-space: nowrap;
}

/* ---- Colour Coding ---- */
.lit-ct-val {
    font-weight: 600;
    text-align: center;
    border-left: 1px solid var(--lit-cream);
}

.lit-ct-best {
    background: #D1FAE5;
    color: #065F46;
}

.lit-ct-mid {
    background: #FEF3C7;
    color: #92400E;
}

.lit-ct-worst {
    background: #FEE2E2;
    color: #991B1B;
}

.lit-ct-neutral {
    background: transparent;
    color: var(--lit-charcoal);
}

.lit-ct-na {
    color: var(--lit-grey-light);
    font-weight: 400;
}

.lit-ct-yes {
    color: #065F46;
}

.lit-ct-no {
    color: #991B1B;
}

/* ---- Empty State ---- */
.lit-compare-empty {
    text-align: center;
    padding: 80px 20px;
    background: var(--lit-white);
    border-radius: var(--lit-radius);
    border: 2px dashed var(--lit-stone);
}

.lit-compare-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.lit-compare-empty h3 {
    font-family: var(--lit-font-heading);
    font-size: 22px;
    color: var(--lit-charcoal);
    margin: 0 0 8px 0;
}

.lit-compare-empty p {
    font-size: 15px;
    color: var(--lit-grey);
    margin: 0;
}

/* ============================================
   Responsive — Compare
   ============================================ */
@media (max-width: 768px) {
    .lit-compare-title {
        font-size: 28px;
    }

    .lit-compare-selectors {
        flex-direction: column;
        gap: 12px;
    }

    .lit-selector-vs {
        padding-top: 0;
        justify-content: center;
    }

    .lit-selector-vs-optional {
        display: none;
    }

    .lit-compare-table thead th,
    .lit-compare-table tbody td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .lit-ct-metric {
        min-width: 140px;
    }

    .lit-compare-table thead th a {
        font-size: 14px;
    }

    #lit-compare-map {
        height: 220px !important;
    }
}

@media (max-width: 480px) {
    .lit-compare-table-wrap {
        margin: 0 -20px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .lit-compare-table thead th,
    .lit-compare-table tbody td {
        padding: 8px 10px;
        font-size: 12px;
    }
}
