/* U-日本語 300 v0.2.13
 * Silence FM reading layout.
 * The site controls the base font size / line-height; this plugin controls only learning UI structure.
 */

.uj300-page {
    --uj300-ink: #202124;
    --uj300-subtle: #5f6368;
    --uj300-badge-border: #9B8A79;
    --uj300-badge-ink: #4B4038;
    --uj300-done: #444444;
    --uj300-focus: rgba(75, 64, 56, .25);

    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    color: inherit;
    font-family: inherit;
    letter-spacing: inherit;
}

.uj300-page *,
.uj300-page *::before,
.uj300-page *::after {
    box-sizing: border-box;
}

/* Inherit Silence FM typography except Japanese text and small control labels. */
.uj300-day-title,
.uj300-retrieval-title,
.uj300-guide,
.uj300-pronunciation,
.uj300-korean,
.uj300-recall-question,
.uj300-answer-pronunciation,
.uj300-nav,
.uj300-number {
    font-family: inherit;
    font-weight: inherit;
    color: inherit;
}

.uj300-day-title {
    margin: 0 0 1.15em;
}

.uj300-guide {
    margin: 0 0 3.1em;
}

.uj300-input-list,
.uj300-retrieval {
    width: 100%;
}

.uj300-expression,
.uj300-recall {
    margin: 0 0 2.65em;
}

/* Question / study rows: quiet, book-like two-column alignment. */
.uj300-expression,
.uj300-recall-question {
    display: grid;
    grid-template-columns: 1.55em minmax(0, 1fr);
    column-gap: .55em;
    align-items: start;
    width: 100%;
}

.uj300-expression-body,
.uj300-recall-body {
    min-width: 0;
}

.uj300-expression-body > *,
.uj300-recall-body > * {
    margin: 0;
}

.uj300-number {
    display: block;
    min-width: 0;
    white-space: nowrap;
}

.uj300-japanese,
.uj300-answer-jp {
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    font-weight: 600;
    letter-spacing: 0;
}

.uj300-japanese-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .42em;
    margin: 0;
}

.uj300-pronunciation,
.uj300-korean {
    margin: 0;
}

/* Speaker: icon only; never turns into a browser-style button. */
.uj300-speak,
.uj300-speak:hover,
.uj300-speak:focus,
.uj300-speak:focus-visible,
.uj300-speak:active {
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-decoration: none !important;
    color: #2093c3 !important;
}

.uj300-speak i,
.uj300-speak:hover i,
.uj300-speak:focus i,
.uj300-speak:focus-visible i,
.uj300-speak:active i {
    color: #2093c3 !important;
}

.uj300-speak {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin: 0;
    padding: 0 .12em;
    color: #2093c3 !important;
    font: inherit;
    line-height: 1;
    cursor: pointer;
    vertical-align: baseline;
    -webkit-tap-highlight-color: transparent;
}

/* Decorative separator: match the Silence FM title ornament proportions. */
.uj300-major-divider {
    width: 100%;
    margin: 3.7em 0 3.35em;
    text-align: center;
}

.uj300-divider {
    display: block;
    width: 100%;
    max-width: 600px;
    height: 30px;
    margin: 0 auto;
    background-image: url('https://silencefm.com/wp-content/uploads/2026/09/line.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
}

.uj300-divider img,
.uj300-divider-image {
    display: none !important;
}

.uj300-recall-question {
    margin: 0 0 .72em;
}

/*
 * Retrieval answer row
 * The first column is fixed. The Show/Hide control never re-centres when an answer appears,
 * so clicking it cannot make the button jump vertically.
 */
.uj300-answer-row {
    display: grid;
    grid-template-columns: 4.05em minmax(0, 1fr);
    column-gap: .72em;
    align-items: start;
    width: calc(100% - 2.10em);
    margin: 0 0 0 2.10em;
    min-height: 1.55em;
}

.uj300-answer-toggle,
.uj300-answer-toggle:hover,
.uj300-answer-toggle:focus,
.uj300-answer-toggle:focus-visible,
.uj300-answer-toggle:active {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    border: 1px solid var(--uj300-badge-border) !important;
    box-shadow: none !important;
    color: var(--uj300-badge-ink) !important;
    text-decoration: none !important;
}

.uj300-answer-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: start !important;

    width: 4.05em !important;
    min-width: 4.05em !important;
    height: 1.52em !important;
    min-height: 1.52em !important;

    margin: 0 !important;
    padding: 0 .34em .02em !important;
    border-radius: 5px !important;

    font-family: "Roboto", "Noto Sans KR", sans-serif !important;
    font-size: .88em !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;

    cursor: pointer !important;
    transform: none !important;
    vertical-align: top !important;
    -webkit-tap-highlight-color: transparent !important;
}

.uj300-answer-toggle:focus-visible {
    outline: 2px solid var(--uj300-focus) !important;
    outline-offset: 3px !important;
}

.uj300-answer-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .38em .46em;
    min-width: 0;
    min-height: 1.52em;
    margin: 0 !important;
    padding: 0 !important;
    line-height: inherit;
}

.uj300-answer-line[hidden] {
    display: flex !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.uj300-answer-pronunciation {
    opacity: .76;
}

/* Final completion control: one calm, dark button at the end of each block. */
.uj300-done-center {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 3.35em 0 0;
    text-align: center;
}

.uj300-done-button,
.uj300-done-button:hover,
.uj300-done-button:focus,
.uj300-done-button:focus-visible,
.uj300-done-button:active {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 0 !important;
    background: var(--uj300-done) !important;
    color: #fff !important;
    box-shadow: none !important;
    text-decoration: none !important;
    transform: none !important;
}

.uj300-done-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 8.25em !important;
    min-width: 8.25em !important;
    min-height: 2.65em !important;
    margin: 0 !important;
    padding: .58em 1.5em !important;
    border-radius: 7px !important;

    font-family: "Roboto", "Noto Sans KR", sans-serif !important;
    font-size: .92em !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;

    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
}

.uj300-done-button:focus-visible {
    outline: 2px solid rgba(68, 68, 68, .22) !important;
    outline-offset: 3px !important;
}

.uj300-done-button[disabled] {
    opacity: .62;
    cursor: default !important;
}

.uj300-morning-review {
    margin-bottom: 0;
}

.uj300-empty {
    opacity: .7;
}

.uj300-nav {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    margin-top: 4em;
}

.uj300-nav a {
    color: inherit;
    text-decoration: none;
}

.uj300-nav a:focus-visible,
.uj300-speak:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

@media (max-width: 600px) {
    .uj300-page {
        max-width: 100%;
    }

    .uj300-major-divider {
        margin-top: 3.25em;
        margin-bottom: 3em;
    }

    .uj300-divider {
        width: 100%;
        max-width: 600px;
        height: 30px;
    }

    .uj300-answer-row {
        grid-template-columns: 3.85em minmax(0, 1fr);
        column-gap: .62em;
    }

    .uj300-answer-toggle {
        width: 3.85em !important;
        min-width: 3.85em !important;
    }

    .uj300-done-button {
        width: 8em !important;
        min-width: 8em !important;
    }
}


/* v0.2.19: day navigation swaps only the learning region; no document-level page animation. */
.uj300-page[data-loading="1"] {
    pointer-events: none;
}

/* v0.2.16: keep study-line rhythm identical on desktop and mobile.
 * Silence FM desktop globally gives .entry-content p a large paragraph margin/line-height.
 * These learning lines are not prose paragraphs, so neutralize that rule only inside them.
 */
.entry-content .uj300-page .uj300-japanese-line,
.entry-content .uj300-page .uj300-pronunciation,
.entry-content .uj300-page .uj300-korean,
.entry-content .uj300-page .uj300-recall-body > p,
.entry-content .uj300-page .uj300-answer-line {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.65 !important;
}

/* =========================================================
 * v0.3.0 - Foreign Language Textbook front matter / TOC
 * ======================================================= */
.uj300-book-front {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    color: inherit;
    font-family: inherit;
    letter-spacing: inherit;
}

.uj300-book-front *,
.uj300-book-front *::before,
.uj300-book-front *::after {
    box-sizing: border-box;
}

.uj300-book-shell { width: 100%; }

.uj300-book-overview {
    display: grid;
    grid-template-columns: minmax(150px, 34%) minmax(0, 1fr);
    gap: 2.1em;
    align-items: start;
}

.uj300-book-cover {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    border: 1px solid rgba(0,0,0,.28);
    border-radius: 5px;
}

.uj300-book-meta { min-width: 0; padding-top: .08em; }

.uj300-book-title {
    margin: 0;
    text-align: left;
    font-size: 1.55em;
    line-height: 1.35;
}

.uj300-book-subtitle {
    margin: .6em 0 1.25em;
    text-align: left;
    opacity: .78;
}

.uj300-biblio { margin: 1.35em 0 0; }
.uj300-biblio > div {
    display: grid;
    grid-template-columns: 4.5em minmax(0, 1fr);
    gap: .75em;
    padding: .34em 0;
}
.uj300-biblio dt { margin: 0; opacity: .58; font-weight: 400; }
.uj300-biblio dd { margin: 0; }

.uj300-front-section { margin-top: 3.25em; }
.uj300-front-section > h2 { margin: 0 0 1.05em; font-size: 1.12em; line-height: 1.4; }
.uj300-front-prose > :first-child { margin-top: 0 !important; }
.uj300-front-prose > :last-child { margin-bottom: 0 !important; }

.uj300-book-next {
    display: flex;
    justify-content: flex-end;
    margin: 3.1em 0 1em;
}
.uj300-next-page,
.uj300-next-page:hover,
.uj300-next-page:focus,
.uj300-next-page:active {
    color: inherit;
    text-decoration: none;
    opacity: .72;
}

.uj300-toc-section { margin-top: 0; }
.uj300-toc { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(0,0,0,.12); }
.uj300-toc li { margin: 0; padding: 0; border-bottom: 1px solid rgba(0,0,0,.10); }
.uj300-toc a {
    display: grid;
    grid-template-columns: 5.4em minmax(0, 1fr);
    gap: .75em;
    align-items: baseline;
    padding: .82em .08em;
    color: inherit;
    text-decoration: none;
}
.uj300-toc-day { white-space: nowrap; opacity: .72; }
.uj300-toc-title { min-width: 0; }

.uj300-book-start { display: flex; justify-content: center; margin: 3.1em 0 1em; }
.uj300-start-button,
.uj300-start-button:hover,
.uj300-start-button:focus,
.uj300-start-button:active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 9.2em;
    padding: .72em 1.4em;
    border: 0;
    border-radius: 7px;
    background: #444;
    color: #fff;
    text-decoration: none;
    box-shadow: none;
}

@media (max-width: 600px) {
    .uj300-book-front { max-width: 100%; }
    .uj300-book-overview { grid-template-columns: minmax(105px, 36%) minmax(0, 1fr); gap: 1.15em; }
    .uj300-book-title { font-size: 1.32em; }
    .uj300-book-subtitle { margin-bottom: .85em; }
    .uj300-biblio { margin-top: .8em; font-size: .92em; }
    .uj300-biblio > div { grid-template-columns: 3.9em minmax(0, 1fr); gap: .55em; padding: .2em 0; }
    .uj300-toc a { grid-template-columns: 4.8em minmax(0, 1fr); gap: .6em; }
}
