/* =====================================================================
   Compatibility pages. Extends the shared horoscope.css (.hp-*) design.
   ===================================================================== */

.cmp-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hp-section {
    scroll-margin-top: 90px;
}

.cmp-jump {
    margin: 0 0 26px;
}

.hp-section .cmp-h2-gap,
.cmp-h2-gap {
    margin-top: 34px;
}

/* ---- Shared horoscope-page typography and compatibility hero layering ---- */

.cmp-page {
    font-family: var(--font-sans, sans-serif);
}

.cmp-hub-page > .hp-hero {
    position: relative;
    z-index: 20;
    overflow: visible;
}

.cmp-hub-page > .hp-wrap {
    position: relative;
    z-index: 1;
}

/* ---- Compatibility checker ---- */

.cmp-form {
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: 640px;
    margin: 20px 0 4px;
    padding: 20px;
    border: 1px solid #eadfbd;
    font-family: var(--font-sans, sans-serif);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 6px 20px rgba(37, 42, 53, 0.045);
}

.cmp-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.cmp-field label {
    display: block;
    color: #596274;
    font-family: var(--font-sans, sans-serif);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    opacity: 1;
}

.cmp-form .btn-gold {
    min-height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-sans, sans-serif);
    font-weight: 800;
}

@media (min-width: 640px) {
    .cmp-form {
        grid-template-columns: 1fr 1fr auto;
        align-items: end;
    }
}


/* ---- Pair hero: zodiac icons + heading ---- */

.hp-hero .hp-sign.cmp-pair-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 18px;
}

.cmp-pair-signs {
    display: flex;
    flex: 0 0 76px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.cmp-pair-signs .hp-sign-icon {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0;
    object-fit: contain;
}

.cmp-pair-plus {
    display: block;
    margin: -4px 0;
    padding: 0;
    color: #e7c66e;
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
}

.cmp-pair-title {
    flex: 1;
    min-width: 0;
}

.cmp-pair-title h1 {
    margin: 0;
}

/* ---- Mobile pair hero ---- */

@media (max-width: 639px) {
    .hp-hero .hp-sign.cmp-pair-hero {
        gap: 8px;
    }

    .cmp-pair-signs {
        flex: 0 0 54px;
    }

    .cmp-pair-signs .hp-sign-icon {
        width: 46px;
        height: 46px;
    }

    .cmp-pair-plus {
        font-size: 26px;
    }

    .cmp-pair-title h1 {
        line-height: 1.25;
    }
}


/* ---- Compatibility hero: two-column layout ---- */

.cmp-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    align-items: center;
    gap: 36px;
}

.cmp-hero-copy {
    min-width: 0;
}

.cmp-hero-copy .hp-sign {
    margin-bottom: 14px;
}

.cmp-hero-copy .hp-lead {
    margin-bottom: 0;
}

.cmp-hero-grid .cmp-form {
    width: 100%;
    max-width: none;
    grid-template-columns: 1fr;
    align-self: center;
    margin: 0;
}

/* Mobile: retain the existing stacked layout */

@media (max-width: 639px) {
    .cmp-hero-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cmp-hero-grid .cmp-form {
        grid-template-columns: 1fr;
        margin: 0;
    }
}


/* ---- Rating panel ---- */

.cmp-rating {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0 0 18px;
    padding: 20px;
    border: 1px solid #f0dca6;
    border-radius: 18px;
    background: #fff8e7;
}

.cmp-score {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cmp-score strong {
    color: #8a6a12;
    font-family: var(--font-display, Georgia, serif);
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
}

.cmp-score span {
    color: #596274;
    font-size: 18px;
    font-weight: 700;
}

.cmp-rating-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.hp-section .cmp-rating-body p {
    margin: 0;
}

.cmp-meter {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 99px;
    background: #efeade;
}

.cmp-meter span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(105deg, #fcd34d, #f59e0b 68%, #ea8a0c);
}

@media (min-width: 640px) {
    .cmp-rating {
        flex-direction: row;
        align-items: center;
        gap: 28px;
        padding: 24px 28px;
    }
}

/* ---- Tables ---- */

.cmp-table-wrap {
    overflow-x: auto;
    margin: 0 0 14px;
    border: 1px solid #e9e5db;
    border-radius: 14px;
    background: #fff;
}

.cmp-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-sans, sans-serif);
    font-size: 14px;
}

.cmp-table thead {
    background: #fff8e7;
}

.cmp-table th,
.cmp-table td {
    padding: 11px 14px;
    text-align: left;
    vertical-align: top;
    min-width: 90px;
}

.cmp-table thead th {
    color: #6b520d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cmp-table tbody th {
    color: #252a35;
    font-weight: 800;
}

.cmp-table tbody td {
    color: #4b5160;
    line-height: 1.55;
}

.cmp-table tbody tr + tr > * {
    border-top: 1px solid #efeade;
}

.cmp-table tbody tr:nth-child(even) {
    background: #fffdf8;
}

.cmp-total th,
.cmp-total td {
    background: #fff8e7;
    color: #252a35;
    font-weight: 800;
}

.cmp-matrix td {
    white-space: nowrap;
}

/* ---- Strengths / challenges ---- */

.cmp-lists {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 640px) {
    .cmp-lists {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---- Chart ---- */

.cmp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.cmp-chart-wrap {
    overflow-x: auto;
    border: 1px solid #e9e5db;
    border-radius: 14px;
    background: #fff;
}

.cmp-chart {
    width: 100%;
    min-width: 760px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 3px;
    font-size: 12px;
}

/* Zodiac name column */
.cmp-chart thead tr > :first-child,
.cmp-chart tbody th {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.cmp-chart thead th {
    padding: 4px 0;
    color: #596274;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.cmp-chart thead th img,
.cmp-chart tbody th img {
    display: block;
    width: 22px;
    height: 22px;
    margin: 0 auto 2px;
    object-fit: contain;
}

.cmp-chart tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    padding: 4px 4px 4px 8px;
    color: #252a35;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
    background: #fff;
}

.cmp-chart tbody th img {
    display: inline-block;
    margin: 0 6px 0 0;
    vertical-align: middle;
}

.cmp-cell {
    padding: 0;
    text-align: center;
    border-radius: 8px;
}

.cmp-cell a {
    display: block;
    padding: 9px 0;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.cmp-cell a:hover {
    text-decoration: underline;
}

.cmp-cell-high {
    background: #dff3e3;
}

.cmp-cell-high a {
    color: #166534;
}

.cmp-cell-moderate {
    background: #fff1cf;
}

.cmp-cell-moderate a {
    color: #7a5a0a;
}

.cmp-cell-challenging {
    background: #ece9e2;
}

.cmp-cell-challenging a {
    color: #44403c;
}


/* ---- Ranked lists ---- */

.cmp-ranked {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
    counter-reset: cmp-rank;
}

.cmp-ranked li {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #e9e5db;
    border-radius: 14px;
    background: #fff;
    counter-increment: cmp-rank;
}

.cmp-ranked li::before {
    content: counter(cmp-rank) ".";
    flex: 0 0 auto;
    width: 26px;
    color: #8a6a12;
    font-weight: 800;
}

.cmp-ranked li a {
    flex: 1;
    min-width: 0;
    font-weight: 700;
}

.cmp-ranked li span {
    flex: 0 0 auto;
    color: #596274;
    font-size: 14px;
    font-weight: 800;
}

/* Two columns on sm and larger */

@media (min-width: 640px) {
    .cmp-ranked {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}



/* ---- Custom zodiac dropdown ---- */

.cmp-select-field {
    position: relative;
    min-width: 0;
}

.cmp-select-field.is-open {
    z-index: 5;
}

.cmp-select-trigger {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid #e0d4b3;
    border-radius: 12px;
    color: #252a35;
    font: inherit;
    font-size: 16px;
    text-align: left;
    background: #fffdf8;
    cursor: pointer;
}

.cmp-select-trigger:focus-visible {
    outline: 2px solid #e7c66e;
    outline-offset: 2px;
}

.cmp-select-arrow {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-right: 2px solid #596274;
    border-bottom: 2px solid #596274;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -5px;
}

.cmp-select-field.is-open .cmp-select-arrow {
    transform: rotate(225deg);
    margin-top: 5px;
}

.cmp-select-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    left: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: min(260px, 40vh);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #e9e5db;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(37, 42, 53, 0.14);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.cmp-select-menu[hidden] {
    display: none;
}

.cmp-select-option {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 0;
    border-radius: 9px;
    color: #252a35;
    font: inherit;
    font-family: var(--font-sans, sans-serif);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    background: transparent;
    cursor: pointer;
}

.cmp-select-option img {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(72%) sepia(38%) saturate(600%) hue-rotate(5deg) brightness(90%) contrast(90%);
}

.cmp-select-option:hover,
.cmp-select-option:focus-visible {
    background: #fff8e7;
    outline: none;
}

.cmp-select-option[aria-selected="true"] {
    color: #8a6a12;
    background: #fff4d4;
    font-weight: 800;
}

.cmp-select-error {
    display: block;
    margin-top: 5px;
    color: #b42318;
    font-size: 12px;
}

.cmp-select-error[hidden] {
    display: none;
}

.cmp-select-trigger[aria-invalid="true"] {
    border-color: #b42318;
}

@media (max-width: 639px) {
    .cmp-form {
        padding: 18px;
    }

    .cmp-select-menu {
        max-height: min(220px, 38vh);
    }
}