/*
 * webonvps local customizations. Loaded separately from Casper's built/screen.css
 * so upstream rebuilds do not overwrite these rules.
 */

/* Table of contents */
.wv-toc {
    margin: 0 auto 2.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    background: var(--color-bg, #fff);
    font-size: 0.95rem;
}
.wv-toc[hidden] { display: none; }
.wv-toc-title {
    margin: 0 0 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.wv-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.wv-toc-item { margin: 0.3rem 0; }
.wv-toc-h3 { padding-left: 1.25rem; }
.wv-toc a { text-decoration: none; }
.wv-toc a:hover,
.wv-toc a.is-active { text-decoration: underline; }

/* Prism code blocks */
.gh-content pre[class*="language-"] {
    position: relative;
    margin: 1.5rem 0;
    border-radius: 8px;
    font-size: 0.9rem;
}
.wv-code-lang {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    opacity: 0.65;
    pointer-events: none;
}

/* Categories / archive pages */
.wv-page-header {
    margin: 0 auto 2rem;
    text-align: center;
}
.wv-page-title { margin-bottom: 0.5rem; }
.wv-page-description { opacity: 0.8; }
.wv-category-list,
.wv-archive-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 720px;
}
.wv-category-item {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
}
.wv-archive-year {
    margin: 2.5rem auto 0.75rem;
    max-width: 720px;
    font-size: 1.6rem;
}
.wv-archive-month {
    margin: 1.5rem auto 0.5rem;
    max-width: 720px;
    font-size: 1.2rem;
}
.wv-archive-list li {
    margin: 0.4rem 0;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.wv-archive-date {
    display: inline-block;
    min-width: 4.5rem;
    opacity: 0.7;
}

/* Self-hosted native comments */
.wv-comments {
    margin: 2.5rem auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border, #e5e7eb);
}
.wv-comments-title { font-size: 1.3rem; }
.wv-comments-note {
    padding: 1rem;
    border-radius: 6px;
    background: rgba(127, 127, 127, 0.08);
    font-size: 0.9rem;
}
.wv-comments .article-comments { margin: 0; }

/* Privacy link in footer */
.wv-footer-privacy { margin-left: 1rem; }

/* Skip link: visible only when focused */
.wv-skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 1000;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    background: var(--color-bg, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    text-decoration: none;
}
.wv-skip-link:focus { top: 1rem; }

/* Shared site navigation (header + footer) */
.wv-site-nav { border-top: 1px solid var(--color-border, #e5e7eb); border-bottom: 1px solid var(--color-border, #e5e7eb); }
.wv-site-nav-list {
    list-style: none;
    margin: 0 auto;
    padding: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    max-width: 1200px;
    justify-content: center;
}
.wv-site-nav-list a {
    display: inline-block;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.95rem;
}
.wv-site-nav-list a:hover,
.wv-site-nav-list a:focus-visible { text-decoration: underline; }
.wv-site-nav-list a[aria-current="page"] {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}
.site-footer .wv-site-nav { margin-top: 1.5rem; border-top: 1px solid var(--color-border, #e5e7eb); border-bottom: 0; }

/* Pagination controls (archive + category lists) */
.wv-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem auto;
    max-width: 720px;
}
.wv-pagination[hidden] { display: none; }
.wv-pagination button {
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}
.wv-pagination button:hover:not([disabled]) { text-decoration: underline; }
.wv-pagination button[disabled] { opacity: 0.45; cursor: default; }
.wv-pagination-status { font-size: 0.9rem; opacity: 0.85; }

/* Archive grouping wrappers (added by archive.js) */
.wv-archive-year-group,
.wv-archive-month-group { max-width: 720px; margin-left: auto; margin-right: auto; }
.wv-archive-year-group[hidden],
.wv-archive-month-group[hidden] { display: none; }

/* Search hub */
.wv-search-box-wrap { margin-bottom: 2rem; }
.wv-search-label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.wv-search-box { display: flex; flex-wrap: wrap; gap: 0.75rem; max-width: 720px; }
.wv-search-input {
    flex: 1 1 16rem;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: var(--color-bg, #fff);
    color: inherit;
    font: inherit;
}
.wv-search-modal-btn {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}
.wv-search-hint { margin-top: 0.5rem; font-size: 0.9rem; opacity: 0.8; }
.wv-search-result { min-height: 1.25rem; margin-top: 0.35rem; font-size: 0.9rem; }
.wv-search-results { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; }
.wv-search-item { padding: 0.75rem 0; border-bottom: 1px solid var(--color-border, #e5e7eb); }
.wv-search-item[hidden] { display: none; }
.wv-search-item a { font-weight: 600; }
.wv-search-excerpt { display: block; margin-top: 0.2rem; font-size: 0.9rem; opacity: 0.85; }
.wv-search-date { display: block; margin-top: 0.2rem; font-size: 0.8rem; opacity: 0.7; }

/* Article: extra public tags + adjacent-post navigation */
.wv-article-tag a { text-decoration: none; }
.wv-article-tag a:hover { text-decoration: underline; }
.wv-post-nav { margin-top: 2rem; }
.wv-post-nav-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.wv-post-nav a { display: flex; flex-direction: column; text-decoration: none; max-width: 45%; }
.wv-post-nav-next { margin-left: auto; text-align: right; }
.wv-post-nav-label { font-size: 0.8rem; opacity: 0.7; }
.wv-post-nav-title { font-weight: 600; }
.wv-post-nav a:hover .wv-post-nav-title { text-decoration: underline; }

/* Content formatting: tables, media, anchors, focus and motion */
.gh-content { overflow-wrap: break-word; }
.gh-content h2,
.gh-content h3 { scroll-margin-top: 5rem; }
.gh-content :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.gh-content table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; margin: 1.5rem 0; }
.gh-content th,
.gh-content td { border: 1px solid var(--color-border, #e5e7eb); padding: 0.5rem 0.75rem; text-align: left; }
.gh-content blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--color-border, #e5e7eb); opacity: 0.95; }
.gh-content img,
.gh-content video { max-width: 100%; height: auto; }
.gh-content figcaption { font-size: 0.85rem; opacity: 0.75; text-align: center; }
.wv-static-page .article-title { margin-bottom: 1.5rem; }

@media (max-width: 640px) {
    .wv-toc { padding: 1rem; }
    .wv-toc-h3 { padding-left: 0.75rem; }
    .wv-site-nav-list { gap: 0.25rem 0.75rem; }
    .wv-pagination { gap: 0.5rem; flex-wrap: wrap; }
    .wv-post-nav a { max-width: 100%; }
    .wv-post-nav-next { margin-left: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    .wv-site-nav-list a,
    .wv-pagination button,
    .wv-post-nav a { transition: none; }
}
