/* Szerkesztett tartalom böngészős rétege - a contentBase.css UTÁN töltendő (felülírja), emailbe sosem kerül be. */

.tetra-content {
    --ck-content-font-family: "Space Grotesk", sans-serif;
    font-family: var(--ck-content-font-family);
}

.tetra-content td,
.tetra-content th {
    line-height: 1.6;
}

/* --- Fluid betűméret ------------------------------------------------- */

.tetra-content :where(h1) {
    --fs: 40;
}

.tetra-content :where(h2) {
    --fs: 32;
}

.tetra-content :where(h3) {
    --fs: 27;
}

.tetra-content :where(h4) {
    --fs: 20;
}

.tetra-content :where(h5) {
    --fs: 16;
}

.tetra-content :where(h6) {
    --fs: 14;
}

.tetra-content :where(p, li, table) {
    --fs: 16;
}

.tetra-content :where(blockquote) {
    --fs: 17;
}

.tetra-content :where(figcaption) {
    --fs: 13;
}

.tetra-content p.tetra-lead {
    --fs: 18;
}

.tetra-content p.tetra-muted {
    --fs: 14;
}

/* --- Idézet, kód ----------------------------------------------------- */

.tetra-content blockquote {
    position: static;
}

.tetra-content blockquote::before {
    content: none;
}

.tetra-content blockquote p {
    font-size: inherit;
    line-height: inherit;
    font-style: normal;
    margin-bottom: 1em;
}

.tetra-content code {
    font-family: "PT Mono", monospace;
}

.tetra-content pre {
    overflow-x: auto;
}

/* --- Hivatkozás ------------------------------------------------------ */

.tetra-content a:not(.btn) {
    color: #18181b !important;
    text-decoration: underline !important;
    text-underline-offset: 4px;
    cursor: pointer;
}

/* --- Kép -------------------------------------------------------------- */

.tetra-content img {
    margin: 1rem 0 !important;
}

.tetra-content figure.image {
    display: table;
    margin: 1rem auto !important;
}

.tetra-content figure.image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 !important;
}

.tetra-content figure.image>figcaption {
    display: table-caption;
    caption-side: bottom;
}

.tetra-content figure.image.image_resized>figcaption {
    display: block;
}

/* Sorközi kép: a CKEditor <span class="image-inline">-be csomagolja. */
.tetra-content span.image-inline {
    display: inline-flex;
    max-width: 100%;
    align-items: flex-start;
}

/* --- Adattáblázat ----------------------------------------------------- */

.tetra-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
}

.tetra-content th,
.tetra-content td {
    border: 1px solid #e4e4e7 !important;
    padding: 0.5rem 1rem !important;
    text-align: left;
    min-width: 120px;
}

.tetra-content th {
    background-color: #f4f4f5;
    color: #71717a;
    font-weight: 700;
}

.tetra-content th>:first-child,
.tetra-content td>:first-child {
    margin-top: 0;
}

.tetra-content th>:last-child,
.tetra-content td>:last-child {
    margin-bottom: 0;
}

.tetra-content figure.table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #e4e4e7 transparent;
}

.tetra-content figure.table::-webkit-scrollbar {
    height: 6px;
}

.tetra-content figure.table::-webkit-scrollbar-track {
    background: transparent;
}

.tetra-content figure.table::-webkit-scrollbar-thumb {
    background-color: #e4e4e7;
    border-radius: 9999px;
}

.tetra-content figure.table>table {
    display: table;
    width: 100%;
}

/* --- Elrendezés-táblázat: oszlopköz és mobil tördelés ----------------- */

.tetra-content table.layout-table {
    /* Egy helyen állítható a két oszlop közötti térköz. */
    --tetra-layout-gap: 1.5rem;
}

.tetra-content table.layout-table>tbody>tr>td:not(:last-child) {
    padding-right: var(--tetra-layout-gap) !important;
}

@media (max-width: 1200px) {
    .tetra-content table.layout-table,
    .tetra-content table.layout-table>tbody,
    .tetra-content table.layout-table>tbody>tr {
        display: block;
        width: 100%;
    }

    .tetra-content table.layout-table>tbody>tr>td {
        display: block;
        width: 100% !important;
    }

    /* Egymás alatt a vízszintes térköznek nincs értelme. */
    .tetra-content table.layout-table>tbody>tr>td:not(:last-child) {
        padding-right: 0 !important;
    }

    .tetra-content figure.image img {
        max-height: 350px;
        object-fit: contain;
    }
}

/* sm és alatta a képnek kevesebb függőleges hely jut, mielőtt kitolná a szöveget. */
@media (max-width: 575.98px) {
    .tetra-content figure.image img {
        max-height: 300px;
    }
}

/* --- Float-törés ------------------------------------------------------ */

.tetra-content h1,
.tetra-content h2,
.tetra-content h3,
.tetra-content h4,
.tetra-content h5,
.tetra-content h6,
.tetra-content hr,
.tetra-content figure.media {
    clear: both;
}

/* A CKEditor a beágyazott médiának 15em-es padlót ad (.ck-content .media), a képnek
   viszont csak 50px-et - emiatt a videó a szerkesztőben megáll, miközben a húzott
   (és mentett) százalék tovább csökken, a publikus oldalon pedig nincs ilyen padló.
   A szerkesztőben ezért nullázzuk: azt lássuk, ami ténylegesen mentődik. */
.tetra-content.ck-editor__editable .media {
    min-width: 0;
}

/* A kis kijelzőn felnagyított méret a MEGJELENÍTÉS szabálya: egy 30%-os kép telefonon
   olvashatatlanul apró lenne. A SZERKESZTŐBEN viszont nem érvényesülhet, mert ott a
   valódi, mentett szélességet kell látni - enélkül az átméretezés használhatatlan
   keskeny nézetben: a fogantyú húzására a százalék változik, a kép viszont nem mozdul,
   mert ez a min-width visszafeszíti. A szerkeszthető felület gyökere a .tetra-content
   MELLETT a .ck-editor__editable osztályt is viseli, a publikus oldal és az admin
   előnézete nem - így a kizárás pontosan a szerkesztőt hagyja ki. */
@media (max-width: 991.98px) {
    .tetra-content:not(.ck-editor__editable) figure.media,
    .tetra-content:not(.ck-editor__editable) figure.image.image_resized {
        min-width: 75%;
    }
}

@media (max-width: 767.98px) {
    .tetra-content:not(.ck-editor__editable) figure.media,
    .tetra-content:not(.ck-editor__editable) figure.image.image_resized {
        min-width: 100%;
    }
}

.tetra-content figure.table,
.tetra-content figure.image:not(.image-style-side):not(.image-style-align-left):not(.image-style-align-right) {
    clear: both;
}

/* --- Teendőlista: saját rajzolt jelölőnégyzet ------------------------- */

.tetra-content {
    --tetraCMS-todo-size: 16px;
    --tetraCMS-todo-accent: #2563eb;
}

.tetra-content ul.todo-list>li {
    margin-bottom: 0.25rem;
}

.tetra-content ul.todo-list .todo-list__label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.tetra-content ul.todo-list .todo-list__label>input[type="checkbox"],
.tetra-content ul.todo-list .todo-list__label>span[contenteditable="false"]>input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: var(--tetraCMS-todo-size) !important;
    height: var(--tetraCMS-todo-size) !important;
    border: 1px solid var(--tetraCMS-todo-accent) !important;
    border-radius: 3px;
    background-color: #fff;
    
    position: relative !important;
    left: 0 !important;
    right: auto !important;
    margin: 0 !important;
    
    margin-top: 0.3em !important;
    flex-shrink: 0;
    cursor: inherit;
}

.tetra-content ul.todo-list .todo-list__label>input[type="checkbox"]:checked,
.tetra-content ul.todo-list .todo-list__label>span[contenteditable="false"]>input[type="checkbox"]:checked {
    background-color: var(--tetraCMS-todo-accent);
}

.tetra-content ul.todo-list .todo-list__label>input[type="checkbox"]:disabled,
.tetra-content ul.todo-list .todo-list__label>span[contenteditable="false"]>input[type="checkbox"]:disabled {
    opacity: 0.55;
    cursor: default;
}

.tetra-content ul.todo-list .todo-list__label>input[type="checkbox"]::before,
.tetra-content ul.todo-list .todo-list__label>span[contenteditable="false"]>input[type="checkbox"]::before {
    content: none !important;
}

/* Saját pipa: fehér, elforgatott "L" alakú szár, csak bejelölt állapotban. */
.tetra-content ul.todo-list .todo-list__label>input[type="checkbox"]::after,
.tetra-content ul.todo-list .todo-list__label>span[contenteditable="false"]>input[type="checkbox"]::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    left: 34% !important;
    top: 16% !important;
    width: 26% !important;
    height: 52% !important;
    border: solid #fff !important;
    border-width: 0 2px 2px 0 !important;
    border-radius: 0 !important;
    transform: rotate(45deg) !important;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

.tetra-content ul.todo-list .todo-list__label>input[type="checkbox"]:checked::after,
.tetra-content ul.todo-list .todo-list__label>span[contenteditable="false"]>input[type="checkbox"]:checked::after {
    opacity: 1;
}

/* --- Tartalomjegyzék: böngésző-specifikus többlet --------------------- */

.tetra-content nav.table-of-contents a:hover {
    text-decoration: underline;
}

/* Csak a szerkesztő-nézetben létezik, a mentett HTML-ben soha. */
.tetra-content nav.table-of-contents .toc-empty {
    margin: 0;
    color: #71717a;
}

.tetra-content :where(h2, h3, h4)[id] {
    scroll-margin-top: 6rem;
}

/* --- Szöveges elválasztó (Sablonok: "Olvass tovább" elválasztó) ------- */

.tetra-content .tetra-divider-text {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 480px;
    margin: 32px auto;
}

.tetra-content .tetra-divider-text > span {
    flex: 1 1 auto;
    height: 1px;
    background-color: #e4e4e7;
}

.tetra-content .tetra-divider-text > span.tetra-divider-text__label {
    flex: 0 0 auto;
    height: auto;
    background-color: transparent;
    padding: 0 20px;
    font-style: italic;
    white-space: nowrap;
}
