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

.rct {
    font-family: var(--body);
    color: var(--ink);
    display: grid;
    grid-template-columns: 108px 1fr;
    background: #FBF3DF;
    border-radius: 6px;
    position: relative;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--rule-soft);
    min-height: 320px;
    margin-bottom: var(--space-2);
}

/* Perforation circles at the stub/body seam */
.rct::before,
.rct::after {
    content: '';
    position: absolute;
    left: 100px;
    width: 16px;
    height: 16px;
    background: #E8DEC6;
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
}
.rct::before { top: -8px; }
.rct::after  { bottom: -8px; }

/* ── Left stub ─────────────────────────────── */
.rct__stub {
    background: var(--deep-maroon);
    color: #FBE9CB;
    padding: 18px 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    z-index: 1;
}

/* Dashed tear edge */
.rct__stub::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10px;
    bottom: 10px;
    border-right: 2px dashed rgba(251,233,203,.4);
}

.rct__place {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

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

.rct__place-img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background: #A63D46;
    box-shadow: 0 1px 2px rgba(0,0,0,.18);
    border: 2px solid rgba(251,233,203,.25);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(251,233,203,.45);
    font-size: 11px;
}
.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: 14px;
    line-height: 1.15;
    word-break: break-word;
    margin: 0;
    color: #FBE9CB;
}

/* Selected place gets golden border + heavier name */
.rct__place--primary .rct__place-img {
    border-color: var(--golden-ochre);
}
.rct__place--primary .rct__place-name {
    font-weight: 700;
    font-size: 15px;
}

/* ── Connector arrow ───────────────────────── */
.rct__connector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .2em;
    color: rgba(251,233,203,.55);
    text-transform: uppercase;
}
.rct__connector::before,
.rct__connector::after {
    content: '';
    flex: 1;
    height: 0;
    border-top: 1px dashed rgba(251,233,203,.3);
}

/* ── Right body ────────────────────────────── */
.rct__body {
    padding: 22px 18px 20px;
    display: flex;
    flex-direction: column;
    background: #FBF3DF;
}

/* Topic row: image + label + name */
.rct__topic-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 12px;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--rule);
    margin-bottom: 16px;
}

.rct__topic-img {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: #D7C7A3;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rct__topic-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Initials fallback when topic image is unavailable */
.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__topic-text {
    min-width: 0;
}
.rct__topic-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .24em;
    color: var(--dark-teal);
    text-transform: uppercase;
    margin-bottom: 5px;
}
.rct__topic-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: 17px;
    line-height: 1.25;
    color: var(--ink);
    margin: 0;
    display: block;
}

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

/* ── Compact modifier ──────────────────────── */
.rct--compact .rct__stub {
    padding: 14px 10px;
    gap: 10px;
}
.rct--compact .rct__place-img {
    width: 66px;
    height: 66px;
}
.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 10px;
    background: rgba(0,128,128,0.06);
    border-left: 2px solid var(--connection-color, #008080);
    border-radius: 0 4px 4px 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 140ms;
}
.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: 10px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 10px;
    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 140ms;
}

.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: 11px;
    line-height: 1.55;
    color: var(--ink-faint, #8D6E63);
    font-style: italic;
    margin: 0;
}

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