/*
Theme Name: NewsPedia
Theme URI: https://ebot.my.id
Author: Rifan Muazin
Author URI: https://ebot.my.id
Description: A Wikipedia-inspired news theme for WordPress. Faithfully replicates the Wikipedia Vector 2022 skin layout for a premium news reading experience.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: newspedia
Tags: news, blog, wikipedia, responsive, custom-menu, custom-logo, two-columns, three-columns, left-sidebar, right-sidebar
*/

/* ========================================================
   CSS CUSTOM PROPERTIES (Wikipedia Color System)
   ======================================================== */
:root {
    /* Base colors */
    --color-base: #202122;
    --color-subtle: #54595d;
    --color-neutral: #404244;
    --color-placeholder: #72777d;
    --color-disabled: #a2a9b1;

    /* Background colors */
    --background-color-base: #fff;
    --background-color-interactive-subtle: #f8f9fa;
    --background-color-interactive: #eaecf0;
    --background-color-progressive: #3366cc;
    --background-color-progressive--hover: #3056a9;
    --background-color-progressive--active: #233566;

    /* Border colors */
    --border-color-base: #a2a9b1;
    --border-color-subtle: #c8ccd1;
    --border-color-muted: #dadde3;
    --border-color-interactive: #72777d;
    --border-color-progressive: #3366cc;

    /* Link colors */
    --color-link: #3366cc;
    --color-link--visited: #6b4ba1;
    --color-link--new: #ba0000;

    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Linux Libertine', Georgia, Times, serif;
    --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-family-mono: 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
    --font-size-small: 0.875rem;
    --font-size-medium: 1rem;
    --font-size-large: 1.125rem;
    --font-size-x-large: 1.25rem;
    --line-height-small: 1.375rem;
    --line-height-medium: 1.625rem;

    /* Main page panel colors */
    --mp-left-bg: #f5fffa;
    --mp-left-border: #cef2e0;
    --mp-left-h2-bg: #cef2e0;
    --mp-left-h2-border: #a3bfb1;

    --mp-right-bg: #f5faff;
    --mp-right-border: #cedff2;
    --mp-right-h2-bg: #cedff2;
    --mp-right-h2-border: #a3b0bf;

    --mp-middle-bg: #fff5fa;
    --mp-middle-border: #f2cedd;
    --mp-middle-h2-bg: #f2cedd;
    --mp-middle-h2-border: #bfa3af;

    --mp-lower-bg: #faf5ff;
    --mp-lower-border: #ddcef2;
    --mp-lower-h2-bg: #ddcef2;
    --mp-lower-h2-border: #afa3bf;

    --mp-bottom-border: #e2e2e2;
    --mp-bottom-h2-bg: #eee;
    --mp-bottom-h2-border: #ddd;

    --mp-topbanner-bg: #f9f9f9;
    --mp-topbanner-border: #ddd;

    /* Layout */
    --content-max-width: 1240px;
    --sidebar-width: 200px;
    --sidebar-right-width: 170px;
    --header-height: 57px;
}

/* ========================================================
   DARK MODE — html.theme-dark
   Activated by JS when user selects "Dark" or "Auto" (system dark)
   ======================================================== */
/* ========================================================
   DARK MODE — html.theme-dark (Authentic Wikipedia Dark Mode)
   Activated by JS when user selects "Dark" or "Auto" (system dark)
   ======================================================== */
html.theme-dark {
    --color-base: #f0f2f5;
    --color-subtle: #a2a9b1;
    --color-neutral: #c8ccd1;
    --color-placeholder: #8b949e;
    --color-disabled: #6e7681;

    --background-color-base: #101418;
    --background-color-interactive-subtle: #181d22;
    --background-color-interactive: #252b32;
    --background-color-progressive: #448aff;
    --background-color-progressive--hover: #6596f5;
    --background-color-progressive--active: #2962ff;

    --border-color-base: #3a414a;
    --border-color-subtle: #2e353d;
    --border-color-muted: #242a32;
    --border-color-interactive: #545d68;
    --border-color-progressive: #448aff;

    --color-link: #6596f5;
    --color-link--visited: #b07aff;
    --color-link--new: #ff6b6b;

    /* Main page panels - high contrast darkened versions */
    --mp-left-bg: #0c1a12;
    --mp-left-border: #1a3826;
    --mp-left-h2-bg: #12281c;
    --mp-left-h2-border: #1a3826;

    --mp-right-bg: #0c1524;
    --mp-right-border: #192b45;
    --mp-right-h2-bg: #121e33;
    --mp-right-h2-border: #192b45;

    --mp-middle-bg: #200e12;
    --mp-middle-border: #3d1b22;
    --mp-middle-h2-bg: #2c141a;
    --mp-middle-h2-border: #3d1b22;

    --mp-lower-bg: #160e22;
    --mp-lower-border: #2c1a42;
    --mp-lower-h2-bg: #201431;
    --mp-lower-h2-border: #2c1a42;

    --mp-bottom-border: #2e353d;
    --mp-bottom-h2-bg: #181d22;
    --mp-bottom-h2-border: #2e353d;

    --mp-topbanner-bg: #181d22;
    --mp-topbanner-border: #2e353d;
}

html.theme-dark body {
    color: #f0f2f5;
    background-color: #101418;
    background-image: linear-gradient(to bottom, #181d22 0, #181d22 57px, #101418 57px);
}

html.theme-dark h1,
html.theme-dark h2,
html.theme-dark h3,
html.theme-dark h4,
html.theme-dark h5,
html.theme-dark h6,
html.theme-dark #firstHeading,
html.theme-dark .mw-logo-wordmark,
html.theme-dark .mp-h2,
html.theme-dark .comments-title,
html.theme-dark .np-search-result-title a,
html.theme-dark .np-archive-title a {
    color: #ffffff !important;
}

html.theme-dark a {
    color: #6596f5;
}

html.theme-dark a:hover {
    color: #8bb2ff;
}

html.theme-dark #mw-header-container {
    background: #181d22;
    border-bottom-color: #2e353d;
}

html.theme-dark .cdx-search-input {
    background: #101418;
    border-color: #3a414a;
}

html.theme-dark .cdx-text-input__input {
    background: transparent;
    color: #f0f2f5;
}

html.theme-dark .cdx-text-input__input::placeholder {
    color: #8b949e;
}

html.theme-dark .cdx-search-input__end-button,
html.theme-dark .cdx-button--framed {
    background: #252b32;
    border-color: #3a414a;
    color: #f0f2f5;
}

html.theme-dark .cdx-search-input__end-button:hover {
    background: #313842;
}

html.theme-dark .np-search-dropdown {
    background: #181d22;
    border-color: #3a414a;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

html.theme-dark .np-search-item {
    border-bottom-color: #242a32;
    color: #f0f2f5;
}

html.theme-dark .np-search-item:hover,
html.theme-dark .np-search-item.np-selected {
    background: #252b32;
}

html.theme-dark .np-search-item-title {
    color: #ffffff;
}

html.theme-dark .np-search-mark {
    background: #5d4200;
    color: #ffe066;
}

html.theme-dark .np-search-cat-badge {
    background: #252b32;
    border-color: #3a414a;
    color: #6596f5;
}

html.theme-dark .np-search-footer-link {
    background: #101418;
    border-top-color: #2e353d;
    color: #6596f5;
}

html.theme-dark .np-search-footer-link:hover {
    background: #181d22;
}

html.theme-dark .vector-appearance,
html.theme-dark .vector-menu {
    background: #181d22;
    border-color: #2e353d;
}

html.theme-dark .vector-menu-heading {
    border-bottom-color: #2e353d;
    color: #ffffff;
}

html.theme-dark .mp-box {
    border-color: #2e353d;
    color: #f0f2f5;
}

html.theme-dark #mp-welcome {
    color: #ffffff;
}

html.theme-dark #mp-itn li,
html.theme-dark #mp-dyk li,
html.theme-dark #mp-otd li {
    color: #e6edf3;
    border-bottom-color: #242a32;
}

html.theme-dark .mw-parser-output,
html.theme-dark .entry-content,
html.theme-dark .article-body,
html.theme-dark .comment-content {
    color: #e6edf3;
}

html.theme-dark #siteSub,
html.theme-dark .np-meta-item,
html.theme-dark .np-infobox-caption,
html.theme-dark .np-search-result-meta,
html.theme-dark .np-archive-meta,
html.theme-dark .comment-metadata,
html.theme-dark .comment-metadata a,
html.theme-dark .np-comments-subtitle,
html.theme-dark .thumbcaption,
html.theme-dark .np-breadcrumbs,
html.theme-dark .mw-logo-tagline,
html.theme-dark .tag-count {
    color: #a2a9b1 !important;
}

html.theme-dark .mp-sister-project {
    background: #181d22;
    border-color: #2e3338;
    color: #f0f2f5;
}

html.theme-dark .mp-sister-project:hover {
    background: #252b32;
}

html.theme-dark .np-category-badge {
    background: #252b32;
    border-color: #3a414a;
    color: #6596f5;
}

html.theme-dark .np-article-meta {
    background: #181d22;
    border-color: #2e353d;
}

html.theme-dark .np-infobox {
    background: #181d22;
    border-color: #2e353d;
}

html.theme-dark .thumbinner {
    background-color: #181d22;
    border-color: #2e353d;
    color: #a2a9b1;
}

html.theme-dark .np-references,
html.theme-dark .np-related-post {
    background: #181d22;
    border-color: #2e353d;
}

html.theme-dark .footer-places a,
html.theme-dark .vector-menu-content-list a {
    color: #6596f5;
}

html.theme-dark #footer {
    background: #181d22;
    border-top-color: #2e353d;
}

/* ========================================================
   TEXT SIZE CLASSES — Applied to <html> by JS
   ======================================================== */
html.textsize-small {
    font-size: 14px;
    --font-size-small: 0.8rem;
    --font-size-medium: 0.875rem;
    --font-size-large: 1rem;
    --font-size-x-large: 1.15rem;
}

html.textsize-standard {
    font-size: 16px;
    --font-size-small: 0.875rem;
    --font-size-medium: 1rem;
    --font-size-large: 1.125rem;
    --font-size-x-large: 1.25rem;
}

html.textsize-large {
    font-size: 18px;
    --font-size-small: 0.95rem;
    --font-size-medium: 1.125rem;
    --font-size-large: 1.25rem;
    --font-size-x-large: 1.4rem;
}

/* ========================================================
   PAGE WIDTH CLASSES — Applied to <html> by JS
   ======================================================== */
html.pagewidth-wide {
    --content-max-width: 100%;
}

html.pagewidth-wide .mw-page-container,
html.pagewidth-wide .vector-header,
html.pagewidth-wide .vector-page-toolbar-container,
html.pagewidth-wide .footer-inner {
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}

html.pagewidth-standard .mw-page-container {
    max-width: var(--content-max-width);
}

/* ========================================================
   CDX SEARCH INPUT & AUTOCOMPLETE DROPDOWN — Wikipedia Vector 2022
   ======================================================== */
.vector-search-box {
    flex: 1 1 600px;
    max-width: 680px;
    position: relative;
}

.cdx-search-input {
    display: flex;
    align-items: stretch;
    width: 100%;
    position: relative;
    border: 1px solid var(--border-color-interactive);
    border-radius: 2px;
    background: var(--background-color-base);
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    overflow: hidden;
}

.cdx-search-input:focus-within {
    border-color: var(--border-color-progressive);
    box-shadow: inset 0 0 0 1px var(--border-color-progressive);
}

.cdx-search-input__input-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.cdx-text-input {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.cdx-text-input--has-start-icon .cdx-text-input__input {
    padding-left: 2.3rem;
    padding-right: 2.2rem;
}

.cdx-text-input__input {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 2px 0 0 2px;
    padding: 0.4rem 0.6rem;
    font-size: var(--font-size-medium);
    font-family: inherit;
    background: transparent;
    color: var(--color-base);
    outline: none;
    -webkit-appearance: none;
}

.cdx-text-input__input::placeholder {
    color: var(--color-placeholder);
    opacity: 0.85;
}

/* Remove native search ✕ button on WebKit */
.cdx-text-input__input::-webkit-search-cancel-button {
    display: none;
}

.cdx-text-input__icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-placeholder);
}

.cdx-text-input__start-icon {
    left: 0.6rem;
    width: 1.2rem;
    pointer-events: none;
}

.cdx-text-input__end-icon {
    right: 0.4rem;
    width: 1.4rem;
}

/* Clear button */
.cdx-search-clear {
    pointer-events: all;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 3px;
    color: var(--color-placeholder);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s;
}

.cdx-search-clear:hover {
    background: var(--background-color-interactive);
    color: var(--color-base);
}

/* CDX Search end-button (Wikipedia style) */
.cdx-search-input__end-button,
.cdx-button--framed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0 1.1rem;
    height: 36px;
    border: none;
    border-left: 1px solid var(--border-color-subtle);
    border-radius: 0 2px 2px 0;
    background: var(--background-color-interactive-subtle);
    color: var(--color-base);
    font-size: var(--font-size-small);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    flex-shrink: 0;
}

.cdx-search-input__end-button:hover {
    background: var(--background-color-interactive);
}

.cdx-button__icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* Focus — handled at .cdx-search-input level above */

/* LIVE SEARCH DROPDOWN AUTOCOMPLETE */
.np-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--background-color-base);
    border: 1px solid var(--border-color-subtle);
    border-radius: 4px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.18), 0 1px 4px rgba(0,0,0,0.10);
    z-index: 9000;
    overflow: hidden;
    max-height: 440px;
    overflow-y: auto;
    font-family: var(--font-family-sans);
}

.np-search-results-list {
    display: flex;
    flex-direction: column;
}

.np-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--border-color-muted);
    color: var(--color-base);
    text-decoration: none;
    transition: background .1s;
    cursor: pointer;
}

.np-search-item:last-child {
    border-bottom: none;
}

.np-search-item:hover,
.np-search-item.np-selected {
    background: var(--background-color-interactive);
    text-decoration: none;
}

.np-search-item-thumb {
    width: 44px;
    height: 44px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--background-color-interactive-subtle);
    border: 1px solid var(--border-color-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.np-search-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.np-search-thumb-fallback {
    font-size: 1.25rem;
}

.np-search-item-details {
    flex: 1;
    min-width: 0;
}

.np-search-item-title {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-base);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-search-mark {
    background: #fff3c4;
    color: #101418;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
}

.np-search-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-subtle);
}

.np-search-cat-badge {
    display: inline-block;
    padding: 1px 5px;
    background: var(--background-color-interactive-subtle);
    border: 1px solid var(--border-color-subtle);
    border-radius: 2px;
    color: var(--color-link);
    font-size: 0.72rem;
    font-weight: 500;
}

.np-search-date {
    color: var(--color-subtle);
}

.np-search-footer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.8rem;
    background: var(--background-color-interactive-subtle);
    border-top: 1px solid var(--border-color-subtle);
    color: var(--color-link);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
}

.np-search-footer-link:hover {
    background: var(--background-color-interactive);
    text-decoration: none;
}

.np-search-count {
    color: var(--color-subtle);
    font-size: 0.8rem;
    font-weight: normal;
}

.np-search-empty,
.np-search-loading {
    padding: 1rem;
    text-align: center;
    color: var(--color-subtle);
    font-size: 0.88rem;
}

.np-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color-subtle);
    border-top-color: var(--color-link);
    border-radius: 50%;
    animation: np-spin .6s linear infinite;
    vertical-align: middle;
    margin-right: 0.4rem;
}

@keyframes np-spin {
    to { transform: rotate(360deg); }
}

/* ========================================================
   APPEARANCE PANEL CARD — Wikipedia vector style
   ======================================================== */
.vector-appearance,
.cdx-card {
    background: var(--background-color-base);
    border: 1px solid var(--border-color-subtle);
    border-radius: 4px;
    padding: 0.75em 0.8em;
    margin-bottom: 0.75em;
    font-size: var(--font-size-small);
    font-family: var(--font-family-sans);
}

.np-appearance-header {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.6em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid var(--border-color-subtle);
}

.np-appearance-section {
    margin-bottom: 0.8em;
}

.np-appearance-label {
    font-size: 0.78rem;
    font-weight: bold;
    color: var(--color-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4em;
}

.np-appearance-row {
    display: flex;
    gap: 0.3em;
}

.np-appearance-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25em;
    padding: 0.4em 0.2em;
    border: 1px solid var(--border-color-subtle);
    border-radius: 4px;
    background: var(--background-color-base);
    color: var(--color-base);
    cursor: pointer;
    font-size: 0.72rem;
    font-family: inherit;
    transition: background .1s, border-color .1s, box-shadow .1s;
    min-width: 0;
    position: relative;
}

.np-appearance-btn:hover {
    background: var(--background-color-interactive-subtle);
    border-color: var(--border-color-interactive);
}

/* Active / selected state */
.np-appearance-btn.np-active {
    border-color: var(--border-color-progressive);
    box-shadow: 0 0 0 1px var(--border-color-progressive);
    background: color-mix(in srgb, var(--border-color-progressive) 10%, var(--background-color-base));
}

.np-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-base);
    min-height: 20px;
}

.np-btn-label {
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: center;
    color: var(--color-subtle);
}

.np-appearance-btn.np-active .np-btn-label {
    color: var(--color-link);
}

/* Dark mode compatibility for appearance panel */
html.theme-dark .np-appearance-btn {
    background: #181d22;
    border-color: #2e353d;
    color: #f0f2f5;
}

html.theme-dark .np-appearance-btn:hover {
    background: #252b32;
}

html.theme-dark .np-appearance-btn.np-active {
    border-color: #6596f5;
    box-shadow: 0 0 0 1px #6596f5;
    background: rgba(101,150,245,0.12);
}

html.theme-dark .np-btn-label {
    color: #a2a9b1;
}

html.theme-dark .np-appearance-btn.np-active .np-btn-label {
    color: #6596f5;
}

html.theme-dark .np-btn-icon {
    color: #f0f2f5;
}

html.theme-dark .vector-appearance,
html.theme-dark .cdx-card {
    background: #181d22;
    border-color: #2e353d;
    color: #f0f2f5;
}

html.theme-dark .np-appearance-header {
    border-bottom-color: #2e353d;
}

html.theme-dark .np-appearance-label {
    color: #a2a9b1;
}

/* ========================================================
   RESET & BASE — Authentic Wikipedia Typography & Layout
   ======================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-sans);
    font-size: var(--font-size-medium);
    line-height: var(--line-height-medium);
    color: var(--color-base);
    background-color: var(--background-color-base);
    background-image: linear-gradient(to bottom, #eaecf0 0, #eaecf0 57px, #fff 57px);
    background-repeat: no-repeat;
}

/* Wikipedia body content uses serif for article text */
.mw-parser-output, .entry-content, .article-body {
    font-family: var(--font-family-base);
    font-size: 0.9375rem;
    line-height: 1.65;
}

a {
    color: var(--color-link);
    text-decoration: none;
}
a:visited { color: var(--color-link--visited); }
a:hover { text-decoration: underline; }
a.new { color: var(--color-link--new); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-base);
    font-weight: normal;
    margin: 0 0 0.25em;
    line-height: 1.3;
}

p { margin: 0 0 0.8em; }
ul, ol { margin: 0.3em 0 0 1.6em; padding: 0; }
li { margin-bottom: 0.1em; }

/* Robust Image Responsiveness Guarantee */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.thumbinner,
.mp-thumb,
.np-infobox,
.np-search-thumb,
.np-archive-thumb,
#mp-tfp-img {
    box-sizing: border-box;
}

.thumbinner img,
.mp-thumb img,
.np-infobox img,
.np-search-thumb img,
.np-archive-thumb img,
#mp-tfp-img img,
.entry-content img,
.article-body img,
.mw-parser-output img {
    max-width: 100%;
    height: auto;
}

/* ========================================================
   HEADER — Wikipedia Vector 2022 Style
   ======================================================== */
#mw-header-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--border-color-subtle);
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    transition: box-shadow .2s;
}

#mw-header-container.is-sticky {
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.vector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 1rem;
    height: 57px;
    gap: 1.2rem;
}

.vector-header-start {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.mw-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.mw-logo-icon {
    width: auto;
    max-width: 250px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}

.mw-logo-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mw-logo-wordmark {
    font-family: var(--font-family-base);
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--color-base);
    letter-spacing: -0.01em;
    line-height: 1;
    display: block;
}

.mw-logo-tagline {
    font-size: 0.65rem;
    color: var(--color-subtle);
    letter-spacing: 0.02em;
    display: block;
    margin-top: 2px;
}

/* Header User Links */
.vector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 1rem;
    gap: 1rem;
}

.vector-header-start {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

.vector-header-end {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    flex-shrink: 0;
}

.vector-user-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.vector-user-link {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.5rem;
    border-radius: 2px;
    font-size: var(--font-size-small);
    color: var(--color-base);
    text-decoration: none;
    white-space: nowrap;
    transition: background .1s;
}

.vector-user-link:hover {
    background: var(--background-color-interactive-subtle);
    text-decoration: none;
}

/* Mobile menu toggle */
.vector-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color-subtle);
    border-radius: 2px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-base);
    line-height: 1;
}

/* ========================================================
   PAGE TABS (Wikipedia-style Read / Edit / History)
   ======================================================== */
.vector-page-toolbar {
    background: var(--background-color-base);
    border-bottom: 1px solid var(--border-color-subtle);
    padding: 0;
}

.vector-page-toolbar-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
}

.vector-menu-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.vector-menu-tabs li {
    margin: 0;
}

.vector-menu-tabs a {
    display: block;
    padding: 0.4rem 0.8rem;
    font-size: var(--font-size-small);
    color: var(--color-base);
    border-bottom: 2px solid transparent;
    transition: border-color .1s;
    text-decoration: none;
}

.vector-menu-tabs li.selected a,
.vector-menu-tabs a:hover {
    border-bottom-color: var(--border-color-progressive);
    text-decoration: none;
}

/* ========================================================
   LAYOUT: Page Container
   ======================================================== */
.mw-page-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.mw-page-container-inner {
    display: flex;
    gap: 1rem;
    padding-top: 0.5rem;
}

/* Layout variants */

/* Three-column: left sidebar + content + right sidebar (Single posts/pages) */
.layout-three-col .vector-column-start {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

.layout-three-col .mw-content-container {
    flex: 1;
    min-width: 0;
}

.layout-three-col .vector-column-end {
    width: var(--sidebar-right-width);
    flex-shrink: 0;
}

/* Right-only: content (wide) + right sidebar (Front page — like Wikipedia Main Page) */
.layout-right-only .mw-content-container {
    flex: 1;
    min-width: 0;
}

.layout-right-only .vector-column-end {
    width: 185px;        /* slightly wider for front page appearance panel */
    flex-shrink: 0;
}

/* Full-width: content only (search, archive, other pages) */
.layout-full .mw-content-container {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

/* Left column (sidebar) */
.vector-column-start {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

/* Main content area */
.mw-content-container {
    flex: 1;
    min-width: 0;
}

/* Right column (toolbox) */
.vector-column-end {
    width: var(--sidebar-right-width);
    flex-shrink: 0;
}


/* ========================================================
   LEFT SIDEBAR — Wikipedia Navigation Panels
   ======================================================== */
#mw-panel {
    padding-top: 0.5rem;
}

.vector-menu {
    margin-bottom: 0.75rem;
}

.vector-menu-heading {
    padding: 0.3rem 0.5rem;
    font-size: var(--font-size-small);
    font-weight: bold;
    color: var(--color-base);
    border-bottom: 1px solid var(--border-color-subtle);
    margin-bottom: 0.1rem;
}

.vector-menu-content-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vector-menu-content-list li {
    margin: 0;
}

.vector-menu-content-list a {
    display: block;
    padding: 0.2rem 0.5rem;
    font-size: var(--font-size-small);
    color: var(--color-link);
    text-decoration: none;
    transition: background .1s;
}

.vector-menu-content-list a:hover {
    background: var(--background-color-interactive-subtle);
    text-decoration: none;
}

/* ========================================================
   RIGHT SIDEBAR — Toolbox Panel
   ======================================================== */
.vector-sticky-pinned-container {
    position: sticky;
    top: 70px;
}

.vector-appearance {
    background: var(--background-color-interactive-subtle);
    border: 1px solid var(--border-color-subtle);
    border-radius: 2px;
    padding: 0.5rem;
    font-size: var(--font-size-small);
}

.vector-appearance h3 {
    font-size: var(--font-size-small);
    font-weight: bold;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-color-subtle);
}

/* ========================================================
   MAIN CONTENT — Body Content
   ======================================================== */
#content.mw-body {
    padding: 0;
}

.mw-body-header {
    padding: 0.5rem 0;
}

#firstHeading {
    font-family: var(--font-family-base);
    font-size: 1.95em;
    font-weight: normal;
    border-bottom: 1px solid var(--border-color-subtle);
    padding-bottom: 0.25em;
    margin-bottom: 0.5em;
    line-height: 1.2;
    color: var(--color-base);
}

#siteSub {
    font-size: var(--font-size-small);
    color: var(--color-subtle);
    margin-bottom: 0.5rem;
    display: none;
}

/* ========================================================
   WIKIPEDIA MAIN PAGE SECTIONS
   ======================================================== */
.mp-box {
    border: 1px solid #aaa;
    padding: 0 0.5em 0.5em;
    margin-top: 4px;
}

.mp-h2, body .mp-h2 {
    border: 1px solid #aaa;
    margin: 0.5em 0;
    padding: 0.2em 0.4em;
    font-size: 120%;
    font-weight: bold;
    font-family: var(--font-family-base);
    color: var(--color-base);
}

/* Top banner */
#mp-topbanner {
    background-color: var(--mp-topbanner-bg);
    border-color: var(--mp-topbanner-border);
}

#mp-welcomecount {
    text-align: center;
    margin: 0.4em;
}

#mp-welcome {
    font-size: 162%;
    padding: 0.1em;
    font-family: var(--font-family-base);
}

#mp-welcome h1 {
    font-size: inherit;
    font-family: inherit;
    display: inline;
    border: none;
    padding: 0;
    font-weight: normal;
}

#mp-free { font-size: 95%; }

#articlecount {
    font-size: 85%;
}

#articlecount > ul {
    margin: 0;
    padding: 0;
}

#articlecount > ul > li {
    margin: 0;
    display: inline;
}

#articlecount > ul > li::after {
    content: " · ";
    font-weight: bold;
}

#articlecount > ul > li:last-child::after {
    content: "";
}

/* Upper section: featured + news (2 column flex) */
#mp-upper {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

#mp-left {
    flex: 1 1 55%;
    background-color: var(--mp-left-bg);
    border-color: var(--mp-left-border);
}

#mp-left .mp-h2 {
    background-color: var(--mp-left-h2-bg);
    border-color: var(--mp-left-h2-border);
}

#mp-right {
    flex: 1 1 45%;
    background-color: var(--mp-right-bg);
    border-color: var(--mp-right-border);
}

#mp-right .mp-h2 {
    background-color: var(--mp-right-h2-bg);
    border-color: var(--mp-right-h2-border);
}

/* Middle section - Featured Picture */
#mp-middle {
    background-color: var(--mp-middle-bg);
    border-color: var(--mp-middle-border);
    margin-top: 4px;
}

#mp-middle .mp-h2 {
    background-color: var(--mp-middle-h2-bg);
    border-color: var(--mp-middle-h2-border);
}

/* Lower section - Other areas */
#mp-lower {
    background-color: var(--mp-lower-bg);
    border-color: var(--mp-lower-border);
    margin-top: 4px;
}

#mp-lower .mp-h2 {
    background-color: var(--mp-lower-h2-bg);
    border-color: var(--mp-lower-h2-border);
}

/* Bottom section - Categories */
#mp-bottom {
    border-color: var(--mp-bottom-border);
    margin-top: 4px;
}

#mp-bottom .mp-h2 {
    background-color: var(--mp-bottom-h2-bg);
    border-color: var(--mp-bottom-h2-border);
}

/* Float clearfix for main page content */
.mp-contains-float::after {
    content: "";
    display: block;
    clear: both;
}

/* ========================================================
   IN THE NEWS Section Styles
   ======================================================== */
.itn-img {
    float: right;
    margin-left: 0.5em;
    margin-top: 0.2em;
}

#mp-itn ul {
    margin-top: 0.3em;
}

#mp-itn li {
    margin-bottom: 0.4em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid var(--border-color-muted);
    font-size: 0.9rem;
}

#mp-itn li:last-child {
    border-bottom: none;
}

/* ========================================================
   DID YOU KNOW Section
   ======================================================== */
.dyk-img {
    float: right;
    margin-left: 0.5em;
}

#mp-dyk ul {
    margin-top: 0.3em;
}

#mp-dyk li {
    margin-bottom: 0.4em;
    font-size: 0.9rem;
}

/* ========================================================
   ON THIS DAY Section
   ======================================================== */
#mp-otd ul {
    margin-top: 0.3em;
}

#mp-otd li {
    margin-bottom: 0.4em;
    font-size: 0.9rem;
    padding-bottom: 0.3em;
    border-bottom: 1px dotted var(--border-color-muted);
}

#mp-otd li:last-child {
    border-bottom: none;
}

/* ========================================================
   FEATURED PICTURE (Today's featured article style)
   ======================================================== */
#mp-tfp {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

#mp-tfp-img {
    flex-shrink: 0;
}

#mp-tfp-img img {
    display: block;
    max-width: 250px;
    border: 1px solid var(--border-color-subtle);
}

#mp-tfp-text {
    flex: 1;
    min-width: 0;
}

/* ========================================================
   OTHER AREAS (Tags list)
   ======================================================== */
#mp-other-areas {
    columns: 2;
    column-gap: 2rem;
    padding: 0.5em;
}

#mp-other-areas ul {
    margin: 0;
    padding: 0;
    list-style: none;
    break-inside: avoid;
}

#mp-other-areas li {
    padding: 0.15em 0;
    font-size: 0.9rem;
    border-bottom: 1px dotted var(--border-color-muted);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

#mp-other-areas li a {
    font-weight: bold;
    color: var(--color-link);
}

#mp-other-areas .tag-count {
    color: var(--color-subtle);
    font-size: 0.8rem;
    margin-left: 0.5em;
}

/* ========================================================
   CATEGORIES SECTION (Sister projects style)
   ======================================================== */
#mp-sister {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    padding: 0.5em;
}

.mp-sister-project {
    display: flex;
    align-items: center;
    gap: 0.5em;
    border: 1px solid var(--border-color-subtle);
    border-radius: 2px;
    padding: 0.4em 0.7em;
    background: var(--background-color-interactive-subtle);
    min-width: 160px;
    flex: 1;
    text-decoration: none;
    color: var(--color-base);
    transition: background .1s;
}

.mp-sister-project:hover {
    background: var(--background-color-interactive);
    text-decoration: none;
}

.mp-sister-project-icon {
    font-size: 1.5rem;
    line-height: 1;
    width: 32px;
    text-align: center;
}

.mp-sister-project-name {
    font-weight: bold;
    font-size: 0.9rem;
    display: block;
    color: var(--color-link);
}

.mp-sister-project-desc {
    font-size: 0.75rem;
    color: var(--color-subtle);
    display: block;
}

/* ========================================================
   THUMBNAIL / THUMB BOXES (Wikipedia style)
   ======================================================== */
.mp-thumb {
    background: transparent;
    border: none;
    padding: 0;
}

.thumbinner {
    border: 1px solid var(--border-color-subtle);
    background-color: var(--background-color-interactive-subtle);
    font-size: 94%;
    padding: 3px;
    text-align: center;
}

.thumbcaption {
    text-align: start;
    line-height: 1.4em;
    padding: 3px;
    font-size: 0.85rem;
    color: var(--color-subtle);
}

/* ========================================================
   FOOTER LINKS (hlist style)
   ======================================================== */
.hlist ul, .hlist ol {
    margin: 0;
    padding: 0;
}

.hlist dd, .hlist dt, .hlist li {
    margin: 0;
    display: inline;
}

.hlist li::after {
    content: " · ";
    font-weight: bold;
}

.hlist li:last-child::after {
    content: "";
}

.tfa-footer, .dyk-footer, .itn-footer, .otd-footer {
    text-align: right;
    font-size: var(--font-size-small);
    margin-top: 0.5em;
}

.tfa-recent {
    text-align: right;
    font-size: var(--font-size-small);
    margin-top: 0.5em;
}

/* ========================================================
   SINGLE POST — Wikipedia Article Style
   ======================================================== */

/* Article metadata bar (like Wikipedia's categories bar) */
.np-article-meta {
    background: var(--background-color-interactive-subtle);
    border: 1px solid var(--border-color-subtle);
    padding: 0.5em 0.7em;
    font-size: var(--font-size-small);
    margin-bottom: 0.8em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: center;
}

.np-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25em;
    color: var(--color-subtle);
}

.np-meta-item strong {
    color: var(--color-base);
}

.np-meta-sep {
    color: var(--border-color-base);
}

/* Infobox / Thumbnail box (right-floated on single post) */
.np-infobox {
    float: right;
    clear: right;
    margin: 0 0 1em 1.5em;
    border: 1px solid var(--border-color-subtle);
    background: var(--background-color-interactive-subtle);
    padding: 3px;
    max-width: 300px;
    font-size: 88%;
    text-align: center;
}

.np-infobox img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border-color-subtle);
}

.np-infobox-caption {
    padding: 0.3em 0.5em;
    font-size: 0.85rem;
    color: var(--color-subtle);
    text-align: center;
    line-height: 1.3;
}

.np-infobox-meta {
    padding: 0.3em 0.5em;
    text-align: left;
    font-size: 0.85rem;
}

.np-infobox-meta table {
    width: 100%;
    border-collapse: collapse;
}

.np-infobox-meta td {
    padding: 0.2em;
    vertical-align: top;
}

.np-infobox-meta td:first-child {
    font-weight: bold;
    white-space: nowrap;
    padding-right: 0.5em;
    color: var(--color-subtle);
}

/* Article content body */
.np-article-body h2 {
    font-family: var(--font-family-base);
    font-size: 1.4em;
    border-bottom: 1px solid var(--border-color-subtle);
    padding-bottom: 0.2em;
    margin: 1.2em 0 0.5em;
    font-weight: normal;
}

.np-article-body h3 {
    font-family: var(--font-family-base);
    font-size: 1.15em;
    margin: 1em 0 0.4em;
    font-weight: bold;
}

.np-article-body p {
    margin-bottom: 0.75em;
    font-family: var(--font-family-base);
    font-size: 0.9375rem;
    line-height: 1.65;
}

/* Tags display */
.np-tags {
    margin-top: 1em;
    padding: 0.5em;
    border-top: 1px solid var(--border-color-subtle);
    font-size: var(--font-size-small);
}

.np-tags a {
    display: inline-block;
    background: var(--background-color-interactive-subtle);
    border: 1px solid var(--border-color-subtle);
    padding: 0.1em 0.5em;
    border-radius: 2px;
    margin: 0.1em;
    font-size: 0.8rem;
    color: var(--color-link);
    text-decoration: none;
    transition: background .1s;
}

.np-tags a:hover {
    background: var(--background-color-interactive);
    text-decoration: none;
}

/* References / Related articles section */
.np-references {
    border-top: 1px solid var(--border-color-subtle);
    margin-top: 1.5em;
    padding-top: 0.5em;
}

.np-references h2 {
    font-family: var(--font-family-base);
    font-size: 1.4em;
    border-bottom: 1px solid var(--border-color-subtle);
    padding-bottom: 0.2em;
    margin-bottom: 0.7em;
    font-weight: normal;
}

.np-related-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5em;
}

.np-related-post {
    border: 1px solid var(--border-color-subtle);
    padding: 0.5em;
    font-size: var(--font-size-small);
    background: var(--background-color-interactive-subtle);
}

.np-related-post a {
    font-weight: bold;
    color: var(--color-link);
}

.np-related-post img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
    margin-bottom: 0.3em;
}

.np-related-post-excerpt {
    color: var(--color-subtle);
    font-size: 0.82rem;
    margin-top: 0.2em;
}

/* ========================================================
   SEARCH PAGE — Wikipedia Special:Search Style
   ======================================================== */
.np-search-header {
    background: var(--background-color-interactive-subtle);
    border: 1px solid var(--border-color-subtle);
    padding: 1em;
    margin-bottom: 1em;
}

.np-search-header h1 {
    font-family: var(--font-family-base);
    font-size: 1.6em;
    font-weight: normal;
    margin-bottom: 0.5em;
    border-bottom: 1px solid var(--border-color-subtle);
    padding-bottom: 0.25em;
}

.np-search-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.np-search-input-wrap {
    display: flex;
    flex: 1;
    border: 1px solid var(--border-color-interactive);
    border-radius: 2px;
    overflow: hidden;
}

.np-search-input-wrap input[type="search"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
}

.np-search-input-wrap button {
    padding: 0.5rem 1rem;
    border: none;
    border-left: 1px solid var(--border-color-subtle);
    background: var(--background-color-interactive-subtle);
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background .1s;
}

.np-search-input-wrap button:hover {
    background: var(--background-color-interactive);
}

.np-search-stats {
    color: var(--color-subtle);
    font-size: var(--font-size-small);
    margin-bottom: 0.5em;
    padding: 0.3em 0;
    border-bottom: 1px solid var(--border-color-muted);
}

/* Search result item */
.np-search-result {
    display: flex;
    gap: 1em;
    padding: 0.8em 0;
    border-bottom: 1px solid var(--border-color-muted);
    align-items: flex-start;
}

.np-search-result:last-child {
    border-bottom: none;
}

.np-search-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    overflow: hidden;
    border: 1px solid var(--border-color-subtle);
    background: var(--background-color-interactive-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.np-search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.np-search-thumb-placeholder {
    color: var(--color-placeholder);
    font-size: 2rem;
}

.np-search-result-content {
    flex: 1;
    min-width: 0;
}

.np-search-result-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.2em;
}

.np-search-result-title a {
    color: var(--color-link);
}

.np-search-result-title a:hover {
    text-decoration: underline;
}

.np-search-result-excerpt {
    font-size: var(--font-size-small);
    color: var(--color-base);
    line-height: 1.5;
    margin-bottom: 0.3em;
}

.np-search-result-meta {
    font-size: 0.8rem;
    color: var(--color-subtle);
}

/* Search highlight */
.searchmatch {
    font-weight: bold;
    color: var(--color-base);
}

/* ========================================================
   PAGINATION — Wikipedia style
   ======================================================== */
.np-pagination {
    display: flex;
    align-items: center;
    gap: 0.3em;
    margin-top: 1em;
    padding: 0.5em 0;
    border-top: 1px solid var(--border-color-subtle);
    font-size: var(--font-size-small);
}

.np-pagination a,
.np-pagination .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2em;
    padding: 0.2em 0.5em;
    border: 1px solid var(--border-color-subtle);
    border-radius: 2px;
    text-decoration: none;
    background: var(--background-color-base);
    color: var(--color-link);
    transition: background .1s;
}

.np-pagination .current {
    background: var(--background-color-interactive);
    color: var(--color-base);
    border-color: var(--border-color-interactive);
    font-weight: bold;
}

.np-pagination a:hover {
    background: var(--background-color-interactive-subtle);
    text-decoration: none;
}

/* ========================================================
   ARCHIVE PAGE
   ======================================================== */
.np-archive-header {
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid var(--border-color-subtle);
}

.np-archive-header h1 {
    font-family: var(--font-family-base);
    font-size: 1.95em;
    font-weight: normal;
    border-bottom: 1px solid var(--border-color-subtle);
    padding-bottom: 0.25em;
}

.np-archive-description {
    font-size: var(--font-size-small);
    color: var(--color-subtle);
    margin-top: 0.5em;
}

.np-archive-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.np-archive-item {
    display: flex;
    gap: 1em;
    padding: 0.7em 0;
    border-bottom: 1px solid var(--border-color-muted);
    align-items: flex-start;
}

.np-archive-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 55px;
    overflow: hidden;
    border: 1px solid var(--border-color-subtle);
    background: var(--background-color-interactive-subtle);
}

.np-archive-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.np-archive-content {
    flex: 1;
    min-width: 0;
}

.np-archive-title {
    font-weight: bold;
    margin-bottom: 0.2em;
}

.np-archive-excerpt {
    font-size: var(--font-size-small);
    color: var(--color-subtle);
    line-height: 1.4;
}

/* ========================================================
   COMMENTS & TALK DISCUSSION SECTION — Modern Wikipedia Talk Style
   ======================================================== */
.np-comments-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color-subtle);
    font-family: var(--font-family-sans);
}

.np-comments-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color-muted);
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-family-base);
    font-size: 1.5rem;
    font-weight: normal;
    color: var(--color-base);
    margin: 0 0 0.3rem;
}

.np-comments-icon {
    color: var(--color-link);
    flex-shrink: 0;
}

.np-comments-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-family-sans);
    background: var(--background-color-interactive);
    color: var(--color-link);
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    border: 1px solid var(--border-color-subtle);
    line-height: 1;
}

.np-comments-subtitle {
    font-size: 0.85rem;
    color: var(--color-subtle);
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Comment List */
.comment-list {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
}

.comment-list .comment {
    list-style: none;
    margin: 0 0 1.2rem;
    padding: 1.1rem 1.2rem;
    background: var(--background-color-interactive-subtle);
    border: 1px solid var(--border-color-subtle);
    border-radius: 4px;
    transition: border-color .15s, box-shadow .15s;
}

.comment-list .comment:hover {
    border-color: var(--border-color-interactive);
}

.comment-list .bypostauthor {
    border-left: 3px solid var(--color-link);
}

.comment-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.comment-author .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color-subtle);
    background: var(--background-color-base);
    object-fit: cover;
}

.comment-author .fn {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-base);
    font-style: normal;
}

.comment-author .fn a {
    color: var(--color-base);
    text-decoration: none;
}

.comment-author .fn a:hover {
    color: var(--color-link);
    text-decoration: underline;
}

.comment-metadata {
    font-size: 0.8rem;
    color: var(--color-subtle);
}

.comment-metadata a {
    color: var(--color-subtle);
    text-decoration: none;
}

.comment-metadata a:hover {
    color: var(--color-link);
    text-decoration: underline;
}

.comment-content {
    font-family: var(--font-family-base);
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--color-base);
}

.comment-content p:last-child {
    margin-bottom: 0;
}

/* Reply Link */
.comment .reply {
    text-align: right;
    margin-top: 0.2rem;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-family-sans);
    color: var(--color-link);
    background: var(--background-color-base);
    border: 1px solid var(--border-color-subtle);
    border-radius: 3px;
    text-decoration: none;
    transition: background .12s, border-color .12s, color .12s;
}

.comment-reply-link:hover {
    background: var(--background-color-interactive);
    border-color: var(--color-link);
    text-decoration: none;
}

/* Nested replies */
.comment-list .children {
    list-style: none;
    margin: 1rem 0 0 1rem;
    padding: 0 0 0 1rem;
    border-left: 2px solid var(--border-color-muted);
}

@media (min-width: 600px) {
    .comment-list .children {
        margin-left: 1.5rem;
        padding-left: 1.25rem;
    }
}

/* Comment Form / Respond Box */
.comment-respond,
#respond {
    margin-top: 1.5rem;
    padding: 1.3rem 1.4rem;
    background: var(--background-color-interactive-subtle);
    border: 1px solid var(--border-color-subtle);
    border-radius: 4px;
}

.np-reply-title,
.comment-reply-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-family: var(--font-family-base);
    font-size: 1.3rem;
    font-weight: normal;
    color: var(--color-base);
    margin: 0 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color-muted);
}

.np-cancel-reply-wrap a,
#cancel-comment-reply-link {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    font-family: var(--font-family-sans);
    font-weight: 600;
    color: #c92a2a;
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    border-radius: 3px;
    text-decoration: none;
    transition: background .12s;
}

.np-cancel-reply-wrap a:hover,
#cancel-comment-reply-link:hover {
    background: #ffe3e3;
    text-decoration: none;
}

.np-comment-notes,
.comment-notes {
    font-size: 0.82rem;
    color: var(--color-subtle);
    margin: 0 0 1rem;
}

.logged-in-as {
    font-size: 0.85rem;
    color: var(--color-subtle);
    margin-bottom: 1rem;
}

.logged-in-as a {
    color: var(--color-link);
    font-weight: 600;
}

/* Form Fields */
.np-form-field {
    margin-bottom: 1rem;
}

.np-form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-base);
    margin-bottom: 0.35rem;
}

.np-form-field .required {
    color: #ba0000;
}

.np-label-subtle {
    font-size: 0.78rem;
    font-weight: normal;
    color: var(--color-subtle);
}

.np-input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.np-field-icon {
    position: absolute;
    left: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-placeholder);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.np-form-field input[type="text"],
.np-form-field input[type="email"],
.np-form-field input[type="url"] {
    width: 100%;
    height: 38px;
    padding: 0 0.8rem 0 2.4rem;
    font-size: var(--font-size-medium);
    font-family: inherit;
    color: var(--color-base);
    background: var(--background-color-base);
    border: 1px solid var(--border-color-interactive);
    border-radius: 3px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}

.np-form-field textarea,
#commentform textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.7rem 0.8rem;
    font-size: 0.95rem;
    font-family: var(--font-family-base);
    color: var(--color-base);
    background: var(--background-color-base);
    border: 1px solid var(--border-color-interactive);
    border-radius: 3px;
    outline: none;
    resize: vertical;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    line-height: 1.5;
}

.np-form-field input:focus,
.np-form-field textarea:focus,
#commentform textarea:focus {
    border-color: var(--border-color-progressive);
    box-shadow: 0 0 0 2px rgba(51, 102, 204, 0.18);
}

.np-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.8rem 0 1.2rem;
    font-size: 0.82rem;
    color: var(--color-subtle);
    line-height: 1.4;
}

.np-cookies-consent input[type="checkbox"] {
    margin-top: 0.2rem;
    cursor: pointer;
}

.np-cookies-consent label {
    cursor: pointer;
}

/* Form Submit Button */
.np-form-submit {
    margin-top: 1rem;
}

.np-submit-btn,
.form-submit input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.4rem;
    min-height: 38px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: var(--font-family-sans);
    color: #fff;
    background: var(--background-color-progressive);
    border: 1px solid var(--background-color-progressive);
    border-radius: 3px;
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .05s;
    white-space: nowrap;
}

.np-submit-btn:hover,
.form-submit input[type="submit"]:hover {
    background: var(--background-color-progressive--hover);
    border-color: var(--background-color-progressive--hover);
    box-shadow: 0 2px 6px rgba(51, 102, 204, 0.25);
}

.np-submit-btn:active,
.form-submit input[type="submit"]:active {
    background: var(--background-color-progressive--active);
    transform: translateY(1px);
}

.np-comments-closed-notice {
    padding: 0.8rem 1rem;
    background: var(--background-color-interactive-subtle);
    border: 1px solid var(--border-color-muted);
    border-radius: 3px;
    font-size: 0.875rem;
    color: var(--color-subtle);
    margin-top: 1rem;
}

/* Comment navigation */
.comment-navigation {
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.comment-navigation a {
    color: var(--color-link);
    font-weight: 600;
}

/* Comment Form Spacing */
.np-reply-title {
    margin-bottom: 0.5rem;
}

.logged-in-as,
.np-comment-notes {
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--color-subtle);
    display: block;
}

.np-form-field {
    margin-bottom: 1rem;
}

/* Dark Mode Overrides for Comments */
html.theme-dark .np-comments-container {
    border-top-color: #2e353d;
}

html.theme-dark .np-comments-header {
    border-bottom-color: #2e353d;
}

html.theme-dark .np-comments-badge {
    background: #252b32;
    border-color: #3a414a;
    color: #6596f5;
}

html.theme-dark .comments-title,
html.theme-dark .np-reply-title,
html.theme-dark .comment-reply-title {
    color: #ffffff;
    border-bottom-color: #2e353d;
}

html.theme-dark .comment-list .comment {
    background: #181d22;
    border-color: #2e353d;
    color: #e6edf3;
}

html.theme-dark .comment-list .comment:hover {
    border-color: #3a414a;
}

html.theme-dark .comment-list .bypostauthor {
    border-left-color: #6596f5;
}

html.theme-dark .comment-author .fn,
html.theme-dark .comment-author .fn a {
    color: #f0f2f5;
}

html.theme-dark .comment-author .fn a:hover {
    color: #6596f5;
}

html.theme-dark .comment-author .avatar {
    border-color: #3a414a;
    background: #101418;
}

html.theme-dark .comment-content {
    color: #e6edf3;
}

html.theme-dark .comment-metadata,
html.theme-dark .comment-metadata a {
    color: #8b949e;
}

html.theme-dark .comment-reply-link {
    background: #252b32;
    border-color: #3a414a;
    color: #6596f5;
}

html.theme-dark .comment-reply-link:hover {
    background: #313842;
    border-color: #6596f5;
}

html.theme-dark .comment-list .children {
    border-left-color: #2e353d;
}

html.theme-dark .comment-respond,
html.theme-dark #respond {
    background: #181d22;
    border-color: #2e353d;
}

html.theme-dark .np-cancel-reply-wrap a,
html.theme-dark #cancel-comment-reply-link {
    background: #2c1414;
    border-color: #5c2828;
    color: #ff8787;
}

html.theme-dark .np-form-field label {
    color: #f0f2f5;
}

html.theme-dark .np-form-field input[type="text"],
html.theme-dark .np-form-field input[type="email"],
html.theme-dark .np-form-field input[type="url"],
html.theme-dark .np-form-field textarea,
html.theme-dark #commentform textarea {
    background: #101418;
    border-color: #3a414a;
    color: #f0f2f5;
}

html.theme-dark .np-form-field input[type="text"]:focus,
html.theme-dark .np-form-field input[type="email"]:focus,
html.theme-dark .np-form-field input[type="url"]:focus,
html.theme-dark .np-form-field input:focus,
html.theme-dark .np-form-field textarea:focus,
html.theme-dark #commentform textarea:focus {
    border-color: #6596f5;
    box-shadow: 0 0 0 2px rgba(101, 150, 245, 0.20);
}

html.theme-dark .np-submit-btn,
html.theme-dark .form-submit input[type="submit"] {
    background: #6596f5;
    border-color: #6596f5;
    color: #101418;
    font-weight: 700;
}

html.theme-dark .np-submit-btn:hover,
html.theme-dark .form-submit input[type="submit"]:hover {
    background: #82aaff;
    border-color: #82aaff;
    box-shadow: 0 2px 8px rgba(101, 150, 245, 0.35);
}

html.theme-dark .np-comments-closed-notice {
    background: #181d22;
    border-color: #2e353d;
    color: #a2a9b1;
}

/* ========================================================
   SITE FOOTER
   ======================================================== */
#footer {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color-subtle);
    background: var(--background-color-interactive-subtle);
    padding: 1rem;
    font-size: var(--font-size-small);
    color: var(--color-subtle);
}

.footer-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-places {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color-muted);
    padding-bottom: 0.5rem;
}

.footer-places a {
    color: var(--color-link);
}

.footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-poweredby {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================================
   NOTIFICATION / HATNOTE
   ======================================================== */
.hatnote, .np-hatnote {
    padding: 4px 0.5em;
    color: var(--color-subtle);
    font-size: var(--font-size-small);
    background: var(--background-color-interactive-subtle);
    border: 1px solid var(--border-color-muted);
    margin-bottom: 0.5em;
    font-style: italic;
}

/* ========================================================
   UTILITY CLASSES
   ======================================================== */
.noprint { /* Keep visible on screen */ }
.mw-empty-elt { display: none; }
.nowrap { white-space: nowrap; }

.np-category-badge {
    display: inline-block;
    background: var(--background-color-interactive);
    border: 1px solid var(--border-color-subtle);
    padding: 0.1em 0.4em;
    font-size: 0.78rem;
    border-radius: 2px;
    color: var(--color-link);
    text-decoration: none;
    margin: 0.1em;
}

.np-category-badge:hover {
    background: var(--background-color-interactive-subtle);
    text-decoration: none;
}

/* ========================================================
   RESPONSIVE — Mobile First Adjustments
   ======================================================== */
@media (max-width: 875px) {
    #mp-upper {
        flex-direction: column;
    }

    #mp-left, #mp-right {
        flex: none;
        width: 100%;
    }

    #mp-tfp {
        flex-direction: column;
    }

    #mp-other-areas {
        columns: 1;
    }
}

@media (max-width: 768px) {
    /* All layout variants collapse to single column */
    .mw-page-container-inner,
    .layout-three-col,
    .layout-right-only,
    .layout-full {
        flex-direction: column;
    }

    /* Left sidebar hidden by default on mobile — toggled by ☰ */
    .vector-column-start {
        display: none;
        width: 100%;
        order: -1;
    }

    .vector-column-start.mobile-open {
        display: block;
    }

    /* Right sidebar: show below content on mobile */
    .vector-column-end {
        width: 100% !important;
        order: 1;
    }

    /* On front page, hide right sidebar on small screens to maximize content */
    .layout-right-only .vector-column-end {
        display: none;
    }

    .vector-menu-toggle {
        display: block;
    }

    .np-infobox {
        float: none;
        margin: 0 auto 1em;
        max-width: 100%;
    }

    .np-search-thumb {
        width: 70px;
        height: 50px;
    }

    .np-related-posts {
        grid-template-columns: 1fr;
    }

    #mp-other-areas {
        columns: 1;
    }

    .vector-header-end .vector-user-link span {
        display: none;
    }
}

@media (max-width: 500px) {
    .mp-contains-float > * {
        float: none !important;
        margin: auto !important;
    }

    .mp-contains-float .mp-thumb {
        margin: auto;
    }

    .itn-img, .dyk-img, #mp-otd-img {
        float: none;
        margin: 0 auto 0.5em;
        display: table;
    }

    .mw-logo-tagline {
        display: none;
    }

    .vector-user-link {
        font-size: 0.75rem;
    }
}


/* ========================================================
   PRINT STYLES
   ======================================================== */
@media print {
    #mw-header-container,
    .vector-page-toolbar,
    #mw-panel,
    .vector-column-end,
    #footer,
    .noprint {
        display: none !important;
    }

    .mw-page-container-inner {
        flex-direction: column;
    }

    #firstHeading {
        font-size: 1.5em;
    }
}
