/*
 * Toolkit pages (toolkits.html = module overview, topic.html = one topic).
 * Shared: css/index.css, css/page.css, css/resources.css (.rs-badge, .rs-tba), css/lang-switcher.css.
 */

/* ------------------------------------------------------------------ shared */
.tk-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid #000;
    border-radius: 5px;
    background: transparent;
    color: #000;
    font: inherit;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.tk-link:hover {
    background: #000;
    color: #fff;
    text-decoration: none;
}

.tk-link:focus-visible,
.tkm-topic:focus-visible,
.tp-toc a:focus-visible,
.tp-pager__link:focus-visible,
.tp-links a:focus-visible,
.tp-crumb__list a:focus-visible,
.tp-panel summary:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

/* ------------------------------------------------------------ overview page */
.tkm-wrap {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem 0 2rem;
}

.tkm-heading {
    margin: 0;
    text-align: center;
    font-size: 1.75rem;
}

.tkm {
    scroll-margin-top: 80px;
}

.tkm__head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.tkm__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid #000;
    border-radius: 50%;
    background: var(--accent-color, #8897d8);
    font-size: 1.3rem;
}

.tkm__kicker {
    margin: 0;
    color: #4b4b4b;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tkm__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.tkm__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 1rem;
}

.tkm-topic {
    display: block;
    height: 100%;
    color: #000;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

a.tkm-topic:hover {
    color: #000;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.tkm-topic__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.tkm-topic__num {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.tkm-topic__title {
    margin: 0;
    flex: 1;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

/* disabled topics: visibly inactive, not clickable */
.tkm-topic.is-disabled {
    background: #f3f3f3;
    color: #6b6b6b;
    cursor: not-allowed;
    box-shadow: none !important;
}

.tkm-topic.is-disabled .tkm-topic__title {
    color: #6b6b6b;
}

/* --------------------------------------------------------------- topic page */
.tp-crumb {
    width: 90%;
    max-width: 880px;
    margin: 0 auto;
    padding: 6rem 0 0;
}

.tp-crumb__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
    color: #4b4b4b;
}

.tp-crumb__list li + li::before {
    content: "/";
    margin-right: 0.5rem;
}

.tp-crumb__list a {
    color: #000;
    text-decoration: underline;
}

.tp {
    width: 90%;
    max-width: 880px;
    margin: 0 auto;
    padding: 1.25rem 0 4rem;
}

.tp-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #000;
}

.tp-kicker {
    margin: 0 0 0.4rem;
    color: #4b4b4b;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tp-title {
    margin: 0 0 0.9rem;
    font-family: "Montserrat", sans-serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
}

.tp-title__num {
    display: inline-block;
    padding: 0 0.5rem;
    border: 1px solid #000;
    border-radius: 5px;
    background: var(--accent-color, #8897d8);
    font-size: 0.8em;
}

.tp-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.tp-details__label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tp-print {
    margin-left: auto;
}

.tp-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tp-toc a {
    padding: 0.35rem 0.85rem;
    border: 1px solid #000;
    border-radius: 999px;
    background: #fff;
    color: #000;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.3s;
}

.tp-toc a:hover {
    background: var(--accent-color, #8897d8);
    text-decoration: none;
}

.tp-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tp-section {
    scroll-margin-top: 80px;
}

.tp-section__title {
    margin: 0 0 0.75rem;
    padding-left: 0.75rem;
    border-left: 5px solid var(--accent-color, #8897d8);
    font-size: 1.4rem;
    font-weight: 800;
}

.tp-section p {
    margin: 0 0 0.9rem;
    line-height: 1.7;
}

.tp-steps,
.tp-list {
    margin: 0;
    padding-left: 1.4rem;
    line-height: 1.7;
}

.tp-steps li,
.tp-list li {
    margin-bottom: 0.4rem;
}

.tp-hint {
    color: #4b4b4b;
    font-size: 0.9rem;
}

/* evaluation panels */
.tp-panel {
    margin-bottom: 0.6rem;
    border: 1px solid #000;
    border-radius: 0.5rem;
    background: #fff;
}

.tp-panel summary {
    padding: 0.75rem 1rem;
    font-weight: 700;
    cursor: pointer;
}

.tp-panel[open] summary {
    border-bottom: 1px solid #000;
    background: var(--accent-soft, #eceffa);
}

.tp-panel .tp-list {
    padding: 0.9rem 1rem 0.5rem 2.4rem;
}

/* links / documents */
.tp-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tp-links li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tp-links a {
    color: #000;
    text-decoration: underline;
}

/* videos */
.tp-video {
    margin: 0 0 1rem;
}

.tp-video__frame {
    position: relative;
    padding-top: 56.25%;
    border: 1px solid #000;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #000;
}

.tp-video__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.tp-video figcaption {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #4b4b4b;
}

/* coming soon / not found */
.tp-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2.5rem 1.5rem;
    border: 2px dashed #000;
    border-radius: 0.5rem;
    background: #fff;
    text-align: center;
}

.tp-state .tp-title {
    margin: 0;
}

.tp-state__title {
    margin: 0;
    font-size: 1.5rem;
}

.tp-state p {
    max-width: 480px;
    margin: 0;
}

.tp-state__icon {
    font-size: 2.2rem;
    line-height: 1;
}

/* previous / next */
.tp-pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #000;
}

.tp-pager__link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid #000;
    border-radius: 5px;
    background: #fff;
    color: #000;
    text-decoration: none;
    transition: background-color 0.3s;
}

.tp-pager__link:hover {
    background: var(--accent-soft, #eceffa);
    color: #000;
    text-decoration: none;
}

.tp-pager__link.is-next {
    justify-self: end;
    text-align: right;
}

.tp-pager__label {
    display: block;
    color: #4b4b4b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tp-pager__name {
    display: block;
    font-weight: 700;
    line-height: 1.3;
}

@media (max-width: 767px) {
    .tp-pager {
        grid-template-columns: 1fr;
    }

    .tp-pager__link.is-next {
        justify-self: stretch;
    }

    .tp-title {
        font-size: 1.6rem;
    }
}

@media print {
    header,
    footer,
    .tp-toc,
    .tp-pager,
    .tp-print,
    .tp-crumb {
        display: none !important;
    }

    .tp-panel > * {
        display: block;
    }

    .tp {
        width: 100%;
        padding-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tkm-topic, .tk-link, .tp-toc a, .tp-pager__link { transition: none; }
}

/* ------------------------------------------------- topic content additions */
.tp-summary {
    margin: 0 0 1.25rem;
    padding: 1rem 1.1rem;
    border-left: 5px solid var(--accent-color, #8897d8);
    background: var(--accent-soft, #eceffa);
    line-height: 1.65;
}

.tp-figure {
    margin: 0 0 1rem;
}

.tp-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #000;
    border-radius: 0.5rem;
}

.tp-figure figcaption {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #4b4b4b;
}

.tp-sub {
    margin: 1.25rem 0 0.6rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.tp-step__title {
    display: block;
    margin-bottom: 0.25rem;
}

.tp-steps > li {
    margin-bottom: 0.9rem;
}

.tp-steps > li p {
    margin: 0 0 0.5rem;
}

.tp-steps .tp-list {
    margin-bottom: 0.5rem;
}

/* quiz */
.tp-quiz {
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    counter-reset: q;
}

.tp-quiz__item {
    margin-bottom: 1rem;
    counter-increment: q;
}

.tp-quiz__set {
    margin: 0;
    padding: 1rem;
    border: 1px solid #000;
    border-radius: 0.5rem;
    background: #fff;
}

.tp-quiz__q {
    float: none;
    width: 100%;
    margin: 0 0 0.6rem;
    padding: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.tp-quiz__q::before {
    content: counter(q) ". ";
}

.tp-quiz__option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0 0 0.35rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
}

.tp-quiz__option:hover {
    background: var(--accent-soft, #eceffa);
}

.tp-quiz__option input {
    margin-top: 0.3rem;
}

.tp-quiz__option.is-correct {
    border-color: #1a7f37;
    background: #e6f6ea;
}

.tp-quiz__option.is-wrong {
    border-color: #b42318;
    background: #fdecea;
}

.tp-quiz__feedback {
    min-height: 1.4rem;
    margin: 0.4rem 0 0;
    font-weight: 700;
    font-size: 0.9rem;
}

.tp-quiz__feedback.is-correct {
    color: #1a7f37;
}

.tp-quiz__feedback.is-wrong {
    color: #b42318;
}

/* video poster used when the page cannot embed YouTube (opened from a file) */
.tp-video__poster {
    position: absolute;
    inset: 0;
    display: block;
}

.tp-video__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tp-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 4rem;
    line-height: 1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* ------------------------------------------- Toolkit for Youth: coming soon */
.ty-soon {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 90%;
    max-width: 900px;
    margin: 1rem auto 4rem;
    padding: 3rem 1.5rem;
    border: 1px solid #000;
    border-radius: 0.5rem;
    background: linear-gradient(180deg, var(--accent-soft, #eceffa) 0%, #fff 70%);
    text-align: center;
}

.ty-soon__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border: 1px solid #000;
    border-radius: 50%;
    background: var(--accent-color, #8897d8);
    font-size: 2.2rem;
    line-height: 1;
}

.ty-soon__title {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.ty-soon__text {
    max-width: 560px;
    margin: 0;
    color: #374151;
    line-height: 1.65;
}

.ty-soon__features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.ty-soon__features li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #000;
    border-radius: 999px;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 600;
}

.ty-soon__next {
    width: 100%;
    margin-top: 1.25rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #000;
}

.ty-soon__next-title {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ty-soon__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

@media (max-width: 575px) {
    .ty-soon { padding: 2rem 1rem; }
    .ty-soon__title { font-size: 1.5rem; }
}
