/* /static/css/components/result_card_ticket.css */

.rct {
    font-family: var(--body);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    background: #FBF3DF;
    border-radius: 6px;
    position: relative;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--rule-soft);
    margin: 0 20% var(--space-2);
}

/* ── Places row ─────────────────────────────── */
.rct__places {
    background: var(--deep-maroon);
    color: #FBE9CB;
    padding: 14px 60px 20px 50px;
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    align-items: start;
    position: relative;
}

.rct__places-arc {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 198px;
    pointer-events: none;
}

.rct__place {
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    position: relative;
    z-index: 1;
    padding-top: 87px;
}

.rct__place-label {
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: .22em;
    opacity: .65;
    text-transform: uppercase;
}

.rct__place-img {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: #A63D46;
    box-shadow: 0 1px 2px rgba(0,0,0,.18);
    border: 2px solid rgba(251,233,203,.65);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(251,233,203,.45);
    font-size: 11px;
    cursor: pointer;
}
.rct__place-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rct__place-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: 10px;
    line-height: 1.2;
    word-break: break-word;
    margin: 0;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    width: calc(100% + 40px);
    text-align: center;
}
.rct__place-name .bm-link {
    background-image: none;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color var(--duration-normal);
}
.rct__place-name .bm-link:hover {
    text-decoration-thickness: 2px;
}

/* Selected place gets golden border */
.rct__place--primary .rct__place-img {
    border-color: var(--golden-ochre);
}

/* ── Topic center chip ─────────────────────── */
.rct__topic-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 36px 10px 10px;
    text-align: center;
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
}

.rct__topic-center-label {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .18em;
    color: #8FD8D8;
    text-transform: uppercase;
    white-space: nowrap;
}

.rct__topic-center-img {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    overflow: hidden;
    background: #0D4E50;
    box-shadow: 0 0 0 3px #8FD8D8, 0 4px 0 #0A3A3C;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}
.rct__topic-center-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.rct__topic-center-img .rct__topic-img-fallback {
    background: transparent;
    color: #8FD8D8;
    font-size: 24px;
}

.rct__topic-center-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    color: #fff;
    word-break: break-word;
    text-align: center;
    order: -1;
}

/* ── Body ──────────────────────────────────── */
.rct__body {
    padding: 20px 26px 18px;
    display: flex;
    flex-direction: column;
    background: #FBF3DF;
    border-top: 1px dashed rgba(140,47,57,.35);
}

/* Initials fallback (base — overridden in center chip context above) */
.rct__topic-img-fallback {
    font-family: var(--display);
    font-weight: 600;
    font-size: 20px;
    color: var(--dark-teal);
    background: var(--paper-warm);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rct__desc {
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-soft);
    margin: 0;
    flex: 1;
}

/* Placeholder shown when Gemini description generation fails all 3 retries. */
.rct__desc-unavailable {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    text-align: center;
    font-style: italic;
    color: var(--ink-soft, #4A3B30);
    opacity: 0.75;
    padding: 12px 0;
}

/* ── Compact modifier ──────────────────────── */
.rct--compact .rct__places {
    padding: 10px 20px;
}
.rct--compact .rct__place-img {
    width: 48px;
    height: 48px;
}
.rct--compact .rct__topic-center-img {
    width: 62px;
    height: 62px;
}
.rct--compact .rct__topic-center-name {
    font-size: 12px;
}
.rct--compact .rct__desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Also connects to ──────────────────────── */
.rct__also-connects {
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-top: 12px;
    padding: 7px 0;
    line-height: 1.6;
}
.rct__also-label {
    font-weight: 600;
    color: var(--ink-faint);
    margin-right: 4px;
}
.rct__also-link {
    color: var(--connection-color, #008080);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--duration-fast);
}
.rct__also-link:hover {
    color: var(--connection-color-dark, #006666);
    text-decoration: underline;
}

/* ── Source sentence toggle link ───────────── */
.rct__source-link {
    align-self: flex-start;
    margin-top: 20px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .08em;
    color: var(--ink-faint, #8D6E63);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(141,110,99,.4);
    transition: color var(--duration-fast);
}

.rct__source-link:hover {
    color: var(--ink-soft, #4A3B30);
    text-decoration-color: rgba(74,59,48,.5);
}

/* ── Source sentences (Wikipedia grounding) ─── */
.rct__sources {
    margin-top: 12px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.03);
    border-left: 2px solid var(--rule, #D7CCC8);
    border-radius: 0 4px 4px 0;
}

.rct__source-sentence {
    font-size: 12px;
    line-height: 1.55;
    color: var(--ink-faint, #8D6E63);
    font-style: italic;
    margin: 0;
}

.rct__source-sentence + .rct__source-sentence {
    margin-top: 6px;
}

.rct__source-label {
    display: block;
    font-size: 10px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-faint, #8D6E63);
    margin-bottom: 2px;
}

/* ── Mobile ────────────────────────────────── */
@media (max-width: 600px) {
    .rct {
        margin: 0 10px var(--space-2);
    }
    .rct__places {
        padding: 14px 16px 20px 16px;
    }
    .rct__place-name {
        width: 100%;
    }
    .rct__body {
        padding: 16px 18px 14px;
    }
}
