
:root {
    --pg-content-max: 800px;
    --pg-wrap-max: 1000px;
    --pg-hero-min-h: auto;
    --pg-hero-pad-x: 2rem;
    --pg-hero-pad-y: 2.5rem;
    --pg-hero-overlay: linear-gradient(135deg, rgba(15,23,42,0.92) 0%, rgba(30,41,59,0.85) 100%);
    --pg-hero-pattern: radial-gradient(circle at 20% 80%, rgba(226,27,51,0.12) 0%, transparent 50%),
                       radial-gradient(circle at 80% 20%, rgba(99,102,241,0.08) 0%, transparent 50%);
    --pg-accent-line: 4px;
    --pg-sidebar-w: 48px;
    --pg-sidebar-gap: 2rem;
    --pg-share-size: 38px;
    --pg-toc-bg: var(--fe-color-bg-alt);
    --pg-toc-border: var(--fe-color-border);
}

[data-theme="dark"] {
    --pg-hero-overlay: linear-gradient(135deg, rgba(15,23,42,0.95) 0%, rgba(30,41,59,0.9) 100%);
    --pg-hero-pattern: radial-gradient(circle at 20% 80%, rgba(244,63,94,0.1) 0%, transparent 50%),
                       radial-gradient(circle at 80% 20%, rgba(99,102,241,0.06) 0%, transparent 50%);
    --pg-toc-bg: var(--fe-color-surface);
    --pg-toc-border: var(--fe-color-border);
}

.pg-hero {
    position: relative;
    min-height: var(--pg-hero-min-h);
    display: flex;
    align-items: flex-end;
    background: var(--pg-hero-overlay);
    overflow: hidden;
    margin-top: calc(-1 * var(--fe-spacing-lg, 1.5rem));
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
}
.pg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--pg-hero-pattern);
    pointer-events: none;
    z-index: 1;
}

.pg-hero__bg {
    position: absolute;
    inset: 0;
    background-image: var(--pg-hero-bg, none);
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.pg-hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--pg-hero-overlay);
}

.pg-hero__img-seo {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.pg-hero--has-img {
    min-height: 280px;
}

.pg-hero--no-img {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
}
[data-theme="dark"] .pg-hero--no-img {
    background: linear-gradient(135deg, #020617 0%, #0f172a 60%, #020617 100%);
}

.pg-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--pg-accent-line);
    background: linear-gradient(90deg, var(--fe-color-primary) 0%, rgba(99,102,241,0.6) 50%, var(--fe-color-primary) 100%);
    z-index: 3;
}

.pg-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--pg-wrap-max);
    margin: 0 auto;
    padding: var(--pg-hero-pad-y) var(--pg-hero-pad-x) calc(var(--pg-hero-pad-y) - 0.5rem);
}

.pg-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}
.pg-breadcrumb a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.15s;
}
.pg-breadcrumb a:hover { color: #fff; }
.pg-breadcrumb__sep {
    color: rgba(255,255,255,0.35);
    flex-shrink: 0;
}
.pg-breadcrumb__home {
    display: inline-flex;
    align-items: center;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.15s;
}
.pg-breadcrumb__home:hover { color: #fff; }
.pg-breadcrumb > span { color: rgba(255,255,255,0.5); }

.pg-hero__title {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
    max-width: var(--pg-content-max);
}

.pg-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.8125rem;
    font-weight: 400;
}
.pg-hero__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: rgba(255,255,255,0.7);
}
.pg-hero__meta-item svg {
    flex-shrink: 0;
    opacity: 0.7;
    stroke: currentColor;
}
.pg-hero__meta-item time {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.pg-hero__meta-item a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 500;
}
.pg-hero__meta-item a:hover {
    text-decoration: underline;
}

.pg-content-wrap {
    position: relative;
    max-width: var(--pg-wrap-max);
    margin: 0 auto;
    padding: 2.5rem var(--fe-spacing-lg) 0;
    display: flex;
    gap: var(--pg-sidebar-gap);
}

.pg-share-sidebar {
    position: sticky;
    top: var(--sh-total-height, 140px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: var(--pg-sidebar-w);
    flex-shrink: 0;
    align-self: flex-start;
    padding-top: 0.25rem;
}
.pg-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--pg-share-size);
    height: var(--pg-share-size);
    border-radius: 50%;
    border: 1px solid var(--fe-color-border);
    background: var(--fe-color-surface);
    color: var(--fe-color-text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
    position: relative;
    padding: 0;
    font-family: inherit;
}
.pg-share-btn:hover {
    color: var(--fe-color-primary);
    border-color: var(--fe-color-primary);
    transform: scale(1.1);
}
.pg-share-btn--x:hover { background: #0f1419; color: #fff; border-color: #0f1419; }
.pg-share-btn--facebook:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.pg-share-btn--linkedin:hover { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.pg-share-btn--whatsapp:hover { background: #25d366; color: #fff; border-color: #25d366; }
.pg-share-btn.pg-share-copy:hover { background: var(--fe-color-primary); color: #fff; border-color: var(--fe-color-primary); }
.pg-share-btn svg { flex-shrink: 0; }
.pg-share-btn:focus-visible { outline: 2px solid var(--fe-color-primary); outline-offset: 2px; }

.pg-share-copy__tooltip {
    position: absolute;
    left: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
    background: var(--fe-color-text);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}
.pg-share-copy.is-copied .pg-share-copy__tooltip {
    opacity: 1;
    visibility: visible;
}

.pg-article {
    flex: 1;
    min-width: 0;
    max-width: var(--pg-content-max);
}

.pg-toc {
    margin-bottom: 2.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--pg-toc-bg);
    border: 1px solid var(--pg-toc-border);
    border-radius: var(--fe-radius-lg);
    transition: background 0.2s, border-color 0.2s;
}
.pg-toc__title {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fe-color-text-muted);
}
.pg-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.pg-toc__list li {
    margin-bottom: 0.5rem;
}
.pg-toc__list li:last-child { margin-bottom: 0; }
.pg-toc__list a {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--fe-color-text);
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.15s;
    border-bottom: 1px solid transparent;
}
.pg-toc__list a::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fe-color-primary);
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s, transform 0.15s;
    position: relative;
    top: -1px;
}
.pg-toc__list a:hover {
    color: var(--fe-color-primary);
}
.pg-toc__list a:hover::before {
    opacity: 1;
    transform: scale(1.3);
}

.pg-body {
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.85;
    color: var(--fe-color-text);
}
.pg-body p { margin: 0 0 1.5em; }
.pg-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.25em 0 0.75em;
    letter-spacing: -0.02em;
    line-height: 1.3;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--fe-color-border);
}
.pg-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.75em 0 0.625em;
    line-height: 1.35;
}
.pg-body h4 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 1.5em 0 0.5em;
}
.pg-body strong { font-weight: 600; }
.pg-body a {
    color: var(--fe-color-primary);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}
.pg-body a:hover { color: var(--fe-color-primary-hover, var(--fe-color-primary)); }
.pg-body ul, .pg-body ol { margin: 0 0 1em; padding-left: 1.5rem; }
.pg-body li { margin-bottom: 0.15em; }
.pg-body li:last-child { margin-bottom: 0; }
.pg-body li p { margin: 0 0 0.35em; }
.pg-body li p:last-child { margin-bottom: 0; }
.pg-body blockquote {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--fe-color-primary);
    font-size: 1.1875rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--fe-color-text-muted);
    background: var(--fe-color-bg-alt);
    border-radius: 0 var(--fe-radius-lg) var(--fe-radius-lg) 0;
}
.pg-body blockquote p:last-child { margin-bottom: 0; }
.pg-body figure {
    margin: 2rem 0;
    padding: 0;
    overflow: hidden;
}
.pg-body figure img {
    width: 100%;
    height: auto;
    border-radius: var(--fe-radius-lg);
}
.pg-body figcaption {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--fe-color-text-muted);
    font-style: italic;
    text-align: center;
}
.pg-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--fe-radius-lg);
    margin: 1.5rem 0;
}

.pg-body hr {
    border: 0;
    height: 0;
    margin: 2rem 0;
    padding: 0;
    border-top: 1px solid var(--fe-color-border);
    background: transparent;
}
.pg-body hr.liste-sep {
    position: relative;
    height: 1px;
    margin: 2.5rem 0;
    border: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--fe-color-border) 12%,
        var(--fe-color-primary) 50%,
        var(--fe-color-border) 88%,
        transparent 100%
    );
    overflow: visible;
}
.pg-body hr.liste-sep::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fe-color-primary);
    box-shadow: 0 0 0 4px var(--fe-color-bg);
}

.pg-body table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    font-size: 0.9375rem;
}
.pg-body table th,
.pg-body table td {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--fe-color-border);
    text-align: left;
}
.pg-body table th {
    font-weight: 600;
    background: var(--fe-color-bg-alt);
}
.pg-body .cd-table-wrap {
    margin: 1.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--fe-radius-lg);
    border: 1px solid var(--fe-color-border);
    background: var(--fe-color-bg-alt);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
[data-theme="dark"] .pg-body .cd-table-wrap {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.pg-body .cd-table-wrap table {
    width: 100%;
    min-width: min(100%, 32rem);
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    border: 0;
    background: var(--fe-color-bg);
    border-radius: calc(var(--fe-radius-lg) - 1px);
    overflow: hidden;
}
.pg-body .cd-table-wrap th,
.pg-body .cd-table-wrap td {
    padding: 0.65rem 0.85rem;
    border: 0;
    border-bottom: 1px solid var(--fe-color-border);
    border-right: 1px solid var(--fe-color-border);
    vertical-align: top;
}
.pg-body .cd-table-wrap th:last-child,
.pg-body .cd-table-wrap td:last-child {
    border-right: 0;
}
.pg-body .cd-table-wrap tr:last-child th,
.pg-body .cd-table-wrap tr:last-child td {
    border-bottom: 0;
}
.pg-body .cd-table-wrap thead th {
    font-weight: 600;
    font-size: 0.8125rem;
    background: var(--fe-color-bg-alt);
}
.pg-body .cd-table-wrap tbody tr:nth-child(even) td {
    background: rgba(148, 163, 184, 0.06);
}
[data-theme="dark"] .pg-body .cd-table-wrap tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

.pg-body .cd-editor-note {
    margin: 1.5rem 0;
    padding: 1.1rem 1.25rem;
    border-left: 4px solid #64748b;
    border-radius: 0 var(--fe-radius-lg) var(--fe-radius-lg) 0;
    background: var(--fe-color-bg-alt);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--fe-color-text);
}
.pg-body .cd-editor-note p { margin: 0 0 0.65em; }
.pg-body .cd-editor-note p:last-child { margin-bottom: 0; }
.pg-body .cd-editor-note > :first-child { margin-top: 0; }
.pg-body .cd-editor-note--editor { border-left-color: #64748b; }
.pg-body .cd-editor-note--tip {
    border-left-color: var(--fe-color-primary);
    background: var(--fe-color-primary-soft, rgba(244, 63, 94, 0.08));
}
.pg-body .cd-editor-note--info {
    border-left-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.08);
}
.pg-body .cd-editor-note--warn {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.10);
}
.pg-body pre {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: var(--fe-color-bg-alt);
    border-radius: var(--fe-radius);
    overflow-x: auto;
    font-family: var(--fe-font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
}
.pg-body code {
    font-family: var(--fe-font-mono);
    font-size: 0.875em;
    padding: 0.15em 0.35em;
    background: var(--fe-color-bg-alt);
    border-radius: 3px;
}
.pg-body pre code { padding: 0; background: none; border-radius: 0; }

.pg-body iframe {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 1.5rem 0;
    border: 0;
    border-radius: var(--fe-radius-lg);
    vertical-align: top;
}

.pg-body hr {
    border: none;
    height: 1px;
    background: var(--fe-color-border);
    margin: 2.5rem 0;
}

.pg-share-inline {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fe-color-border);
}
.pg-share-inline__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fe-color-text-muted);
    margin-right: 0.25rem;
}
.pg-share-inline .pg-share-btn {
    width: 34px;
    height: 34px;
}
.pg-share-inline .pg-share-copy__tooltip {
    left: auto;
    right: 0;
    top: auto;
    bottom: calc(100% + 0.5rem);
    transform: none;
}

.pg-after-content {
    max-width: var(--pg-wrap-max);
    margin: 0 auto;
    padding: 0 var(--fe-spacing-lg) 3rem;
}
.pg-updated-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--fe-color-text-muted);
    background: var(--fe-color-bg-alt);
    border-radius: var(--fe-radius-lg);
    border: 1px solid var(--fe-color-border);
}
.pg-updated-note svg {
    flex-shrink: 0;
    color: var(--fe-color-text-muted);
    opacity: 0.7;
}

.pg-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--fe-color-primary), rgba(99,102,241,0.8));
    z-index: 9999;
    transition: width 0.1s linear;
    pointer-events: none;
}

@media (max-width: 768px) {
    .pg-hero__title {
        font-size: 1.75rem;
    }
    .pg-hero__content {
        padding: 2.5rem 1.25rem 2rem;
    }
    .pg-hero--has-img {
        min-height: 260px;
    }
    .pg-hero {
        min-height: 220px;
    }
    .pg-content-wrap {
        padding: 1.5rem var(--fe-spacing) 0;
    }
    .pg-share-sidebar {
        display: none;
    }
    .pg-share-inline {
        display: flex;
    }
    .pg-body {
        font-size: 1.0625rem;
    }
    .pg-body h2 { font-size: 1.3125rem; }
    .pg-about-disclosure h2 { font-size: 1.3125rem; }
    .pg-body h3 { font-size: 1.125rem; }
    .pg-toc {
        padding: 1rem 1.25rem;
    }
    .pg-after-content {
        padding: 0 var(--fe-spacing) 2rem;
    }
}

@media (max-width: 480px) {
    .pg-hero__title {
        font-size: 1.5rem;
    }
    .pg-hero__content {
        padding: 2rem 1rem 1.5rem;
    }
    .pg-hero {
        min-height: 180px;
    }
    .pg-hero--has-img {
        min-height: 220px;
    }
    .pg-hero__meta {
        gap: 0.75rem;
    }
    .pg-breadcrumb {
        font-size: 0.75rem;
    }
}

.pg-about-disclosure {
    max-width: var(--pg-content-max);
}
.pg-about-disclosure h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.25em 0 0.75em;
    letter-spacing: -0.02em;
    line-height: 1.3;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--fe-color-border);
    color: var(--fe-color-text);
}
.pg-about-disclosure__lead {
    margin: 0 0 1.5em;
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--fe-color-text);
}
.pg-about-disclosure__list {
    list-style: disc;
    margin: 0 0 1em;
    padding-left: 1.5rem;
}
.pg-about-disclosure__list li {
    margin: 0 0 0.35em;
    padding-left: 0.25rem;
}
.pg-about-disclosure__list li::marker {
    color: var(--fe-color-text-muted);
}
.pg-about-disclosure__list a {
    color: var(--fe-color-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.125rem;
    line-height: 1.85;
}
.pg-about-disclosure__list a:hover {
    text-decoration: underline;
}
[data-theme="dark"] .pg-about-disclosure__list a {
    color: var(--fe-color-primary);
}

.pg-about-copyright {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fe-color-border);
    max-width: var(--pg-content-max);
}
.pg-about-copyright p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--fe-color-text-muted);
}
