/* ==========================================================================
   sphinx-javadoc-xml  —  JavaDoc-style rendering for Sphinx
   Compatible with alabaster, sphinx_rtd_theme, furo, and most themes.
   ========================================================================== */

/* -- Package section header ------------------------------------------------ */

.javadoc-package-section > h1,
.javadoc-package-section > h2 {
    background: linear-gradient(135deg, #2c5f2d 0%, #1b3a1c 100%);
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
    font-family: "SFMono-Regular", Menlo, "DejaVu Sans Mono", Consolas, monospace;
    font-size: 1.15em;
    letter-spacing: 0.02em;
}

.javadoc-package-section {
    border: 1px solid #c8d6c8;
    border-radius: 4px;
    margin-bottom: 2rem;
    padding: 0 0 1rem 0;
    background: #fcfcfc;
}

.javadoc-package-section > *:not(h1):not(h2):not(section) {
    padding-left: 20px;
    padding-right: 20px;
}

/* -- Type section (class / enum / interface) ------------------------------- */

.javadoc-type-section {
    border: 1px solid #d0d7de;
    border-radius: 4px;
    margin: 1.5rem 0;
    padding: 0;
    background: #fff;
}

.javadoc-type-section > h1,
.javadoc-type-section > h2,
.javadoc-type-section > h3 {
    background: #f6f8fa;
    border-bottom: 2px solid #d0d7de;
    padding: 10px 20px;
    margin: 0;
    font-size: 1.2em;
}

.javadoc-enum > h1,
.javadoc-enum > h2,
.javadoc-enum > h3 {
    background: #fff8e1;
    border-bottom-color: #ffe082;
}

.javadoc-type-section > *:not(h1):not(h2):not(h3):not(section) {
    padding-left: 20px;
    padding-right: 20px;
}

/* -- Type header block ----------------------------------------------------- */

.javadoc-type-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eaecef;
    margin-bottom: 0.5rem;
}

.javadoc-package-name {
    font-size: 0.85em;
    color: #656d76;
    margin-bottom: 4px !important;
    font-family: "SFMono-Regular", Menlo, "DejaVu Sans Mono", Consolas, monospace;
}

.javadoc-declaration {
    font-family: "SFMono-Regular", Menlo, "DejaVu Sans Mono", Consolas, monospace;
    font-size: 0.95em;
    line-height: 1.6;
    padding: 8px 12px;
    background: #f6f8fa;
    border-radius: 4px;
    border: 1px solid #d0d7de;
    margin: 8px 0 !important;
}

.javadoc-description {
    margin-top: 12px !important;
    color: #1f2328;
    line-height: 1.6;
}

/* -- Modifiers, types, keywords ------------------------------------------- */

.javadoc-modifier {
    color: #8250df;
    font-family: "SFMono-Regular", Menlo, "DejaVu Sans Mono", Consolas, monospace;
    font-size: 0.92em;
}

.javadoc-type {
    color: #0550ae;
    font-family: "SFMono-Regular", Menlo, "DejaVu Sans Mono", Consolas, monospace;
    font-size: 0.92em;
}

.javadoc-keyword {
    color: #cf222e;
    font-weight: 600;
    font-family: "SFMono-Regular", Menlo, "DejaVu Sans Mono", Consolas, monospace;
    font-size: 0.92em;
}

/* -- Summary/detail section headings -------------------------------------- */

.javadoc-summary > h1,
.javadoc-summary > h2,
.javadoc-summary > h3,
.javadoc-summary > h4 {
    background: #ddf4ff;
    color: #0550ae;
    padding: 8px 16px;
    border-bottom: 1px solid #54aeff;
    border-radius: 4px 4px 0 0;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1rem 0 0 0;
}

.javadoc-detail > h1,
.javadoc-detail > h2,
.javadoc-detail > h3,
.javadoc-detail > h4 {
    background: #f6f8fa;
    color: #1f2328;
    padding: 8px 16px;
    border-bottom: 2px solid #d0d7de;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1.5rem 0 0 0;
}

/* -- Summary tables -------------------------------------------------------- */

.javadoc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1rem 0;
    font-size: 0.9em;
}

.javadoc-table thead th,
.javadoc-table thead td {
    background: #f0f3f6;
    border-bottom: 2px solid #d0d7de;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #1f2328;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Some themes put <p> inside table cells — remove extra margin */
.javadoc-table td p,
.javadoc-table th p {
    margin: 0;
}

.javadoc-table tbody td {
    border-bottom: 1px solid #eaecef;
    padding: 8px 12px;
    vertical-align: top;
}

.javadoc-table tbody tr:hover {
    background: #f6f8fa;
}

.javadoc-table tbody tr:last-child td {
    border-bottom: none;
}

/* -- Member detail blocks ------------------------------------------------- */

.javadoc-member-detail {
    padding: 12px 20px;
    margin: 12px 0;
    background: #f9fbfd;
    border-radius: 4px;
    border: 1px solid #eaecef;
}

.javadoc-member-detail .subtitle {
    font-size: 1.05em;
    font-weight: 700;
    color: #1f2328;
    margin: 0 0 8px 0;
    font-family: "SFMono-Regular", Menlo, "DejaVu Sans Mono", Consolas, monospace;
}

.javadoc-member-name {
    font-size: 1.05em;
    font-weight: 700;
    color: #1f2328;
    margin: 0 0 8px 0 !important;
    font-family: "SFMono-Regular", Menlo, "DejaVu Sans Mono", Consolas, monospace;
}

/* -- Signature code blocks ------------------------------------------------ */

.javadoc-signature {
    background: #f6f8fa !important;
    border: 1px solid #d0d7de !important;
    border-radius: 4px;
    padding: 10px 14px !important;
    font-size: 0.88em !important;
    line-height: 1.5;
    overflow-x: auto;
    margin: 6px 0 10px 0 !important;
}

/* -- Links to members ----------------------------------------------------- */

a.javadoc-member-link,
.javadoc-member-link {
    color: #0969da;
    font-family: "SFMono-Regular", Menlo, "DejaVu Sans Mono", Consolas, monospace;
    font-size: 0.92em;
    text-decoration: none;
    font-weight: 600;
}

a.javadoc-member-link:hover,
.javadoc-member-link:hover {
    text-decoration: underline;
    color: #0550ae;
}

/* -- Parameters & return -------------------------------------------------- */

.javadoc-params {
    margin: 8px 0 !important;
    padding-left: 0 !important;
}

.javadoc-params .field-name {
    font-weight: 700;
    color: #1f2328;
}

.javadoc-params .field-body ul {
    margin: 4px 0 4px 8px;
    padding-left: 16px;
}

.javadoc-params .field-body li {
    margin-bottom: 2px;
    font-size: 0.92em;
}

.javadoc-returns {
    font-size: 0.92em;
    margin: 6px 0;
}

.javadoc-tag-detail {
    font-size: 0.88em;
    color: #656d76;
}

/* -- Tags (author, version, etc.) ----------------------------------------- */

.javadoc-tags {
    margin: 8px 0 0 0;
}

.javadoc-tags dt {
    font-family: "SFMono-Regular", Menlo, "DejaVu Sans Mono", Consolas, monospace;
    font-size: 0.85em;
    color: #8250df;
    font-weight: 600;
}

.javadoc-tags dd {
    margin-left: 16px;
    margin-bottom: 4px;
    font-size: 0.9em;
}

/* -- Kind group inside package summary ------------------------------------ */

.javadoc-kind-group {
    margin: 0.5rem 20px 1rem 20px;
    border: none;
}

.javadoc-kind-group > h1,
.javadoc-kind-group > h2,
.javadoc-kind-group > h3,
.javadoc-kind-group > h4 {
    font-size: 0.9em;
    background: transparent;
    border-bottom: 1px solid #d0d7de;
    padding: 4px 0;
    color: #656d76;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* -- Responsive ----------------------------------------------------------- */

@media (max-width: 768px) {
    .javadoc-table {
        display: block;
        overflow-x: auto;
    }

    .javadoc-member-detail {
        padding: 8px 12px;
    }

    .javadoc-type-header,
    .javadoc-type-section > *:not(h1):not(h2):not(h3):not(section) {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* -- Print ---------------------------------------------------------------- */

@media print {
    .javadoc-package-section > h1,
    .javadoc-package-section > h2 {
        background: #eee !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
    }

    .javadoc-member-detail {
        break-inside: avoid;
    }
}
