/* ===== Страница «Плагины для WordPress»: блочный редактор ===== */

.wpp {
    --gold: #ce9248;
    --gold-light: #f3d3a3;
    --cream: #f1e3d3;
    --muted: #a79c8f;
    --ink: #1a1108;
    --line: rgba(255, 255, 255, .09);
    --select: rgba(206, 146, 72, .9);
    --glow: 0 0 5px rgba(255, 255, 255, .8);
    --display: "EB Garamond", Georgia, serif;
    --ui: Montserrat, Arial, sans-serif;
    --code: Consolas, "SFMono-Regular", Menlo, monospace;

    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 30px 20px 80px;
    color: var(--cream);
    font-family: var(--ui);
    -webkit-user-select: text;
    user-select: text;
}

.wpp p {
    margin: 0;
}

.wpp-h2 {
    max-width: 760px;
    margin: 0 0 30px;
    font-family: var(--display);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 600;
    line-height: 1.1;
    color: var(--cream);
    text-align: left;
    text-wrap: balance;
}

.wpp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wpp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 24px;
    border-radius: 2px;
    font: 600 15px/1.2 var(--ui);
    text-decoration: none;
    transition: transform .3s ease, box-shadow .3s ease, color .3s;
}

.wpp-btn:focus-visible,
.wpp-publish:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

.wpp-btn--gold {
    color: var(--ink);
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, #9c6528);
}

.wpp-btn--gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -12px rgba(206, 146, 72, .95);
}

.wpp-btn--ghost {
    color: var(--cream);
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
}

.wpp-btn--ghost:hover {
    color: #fff;
    box-shadow: inset 0 0 0 1px #fff;
}

/* --- редактор --- */
.wpp-editor {
    margin-top: 20px;
    border-radius: 10px;
    background: #0b0a09;
    box-shadow: var(--glow), 0 40px 80px -40px rgba(206, 146, 72, .4);
    overflow: hidden;
}

.wpp-editor__bar {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 58px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: #050505;
}

.wpp-editor__logo {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: #fff;
}

.wpp-editor__add {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--gold);
    color: var(--ink);
    font-size: 22px;
    font-weight: 300;
}

.wpp-editor__tools {
    font-size: 18px;
    color: var(--muted);
    letter-spacing: 6px;
}

.wpp-editor__spacer {
    flex: 1;
}

.wpp-editor__preview {
    font-size: 14px;
    color: var(--muted);
}

.wpp-publish {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.wpp-editor__canvas {
    max-width: 820px;
    margin: 0 auto;
    padding: 56px 40px 60px;
}

/* блоки на холсте: обводка и ярлык при наведении, как в Gutenberg */
.wpp-canvas-block,
.wpp-block {
    position: relative;
    border-radius: 2px;
    outline: 1px solid transparent;
    outline-offset: 8px;
    transition: outline-color .2s;
}

.wpp-canvas-block {
    margin-bottom: 26px;
}

.wpp-canvas-block:before,
.wpp-block:before {
    content: attr(data-block);
    position: absolute;
    left: -8px;
    top: -38px;
    padding: 5px 10px;
    border-radius: 2px;
    background: #000;
    box-shadow: inset 0 0 0 1px var(--select);
    font: 600 12px var(--ui);
    color: var(--gold-light);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s, transform .2s;
    pointer-events: none;
}

.wpp-canvas-block:hover,
.wpp-canvas-block:focus-within,
.wpp-block:hover {
    outline-color: var(--select);
}

.wpp-canvas-block:hover:before,
.wpp-canvas-block:focus-within:before,
.wpp-block:hover:before {
    opacity: 1;
    transform: none;
}

/* заголовок «выделен» при загрузке страницы */
.wpp-canvas-block--title.is-selected {
    outline-color: var(--select);
}

.wpp-canvas-block--title.is-selected:before {
    opacity: 1;
    transform: none;
}

.wpp-hero__title {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(38px, 5vw, 60px);
    font-weight: 600;
    line-height: 1.04;
    color: var(--cream);
    text-align: left;
    text-wrap: balance;
}

.wpp-hero__title em {
    font-style: italic;
    background: linear-gradient(40deg, #fff, #d4a729);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wpp .wpp-hero__lead {
    max-width: 640px;
    font-size: 18px;
    line-height: 1.65;
    color: var(--muted);
}

/* вставка блока «Ваш плагин» */
.wpp-inserter {
    position: relative;
    min-height: 80px;
    margin-top: 10px;
}

.wpp-inserter__plus {
    position: absolute;
    left: 0;
    top: 16px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    background: #000;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
    font-size: 22px;
    color: #fff;
}

.wpp-inserter__menu {
    position: absolute;
    left: 44px;
    top: 0;
    display: grid;
    gap: 2px;
    min-width: 210px;
    padding: 6px;
    border-radius: 4px;
    background: #141210;
    box-shadow: 0 16px 30px -10px #000, inset 0 0 0 1px var(--line);
    font-size: 14px;
    color: var(--cream);
    opacity: 0;
    transform: translateY(6px);
}

.wpp-inserter__menu span {
    padding: 8px 10px;
    border-radius: 2px;
}

.wpp-inserter__pick {
    color: var(--ink);
    background: var(--gold);
    font-weight: 700;
}

.wpp-inserter__result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 2px;
    background: linear-gradient(120deg, rgba(206, 146, 72, .18), rgba(206, 146, 72, .04));
    box-shadow: inset 0 0 0 1px var(--select);
    opacity: 0;
    transform: scale(.97);
}

.wpp-inserter__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--gold);
    color: var(--ink);
    font-size: 20px;
}

.wpp-inserter__result b {
    display: block;
    font-size: 16px;
    color: #fff;
}

.wpp-inserter__result small {
    font-size: 13px;
    color: var(--gold-light);
}

.wpp-inserter__ok {
    margin-left: auto;
    font-size: 20px;
    color: #8fbf7a;
}

/* сцены анимации вставки */
.wpp-inserter.is-menu .wpp-inserter__menu {
    opacity: 1;
    transform: none;
    transition: opacity .3s, transform .3s;
}

.wpp-inserter.is-done .wpp-inserter__plus,
.wpp-inserter.is-done .wpp-inserter__menu {
    opacity: 0;
    transition: opacity .2s;
}

.wpp-inserter.is-done .wpp-inserter__result {
    opacity: 1;
    transform: none;
    transition: opacity .4s .15s, transform .4s .15s;
}

/* --- разделы-блоки --- */
.wpp-block {
    margin-top: 110px;
}

.wpp-columns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.wpp-columns > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 26px 22px;
    background: #070605;
}

.wpp-columns b {
    font-family: var(--display);
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
    background: linear-gradient(40deg, #fff, #d4a729);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wpp-columns span {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.wpp-offers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.wpp-offers article {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 26px 24px;
    border-radius: 2px;
    background: #070605;
    box-shadow: inset 0 3px 0 var(--gold), var(--glow);
}

.wpp-offers__tag {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 2px;
    background: rgba(206, 146, 72, .15);
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-light);
}

.wpp-offers h3 {
    margin: 0;
    font-size: 20px;
    color: #fff;
}

.wpp-offers p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--muted);
}

/* код */
.wpp-code-section {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 48px;
    align-items: center;
}

.wpp-code-section__text p {
    font-size: 17px;
    line-height: 1.65;
    color: var(--muted);
}

.wpp-code {
    margin: 0;
    border-radius: 6px;
    background: #050505;
    box-shadow: inset 0 0 0 1px var(--line);
    overflow: hidden;
}

.wpp-code figcaption {
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    font: 12px var(--code);
    color: #6f6961;
}

.wpp-code pre {
    margin: 0;
    padding: 20px 18px;
    overflow-x: auto;
    font: 14px/1.7 var(--code);
    color: var(--cream);
    white-space: pre;
    scrollbar-width: thin;
    scrollbar-color: rgba(206, 146, 72, .5) transparent;
}

.wpp-code pre::-webkit-scrollbar {
    height: 4px;
}

.wpp-code pre::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: rgba(206, 146, 72, .6);
}

.wpp-code .c { color: #6f6961; }
.wpp-code .f { color: var(--gold-light); }
.wpp-code .s { color: #9fcf8a; }
.wpp-code .k { color: #d58e7a; }
.wpp-code .v { color: #8fc3e6; }

/* процесс */
.wpp-process {
    display: grid;
    gap: 10px;
    list-style: none;
    counter-reset: wpp-step;
}

.wpp-process li {
    display: grid;
    grid-template-columns: 48px 260px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 2px;
    background: #070605;
    box-shadow: inset 0 0 0 1px var(--line);
    counter-increment: wpp-step;
}

.wpp-process li:before {
    content: counter(wpp-step);
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--ink);
    font: 700 18px var(--ui);
}

.wpp-process b {
    font-size: 17px;
    color: #fff;
}

.wpp-process span {
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

.wpp-faq .faq {
    max-width: 820px;
}

/* финал: окно перед публикацией */
.wpp-final {
    display: flex;
    justify-content: center;
    margin-top: 120px;
}

.wpp-final__panel {
    width: min(640px, 100%);
    padding: 36px 34px;
    border-radius: 2px;
    background: #0b0a09;
    box-shadow: inset 0 3px 0 var(--gold), var(--glow);
}

.wpp .wpp-final__ask {
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
}

.wpp-final__checks {
    display: grid;
    gap: 8px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
    list-style: none;
    font-size: 15px;
    color: var(--cream);
}

.wpp-final__checks li:before {
    content: "✓";
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 50%;
    background: rgba(143, 191, 122, .18);
    color: #8fbf7a;
    font-size: 12px;
}

.wpp-final .wpp-h2 {
    margin-bottom: 12px;
}

.wpp-final__panel > p:not(.wpp-final__ask) {
    margin-bottom: 24px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

/* --- адаптив --- */
@media (max-width: 960px) {
    .wpp-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wpp-offers,
    .wpp-code-section {
        grid-template-columns: 1fr;
    }

    .wpp-process li {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .wpp-process li span {
        grid-column: 2;
    }
}

@media (max-width: 640px) {
    .wpp {
        padding: 16px 12px 60px;
    }

    .wpp-editor__tools,
    .wpp-editor__preview {
        display: none;
    }

    .wpp-editor__canvas {
        padding: 44px 18px 36px;
    }

    .wpp-inserter__menu {
        min-width: 170px;
    }

    .wpp-block {
        margin-top: 80px;
    }

    .wpp-block:before,
    .wpp-canvas-block:before {
        display: none;
    }

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

    .wpp-process li {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .wpp-process li span {
        grid-column: auto;
    }

    .wpp-final__panel {
        padding: 26px 20px;
    }

    .wpp-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wpp *,
    .wpp *:before,
    .wpp *:after {
        transition: none !important;
    }
}
