/*
Theme Name: API Fixer Pro
Theme URI: https://apifixer.com
Author: ApiFixer
Description: A high-performance, custom-coded theme for the API Fixer platform, built with HTML and Elementor.
Version: 1.0.0
Text Domain: apifixer
*/


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

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

:root {
    --accent: #0a6e4f;
    --accent-lt: #e0f5ee;
    --accent-mid: #1d9e75;
    --accent-dark: #064433;
    --ink: #0f1b14;
    --ink-2: #2e4039;
    --ink-3: #5a7168;
    --surface: #ffffff;
    --surface-2: #f7faf8;
    --surface-3: #eef5f1;
    --border: #daeade;
    --code-bg: #0f2218;
    --code-fg: #a8e6c5;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-sans: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, .08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .10);
    --transition: 0.22s cubic-bezier(.4, 0, .2, 1);
}

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

body {
    font-family: var(--font-sans);
    background: var(--surface-2);
    color: var(--ink);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ---------- Container ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--ink-3);
}

.breadcrumb a {
    color: var(--accent);
    transition: color var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent-dark);
}

.breadcrumb .sep {
    color: var(--border);
}

.breadcrumb .current {
    color: var(--ink-2);
    font-weight: 500;
}

/* ---------- Layout Grid ---------- */
.main-layout {
    padding: 48px 0 80px;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 36px;
    align-items: start;
}

/* ---------- Post Content ---------- */
.post-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 48px 52px;
    box-shadow: var(--shadow-sm);
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.cat-badge {
    display: inline-block;
    background: var(--accent-lt);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 4px 12px;
    border-radius: 100px;
    text-transform: uppercase;
}

.meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border);
}

.meta-date,
.meta-read {
    font-size: 13px;
    color: var(--ink-3);
}

/* Post Title */
.post-title {
    font-family: var(--font-serif);
    font-size: clamp(26px, 3.5vw, 40px);
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 24px;
    letter-spacing: -.02em;
}

/* Author Row */
.author-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.author-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-mid);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.author-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.author-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
}

.author-role {
    font-size: 12px;
    color: var(--ink-3);
}

.share-row {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.share-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.share-btn:hover {
    background: var(--accent-lt);
    border-color: var(--accent-mid);
    color: var(--accent-dark);
}

/* Featured Image */
.featured-image-wrap {
    margin-bottom: 36px;
}

.featured-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.img-placeholder {
    height: 380px;
    background: linear-gradient(135deg, var(--surface-3) 0%, var(--accent-lt) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--ink-3);
}

.img-icon {
    color: var(--accent-mid);
    opacity: .6;
}

.img-placeholder span {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-3);
}

.img-caption {
    padding: 10px 16px;
    font-size: 12px;
    color: var(--ink-3);
    background: var(--surface-3);
    border-top: 1px solid var(--border);
    text-align: center;
    font-style: italic;
}

/* Post Body */
.post-body {
    color: var(--ink-2);
}

.post-body p {
    font-size: 16.5px;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--ink-2);
}

.post-body p.lead {
    font-size: 18px;
    color: var(--ink);
    font-weight: 400;
    border-left: 3px solid var(--accent-mid);
    padding-left: 18px;
    margin-bottom: 28px;
}

.post-body h2 {
    font-family: var(--font-serif);
    font-size: 24px;
    color: var(--ink);
    margin: 36px 0 14px;
    letter-spacing: -.01em;
}

.post-body h3 {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    margin: 28px 0 10px;
}

/* Code blocks */
.post-body code {
    font-family: var(--font-mono);
    font-size: 13.5px;
    background: var(--surface-3);
    color: var(--accent-dark);
    padding: 2px 6px;
    border-radius: 4px;
}

.post-body pre {
    background: var(--code-bg);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid rgba(255, 255, 255, .06);
}

.post-body pre code {
    background: none;
    color: var(--code-fg);
    font-size: 13.5px;
    padding: 0;
    line-height: 1.7;
}

/* Callouts */
.callout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin: 24px 0;
    font-size: 15px;
}

.callout-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.callout-info {
    background: #e8f0fe;
    border-left: 3px solid #4285f4;
    color: #1a3a6e;
}

.callout-info .callout-icon {
    color: #4285f4;
}

.callout-success {
    background: var(--accent-lt);
    border-left: 3px solid var(--accent-mid);
    color: var(--accent-dark);
}

.callout-success .callout-icon {
    color: var(--accent-mid);
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.tag {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 100px;
    background: var(--surface-3);
    color: var(--accent);
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
}

.tag:hover {
    background: var(--accent-lt);
    border-color: var(--accent-mid);
}

/* Author Bio Box */
.author-bio-box {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-top: 40px;
}

.author-bio-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-mid);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.author-bio-content h4 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
}

.author-bio-content p {
    font-size: 14px;
    color: var(--ink-3);
    margin-bottom: 10px;
}

.author-contact {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}

.author-contact:hover {
    text-decoration: underline;
}

/* Related Posts */
.related-posts {
    margin-top: 48px;
}

.related-title {
    font-family: var(--font-serif);
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--ink);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.related-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    transition: all var(--transition);
    display: block;
}

.related-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--accent-mid);
}

.related-img {
    height: 110px;
    background: linear-gradient(135deg, var(--surface-3), var(--accent-lt));
}

.related-meta {
    padding: 14px;
}

.related-cat {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent-mid);
}

.related-meta h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin: 6px 0 8px;
    line-height: 1.4;
}

.related-date {
    font-size: 11px;
    color: var(--ink-3);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sb-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

/* Sidebar heading */
.sb-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.sb-heading span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-3);
    white-space: nowrap;
}

.sb-heading-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Search */
.sb-search form {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    transition: border-color var(--transition);
}

.sb-search:focus-within {
    border-color: var(--accent-mid);
    box-shadow: 0 0 0 3px rgba(29, 158, 117, .12);
}

.sb-search-icon {
    color: var(--ink-3);
    flex-shrink: 0;
}

.sb-search input {
    border: none;
    outline: none;
    width: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    background: transparent;
    color: var(--ink);
}

.sb-search input::placeholder {
    color: var(--ink-3);
}

/* Author Card */
.sb-author-card {
    text-align: center;
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.sb-author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-mid);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    margin: 0 auto 12px;
    border: 3px solid rgba(255, 255, 255, .2);
}

.sb-author-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.sb-author-bio {
    font-size: 13px;
    color: rgba(255, 255, 255, .65);
    line-height: 1.5;
    margin-bottom: 16px;
}

.sb-author-cta {
    display: inline-block;
    background: var(--accent-mid);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 20px;
    border-radius: 100px;
    transition: all var(--transition);
}

.sb-author-cta:hover {
    background: #15b585;
    transform: translateY(-1px);
}

/* Recent Posts */
.sb-recent-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sb-recent-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.sb-recent-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--surface-3), var(--accent-lt));
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.sb-recent-info {
    flex: 1;
}

.sb-recent-title {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
    margin-bottom: 4px;
    transition: color var(--transition);
}

.sb-recent-title:hover {
    color: var(--accent);
}

.sb-recent-date {
    font-size: 11px;
    color: var(--ink-3);
}

/* Category Tags */
.sb-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sb-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-dark);
    background: var(--accent-lt);
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
}

.sb-tag:hover {
    background: var(--accent-mid);
    color: #fff;
    border-color: var(--accent-mid);
}

.sb-tag-count {
    background: rgba(0, 0, 0, .08);
    border-radius: 100px;
    padding: 1px 6px;
    font-size: 10px;
}

.sb-tag:hover .sb-tag-count {
    background: rgba(255, 255, 255, .2);
}

/* CTA Widget */
.sb-cta-widget {
    background: var(--accent-lt);
    border-color: var(--accent-mid);
    text-align: center;
}

.sb-cta-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--accent-mid);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.sb-cta-widget h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: 8px;
}

.sb-cta-widget p {
    font-size: 13px;
    color: var(--ink-3);
    margin-bottom: 16px;
    line-height: 1.5;
}

.sb-cta-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 100px;
    transition: all var(--transition);
}

.sb-cta-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(10, 110, 79, .25);
}

/* Table of Contents */
.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-list li a {
    display: block;
    font-size: 13px;
    color: var(--ink-3);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    transition: all var(--transition);
}

.toc-list li a:hover,
.toc-list li a.active {
    color: var(--accent);
    background: var(--accent-lt);
    border-left-color: var(--accent-mid);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
[data-animate] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-animate].in-view {
    opacity: 1;
    transform: none;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    padding: 10px 22px;
    border-radius: 100px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .layout-grid {
        grid-template-columns: 1fr 280px;
        gap: 24px;
    }

    .post-content {
        padding: 36px;
    }
}

@media (max-width: 768px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .sb-author-card,
    .sb-cta-widget,
    .sb-search-card,
    .sb-toc {
        grid-column: 1 / -1;
    }

    .post-content {
        padding: 24px;
    }

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

    .author-bio-box {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .sidebar {
        grid-template-columns: 1fr;
    }

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

    .post-content {
        padding: 20px 18px;
    }
}

/* ===================== API FIXER TABLE STYLES ===================== */

/* 1. Container & Layout */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: 8px;
    overflow: hidden;
    /* Ensures corners are rounded */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f6;
}

/* 2. Header Style */
.post-body table th {
    background-color: #f8fafc;
    /* Very light gray/blue */
    color: #1e293b;
    /* Dark slate */
    font-weight: 600;
    text-align: left;
    padding: 16px;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

/* 3. Table Cells */
.post-body table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    vertical-align: middle;
}

/* 4. Zebra Striping & Hover */
.post-body table tbody tr:nth-child(even) {
    background-color: #fcfdfe;
}

.post-body table tbody tr:hover {
    background-color: #f1f5f9;
    transition: background-color 0.2s ease;
}

/* 5. Styling Code inside Tables (Common for API sites) */
.post-body table td code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #ef4444;
    /* Red for API endpoints/keys */
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

/* 6. Responsive Table (Essential for Mobile) */
@media screen and (max-width: 600px) {
    .post-body table {
        display: block;
        overflow-x: auto;
        /* Adds horizontal scroll on small screens */
        white-space: nowrap;
    }
}