/* Central visual contract for every Gamma handout page. */
@font-face {
    font-family: 'Yekan';
    src: url('../fonts/Yekan.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

.gamma-lesson,
.gamma-lesson *:not(i[class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab) {
    font-family: 'Yekan', Tahoma, Arial, sans-serif !important;
    letter-spacing: 0 !important;
}
.gamma-lesson i[class*="fa-"],
.gamma-lesson .fa,
.gamma-lesson .fas,
.gamma-lesson .far {
    font-family: "Font Awesome 6 Free" !important;
}
.gamma-lesson .fab,
.gamma-lesson .fa-brands { font-family: "Font Awesome 6 Brands" !important; }

/* Readability: never use near-white text on the lesson surfaces. */
.gamma-lesson,
.gamma-lesson .gamma-card,
.gamma-lesson .gamma-toc-card,
.gamma-lesson .gamma-progress-card {
    color: #172b3d !important;
}
.gamma-lesson .gamma-card p,
.gamma-lesson .gamma-card li,
.gamma-lesson .gamma-card td,
.gamma-lesson .gamma-card th,
.gamma-lesson .gamma-card strong,
.gamma-lesson .gamma-card small,
.gamma-lesson .gamma-card span,
.gamma-lesson .gamma-card label,
.gamma-lesson .gamma-answer-body,
.gamma-lesson .gamma-answer-body * {
    color: #172b3d !important;
    opacity: 1 !important;
}
.gamma-lesson .gamma-kicker,
.gamma-lesson .gamma-card > .gamma-kicker,
.gamma-lesson .gamma-section-title,
.gamma-lesson .gamma-card h3,
.gamma-lesson .gamma-card h4 {
    color: #123b59 !important;
}
.gamma-lesson .gamma-kicker { color: #087c70 !important; }
.gamma-lesson .gamma-answer summary {
    color: #075e54 !important;
    opacity: 1 !important;
}
.gamma-lesson .gamma-answer-body p,
.gamma-lesson .gamma-answer-list li,
.gamma-lesson .gamma-answer-item p,
.gamma-lesson .gamma-answer-item strong {
    color: #172b3d !important;
    opacity: 1 !important;
}
.gamma-lesson .gamma-dialogue-row strong { color: #087c70 !important; }
.gamma-lesson .gamma-dialogue-row p,
.gamma-lesson .gamma-note,
.gamma-lesson .gamma-question-list p,
.gamma-lesson .gamma-problem p,
.gamma-lesson .gamma-debate p { color: #243f58 !important; opacity: 1 !important; }

/* Keep every table inside its card and prevent mobile horizontal scrolling. */
.gamma-lesson .gamma-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin: 18px 0 0 !important;
    padding: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}
.gamma-lesson .gamma-table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: separate !important;
    table-layout: fixed !important;
    min-width: 0 !important;
}
.gamma-lesson .gamma-table th,
.gamma-lesson .gamma-table td {
    vertical-align: middle !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.85 !important;
}
.gamma-lesson .gamma-table thead th { text-align: center !important; color: #123b59 !important; }
.gamma-lesson .gamma-table td[dir="ltr"],
.gamma-lesson .gamma-table th[dir="ltr"] {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: plaintext !important;
}
.gamma-lesson .gamma-table td[dir="rtl"],
.gamma-lesson .gamma-table th[dir="rtl"] {
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: plaintext !important;
}
.gamma-lesson .gamma-table thead th { text-align: center !important; }

/* Two-column word tables: German/Persian side by side, example below both. */
.gamma-lesson .gamma-vocab-table th:first-child,
.gamma-lesson .gamma-vocab-table td:first-child,
.gamma-lesson .combo-vocab th:first-child,
.gamma-lesson .combo-vocab td:first-child { width: 50% !important; }
.gamma-lesson .gamma-vocab-table th:nth-child(2),
.gamma-lesson .gamma-vocab-table td:nth-child(2),
.gamma-lesson .combo-vocab th:nth-child(2),
.gamma-lesson .combo-vocab td:nth-child(2) { width: 50% !important; }
.gamma-lesson .gamma-vocab-example td,
.gamma-lesson .combo-example td,
.gamma-lesson .hair-vocab-example td { background: #eef4f8 !important; color: #173a55 !important; }

/* Persian translation tables: the row number stays in a narrow right column. */
.gamma-lesson .gamma-translation-table th:last-child,
.gamma-lesson .gamma-translation-table td:last-child,
.gamma-lesson .hair-translation-table th:last-child,
.gamma-lesson .hair-translation-table td:last-child,
.gamma-lesson .combo-translation th:last-child,
.gamma-lesson .combo-translation td:last-child {
    width: 3.4rem !important;
    min-width: 3.4rem !important;
    max-width: 3.4rem !important;
    text-align: right !important;
    direction: rtl !important;
}
.gamma-lesson .gamma-translation-table .fa-number,
.gamma-lesson .gamma-table .fa-number {
    width: 3.4rem !important;
    min-width: 3.4rem !important;
    text-align: right !important;
    direction: rtl !important;
}

/* German-first tables: the row number stays in a narrow left column. */
.gamma-lesson .gamma-tf th:first-child,
.gamma-lesson .gamma-tf td:first-child,
.gamma-lesson .gamma-puzzle-table th:first-child,
.gamma-lesson .gamma-puzzle-table td:first-child,
.gamma-lesson .gamma-short-table th:first-child,
.gamma-lesson .gamma-short-table td:first-child {
    width: 3.4rem !important;
    min-width: 3.4rem !important;
    max-width: 3.4rem !important;
    direction: ltr !important;
    text-align: left !important;
}

/* Older handouts use a plain table inside #satzpuzzle. */
.gamma-lesson #satzpuzzle .gamma-table th:first-child,
.gamma-lesson #satzpuzzle .gamma-table td:first-child {
    width: 3.4rem !important;
    min-width: 3.4rem !important;
    max-width: 3.4rem !important;
    direction: ltr !important;
    text-align: left !important;
    font-family: Arial, Tahoma, sans-serif !important;
    unicode-bidi: isolate !important;
}
.gamma-lesson #satzpuzzle .gamma-table th:nth-child(2),
.gamma-lesson #satzpuzzle .gamma-table td:nth-child(2) {
    width: 55% !important;
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: plaintext !important;
}
.gamma-lesson #satzpuzzle .gamma-table th:nth-child(3),
.gamma-lesson #satzpuzzle .gamma-table td:nth-child(3) {
    width: auto !important;
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: plaintext !important;
}
.gamma-lesson #satzpuzzle .gamma-table thead th {
    text-align: center !important;
    font-size: 15px !important;
    font-weight: 800 !important;
}

/* Older translation tables keep Persian numbers in the final column. */
.gamma-lesson #translation .gamma-table th:last-child[dir="rtl"],
.gamma-lesson #translation .gamma-table td:last-child[dir="rtl"] {
    width: 3.4rem !important;
    min-width: 3.4rem !important;
    max-width: 3.4rem !important;
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: plaintext !important;
}

@media (max-width: 760px) {
    .gamma-lesson .gamma-card { overflow: hidden !important; }
    .gamma-lesson .gamma-table-wrap { margin: 14px 0 0 !important; }
    .gamma-lesson .gamma-table { font-size: 13px !important; }
    .gamma-lesson .gamma-table th,
    .gamma-lesson .gamma-table td { padding: 9px 7px !important; }
    .gamma-lesson .gamma-translation-table th:last-child,
    .gamma-lesson .gamma-translation-table td:last-child,
    .gamma-lesson .hair-translation-table th:last-child,
    .gamma-lesson .hair-translation-table td:last-child,
    .gamma-lesson .combo-translation th:last-child,
    .gamma-lesson .combo-translation td:last-child,
    .gamma-lesson .gamma-table .fa-number { width: 2.8rem !important; min-width: 2.8rem !important; max-width: 2.8rem !important; }
    .gamma-lesson .gamma-tf th:first-child,
    .gamma-lesson .gamma-tf td:first-child,
    .gamma-lesson .gamma-puzzle-table th:first-child,
    .gamma-lesson .gamma-puzzle-table td:first-child,
    .gamma-lesson .gamma-short-table th:first-child,
    .gamma-lesson .gamma-short-table td:first-child { width: 2.8rem !important; min-width: 2.8rem !important; max-width: 2.8rem !important; }
    .gamma-lesson #satzpuzzle .gamma-table th:first-child,
    .gamma-lesson #satzpuzzle .gamma-table td:first-child { width: 2.8rem !important; min-width: 2.8rem !important; max-width: 2.8rem !important; }
    .gamma-lesson #translation .gamma-table th:last-child[dir="rtl"],
    .gamma-lesson #translation .gamma-table td:last-child[dir="rtl"] { width: 2.8rem !important; min-width: 2.8rem !important; max-width: 2.8rem !important; }
}
