/* ========================================
   WordPress Plugin Manual - Common Stylesheet
   ======================================== */

/* ========================================
   1. Base / Reset
   ======================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial,
        sans-serif;
    color: #1e1e1e;
    background: #fff;
    line-height: 1.7;
}

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

a {
    color: #2271b1;
    text-decoration: none;
}

a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* ========================================
   2. Sidebar
   ======================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #1d2327;
    color: #fff;
    overflow-y: auto;
    z-index: 100;
    padding-bottom: 40px;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid #3c434a;
}

.sidebar-header h1 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
}

.sidebar-header .version {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    color: #a7aaad;
    background: #3c434a;
    padding: 2px 8px;
    border-radius: 3px;
}

.sidebar ul {
    list-style: none;
    padding: 12px 0;
}

.sidebar ul li a {
    display: block;
    padding: 8px 20px;
    color: #c3c4c7;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.sidebar ul li a:hover {
    background: #2c3338;
    color: #fff;
    text-decoration: none;
}

.sidebar ul li.active a {
    background: #2271b1;
    color: #fff;
    font-weight: 600;
}

.sidebar ul li.section-label {
    padding: 18px 20px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8c8f94;
}

/* ========================================
   3. Main Content
   ======================================== */

.content {
    margin-left: 260px;
    max-width: 900px;
    padding: 40px 60px;
}

/* ========================================
   4. Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    color: #1d2327;
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
    margin-bottom: 16px;
}

h2 {
    font-size: 1.5rem;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dcdcde;
}

h3 {
    font-size: 1.2rem;
    margin-top: 32px;
    margin-bottom: 12px;
}

h4 {
    font-size: 1.05rem;
    margin-top: 24px;
    margin-bottom: 8px;
}

p {
    margin-bottom: 16px;
}

.lead {
    font-size: 1.15rem;
    color: #50575e;
    line-height: 1.8;
    margin-bottom: 24px;
}

/* ========================================
   5. Steps
   ======================================== */

.step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.step-content {
    flex: 1;
    padding-top: 4px;
}

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

/* ========================================
   6. Callout Boxes
   ======================================== */

.callout {
    padding: 16px 20px;
    margin: 24px 0;
    border-left: 4px solid;
    border-radius: 0 4px 4px 0;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 6px;
}

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

.callout-tip {
    border-left-color: #46b450;
    background: #f0f9f1;
}

.callout-tip .callout-title {
    color: #2e7d32;
}

.callout-warning {
    border-left-color: #ffb900;
    background: #fef8e7;
}

.callout-warning .callout-title {
    color: #8b6914;
}

.callout-note {
    border-left-color: #2271b1;
    background: #edf5fa;
}

.callout-note .callout-title {
    color: #2271b1;
}

/* ========================================
   7. Screenshots
   ======================================== */

.screenshot {
    margin: 24px 0;
    text-align: center;
}

.screenshot img {
    max-width: 100%;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    cursor: zoom-in;
}

.screenshot figcaption,
.screenshot .caption {
    font-size: 13px;
    color: #646970;
    margin-top: 8px;
    font-style: italic;
}

/* ========================================
   8. Infographic Images
   ======================================== */

.infographic {
    margin: 32px 0;
    text-align: center;
}

.infographic img {
    max-width: 100%;
    display: inline-block;
}

.infographic figcaption,
.infographic .caption {
    font-size: 13px;
    color: #646970;
    margin-top: 8px;
}

/* ========================================
   9. Feature Cards
   ======================================== */

.feature-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 24px 0;
}

.feature-card {
    background: #f6f7f7;
    border-radius: 6px;
    padding: 24px 20px;
    text-align: center;
}

.feature-card h4 {
    margin-top: 0;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: #50575e;
    margin-bottom: 0;
}

.feature-card .icon {
    font-size: 28px;
    margin-bottom: 12px;
    display: block;
}

/* ========================================
   10. Tables (widefat style)
   ======================================== */

table,
table.widefat {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden;
}

table thead th,
table.widefat thead th {
    background: #f0f0f1;
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
    border-bottom: 2px solid #c3c4c7;
    letter-spacing: 0.02em;
}

table tbody td,
table.widefat tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: top;
    line-height: 1.6;
}

table tbody tr:hover,
table.widefat tbody tr:hover {
    background: #f6f7f7;
}

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

table tbody td:first-child {
    font-weight: 500;
    color: #1d2327;
}

/* ========================================
   11. HTTP Status Color Coding
   ======================================== */

.http-2xx {
    color: #00a32a;
    font-weight: 600;
}

.http-3xx {
    color: #2271b1;
    font-weight: 600;
}

.http-4xx {
    color: #dba617;
    font-weight: 600;
}

.http-5xx {
    color: #d63638;
    font-weight: 600;
}

/* ========================================
   12. Status Badges
   ======================================== */

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.status-ok {
    background: #edfaef;
    color: #00a32a;
}

.status-warning {
    background: #fef8e7;
    color: #996800;
}

.status-error {
    background: #fcf0f1;
    color: #d63638;
}

/* ========================================
   13. Lightbox Overlay
   ======================================== */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* ========================================
   14. Page Navigation
   ======================================== */

.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid #dcdcde;
}

.page-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #2271b1;
    padding: 8px 0;
}

.page-nav a:hover {
    color: #135e96;
    text-decoration: none;
}

.page-nav .prev::before {
    content: "\2190";
}

.page-nav .next::after {
    content: "\2192";
}

/* ========================================
   15. Manual Footer
   ======================================== */

.manual-footer {
    margin-top: 48px;
    padding: 24px 0 0;
    border-top: 1px solid #dcdcde;
    font-size: 13px;
    color: #8c8f94;
    line-height: 1.8;
}

.manual-footer a {
    color: #2271b1;
}

.manual-footer a:hover {
    color: #135e96;
}

/* ========================================
   16. Code Blocks
   ======================================== */

code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    color: #1d2327;
}

pre {
    background: #2c3338;
    color: #e4e6e8;
    padding: 20px 24px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 24px 0;
    font-size: 13px;
    line-height: 1.6;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
}

/* ========================================
   17. Lists
   ======================================== */

ul, ol {
    margin: 0 0 16px 24px;
}

li {
    margin-bottom: 6px;
}

/* ========================================
   18. Hamburger Menu Button
   ======================================== */

.hamburger-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: #1d2327;
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 22px;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ========================================
   19. Responsive (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        padding: 60px 20px 40px;
    }

    .hamburger-btn {
        display: flex;
    }

    .feature-cards {
        grid-template-columns: 1fr;
    }

    .page-nav {
        flex-direction: column;
        gap: 12px;
    }

    table.widefat {
        font-size: 13px;
    }

    table.widefat thead th,
    table.widefat tbody td {
        padding: 8px 10px;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.3rem;
    }
}
