/*
 * News list, article and download pages. Loaded through the layout's Head section; it builds on the components of
 * site.css (.section, .wrap, .tabs, .list-rows, .pill, .pager, .btn). The rendered article body (.news-body) is also
 * used by the preview page. No inline styles anywhere: the CSP forbids them.
 */

.news-empty {
    padding: 30px 10px;
    color: var(--c-muted);
    text-align: center;
}

/* ---- article ----------------------------------------------------------------------------------------------------- */

.news-detail {
    display: grid;
    grid-template-columns: minmax(0, 9fr) minmax(0, 3fr);
    gap: 60px;
    align-items: start;
}

.news-article__head {
    margin: 0 0 20px;
    padding: 0 0 8px;
    border-bottom: 1px solid #d1d1d1;
}

.news-article__title {
    margin: 0 0 15px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
}

.news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.news-meta__time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text);
    font-size: 12px;
}

.news-meta__time .icon {
    font-size: 13px;
}

.news-article > .btn-wrap {
    margin: 60px 0 0;
    text-align: left;
}

/* Side box: a gradient plate with the article's category over a bordered list of the categories. */
.news-side {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    max-width: 320px;
}

.news-side__plate {
    position: relative;
    padding: 13px 0;
    background: linear-gradient(180deg, #181818, #696969);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.news-side__plate::after {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid #fff;
    pointer-events: none;
}

.news-side__list {
    border: 1px solid #c6c2b4;
    background: var(--c-surface);
}

.news-side__list a {
    display: block;
    padding: 10px 0;
    color: #000;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.news-side__list a:hover,
.news-side__list a:focus-visible,
.news-side__list .is-current a {
    background: #ad9e67;
    color: #fff;
}

@media (max-width: 991.98px) {
    .news-detail {
        grid-template-columns: minmax(0, 1fr);
        gap: 48px;
    }

    .news-side {
        position: static;
        max-width: none;
    }

    .news-side__list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 767.98px) {
    .news-article__title {
        font-size: 20px;
    }

    .news-article > .btn-wrap {
        margin-top: 40px;
    }
}

/* The rendered Markdown of an article (and of the preview page). */
.news-body {
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.news-body > :last-child {
    margin-bottom: 0;
}

.news-body p {
    margin: 0 0 1em;
}

.news-body h2,
.news-body h3,
.news-body h4,
.news-body h5,
.news-body h6 {
    margin: 1.6em 0 0.6em;
    line-height: 1.4;
}

.news-body > :first-child {
    margin-top: 0;
}

.news-body h2 { font-size: 20px; }

/*
 * An operator's "##" (h3 here: the renderer moves headings one level down) is the article's section heading, a
 * full-width orange band with white text like the section bars of the Japanese official site's articles. White on
 * #ef6c00 is 3.1:1, enough for 20px bold text.
 */
.news-body h3 {
    padding: 6px 16px;
    background: #ef6c00;
    color: #fff;
    font-size: 20px;
}

.news-body h4,
.news-body h5,
.news-body h6 { font-size: 16px; }

.news-body a {
    text-decoration: underline;
}

.news-body ul,
.news-body ol {
    margin: 0 0 1em;
    padding: 0 0 0 24px;
}

.news-body ul li { list-style: disc; }
.news-body ol li { list-style: decimal; }

.news-body img {
    max-width: 100%;
    height: auto;
}

.news-body hr {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid var(--c-rule-soft);
}

.news-body blockquote {
    margin: 0 0 1em;
    padding: 8px 16px;
    border-left: 4px solid var(--c-rule-soft);
    background: var(--c-th);
    color: #555;
}

.news-body blockquote p:last-child {
    margin-bottom: 0;
}

.news-body pre {
    margin: 0 0 1em;
    padding: 12px 16px;
    overflow: auto;
    background: #1e1e1e;
    color: #e8e8e8;
    font-size: 13px;
    line-height: 1.5;
}

.news-body code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.news-body :not(pre) > code {
    padding: 1px 4px;
    border-radius: 2px;
    background: #eceff1;
}

.news-body table {
    display: block;
    max-width: 100%;
    margin: 0 0 1em;
    overflow-x: auto;
    border-collapse: collapse;
}

.news-body th,
.news-body td {
    padding: 8px 12px;
    border: 1px solid var(--c-rule-soft);
    text-align: left;
}

.news-body th {
    background: var(--c-th);
}

/* ---- download page ----------------------------------------------------------------------------------------------- */

.download-panel {
    text-align: center;
}

.download-panel__lead {
    max-width: 40em;
    margin: 0 auto;
    font-size: 18px;
}

.download-panel__action {
    margin: 40px 0 0;
}

/* The "install before you play" box under the launcher button: one row per Microsoft component. */
.download-notice {
    margin: 56px 0 0;
    padding: 35px 30px;
    background: var(--c-th);
    text-align: left;
}

.download-notice__title {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 0 12px;
    font-size: 19px;
    font-weight: 700;
}

.download-notice__title::before {
    content: "";
    flex: 0 0 auto;
    width: 20px;
    height: 19px;
    background-color: currentColor;
    -webkit-mask: url("../img/ui/warning.svg") center / contain no-repeat;
    mask: url("../img/ui/warning.svg") center / contain no-repeat;
}

.download-notice__lead {
    margin: 0 0 20px;
    color: #444;
    font-size: 17px;
}

.download-notice__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.download-notice__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 24px;
    row-gap: 4px;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid var(--c-rule-soft);
}

.download-notice__name {
    grid-column: 1;
    font-size: 17px;
    font-weight: 700;
}

.download-notice__note {
    grid-column: 1;
    color: #444;
    font-size: 15px;
}

.download-notice__link {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 40px;
    padding: 0 20px;
    font-size: 15px;
}

@media (max-width: 767.98px) {
    .download-notice {
        padding: 24px 18px;
    }

    .download-notice__item {
        grid-template-columns: minmax(0, 1fr);
    }

    .download-notice__link {
        grid-column: 1;
        grid-row: auto;
        margin-top: 8px;
        justify-self: start;
    }
}
