/* Unified detail page surface for all single.php entries. */
.gw-entry--article {
    --detail-line: #e6e9f1;
    --detail-ink: #171d27;
    --detail-muted: #858b98;
    --detail-blue: #1769aa;
    --detail-blue-dark: #0e4f86;
    --detail-bg: #f4f5f9;
    background: var(--detail-bg);
}

.gw-entry--article .gw-container { max-width: 1320px; }
.gw-entry--article .gw-wiki-breadcrumb { margin: 0 auto 14px; padding: 0 4px; color: var(--detail-muted); font-size: 12px; }
.gw-entry--article .gw-wiki-hero-card {
    position: relative;
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 20px;
    min-height: 250px;
    padding: 24px;
    overflow: visible;
    border: 1px solid var(--detail-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(34, 43, 65, .055);
}
.gw-entry--article .gw-wiki-hero-card::after { display: none; }
.gw-entry--article .gw-wiki-hero__cover { align-self: start; width: 160px; height: 202px; border: 0; border-radius: 14px; overflow: hidden; background: #e8f4fc; box-shadow: 0 8px 18px rgba(23, 105, 170, .16); }
.gw-entry--article .gw-wiki-hero__image { width: 100%; height: 100%; object-fit: cover; }
.gw-entry--article .gw-wiki-hero__info { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 0; }
.gw-entry--article .gw-wiki-hero__title { order: 1; margin: 0; color: #17324d; font-size: clamp(27px, 3vw, 42px); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; overflow-wrap: anywhere; }
.gw-entry--article .gw-article-hero__badges { order: 2; display: grid; gap: 7px; width: 100%; margin-top: 12px; padding-bottom: 12px; border-bottom: 1px solid #e9e4fb; }
.gw-entry--article .gw-article-hero__badge-row { display: flex; flex-wrap: wrap; gap: 7px; }
.gw-entry--article .gw-article-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px; border-radius: 999px; background: #f0edfa; color: #716787; font-size: 12px; text-decoration: none; }
.gw-entry--article .gw-article-badge:hover { background: #e6dfff; color: var(--detail-blue); }
.gw-entry--article .gw-article-badge--type { background: #e5ddff; color: #6848ed; font-weight: 700; }
.gw-entry--article .gw-article-badge--category { background: #eee9ff; color: #6848ed; font-weight: 700; }
.gw-entry--article .gw-detail-facts { order: 3; display: inline-flex; flex-wrap: wrap; width: auto; max-width: 100%; margin-top: 14px; padding: 3px 5px; border: 1px solid #e9e3f9; border-radius: 11px; background: #faf8ff; color: #756d84; }
.gw-entry--article .gw-detail-facts span { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 11px; font-size: 12px; }
.gw-entry--article .gw-detail-facts span + span { border-left: 1px solid #e3dcf4; }
.gw-entry--article .gw-detail-facts b { color: #84789d; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.gw-entry--article .gw-detail-facts b::before { display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0; border-radius: 50%; background: #9c83e9; content: ''; vertical-align: middle; }
.gw-entry--article .gw-wiki-hero__contributor { display: none; }
.gw-entry--article .gw-wiki-hero__contributor-label { color: var(--detail-muted); font-size: 10px; letter-spacing: .12em; }
.gw-entry--article .gw-wiki-contributor__name { color: var(--detail-ink); font-weight: 700; }
.gw-entry--article .gw-wiki-hero__actions { position: absolute; right: 24px; bottom: 10px; z-index: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; width: auto; margin: 0; padding: 0; }
.gw-entry--article .gw-wiki-action { min-height: 34px; padding: 0 13px; border: 1px solid #e5def8; border-radius: 999px; background: #f8f6ff; color: #716787; font-size: 12px; font-weight: 700; }
.gw-entry--article .gw-wiki-action:hover { border-color: #cbbdf7; background: #f0ebff; color: var(--detail-blue); transform: translateY(-1px); }
.gw-entry--article .gw-wiki-action:focus-visible { outline: 3px solid rgba(124,92,255,.28); outline-offset: 3px; }
.gw-entry--article .gw-wiki-action__copy { display: grid; gap: 2px; min-width: 0; text-align: left; }
.gw-entry--article .gw-wiki-action__copy strong { color: inherit; font-size: inherit; line-height: 1.2; }
.gw-entry--article .gw-wiki-action__copy small { color: currentColor; font-size: 10px; font-weight: 600; line-height: 1.25; opacity: .78; }
.gw-entry--article .gw-wiki-action--primary { border-color: var(--detail-blue); background: var(--detail-blue); color: #fff; box-shadow: 0 8px 16px rgba(124,92,255,.22); }
.gw-entry--article .gw-wiki-action--primary:hover { background: var(--detail-blue-dark); color: #fff; }
.gw-entry--article .gw-ai-search-anchor { order: 1; display: inline-flex; }
.gw-entry--article .gw-wiki-action--ai-search,
.gw-entry--article .gw-wiki-action--download { min-width: 230px; min-height: 44px; padding: 5px 13px; border-color: var(--detail-blue); border-radius: 11px; background: var(--detail-blue); color: #fff; box-shadow: 0 6px 13px rgba(23,105,170,.18); }
.gw-entry--article .gw-wiki-action--ai-search > span:first-child { font-size: 16px; }
.gw-entry--article .gw-wiki-action--ai-search .gw-wiki-action__copy strong { font-size: 14px; }
.gw-entry--article .gw-wiki-action--ai-search .gw-wiki-action__copy small { font-size: 10px; }
.gw-entry--article .gw-wiki-action--ai-search:hover,
.gw-entry--article .gw-wiki-action--download:hover { background: var(--detail-blue-dark); color: #fff; }
.gw-entry--article .gw-wiki-action--purchase { border-color: #d8dee8; background: #f4f6f9; color: #8993a3; cursor: not-allowed; box-shadow: none; }
.gw-entry--article .gw-wiki-action--purchase:hover { transform: none; background: #f4f6f9; color: #8993a3; }
.gw-entry--article .gw-wiki-action--primary { order: 2; border: 0; background: transparent; box-shadow: none; color: #4d426b; }
.gw-entry--article .gw-wiki-action--primary:hover { background: #f0ebff; color: var(--detail-blue); }
.gw-entry--article .gw-detail-actions__more { position: relative; order: 3; }
.gw-entry--article .gw-detail-actions__more > summary { display: grid; width: 34px; min-height: 34px; place-items: center; border-radius: 999px; color: #5c5276; cursor: pointer; font-size: 16px; font-weight: 800; letter-spacing: 1px; list-style: none; }
.gw-entry--article .gw-detail-actions__more > summary::-webkit-details-marker { display: none; }
.gw-entry--article .gw-detail-actions__more > summary:hover { background: #f0ebff; color: var(--detail-blue); }
.gw-entry--article .gw-detail-actions__menu { position: absolute; right: 0; bottom: calc(100% + 9px); z-index: 30; display: grid; gap: 6px; min-width: 148px; padding: 8px; border: 1px solid #e5def8; border-radius: 12px; background: #fff; box-shadow: 0 14px 30px rgba(57,43,101,.15); }
.gw-entry--article .gw-detail-actions__menu .gw-wiki-action { justify-content: flex-start; width: 100%; border: 0; border-radius: 8px; background: transparent; box-shadow: none; }
.gw-entry--article .gw-detail-actions__menu .gw-wiki-action:hover { background: #f0ebff; }
.gw-entry--article .gw-detail-actions__menu .gw-ai-search-anchor { display: block; }
.gw-entry--article .gw-ai-search-anchor { z-index: 10020; }
.gw-entry--article .gw-ai-search-popover { width: min(360px, calc(100vw - 28px)); min-height: 64px; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.gw-entry--article .gw-wiki-hero__meta { display: none; }
.gw-entry--article .gw-wiki-hero__rating { color: #c98200; }

.gw-entry--article .gw-wiki-main-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; align-items: start; margin-top: 20px; }
.gw-entry--article .gw-wiki-content { border: 1px solid var(--detail-line); border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(34,43,65,.045); }
.gw-entry--article .gw-wiki-content__topline { padding: 20px 30px 0; color: var(--detail-muted); font-size: 11px; letter-spacing: .1em; }
.gw-entry--article .gw-article-content__topline span:first-child { color: var(--detail-blue); font-weight: 800; }
.gw-entry--article .gw-wiki-content__body { padding: 20px 30px 34px; color: #414856; font-size: 16px; line-height: 1.95; overflow-wrap: anywhere; }
.gw-entry--article .gw-wiki-content__body > p:first-of-type { margin-top: 0; color: #303743; font-size: 18px; }
.gw-entry--article .gw-wiki-content__body h2 { margin-top: 2.2em; padding-bottom: 11px; border-bottom: 1px solid var(--detail-line); color: var(--detail-ink); font-size: 26px; }
.gw-entry--article .gw-wiki-content__body h3 { margin-top: 1.8em; color: var(--detail-ink); font-size: 21px; }
.gw-entry--article .gw-wiki-content__body blockquote { margin: 24px 0; border-left: 4px solid #9b83e8; border-radius: 0 12px 12px 0; background: #f5f1ff; color: #5c5770; }
.gw-entry--article .gw-wiki-content__body img { border-radius: 12px; box-shadow: 0 8px 24px rgba(38,50,77,.1); }
.gw-entry--article .gw-wiki-tags, .gw-entry--article .gw-wiki-pagination { margin: 0 30px 26px; padding-top: 18px; border-top: 1px solid var(--detail-line); }
.gw-entry--article .gw-wiki-tag { border-radius: 999px; background: #eef0f5; }
.gw-entry--article .gw-article-toc { position: sticky; top: 84px; border: 1px solid var(--detail-line); border-radius: 16px; background: #fff; box-shadow: 0 8px 22px rgba(34,43,65,.045); }
.gw-entry--article .gw-article-toc__heading { padding: 16px 18px; border-bottom: 1px solid var(--detail-line); }
.gw-entry--article .gw-article-toc__list { padding: 10px; }
.gw-entry--article .gw-article-toc__item a { border-radius: 8px; color: #697283; }
.gw-entry--article .gw-article-toc__item a:hover, .gw-entry--article .gw-article-toc__item a.is-active { background: #f0ebff; color: var(--detail-blue); }
.gw-entry--article .gw-author-card, .gw-entry--article .gw-submission-references { border: 1px solid var(--detail-line); border-radius: 16px; background: #fff; box-shadow: 0 8px 22px rgba(34,43,65,.045); }

@media (max-width: 980px) {
    .gw-entry--article .gw-wiki-hero-card { grid-template-columns: 140px minmax(0, 1fr); min-height: 220px; padding: 20px; }
    .gw-entry--article .gw-wiki-hero__cover { width: 140px; height: 177px; }
    .gw-entry--article .gw-wiki-main-layout { grid-template-columns: minmax(0, 1fr); }
    .gw-entry--article .gw-article-toc { position: static; order: -1; }
}
@media (max-width: 640px) {
    .gw-entry--article .gw-wiki-hero-card { grid-template-columns: 1fr; gap: 20px; min-height: 0; padding: 18px; border-radius: 16px; }
    .gw-entry--article .gw-wiki-hero__cover { width: 100%; max-width: 420px; height: auto; aspect-ratio: 16 / 9; margin: 0 auto; }
    .gw-entry--article .gw-wiki-hero__title { font-size: clamp(28px, 8vw, 32px); }
    .gw-entry--article .gw-wiki-hero__actions { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; order: 5; justify-content: stretch; width: 100%; margin-top: 16px; }
    .gw-entry--article .gw-ai-search-anchor { grid-column: 1 / -1; display: block; width: 100%; }
    .gw-entry--article .gw-ai-search-anchor .gw-wiki-action { width: 100%; min-width: 0; min-height: 52px; justify-content: flex-start; padding: 8px 16px; border-radius: 14px; }
    .gw-entry--article .gw-wiki-hero__actions > .gw-wiki-action--ai-search { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 52px; justify-content: flex-start; padding: 8px 16px; border-radius: 14px; }
    .gw-entry--article .gw-detail-facts { display: flex; width: 100%; }
    .gw-entry--article .gw-detail-facts span { flex: 1 1 calc(50% - 10px); }
    .gw-entry--article .gw-wiki-action { min-height: 44px; flex: 1 1 auto; justify-content: center; }
    .gw-entry--article .gw-wiki-action__copy small { font-size: 10px; }
    .gw-entry--article .gw-wiki-content__topline { padding: 16px 18px 0; }
    .gw-entry--article .gw-wiki-content__body { padding: 18px 18px 26px; font-size: 16px; line-height: 1.9; }
    .gw-entry--article .gw-wiki-content__body > p:first-of-type { font-size: 17px; }
    .gw-entry--article .gw-wiki-content__body h2 { margin-top: 1.9em; font-size: 23px; }
    .gw-entry--article .gw-wiki-content__body h3 { font-size: 19px; }
    .gw-entry--article .gw-wiki-tags, .gw-entry--article .gw-wiki-pagination { margin-right: 18px; margin-left: 18px; }
}
@media (prefers-reduced-motion: reduce) { .gw-entry--article .gw-wiki-action { transition: none; } }
