/* ==========================================================================
   Modern GitHub (Primer) Styling for Redmine Wiki
   - Type-only version (No Container/Card style)
   ========================================================================== */

/* 1. Base Typography (Directly apply to .wiki) */
.wiki {
    /* Exclude "Noto Sans" to avoid Redmine's limited font weights (missing 600) */
    /* Prioritize system fonts to ensure semi-bold (600) renders correctly */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    color: #1f2328;
    /* Modern Dark Gray */
    /* Removed container styles (border, padding, etc.) per user request */
}

/* Removed *:first-child margin reset to prevent button overlapping issues */

/* 2. Headings */
.wiki h1,
.wiki h2,
.wiki h3,
.wiki h4,
.wiki h5,
.wiki h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    /* GitHub uses 600, not 700/bold */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    /* Force overwrite Redmine's global Heading font-family */
    line-height: 1.25;
    color: #1f2328;
}

.wiki h1 {
    font-size: 2em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #d1d9e0;
}

.wiki h2 {
    font-size: 1.5em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #d1d9e0;
}

.wiki h3 {
    font-size: 1.25em;
}

.wiki h4 {
    font-size: 1em;
}

.wiki h5 {
    font-size: 0.875em;
}

.wiki h6 {
    font-size: 0.85em;
    color: #57606a;
}

/* 3. Links */
.wiki a {
    color: #0969da;
    text-decoration: none;
}

.wiki a:hover {
    text-decoration: underline;
}

/* 4. Block Elements */
.wiki p,
.wiki blockquote,
.wiki ul,
.wiki ol,
.wiki dl,
.wiki table,
.wiki pre {
    margin-top: 0;
    margin-bottom: 16px;
}

.wiki ul,
.wiki ol {
    padding-left: 2em;
}

/* 5. Horizontal Rule */
.wiki hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #d1d9e0;
    border: 0;
}

/* 6. Blockquotes */
.wiki blockquote {
    padding: 0 1em;
    color: #57606a;
    border-left: 0.25em solid #d1d9e0;
}

/* 7. Code Blocks */
.wiki code,
.wiki tt {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    /* Ensure monospace stack is correct */
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    background-color: rgba(175, 184, 193, 0.2);
    border-radius: 6px;
}

div.wiki pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 6px;
    border: none;
}

div.wiki pre code {
    display: inline;
    padding: 0;
    margin: 0;
    overflow: visible;
    line-height: inherit;
    word-wrap: normal;
    background-color: transparent;
    border: 0;
    font-size: 100%;
}

/* 8. Tables */
.wiki table {
    border-spacing: 0;
    border-collapse: collapse;
    display: block;
    width: max-content;
    max-width: 100%;
    overflow: auto;
}

.wiki table th,
.wiki table td {
    padding: 6px 13px;
    border: 1px solid #d1d9e0;
}

.wiki table th {
    font-weight: 600;
    background-color: #f6f8fa;
}

.wiki table tr {
    background-color: #ffffff;
    border-top: 1px solid #d1d9e0;
}

.wiki table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

/* 9. Images */
.wiki img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: transparent;
}

/* 10. Task Lists */
.wiki ul.task-list-item {
    list-style-type: none;
}

.wiki input[type="checkbox"] {
    margin: 0 0.2em 0.25em -1.6em;
    vertical-align: middle;
}