/* Shared by Joomla Guide article bodies and their excerpts. */
:root {
    --joi-guide-ink: #201f21;
    --joi-guide-text: #333236;
    --joi-guide-muted: #605d62;
    /* Homepage interaction accent and its existing accessible navigation text color. */
    --joi-guide-accent: #f31065;
    --joi-guide-accent-ink: #b00a49;
    --joi-guide-line: #dcdadc;
}

.joi-guide .com-content-article__body, .joi-guide-prose {
    color: var(--joi-guide-text);
    font-size: clamp(1rem, .95rem + .2vw, 1.075rem);
    line-height: 1.7;
    overflow-wrap: break-word;
}

.joi-guide .page-header :is(h1, h2),
.joi-guide-title, .joi-guide-section-heading, .joi-guide-heading, .joi-guide-subheading {
    color: var(--joi-guide-ink);
    text-transform: none;
    font-weight: 700;
}

.joi-guide-hero {
    padding-block: clamp(.75rem, 2vw, 1.5rem) .5rem;
}

.joi-guide-title {
    margin: .25em 0 .4em;
    font-size: clamp(2rem, 3.6vw, 2.875rem);
    line-height: 1.14;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.joi-guide-section { margin-block: clamp(2rem, 5vw, 3.25rem); }
.joi-guide-section-heading, h2.joi-guide-heading {
    margin: 1.55em 0 .55em;
    font-size: clamp(1.4rem, 2.25vw, 1.8rem);
    line-height: 1.28;
    letter-spacing: -.015em;
    text-wrap: pretty;
}
.joi-guide-section > :is(.joi-guide-section-heading, .joi-guide-heading):first-child { margin-top: 0; }
.joi-guide-subheading { margin: 1.35em 0 .45em; font-size: 1.18rem; line-height: 1.4; }
.joi-guide-paragraph { margin: 0 0 .9em; color: var(--joi-guide-text); line-height: 1.7; }
.joi-guide-hero .joi-guide-paragraph:not(.joi-guide-meta) { font-size: 1.08em; }
.joi-guide-hero .joi-guide-prose { color: var(--joi-guide-muted); font-size: .92rem; }

.joi-guide-meta, .joi-guide-caption { color: var(--joi-guide-muted); font-size: .9rem; line-height: 1.6; }
.joi-guide-caption { padding: .5em 0; text-align: left; }
.joi-guide-example-text { font-size: 1.08rem; line-height: 1.95; }
.joi-guide-emphasis { color: var(--joi-guide-ink); }
.joi-guide-particle { color: var(--joi-guide-accent-ink); }
.joi-guide-label { color: var(--joi-guide-ink); font-weight: 700; }
.joi-guide-furigana { font-size: .6em; }
.joi-guide-ruby { ruby-align: center; }
.joi-guide-underlined { text-decoration: underline; text-underline-offset: .14em; }
.joi-guide-address { font-style: normal; }
.joi-guide-quote {
    margin: 0;
    padding: .2em 1em;
    color: var(--joi-guide-text);
    border-inline-start: 2px solid var(--joi-guide-line);
}
.joi-guide-list { margin: .4em 0; padding-inline-start: 1.45em; line-height: 1.75; }
.joi-guide-list-item { margin-block: .35em; }
.joi-guide-alphabetical { list-style: upper-alpha; }
.joi-guide-sublist { list-style: circle; }
.joi-guide-unmarked { list-style: none; }

.joi-guide-link, .joi-guide .com-content-article__body a.joi-guide-link {
    color: var(--joi-guide-text);
    text-decoration: underline;
    text-underline-offset: .15em;
}
.joi-guide .com-content-article__body a.joi-guide-link:hover { color: var(--joi-guide-accent-ink); text-decoration-thickness: 2px; }
.joi-guide :is(a, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--joi-guide-accent);
    outline-offset: 2px;
}

/* Sections and examples share a single reading surface. */
.joi-guide-contents { margin-block: 1.5rem; }
.joi-guide-card, .joi-guide-panel { min-width: 0; }
.joi-guide-card-header { margin-block-end: .6rem; }
.joi-guide-card-header > :first-child, .joi-guide-panel > :first-child { margin-block-start: 0; }
.joi-guide-card + .joi-guide-card, .joi-guide-panel + .joi-guide-panel { margin-block-start: 1.25rem; }
:is(.joi-guide-grid, .joi-guide-stack, .joi-guide-row) > :is(.joi-guide-panel, .joi-guide-card) {
    margin-block-start: 0;
}
.joi-guide-panel:has(> .joi-guide-example-text) {
    padding-inline-start: 1em;
}
.joi-guide-divider { margin-block-start: .75em; }
.joi-guide-disclosure {
    margin: 0;
    border-block-end: 1px solid var(--joi-guide-line);
}
.joi-guide-summary, .joi-guide-summary-padded {
    display: list-item;
    padding-block: .7em;
    color: var(--joi-guide-ink);
    font-weight: 650;
    cursor: pointer;
}
.joi-guide-disclosure > summary::marker { color: var(--joi-guide-accent-ink); }
.joi-guide-answer { padding-block: .25rem 1rem; }
.joi-guide-card-link { display: block; }
.joi-guide-action-panel { margin-block: 2.75rem; }
.joi-guide-badge, .joi-guide-badge-solid {
    color: var(--joi-guide-muted);
    font-size: .86rem;
    line-height: 1.5;
    font-weight: 650;
}
a.joi-guide-button, a.joi-guide-button-outline, a.joi-guide-card-link {
    color: var(--joi-guide-accent-ink);
    text-decoration: underline;
    text-underline-offset: .17em;
}
a.joi-guide-button, a.joi-guide-button-outline { font-weight: 650; }
a.joi-guide-button:hover, a.joi-guide-button-outline:hover, a.joi-guide-card-link:hover {
    text-decoration-thickness: 2px;
}
.joi-guide-hero :is(.joi-guide-button, .joi-guide-button-outline, .joi-guide-badge, .joi-guide-badge-solid) {
    color: var(--joi-guide-muted);
    font-size: .85rem;
    line-height: 1.5;
    font-weight: 650;
}

/* Layout for comparison grids, related lessons, and author profiles. */
.joi-guide-grid, .joi-guide-stack { display: grid; gap: 1.5rem 2rem; }
.joi-guide-grid {
    --joi-guide-card-width: 17rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--joi-guide-card-width)), 1fr));
}
.joi-guide-grid-small { --joi-guide-card-width: 14rem; }
.joi-guide-grid-wide { --joi-guide-card-width: 20rem; }
.joi-guide-stack { grid-template-columns: minmax(0, 1fr); }
.joi-guide-column { display: flex; flex-direction: column; }
.joi-guide-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.joi-guide-justify-center { justify-content: center; }
.joi-guide-align-center { align-items: center; }
.joi-guide-flex-item { flex: 1 1 17rem; min-width: 0; }
.joi-guide-flex-item-small { flex: 1 1 42%; min-width: min(6rem, 100%); }
.joi-guide-flex-item-wide { flex: 1 1 26rem; min-width: 0; }
.joi-guide-flex-aside { flex: 0 1 16rem; max-width: 100%; margin-inline: auto; }
.joi-guide-aside-end { max-width: 100%; margin-inline-start: auto; }
.joi-guide-grow { flex: 1; }
.joi-guide-push-end { margin-top: auto; }
.joi-guide-figure { max-width: min(100%, 31rem); margin: 1.7em auto; text-align: center; }
.joi-guide-image, .joi-guide-thumbnail, .joi-guide-thumbnail-contain, .joi-guide-portrait {
    display: block;
    width: 100%;
}
.joi-guide-image { height: auto; }
.joi-guide-thumbnail { height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
img.joi-guide-thumbnail-contain { height: 145px; object-fit: contain; }
.joi-guide-fit-contain { object-fit: contain; }
.joi-guide-avatar-frame {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}
img.joi-guide-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.joi-guide-aside-end:has(> .joi-guide-profile) { flex: 0 1 16rem; }
/* This recurring lazy-loaded illustration is stored with a width but no height. */
.joi-guide-image[src$="/sakura-japanese-teacher.webp"] { aspect-ratio: auto 2048 / 1592; }
.joi-guide-profile { width: min(100%, 16rem); margin: 0 auto; }
.joi-guide-portrait-frame {
    width: min(100%, 180px);
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: .65rem;
    overflow: hidden;
}
img.joi-guide-portrait { height: 100%; object-fit: cover; object-position: 50% 35%; }
.joi-guide-portrait-close .joi-guide-portrait { transform: scale(1.06); }
.joi-guide-portrait-inset .joi-guide-portrait { transform: scale(.96); }
img.joi-guide-portrait-centered { object-position: center; }
img.joi-guide-portrait-low { object-position: 50% 40%; }
.joi-guide-illustrated-aside { display: block; flex: 0 1 135px; max-width: 100%; border-radius: .65rem; }
.joi-guide-illustration { aspect-ratio: 3 / 2; }

/* Wide comparison tables scroll within the reading column. */
.joi-guide-table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; margin-block: 1em; }
.joi-guide-table { width: 100%; border-collapse: collapse; font-size: .94rem; line-height: 1.65; }
.joi-guide-table-medium { min-width: 36rem; }
.joi-guide-table-wide { min-width: 46rem; }
.joi-guide-table-fixed { table-layout: fixed; }
.joi-guide-cell { padding: .7em .65em; border: 0; border-block-end: 1px solid var(--joi-guide-line); vertical-align: top; }
th.joi-guide-cell { text-align: start; font-weight: 700; color: var(--joi-guide-ink); border-bottom-color: #a6a3a8; }

.joi-guide-center, th.joi-guide-center { text-align: center; }
.joi-guide-block { display: block; }
.joi-guide-nowrap { white-space: nowrap; }
.joi-guide-gap-before { margin-top: .75em; }
.joi-guide-break-before { margin-top: 1.65em; }
.joi-guide-gap-after { margin-bottom: .75em; }
.joi-guide-tight { margin-bottom: .35em; }
.joi-guide-flush { margin-bottom: 0; }

/* Preserve authored proportions in fixed-layout grammar and comparison tables. */
.joi-guide-column-15 { width: 15%; }
.joi-guide-column-17 { width: 17%; }
.joi-guide-column-18 { width: 18%; }
.joi-guide-column-20 { width: 20%; }
.joi-guide-column-22 { width: 22%; }
.joi-guide-column-23 { width: 23%; }
.joi-guide-column-24 { width: 24%; }
.joi-guide-column-25 { width: 25%; }
.joi-guide-column-26 { width: 26%; }
.joi-guide-column-27 { width: 27%; }
.joi-guide-column-28 { width: 28%; }
.joi-guide-column-30 { width: 30%; }
.joi-guide-column-33 { width: 33%; }
.joi-guide-column-34 { width: 34%; }
.joi-guide-column-36 { width: 36%; }
.joi-guide-column-38 { width: 38%; }
.joi-guide-column-40 { width: 40%; }
.joi-guide-column-42 { width: 42%; }
.joi-guide-column-50 { width: 50%; }
.joi-guide-column-min-160 { min-width: 160px; }
.joi-guide-column-min-280 { min-width: 280px; }
.joi-guide-column-min-60 { min-width: 60px; }

/* Curated related reading from the Joomla article field. */
.joi-guide-related-section { margin-block: 2.5rem; }
.joi-guide-related-heading { color: var(--joi-guide-ink); font-size: 1.45rem; }
.joi-guide-related-list {
    max-width: 68ch;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
}
.joi-guide-related-item + .joi-guide-related-item { margin-top: 1rem; }
.joi-guide .joi-guide-related-link {
    color: var(--joi-guide-ink);
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: .18em;
}
.joi-guide .joi-guide-related-link:hover { color: var(--joi-guide-accent-ink); }
.joi-guide-related-description { margin: .25rem 0 0; color: var(--joi-guide-muted); }

/* Responsive article navigation. */
.joi-content > .com-content-article.joi-guide,
.joi-article > .com-content-article.joi-guide {
    max-width: 68rem;
}

.joi-guide .joi-guide-layout--sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(224px, 23%, 275px);
    column-gap: clamp(2rem, 4.5vw, 4rem);
    align-items: start;
}

.joi-guide .com-content-article__body {
    max-width: 46rem;
    margin-inline: auto;
}
.joi-guide .joi-guide-layout--sidebar > .com-content-article__body {
    width: 100%;
    grid-area: 1 / 1;
    min-width: 0;
}

.joi-guide .joi-guide-nav {
    margin-block: 1.5rem;
    border-block: 1px solid var(--joi-guide-line);
    color: var(--joi-guide-ink);
    text-align: left;
}

.joi-guide .joi-guide-layout--sidebar > .joi-guide-nav {
    position: sticky;
    top: var(--joi-anchor-offset, 110px);
    grid-area: 1 / 2;
    margin: .75rem 0 0;
    border: 0;
    border-inline-start: 1px solid var(--joi-guide-line);
    padding-inline-start: 1rem;
}

.joi-guide .joi-guide-nav summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem .2rem;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    list-style: none;
    cursor: pointer;
}

.joi-guide .joi-guide-nav summary::-webkit-details-marker {
    display: none;
}

.joi-guide .joi-guide-nav summary::after {
    content: '';
    width: 8px;
    height: 8px;
    border: solid var(--joi-guide-accent);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.joi-guide .joi-guide-nav details[open] > summary::after {
    transform: rotate(225deg);
}

.joi-guide .joi-guide-nav ul {
    margin: 0;
    padding: 0 0 .6rem;
    list-style: none;
}

.joi-guide .joi-guide-layout--sidebar > .joi-guide-nav ul {
    overflow-y: auto;
    max-height: calc(100vh - var(--joi-anchor-offset, 110px) - 85px);
}

.joi-guide .joi-guide-nav li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.joi-guide .joi-guide-layout .joi-guide-nav li a {
    display: block;
    padding: 0.42rem 0.65rem;
    border-inline-start: 3px solid transparent;
    color: var(--joi-guide-text);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.45;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.joi-guide .joi-guide-layout .joi-guide-nav li a:hover {
    color: var(--joi-guide-ink);
    text-decoration: underline;
}

.joi-guide .joi-guide-layout .joi-guide-nav li a[aria-current="location"] {
    color: var(--joi-guide-ink);
    border-inline-start-color: var(--joi-guide-accent);
    font-weight: 700;
}

.joi-guide .joi-guide-nav :is(a, summary):focus-visible {
    outline: 2px solid var(--joi-guide-accent);
    outline-offset: -2px;
}

@media print {
    .joi-guide .joi-guide-layout--sidebar {
        display: block;
    }

    .joi-guide .joi-guide-nav {
        display: none;
    }
}

/* Article gallery. Topic and page selection share the homepage accent. */
.joi-content > .com-content-category-blog.joi-articles-hub { padding-block-start: 1.5rem; }
.joi-content .joi-articles-hub .joi-blog-gallery-title { color: var(--joi-guide-ink); }
.joi-content .joi-articles-hub .joi-articles-intro {
    max-width: 62ch;
    margin: .75rem 0 0;
    color: var(--joi-guide-text);
    font-size: 1.05rem;
    line-height: 1.65;
}
.joi-articles-hub .joi-category-bar { padding: 1.5rem 0 0; border-bottom: 1px solid var(--joi-guide-line); }
.joi-articles-hub .joi-category-pills, .joi-articles-hub .joi-guide-topics, .joi-hub-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem 1.25rem;
}
.joi-articles-hub .joi-category-pill, .joi-content .joi-articles-hub .joi-guide-topics a,
.joi-content .joi-articles-hub .joi-hub-pagination a {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    padding: .45rem .15rem;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--joi-guide-text);
    font-weight: 550;
    text-decoration: none;
}
.joi-articles-hub .joi-category-pill svg { width: 1.1rem; height: 1.1rem; }
.joi-content .joi-articles-hub :is(.joi-category-pills, .joi-guide-topics, .joi-hub-pagination) a:is([aria-current], :hover) {
    border-bottom-color: var(--joi-guide-accent);
    color: var(--joi-guide-accent-ink);
    background: transparent;
}
.joi-content .joi-articles-hub a:focus-visible { outline: 2px solid var(--joi-guide-accent-ink); outline-offset: 2px; }
.joi-articles-hub .joi-guide-topics { padding-top: .8rem; }
.joi-articles-hub .joi-guide-topics > span, .joi-articles-hub .joi-hub-pagination > span {
    color: var(--joi-guide-muted);
    font-size: .9rem;
}
.joi-articles-hub #articles { margin-top: 1.65rem; }
.joi-content .joi-articles-hub .joi-blog-gallery .blog-item,
.joi-content .joi-articles-hub .joi-blog-gallery .blog-item:is(:hover, :focus-within) {
    border-radius: 0;
    box-shadow: none;
    transform: none;
}
.joi-content .joi-articles-hub .joi-blog-gallery .blog-cover :is(img, a),
.joi-content .joi-articles-hub .joi-blog-gallery .blog-cover-empty { border-radius: 0; }
.joi-content .joi-articles-hub .joi-blog-gallery a.item-content {
    flex-direction: column;
    gap: .35rem;
    padding: .8rem 0 1rem;
}
.joi-content .joi-articles-hub .joi-blog-gallery .item-content .page-header h2 { color: var(--joi-guide-ink); }
.joi-content .joi-articles-hub .joi-blog-gallery .blog-item:is(:hover,:focus-within) h2 {
    text-decoration: underline;
    text-decoration-color: var(--joi-guide-accent);
    text-underline-offset: .18em;
}
.joi-articles-hub .joi-hub-card-category { color: var(--joi-guide-muted); font-size: .8rem; font-weight: 550; }
.joi-content .joi-articles-hub .joi-blog-gallery .joi-hub-cover-fallback { background: #f4f4f4; }
.joi-content .joi-articles-hub .joi-hub-cover-fallback a {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    align-items: center;
    justify-content: center;
    color: var(--joi-guide-muted);
    text-decoration: none;
}
.joi-hub-cover-fallback span:first-child { font-size: 3rem; line-height: 1.1; }
.joi-hub-cover-fallback span:last-child { font-size: .85rem; }
.joi-articles-hub .joi-hub-pagination {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--joi-guide-line);
    justify-content: center;
}
.joi-content .joi-articles-hub .joi-hub-pagination a { min-width: 44px; justify-content: center; }

.joi-articles-hub .joi-hub-card-date {
    display: block;
    color: var(--joi-guide-muted);
    font-size: .85rem;
    line-height: 1.5;
}

@media (min-width: 992px) {
    .joi-content .com-content-category-blog.joi-articles-hub .blog-items.joi-blog-gallery {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* The Guides and Articles gallery share the same fixed return control. */
.joi-guide-back-top {
    position: fixed;
    inset-inline-end: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1000;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--joi-guide-accent);
    border-radius: 50%;
    background: #fff;
    color: var(--joi-guide-accent-ink);
    box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
}
.joi-guide-back-top::before {
    content: '';
    width: 12px;
    height: 12px;
    border: solid currentColor;
    border-width: 2px 2px 0 0;
    transform: translateY(3px) rotate(-45deg);
}
.joi-guide-back-top:is(:hover, :focus-visible) {
    color: #fff;
    background-color: var(--joi-guide-accent-ink);
}
.joi-guide-back-top:focus-visible {
    outline: 2px solid var(--joi-guide-ink);
    outline-offset: 3px;
}
.joi-guide-back-top[hidden] { display: none; }
@media print {
    .joi-guide-back-top { display: none; }
}

/* Quiz anchors occur on either the section or its heading. Each question
   contains its own expandable answer, including in particle practice sets. */
.joi-guide section:is([id*="quiz"], [id="practice"], :has(> h2[id$="quiz"])) > .joi-guide-panel:has(> details) {
    border: 1px solid var(--joi-guide-line);
    border-radius: .375rem;
    padding: .8rem 1rem;
    background-color: #fff;
}
