/*
 * Meschugge Jokes – Plugin Stylesheet
 * Theme-agnostic: uses only .meschugge-jokes-* classes.
 * Inherits font-family and base colors from the active theme.
 * Version: 0.1.2
 */

/* ── Wrapper ─────────────────────────────────────────────── */
.meschugge-jokes-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 2em 0;
}

/* ── Search bar ──────────────────────────────────────────── */
.meschugge-jokes-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-bottom: 1.2em;
}

.meschugge-jokes-search-input {
    flex: 1;
    padding: 0.55em 0.9em;
    font-size: 1em;
    border: 2px solid #c7d9f0;
    border-radius: 6px;
    outline: none;
    background: #fff;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.meschugge-jokes-search-input:focus {
    border-color: #3a7bd5;
    box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.15);
}

.meschugge-jokes-count {
    white-space: nowrap;
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}

.meschugge-jokes-no-results {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 1.5em 0;
    border: 1px dashed #ccc;
    border-radius: 6px;
    margin-bottom: 1em;
}

/* ── Table ───────────────────────────────────────────────── */
.meschugge-jokes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    line-height: 1.65;
    /* Inherit theme font – no font-family override */
}

/* ── Header ──────────────────────────────────────────────── */
.meschugge-jokes-th {
    background-color: #2c2c2c;
    color: #f5f5f5;
    text-align: left;
    padding: 0.75em 1em;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-bottom: 3px solid #d4a017;  /* gold accent */
    width: 50%;
}

.meschugge-jokes-flag {
    margin-right: 0.3em;
}

/* ── Rows ────────────────────────────────────────────────── */
.meschugge-jokes-row {
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.meschugge-jokes-row:nth-child(even) {
    background-color: #fafafa;
}

.meschugge-jokes-row:hover {
    background-color: #e8f1fc;
    transition: background-color 0.15s ease;
}

/* ── Cells ───────────────────────────────────────────────── */
.meschugge-jokes-cell {
    padding: 1em 1.1em;
    vertical-align: top;
}

.meschugge-jokes-cell--de {
    border-right: 2px solid #e0e0e0;
}

/* ── Title ───────────────────────────────────────────────── */
.meschugge-jokes-title {
    display: block;
    font-size: 1em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.7em;
    padding-bottom: 0.4em;
    padding-left: 0.6em;
    border-left: 4px solid #d4a017;  /* gold accent, matches table header */
    border-bottom: 1px solid #eee;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

/* ── Content ─────────────────────────────────────────────── */

/* Paragraph groups (separated by blank lines in source) */
.meschugge-jokes-para-group {
    margin-bottom: 0.75em;
}

.meschugge-jokes-para-group:last-child {
    margin-bottom: 0;
}

/* Individual lines within a group (e.g. dialogue lines) */
.meschugge-jokes-para-group p {
    margin: 0 0 0.15em 0;
    color: inherit;
}

.meschugge-jokes-para-group p:last-child {
    margin-bottom: 0;
}

/* ── Tags ────────────────────────────────────────────────── */
.meschugge-jokes-tags {
    margin-top: 0.8em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em;
}

.meschugge-jokes-tag {
    display: inline-block;
    background-color: #f0e9d6;
    color: #6b4c11;
    font-size: 0.72em;
    font-weight: 600;
    padding: 0.2em 0.55em;
    border-radius: 3px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    user-select: none;
}

.meschugge-jokes-tag:hover {
    background-color: #d6e8fb;
    color: #1a4f8a;
    border-color: #a8c8f0;
}

.meschugge-jokes-tag--active {
    background-color: #3a7bd5;
    color: #fff;
    border-color: #2a5faa;
}

/* ── Empty state ─────────────────────────────────────────── */
.meschugge-jokes-empty {
    color: #888;
    font-style: italic;
    padding: 1em 0;
}

/* ── Responsive: stack columns on mobile ─────────────────── */
@media screen and (max-width: 680px) {

    .meschugge-jokes-table,
    .meschugge-jokes-table thead,
    .meschugge-jokes-table tbody,
    .meschugge-jokes-table tr,
    .meschugge-jokes-table th,
    .meschugge-jokes-table td {
        display: block;
        width: 100%;
    }

    .meschugge-jokes-th--en {
        display: none;  /* hide English header on mobile; label appears via ::before */
    }

    .meschugge-jokes-cell {
        border-right: none;
        padding: 0.75em 1em;
    }

    .meschugge-jokes-cell--de {
        border-bottom: 1px solid #e0e0e0;
        background-color: #fefefe;
    }

    .meschugge-jokes-cell--en {
        background-color: #f5f5f5;
    }

    /* Mobile language labels */
    .meschugge-jokes-cell--de::before {
        content: "🇩🇪 Deutsch";
        display: block;
        font-weight: 700;
        font-size: 0.78em;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.5em;
    }

    .meschugge-jokes-cell--en::before {
        content: "\1F1FA\1F1F8 English";
        display: block;
        font-weight: 700;
        font-size: 0.78em;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.5em;
    }
}
