/* ─── EA Service Compare – Frontend ─────────────────────────────────
 * Everything is scoped under .ea-sc so theme table styles can't leak in.
 * Colours come from Settings → Primary / Accent via CSS variables.
 * ─────────────────────────────────────────────────────────────────── */

.ea-sc {
    --ea-sc-primary: #0d2240;
    --ea-sc-accent:  #f59e0b;
    --ea-sc-green:   #059669;
    --ea-sc-red:     #e11d48;
    --ea-sc-ink:     #0f172a;
    --ea-sc-body:    #334155;
    --ea-sc-muted:   #64748b;
    --ea-sc-line:    #e5e9f0;
    --ea-sc-bg:      #ffffff;
    --ea-sc-soft:    #f8fafc;
    --ea-sc-radius:  16px;

    margin: 2rem 0;
    font-family: inherit;
    color: var(--ea-sc-ink);
    line-height: 1.5;
}

.ea-sc *,
.ea-sc *::before,
.ea-sc *::after {
    box-sizing: border-box;
}

/* Visually hidden, still read by screen readers */
.ea-sc .ea-sc-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Heading (compact) ──────────────────────────────────────────── */

.ea-sc .ea-sc-title {
    margin: 0 0 1rem;
    padding: 0;
    font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ea-sc-primary);
}

/* Only rendered when [ea_service_compare show_description="yes"] */
.ea-sc .ea-sc-desc {
    margin: 0 0 1rem;
    max-width: 70ch;
    font-size: 0.95rem;
    color: var(--ea-sc-muted);
}

/* ── Card + scroll container ────────────────────────────────────── */

.ea-sc .ea-sc-scroll {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--ea-sc-bg);
    border: 1px solid var(--ea-sc-line);
    border-radius: var(--ea-sc-radius);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 12px 32px -12px rgba(15, 23, 42, 0.15);
}

.ea-sc .ea-sc-scroll:focus-visible {
    outline: 2px solid var(--ea-sc-accent);
    outline-offset: 3px;
}

/* ── Table reset + base ─────────────────────────────────────────── */

.ea-sc .ea-sc-table {
    width: 100%;
    min-width: 640px;
    margin: 0;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    font-size: 0.95rem;
    line-height: 1.4;
    table-layout: auto;
}

.ea-sc .ea-sc-table th,
.ea-sc .ea-sc-table td {
    margin: 0;
    padding: 1rem 1.1rem;
    border: 0;
    border-bottom: 1px solid var(--ea-sc-line);
    background: var(--ea-sc-bg) !important;
    color: var(--ea-sc-body);
    font-size: inherit;
    font-weight: 400;
    line-height: inherit;
    text-align: center;
    vertical-align: middle;
    text-transform: none;
    letter-spacing: normal;
}

.ea-sc .ea-sc-table tbody tr:last-child th,
.ea-sc .ea-sc-table tbody tr:last-child td {
    border-bottom: 0;
}

/* ── Header row ─────────────────────────────────────────────────── */

.ea-sc .ea-sc-table thead th {
    padding: 1.6rem 1rem 1.35rem;
    background: var(--ea-sc-soft) !important;
    border-bottom: 1px solid var(--ea-sc-line);
    vertical-align: bottom;
}

.ea-sc .ea-sc-table thead th.ea-sc-comp-col,
.ea-sc .ea-sc-table thead th.ea-sc-biz-col {
    min-width: 168px;
}

.ea-sc .ea-sc-corner-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ea-sc-muted);
}

.ea-sc .ea-sc-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.ea-sc .ea-sc-brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: inherit;
    text-decoration: none;
    border-radius: 12px;
    box-shadow: none;
}

.ea-sc .ea-sc-brand-link:focus-visible,
.ea-sc .ea-sc-feature-link:focus-visible,
.ea-sc .ea-sc-cell-link:focus-visible {
    outline: 2px solid var(--ea-sc-accent);
    outline-offset: 3px;
}

.ea-sc .ea-sc-brand-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.005em;
    color: var(--ea-sc-ink);
    text-align: center;
}

.ea-sc .ea-sc-visit {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ea-sc-muted);
    transition: color 0.15s ease;
}

.ea-sc .ea-sc-brand-link:hover .ea-sc-visit {
    color: var(--ea-sc-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ea-sc .ea-sc-arrow {
    flex: none;
    opacity: 0.7;
}

/* Logo tile */
.ea-sc .ea-sc-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 128px;
    height: 60px;
    margin: 0 0 0.75rem;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid var(--ea-sc-line);
    border-radius: 12px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ea-sc .ea-sc-brand-link:hover .ea-sc-logo {
    box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.25);
    transform: translateY(-1px);
}

.ea-sc .ea-sc-logo .ea-sc-logo-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
}

/* Fallback when no logo has been uploaded */
.ea-sc .ea-sc-logo--mono {
    width: 60px;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--ea-sc-primary);
    background: #eef2f7;
    border-color: transparent;
}

/* ── Your column (highlighted) ──────────────────────────────────── */

.ea-sc .ea-sc-table th.ea-sc-highlight,
.ea-sc .ea-sc-table td.ea-sc-highlight {
    background: #fffbf0 !important;
    border-left: 2px solid var(--ea-sc-accent);
    border-right: 2px solid var(--ea-sc-accent);
}

@supports (background: color-mix(in srgb, red, blue)) {
    .ea-sc .ea-sc-table td.ea-sc-highlight {
        background: color-mix(in srgb, var(--ea-sc-accent) 8%, #fff) !important;
    }
}

.ea-sc .ea-sc-table thead th.ea-sc-highlight {
    background: var(--ea-sc-primary) !important;
    border-top: 4px solid var(--ea-sc-accent);
    border-bottom-color: var(--ea-sc-primary);
}

.ea-sc .ea-sc-table thead th.ea-sc-highlight .ea-sc-brand-name {
    color: #fff;
}

.ea-sc .ea-sc-table thead th.ea-sc-highlight .ea-sc-visit {
    color: rgba(255, 255, 255, 0.75);
}

.ea-sc .ea-sc-table thead th.ea-sc-highlight .ea-sc-brand-link:hover .ea-sc-visit {
    color: #fff;
}

.ea-sc .ea-sc-table tbody tr:last-child td.ea-sc-highlight {
    border-bottom: 2px solid var(--ea-sc-accent);
}

.ea-sc .ea-sc-rec-badge {
    display: inline-block;
    margin: 0 0 0.85rem;
    padding: 0.28rem 0.7rem;
    background: var(--ea-sc-accent);
    color: var(--ea-sc-primary);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
    border-radius: 999px;
}

/* ── Feature column ─────────────────────────────────────────────── */

.ea-sc .ea-sc-table .ea-sc-feature-col {
    min-width: 190px;
    width: 28%;
    padding-left: 1.5rem;
    color: var(--ea-sc-ink);
    font-weight: 500;
    text-align: left;
}

.ea-sc .ea-sc-table tbody .ea-sc-feature-col {
    position: sticky;
    left: 0;
    z-index: 1;
}

.ea-sc .ea-sc-table thead .ea-sc-feature-col {
    position: sticky;
    left: 0;
    z-index: 3;
}

.ea-sc .ea-sc-feature-link {
    display: inline;
    color: var(--ea-sc-primary);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(100, 116, 139, 0.45);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: text-decoration-color 0.15s ease;
}

.ea-sc .ea-sc-feature-link:hover {
    text-decoration-color: currentColor;
}

.ea-sc .ea-sc-feature-link .ea-sc-arrow {
    display: inline-block;
    margin-left: 0.35rem;
    vertical-align: -1px;
    opacity: 0.55;
}

.ea-sc .ea-sc-feature-link:hover .ea-sc-arrow {
    opacity: 1;
}

/* ── Price row ──────────────────────────────────────────────────── */

.ea-sc .ea-sc-price-row th,
.ea-sc .ea-sc-price-row td {
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
    background: var(--ea-sc-soft) !important;
    border-bottom: 1px solid var(--ea-sc-line);
}

.ea-sc .ea-sc-price-row td.ea-sc-highlight {
    background: #fff4d6 !important;
}

@supports (background: color-mix(in srgb, red, blue)) {
    .ea-sc .ea-sc-price-row td.ea-sc-highlight {
        background: color-mix(in srgb, var(--ea-sc-accent) 14%, #fff) !important;
    }
}

.ea-sc .ea-sc-price {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ea-sc-primary);
}

.ea-sc .ea-sc-price--empty {
    color: #94a3b8;
    font-weight: 500;
}

.ea-sc .ea-sc-price-note {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--ea-sc-muted);
}

/* ── Cell values ────────────────────────────────────────────────── */

.ea-sc .ea-sc-yes,
.ea-sc .ea-sc-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.ea-sc .ea-sc-yes { color: var(--ea-sc-green); }
.ea-sc .ea-sc-no  { color: var(--ea-sc-red); opacity: 0.7; }

.ea-sc .ea-sc-icon {
    display: block;
    width: 24px;
    height: 24px;
}

.ea-sc .ea-sc-text {
    display: inline-block;
    padding: 0.22rem 0.65rem;
    background: #eef2f7;
    color: #1e293b;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.3;
    border-radius: 999px;
}

.ea-sc .ea-sc-text--muted {
    padding-left: 0;
    padding-right: 0;
    background: transparent;
    color: #94a3b8;
    font-style: italic;
    font-weight: 500;
}

/* Clickable cells */
.ea-sc .ea-sc-cell-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.4rem;
    margin: -0.2rem -0.4rem;
    color: inherit;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.ea-sc .ea-sc-cell-link:hover {
    background: rgba(15, 23, 42, 0.06);
}

.ea-sc .ea-sc-cell-link .ea-sc-text {
    text-decoration: underline dotted;
    text-decoration-color: rgba(100, 116, 139, 0.7);
    text-underline-offset: 3px;
}

/* ── Row hover (sticky column stays opaque) ─────────────────────── */

.ea-sc .ea-sc-table tbody tr:not(.ea-sc-price-row):hover th,
.ea-sc .ea-sc-table tbody tr:not(.ea-sc-price-row):hover td {
    background: #f4f7fb !important;
}

.ea-sc .ea-sc-table tbody tr:not(.ea-sc-price-row):hover td.ea-sc-highlight {
    background: #fff3d1 !important;
}

@supports (background: color-mix(in srgb, red, blue)) {
    .ea-sc .ea-sc-table tbody tr:not(.ea-sc-price-row):hover td.ea-sc-highlight {
        background: color-mix(in srgb, var(--ea-sc-accent) 15%, #fff) !important;
    }
}

/* ── Tablet / mobile ────────────────────────────────────────────── */

@media (max-width: 720px) {
    .ea-sc {
        margin: 1.5rem 0;
    }

    .ea-sc .ea-sc-table {
        font-size: 0.875rem;
    }

    .ea-sc .ea-sc-table th,
    .ea-sc .ea-sc-table td {
        padding: 0.8rem 0.65rem;
    }

    .ea-sc .ea-sc-table thead th {
        padding: 1.2rem 0.65rem 1rem;
    }

    .ea-sc .ea-sc-table .ea-sc-feature-col {
        width: 132px;
        min-width: 132px;
        padding-left: 0.9rem;
        box-shadow: 1px 0 0 var(--ea-sc-line), 6px 0 12px -8px rgba(15, 23, 42, 0.2);
    }

    .ea-sc .ea-sc-table thead th.ea-sc-comp-col,
    .ea-sc .ea-sc-table thead th.ea-sc-biz-col {
        min-width: 138px;
    }

    .ea-sc .ea-sc-rec-badge {
        margin-bottom: 0.7rem;
        padding: 0.25rem 0.55rem;
        font-size: 0.6rem;
        letter-spacing: 0.06em;
    }

    .ea-sc .ea-sc-logo {
        width: 104px;
        height: 50px;
        padding: 6px 10px;
    }

    .ea-sc .ea-sc-logo--mono {
        width: 50px;
        font-size: 1.25rem;
    }

    .ea-sc .ea-sc-price {
        font-size: 1.15rem;
    }
}

/* ── Print ──────────────────────────────────────────────────────── */

@media print {
    .ea-sc .ea-sc-scroll {
        overflow: visible;
        box-shadow: none;
    }

    .ea-sc .ea-sc-visit {
        display: none;
    }

    .ea-sc .ea-sc-table tbody .ea-sc-feature-col,
    .ea-sc .ea-sc-table thead .ea-sc-feature-col {
        position: static;
    }
}

/* ── Admin-only error message ───────────────────────────────────── */

.ea-sc-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9em;
}
