/* Article pages (and the restricted article). Owned by the article page agent. Use the components in
   ../help.css first (.prose, .applies, .callout, .toc, .rail, .breadcrumb, .notice, badges, .pager).
   Board: Article, MobileArticle, RestrictedArticle, ArabicArticle. */

/* ---- Start rail: back link (or the restricted space's name) above the category's articles */
.article-rail__back {
    align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; gap: var(--sp-8); padding: 0 var(--sp-4);
    font-size: var(--fs-14); font-weight: 500; line-height: var(--lh-ui); text-decoration: none;
}
.article-rail__back:hover { text-decoration: underline; }
.article-rail__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); padding: 0 var(--sp-4); }
.article-rail__space { font: 800 var(--fs-18)/var(--lh-head) var(--font-head); color: var(--c-strong); }
.rail__link:has(.article-rail__en) { justify-content: space-between; gap: var(--sp-8); }
.article-rail__en {
    flex: none; padding: 2px 8px; border-radius: var(--r-badge); background: var(--c-subtle);
    font-size: var(--fs-12); font-weight: 500; line-height: var(--lh-ui); color: var(--c-muted);
}
.article-en-note { font-size: var(--fs-12); font-weight: 400; }

/* ---- Breadcrumb: the current page ends the trail. Its links are 44px tall on a 21px line: pull it in so the
   text and the card sit where the board has them. */
.article-crumb-current span { color: var(--c-strong); }
@media (min-width: 641px) {
    .article-page .docs-layout__main > .breadcrumb { margin-block: calc(-1 * var(--sp-12)); }
}

/* ---- The article card */
.article {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-card); box-shadow: var(--shadow-1);
    padding: var(--sp-40); display: flex; flex-direction: column; gap: var(--sp-40);
}
.article__head { display: flex; flex-direction: column; gap: var(--sp-24); }
.article__intro { display: flex; flex-direction: column; gap: var(--sp-12); }
.article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); }
.article__reviewed { font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-muted); }
.applies__area { font-weight: 400; color: var(--c-body); }

/* ---- Language notices: the fallback's second line, the English-original link */
.article-notice__more { font-size: var(--fs-14); color: var(--c-muted); }
.article-notice__original { font-family: Roboto, system-ui, sans-serif; font-size: var(--fs-14); font-weight: 500; }

/* ---- Restricted banner: "Why can I see this?" */
.article-private .notice__lead { flex: 1 1 320px; min-width: 0; }
.article-private__toggle {
    flex: none; height: 44px; display: inline-flex; align-items: center; gap: var(--sp-8); padding: 0 var(--sp-16);
    border: 1px solid var(--c-navy-border); border-radius: var(--r-control); background: transparent; color: #ffffff;
    font-size: var(--fs-14); font-weight: 500; line-height: var(--lh-ui);
}
.article-private__toggle[hidden] { display: none; }
.article-private__toggle .icon { transition: transform .15s; }
.article-private__toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.article-private__why .notice__reasons { margin-top: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-12) var(--sp-24); }
.article-private__host { font-family: var(--font-mono); font-size: var(--fs-13); color: #ffffff; unicode-bidi: isolate; }

/* ---- End column: related articles under "On this page" */
.article-related { display: flex; flex-direction: column; gap: var(--sp-8); }
.article-related .toc__title { padding-bottom: 0; }
.article-related__link { font-size: var(--fs-14); line-height: var(--lh-ui); text-decoration: none; }
.article-related__link:hover { text-decoration: underline; }
.article-related__space { color: var(--c-muted); }

/* ---- Phone menus ("In this section", "On this page"): hidden on wide screens */
.article-pop { display: none; position: relative; }
.article-pop__button {
    min-height: 48px; display: flex; align-items: center; gap: var(--sp-12); padding: 0 var(--sp-16); list-style: none; cursor: pointer;
    background: var(--c-surface); border: 1px solid var(--c-control); border-radius: var(--r-card);
    font-size: var(--fs-14); font-weight: 500; line-height: var(--lh-ui); color: var(--c-strong);
}
.article-pop__button::-webkit-details-marker { display: none; }
.article-pop__lead { color: var(--c-primary); flex: none; }
.article-pop__count { font-weight: 400; color: var(--c-muted); }
.article-pop__chevron { flex: none; margin-inline-start: auto; color: var(--c-muted); transition: transform .15s; }
.article-pop[open] .article-pop__chevron { transform: rotate(180deg); }
.article-pop--toc .article-pop__button { min-height: 44px; padding: 0 var(--sp-12); border-radius: var(--r-control); background: var(--c-ground); }
.article-pop__panel {
    position: absolute; top: calc(100% + var(--sp-8)); inset-inline: 0; z-index: 10; max-height: 70vh; overflow-y: auto;
    display: flex; flex-direction: column; padding: var(--sp-8);
    background: var(--c-surface); border: 1px solid var(--c-border-strong); border-radius: var(--r-card); box-shadow: var(--shadow-2);
}
.article-pop__panel .rail__link[aria-current="true"] {
    border-inline-start-color: var(--c-primary); border-start-start-radius: 0; border-end-start-radius: 0;
    background: var(--c-selected); font-weight: 700; color: var(--c-primary);
}
.article-pop__all {
    min-height: 44px; display: flex; align-items: center; gap: var(--sp-8); margin-top: var(--sp-4); padding: 0 var(--sp-12);
    border-top: 1px solid var(--c-border); font-size: var(--fs-14); font-weight: 500; text-decoration: none;
}

@media (max-width: 1023px) {
    .article-rail, .article-aside { display: none; }
    .article-pop { display: block; }
}
@media (max-width: 640px) {
    .article-page { padding-top: 0; }
    .article-page .docs-layout__main { gap: var(--sp-12); }
    /* The phone trail is the space and category only, as on the board. */
    .article-page .breadcrumb li:first-child, .article-page .breadcrumb .article-crumb-current { display: none; }
    .article-page .breadcrumb .article-crumb-category::after { content: none; }
    .article { padding: var(--sp-20) var(--sp-16); gap: var(--sp-32); }
    .article__intro { gap: var(--sp-8); }
    .article__reviewed { flex-basis: 100%; }
    .article-private__why .notice__reasons { grid-template-columns: minmax(0, 1fr); }
    .article-page .pager { gap: var(--sp-12); }
    .article-page .pager__link { padding: var(--sp-12) var(--sp-16); }
}

/* ---- "Did this solve your problem?" (board: Components "Article feedback"; partial content/partials/feedback).
   Ask row → green thanks line (Yes) or the "What was missing?" panel (No). The states the board doesn't draw
   (sent, already answered, too many, failed) reuse the status line in the notice colours. */
.feedback { display: flex; flex-direction: column; padding-top: var(--sp-24); border-top: 1px solid var(--c-border); }
.feedback [hidden] { display: none !important; }
.feedback__status:focus { outline: none; }
.feedback__status:focus-visible .feedback__msg { box-shadow: 0 0 0 2px var(--c-primary); }
.feedback__status:not(:empty) + form:not([hidden]) { margin-top: var(--sp-16); }
.feedback__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-12); }
.feedback__question { font-size: var(--fs-16); font-weight: 500; line-height: var(--lh-ui); color: var(--c-strong); }
.feedback__choices { display: flex; gap: var(--sp-12); }
.feedback__choice { min-width: 64px; }
.feedback form[aria-busy="true"] .btn { opacity: .6; cursor: progress; }
.feedback__msg {
    margin: 0; display: flex; align-items: flex-start; gap: var(--sp-8); padding: var(--sp-12) var(--sp-16); border-radius: var(--r-card);
    font-size: var(--fs-16); line-height: var(--lh-ui);
}
.feedback__msg .icon { flex: none; margin-top: 3px; }
.feedback__msg--success { background: var(--c-green-tint); color: var(--c-green); }
.feedback__msg--info { background: var(--c-info); color: var(--c-primary); }
.feedback__msg--warning { background: var(--c-amber-tint); color: var(--c-amber); }
.feedback__msg--error { background: var(--c-red-tint); color: var(--c-red); }
.feedback__panel {
    display: flex; flex-direction: column; gap: var(--sp-8); padding: var(--sp-16);
    background: var(--c-ground); border: 1px solid var(--c-border); border-radius: var(--r-card);
}
.feedback__panel .field textarea { font-size: var(--fs-16); color: var(--c-strong); }
.feedback__panel .help { margin: 0; }
.feedback__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-12); padding-top: var(--sp-4); }
.feedback__ticket { min-height: 44px; display: inline-flex; align-items: center; font-size: var(--fs-14); font-weight: 500; line-height: var(--lh-ui); text-decoration: underline; }
@media (max-width: 640px) {
    .feedback { padding-top: var(--sp-16); }
    .feedback__row { flex-direction: column; align-items: stretch; gap: var(--sp-8); }
    .feedback__choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feedback__actions .btn { flex: 1 1 100%; }
}
