/* =========================================================
   OLD ZOMBIE v20 — редактор форума и медиа в сообщениях
   ========================================================= */

/* ---------- Редактор ---------- */
.oz-editor { position: relative; border: 1px solid var(--line-2); border-radius: 16px; background: rgba(8, 12, 20, .6); transition: border-color .2s, box-shadow .2s; }
.oz-editor:focus-within { border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(168, 85, 255, .14), 0 10px 40px rgba(120, 40, 220, .12); }
.ed-bar { position: sticky; top: var(--tb); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); border-radius: 16px 16px 0 0; background: rgba(12, 17, 27, .95); backdrop-filter: blur(10px); }
.ed-group { display: flex; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.ed-bar button { display: inline-flex; align-items: center; gap: 7px; height: 34px; min-width: 34px; padding: 0 9px; border: 0; border-radius: 9px; background: none; color: #aab3c3; font-size: 13px; font-weight: 700; cursor: pointer; transition: .15s; justify-content: center; }
.ed-bar button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.ed-bar button:active { transform: scale(.94); }
.ed-media .ed-accent { color: #fff; background: var(--grad-violet); box-shadow: var(--shadow-violet); }
.ed-media .ed-accent:hover { background: var(--grad-violet); filter: brightness(1.1); }
.ed-media [data-ed="video"] i { color: #ff4e4e; }
.ed-tabs { display: flex; gap: 2px; margin-left: auto; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .03); }
.ed-tabs button { height: 30px; font-size: 12px; }
.ed-tabs .active { color: #fff; background: rgba(139, 61, 255, .3); }
.ed-emoji { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); }
.ed-emoji[hidden] { display: none; }
.ed-emoji button { width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; font-size: 20px; cursor: pointer; transition: transform .15s, background .15s; }
.ed-emoji button:hover { background: rgba(255, 255, 255, .06); transform: scale(1.2); }
.ed-area { position: relative; }
.oz-editor .ed-input { display: block; width: 100%; min-height: 160px; margin: 0; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important; padding: 14px 16px; resize: vertical; line-height: 1.65; font-size: 15px; }
.oz-editor .ed-input.ed-hide { position: absolute; opacity: 0; pointer-events: none; height: 1px !important; min-height: 0; padding: 0; }
.ed-preview { min-height: 160px; padding: 14px 16px; }
.ed-preview[hidden] { display: none; }
.ed-drop { position: absolute; inset: 8px; z-index: 4; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--violet-2); border-radius: 12px; background: rgba(30, 14, 56, .88); color: #fff; font-size: 14px; }
.ed-drop i { font-size: 34px; color: var(--lilac); animation: edBounce 1s ease-in-out infinite; }
@keyframes edBounce { 50% { transform: translateY(-6px); } }
.oz-editor.dragging .ed-drop { display: flex; }
.ed-uploads { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 10px; }
.ed-uploads[hidden] { display: none; }
.ed-up { position: relative; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); cursor: pointer; animation: xReqIn .3s ease both; }
.ed-up img { width: 100%; height: 100%; object-fit: cover; }
.ed-up.loading img { filter: brightness(.45) blur(1px); }
.ed-up-bar { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.ed-up-bar i { display: block; width: 0; height: 100%; background: var(--grad-violet); transition: width .15s; }
.ed-up.done .ed-up-bar, .ed-up.fail .ed-up-bar { display: none; }
.ed-up-st { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; text-shadow: 0 1px 4px #000; }
.ed-up.done .ed-up-st { inset: auto 5px 5px auto; width: 20px; height: 20px; border-radius: 50%; background: #2fbf7a; font-size: 10px; }
.ed-up.fail { border-color: var(--red); }
.ed-up.fail .ed-up-st { background: rgba(120, 0, 20, .55); }
.ed-foot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px 10px; border-top: 1px solid var(--line); color: var(--dim); font-size: 11px; }
.ed-foot i { margin-right: 6px; color: var(--lilac); }
.ed-count b { color: var(--muted); }
.ed-pop { display: grid; gap: 6px; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(139, 61, 255, .1), transparent); animation: xReqIn .2s ease both; }
.ed-pop label { font-size: 12px; font-weight: 800; color: var(--muted); }
.ed-pop small { color: var(--dim); font-size: 11px; }
.ed-pop .oz-input { height: 42px; }
.ed-pop-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.ed-pop-act > * { height: 38px; }

/* ---------- Медиа в сообщениях ---------- */
.post-text .post-h { margin: 14px 0 8px; font-weight: 900; line-height: 1.25; color: #fff; }
.post-text h3.post-h { font-size: 22px; }
.post-text h4.post-h { font-size: 18px; }
.post-text h5.post-h { font-size: 16px; }
.post-text h3.post-h::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 8px; border-radius: 3px; background: var(--grad-violet); }
.post-list { margin: 6px 0 10px; padding-left: 4px; list-style: none; }
.post-list li { position: relative; padding-left: 22px; margin: 4px 0; }
.post-list li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; border-radius: 2px; background: var(--violet-2); box-shadow: 0 0 8px rgba(178, 77, 255, .7); transform: rotate(45deg); }
.post-text u { text-decoration-color: var(--violet-2); text-underline-offset: 3px; }
.post-text s { opacity: .7; }
.post-text .pc-red { color: #ff7b88; } .post-text .pc-green { color: #5ef0a8; } .post-text .pc-gold { color: var(--gold); }
.post-text .pc-violet { color: var(--lilac); } .post-text .pc-cyan { color: var(--cyan); }
.post-code { margin: 8px 0 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #070a11; overflow-x: auto; font-size: 13px; line-height: 1.5; white-space: pre; }
.post-code code { color: #c9d4ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.post-spoiler { margin: 8px 0 12px; border-radius: 12px; border: 1px solid var(--line-violet); background: rgba(139, 61, 255, .05); overflow: hidden; }
.post-spoiler summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 800; color: var(--lilac); user-select: none; }
.post-spoiler summary::-webkit-details-marker { display: none; }
.post-spoiler summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-left: auto; font-size: 11px; transition: transform .2s; }
.post-spoiler[open] summary::after { transform: rotate(180deg); }
.post-spoiler[open] summary i::before { content: "\f06e"; }
.post-spoiler > div { padding: 0 14px 12px; }

.post-gallery { display: grid; gap: 6px; margin: 10px 0 12px; max-width: 760px; }
.post-gallery.g1 { grid-template-columns: 1fr; max-width: 640px; }
.post-gallery.g2 { grid-template-columns: 1fr 1fr; }
.post-gallery.g3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.post-gallery.g3 .post-img:first-child { grid-row: span 2; }
.post-gallery.g4 { grid-template-columns: repeat(2, 1fr); }
.post-img { position: relative; display: block; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #0b0f18; cursor: zoom-in; }
.post-img img { display: block; width: 100%; height: 100%; max-height: 520px; object-fit: cover; transition: transform .35s ease, filter .35s; }
.post-gallery.g1 .post-img img { object-fit: contain; height: auto; }
.post-gallery:not(.g1) .post-img { aspect-ratio: 4 / 3; }
.post-gallery.g3 .post-img:first-child { aspect-ratio: auto; }
.post-img:hover img { transform: scale(1.04); filter: brightness(1.08); }
.post-img::after { content: "\f00e"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; opacity: 0; transition: opacity .2s; }
.post-img:hover::after { opacity: 1; }

.post-video { position: relative; max-width: 760px; margin: 10px 0 12px; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; box-shadow: 0 14px 40px rgba(0, 0, 0, .4); }
.post-video.file { aspect-ratio: auto; }
.post-video iframe, .post-video video { display: block; width: 100%; height: 100%; border: 0; }
.post-video video { max-height: 520px; }
.yt-facade { position: relative; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .25s, transform .4s; }
.yt-facade:hover img { opacity: 1; transform: scale(1.03); }
.yt-play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 74px; height: 52px; margin: -26px 0 0 -37px; border-radius: 16px; background: #ff0033; color: #fff; font-size: 22px; box-shadow: 0 10px 30px rgba(255, 0, 51, .45); transition: transform .2s; }
.yt-facade:hover .yt-play { transform: scale(1.1); }
.yt-brand { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; font-weight: 700; }
.yt-brand i { color: #ff3355; }

.post-linkcard { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 8px 0 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .025); color: var(--text) !important; text-decoration: none; transition: .2s; }
.post-linkcard:hover { border-color: var(--line-violet); background: rgba(139, 61, 255, .07); transform: translateY(-1px); }
.post-linkcard > i:first-child { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; background: rgba(139, 61, 255, .16); color: var(--lilac); }
.post-linkcard span { flex: 1; min-width: 0; }
.post-linkcard b, .post-linkcard small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-linkcard small { color: var(--dim); font-size: 12px; }
.post-linkcard > i:last-child { color: var(--dim); font-size: 12px; }

/* ---------- Просмотр фото ---------- */
.oz-lightbox { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 50px 60px 70px; background: rgba(4, 6, 12, .92); backdrop-filter: blur(10px); animation: lbIn .2s ease both; }
@keyframes lbIn { from { opacity: 0; } }
.oz-lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: lbZoom .25s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes lbZoom { from { transform: scale(.94); opacity: 0; } }
.oz-lightbox button { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 14px; background: rgba(20, 24, 36, .8); color: #fff; font-size: 18px; cursor: pointer; transition: .2s; }
.oz-lightbox button:hover { background: var(--violet); }
.lb-x { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; margin-top: -23px; }
.lb-next { right: 14px; top: 50%; margin-top: -23px; }
.lb-bar { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 16px; color: #c9ced7; font-size: 13px; }
.lb-bar a { color: var(--lilac); text-decoration: none; }
.lb-bar a i { margin-right: 6px; }

@media (max-width: 767px) {
  .ed-bar { gap: 4px; padding: 6px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .ed-bar::-webkit-scrollbar { display: none; }
  .ed-group { flex: none; }
  .ed-media span { display: none; }
  .ed-media .ed-accent span { display: inline; }
  .ed-tabs { flex: none; }
  .ed-tabs button { padding: 0 8px; }
  .ed-foot span:first-child { display: none; }
  .ed-foot { justify-content: flex-end; }
  .post-gallery.g3 { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .post-gallery.g3 .post-img:first-child { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 16 / 10; }
  .post-video { border-radius: 10px; }
  .oz-lightbox { padding: 60px 10px 70px; }
  .lb-prev, .lb-next { top: auto; bottom: 10px; margin: 0; }
  .lb-bar { bottom: 26px; }
}
