/* 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: none;
    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: none;
    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; }
}


/* =========================================================
 * v0.5.2 - cover-only opening page
 * This applies only before Contents. Contents and study layout remain v0.5.1.
 * ======================================================= */
.uj300-cover-stage {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: clamp(20px, 4vw, 44px);
    overflow: hidden;
    background: inherit;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

.uj300-cover-stage .uj300-cover-only {
    display: block;
    width: auto;
    height: auto;
    max-width: min(72vw, 430px);
    max-height: calc(100dvh - clamp(40px, 8vw, 88px));
    margin: 0 !important;
    border: 1px solid rgba(0,0,0,.28);
    border-radius: 5px;
    object-fit: contain;
}

/* v0.6.1: Notice-style prose. Respect the site/GeneratePress reading typography. */
.uj300-general-chapter {
    width:100%; max-width:none; margin:0; padding:0;
    font:inherit; color:inherit; letter-spacing:inherit;
}
/* Preserve the existing chapter title appearance. */
.uj300-general-chapter > header > h1 {
    font-size:1.5rem; font-weight:600; line-height:1.5; margin:0 0 1.8em;
}
.uj300-general-body { font:inherit; color:inherit; width:100%; max-width:none; }
.uj300-general-body p { font:inherit; margin:0 0 1.25em; overflow-wrap:break-word; }
/* Heading sizes come from the site's existing styles, rather than the theme's
   oversized default heading scale inside this plugin. */
.uj300-general-body :is(h2,h3,h4,h5,h6) {
    font-family:inherit; font-size:1.12em; font-weight:600;
    line-height:1.5; color:inherit; letter-spacing:inherit;
    margin:1.9em 0 .8em;
}
.uj300-general-body :is(h4,h5,h6) { font-size:1em; }
.uj300-general-body img { max-width:100%; height:auto; }
.uj300-general-contents { text-align:center; margin-top:24px; }
.uj300-toc-day:empty { display:none; }


/* v0.6.2: general chapters use the title column, not the DAY-number column. */
.uj300-toc li.uj300-toc-general > a { display: block; }
.uj300-toc li.uj300-toc-general .uj300-toc-day { display: none; }
.uj300-toc li.uj300-toc-general .uj300-toc-title { display: block; min-width: 0; overflow-wrap: anywhere; }

/* v1.0 additions: deliberately preserve the v0.6.2 frameless, spacious layout */
.uj300-added-section{margin:2.8em 0 3.2em;padding:0;border:0;background:transparent;}
.uj300-added-section h3{font-size:1.04em;margin:0 0 1.1em;font-weight:600;}
.uj300-soft-icon{color:#88b9e2;margin-right:.45em;font-size:.9em;}
.uj300-situation-image{display:block;width:100%;max-width:720px;height:auto;margin:1.1em 0 0;border:0;}
.uj300-word-row{display:flex;flex-wrap:wrap;align-items:center;gap:.35em .75em;padding:.75em 0;border-bottom:1px solid rgba(0,0,0,.055);}
.uj300-word-source{font-weight:600}.uj300-word-pronunciation,.uj300-word-korean{color:#666;font-size:.9em;}
.uj300-word-image{max-width:74px;height:auto;margin-left:auto;}
.uj300-speak-all{background:none;border:1px solid #a9cce8;color:#548cbf;border-radius:5px;padding:.4em .75em;cursor:pointer;margin-top:1em;font:inherit;font-size:.84em;}
.uj300-speak-all i{color:#88b9e2;margin-right:.35em}
.uj300-toc a{grid-template-columns:5.4em minmax(0,1fr) 1em;}
.uj300-progress-dot{display:inline-block;width:.5em;height:.5em;border-radius:50%;background:#f1a33c;justify-self:end;align-self:center;animation:uj300-dot-pulse 2.8s ease-in-out infinite;}
@keyframes uj300-dot-pulse{0%,100%{opacity:.35}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){.uj300-progress-dot{animation:none;opacity:1;}}
@media(max-width:600px){.uj300-toc a{grid-template-columns:4.8em minmax(0,1fr) 1em;}}

/* v1.0.1: separate application section without cards; retain original page rhythm. */
.uj300-application-heading{margin:2.2em 0 1em;font-size:1.02em;font-weight:600;color:#689ed2;}
.uj300-application-heading .uj300-soft-icon{margin-right:.45em;color:#83b4e0;}
