/* ===== Meduse Journal (مدوسه استایل): public pages + content studio ===== */
.journal, .studio, .tour {
    --j-burgundy: #4A0018;
    --j-burgundy-soft: #6a1a33;
    --j-gray: #6D6B6B;
    --j-bg: #F8F8FA;
    --j-cream: #F5F1ED;
    --j-ink: #1f1a1c;
    --j-line: rgba(74, 0, 24, .12);
    --j-radius: 18px;
    --j-ease: cubic-bezier(.22, .8, .26, 1);
    color: var(--j-ink);
}
.journal { background: var(--j-bg); padding-bottom: 4rem; }
.journal a { color: inherit; text-decoration: none; }
.journal :focus-visible, .studio :focus-visible { outline: 2px solid var(--j-burgundy); outline-offset: 3px; border-radius: 6px; }

/* ---- buttons / fields ---- */
.jbtn { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem 1.25rem; border: 1px solid var(--j-burgundy); border-radius: 999px; background: var(--j-burgundy); color: #fff !important; font: inherit; font-weight: 600; cursor: pointer; transition: transform .25s var(--j-ease), box-shadow .25s var(--j-ease), background .2s; }
.jbtn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(74, 0, 24, .22); }
.jbtn:active { transform: translateY(0); }
.jbtn[disabled] { opacity: .5; pointer-events: none; }
.jbtn--ghost { background: transparent; color: var(--j-burgundy) !important; }
.jbtn--small { padding: .4rem .9rem; font-size: .85rem; }
.jbtn--danger { background: #9b1c1c; border-color: #9b1c1c; }
.jfield { display: grid; gap: .35rem; margin-bottom: 1rem; }
.jfield > span { font-size: .85rem; color: var(--j-gray); font-weight: 600; }
.jfield input, .jfield textarea, .jfield select, .studio input[type=text], .studio input[type=url], .studio input[type=datetime-local], .studio textarea, .studio select {
    width: 100%; padding: .7rem .9rem; border: 1px solid var(--j-line); border-radius: 12px; background: #fff; font: inherit; color: inherit; transition: border-color .2s, box-shadow .2s;
}
.jfield input:focus, .jfield textarea:focus, .studio input:focus, .studio textarea:focus, .studio select:focus { border-color: var(--j-burgundy); box-shadow: 0 0 0 3px rgba(74, 0, 24, .1); outline: none; }
.jhp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.validation-message { color: #9b1c1c; font-size: .8rem; }

/* ---- masthead ---- */
.jmast { background: linear-gradient(180deg, var(--j-cream), var(--j-bg)); border-bottom: 1px solid var(--j-line); padding-block: clamp(2rem, 5vw, 4rem) 1.2rem; }
.jmast__inner { display: grid; gap: .8rem; justify-items: center; text-align: center; }
.jmast__eyebrow { margin: 0; color: var(--j-burgundy); font-weight: 700; letter-spacing: .02em; font-size: .85rem; }
.jmast__title { margin: 0; font-size: clamp(2rem, 6vw, 3.8rem); line-height: 1.15; color: var(--j-burgundy); font-weight: 800; }
.jmast__lead { margin: 0; max-width: 56ch; color: var(--j-gray); line-height: 1.9; }
.jsearch { position: relative; width: min(520px, 100%); }
.jsearch i { position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%); color: var(--j-gray); }
.jsearch input[type=search] { width: 100%; padding: .8rem 1rem !important; padding-inline-start: 2.9rem !important; border-radius: 999px; border: 1px solid var(--j-line); background: #fff; font: inherit; }
.jchips { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding: .3rem .2rem; }
.jchips::-webkit-scrollbar { display: none; }
.jchip { flex: none; padding: .45rem 1.05rem; border-radius: 999px; border: 1px solid var(--j-line); background: #fff; font-size: .9rem; transition: background .2s, color .2s, transform .2s var(--j-ease); }
.jchip:hover { transform: translateY(-2px); border-color: var(--j-burgundy); }
.jchip.active { background: var(--j-burgundy); color: #fff !important; border-color: var(--j-burgundy); }

.jmain { padding-top: 1.6rem; }
.jadminbar { display: flex; gap: .6rem; flex-wrap: wrap; margin: 0 0 1rem; }

/* ---- cards ---- */
.jcard { break-inside: avoid; margin: 0 0 1.4rem; background: #fff; border-radius: var(--j-radius); overflow: hidden; border: 1px solid var(--j-line); display: flex; flex-direction: column; transition: transform .4s var(--j-ease), box-shadow .4s var(--j-ease); }
.jcard:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(74, 0, 24, .12); }
.jcard__media { display: block; overflow: hidden; background: var(--j-cream); position: relative; }
.jcard--tall .jcard__media { aspect-ratio: 4 / 5; }
.jcard--square .jcard__media { aspect-ratio: 1 / 1; }
.jcard--wide .jcard__media { aspect-ratio: 4 / 3; }
.jcard--portrait .jcard__media { aspect-ratio: 3 / 4; }
.jcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--j-ease); }
.jcard:hover .jcard__media img { transform: scale(1.06); }
.jcard__placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; color: var(--j-burgundy); opacity: .35; }
.jcard__body { padding: 1rem 1.1rem 1.2rem; display: grid; gap: .5rem; }
.jcard__cat { color: var(--j-burgundy) !important; font-size: .78rem; font-weight: 700; justify-self: start; }
.jcard__title { margin: 0; font-size: 1.12rem; line-height: 1.6; font-weight: 700; }
.jcard__title a { background-image: linear-gradient(var(--j-burgundy), var(--j-burgundy)); background-repeat: no-repeat; background-position: right bottom; background-size: 0 2px; transition: background-size .35s var(--j-ease); }
.jcard:hover .jcard__title a { background-size: 100% 2px; }
.jcard__excerpt { margin: 0; color: var(--j-gray); font-size: .9rem; line-height: 1.85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.jcard__meta { margin: 0; display: flex; gap: .45rem; color: var(--j-gray); font-size: .78rem; }

.jfeatured { display: grid; gap: 1.4rem; grid-template-columns: 1.5fr 1fr; margin-bottom: 2rem; }
.jfeatured .jcard { margin: 0; }
.jfeatured .jcard:first-child { grid-row: span 2; }
.jfeatured .jcard:first-child .jcard__media { aspect-ratio: 4 / 3.4; }
.jfeatured .jcard:first-child .jcard__title { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.jfeatured .jcard:not(:first-child) { flex-direction: row; }
.jfeatured .jcard:not(:first-child) .jcard__media { width: 42%; aspect-ratio: auto; min-height: 150px; flex: none; }

.jmasonry { column-count: 4; column-gap: 1.4rem; }
@media (max-width: 1180px) { .jmasonry { column-count: 3; } }
@media (max-width: 860px) {
    .jmasonry { column-count: 2; column-gap: .8rem; }
    .jfeatured { grid-template-columns: 1fr; }
    .jfeatured .jcard:first-child { grid-row: auto; }
    .jcard { margin-bottom: .8rem; }
    .jcard__body { padding: .75rem .8rem .9rem; }
    .jcard__title { font-size: .98rem; }
    .jcard__excerpt { display: none; }
}
@media (max-width: 420px) { .jfeatured .jcard:not(:first-child) { flex-direction: column; } .jfeatured .jcard:not(:first-child) .jcard__media { width: 100%; aspect-ratio: 4 / 3; } }

.jpager { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin-top: 2.4rem; }
.jpager__link { min-width: 2.6rem; text-align: center; padding: .55rem .9rem; border-radius: 12px; border: 1px solid var(--j-line); background: #fff; transition: background .2s, transform .2s; }
.jpager__link:hover { transform: translateY(-2px); }
.jpager__link.is-current { background: var(--j-burgundy); color: #fff !important; border-color: var(--j-burgundy); }

/* ---- home teaser ---- */
.jhome { margin-block: 2.5rem; }
.jhome__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.jhome__head h2 { margin: 0; color: #4A0018; font-size: 1.6rem; }
.jhome__all { color: #4A0018; font-weight: 600; }
.jhome__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.jhome .jcard { margin: 0; }
@media (max-width: 760px) { .jhome__grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .6rem; } .jhome__grid > * { scroll-snap-align: start; } }

/* ---- article ---- */
.jprogress { position: fixed; inset-inline: 0; top: 0; height: 3px; z-index: 60; pointer-events: none; }
.jprogress span { display: block; height: 100%; width: 100%; background: var(--j-burgundy); transform-origin: right; transform: scaleX(0); }
.jarticle { max-width: 980px; }
.jarticle__head { display: grid; gap: .8rem; justify-items: center; text-align: center; padding-block: 1.6rem 1.2rem; }
.jarticle__head h1 { margin: 0; font-size: clamp(1.7rem, 4.5vw, 3rem); line-height: 1.5; font-weight: 800; color: var(--j-burgundy); max-width: 22ch; }
.jarticle__lead { margin: 0; max-width: 60ch; color: var(--j-gray); line-height: 2; font-size: 1.05rem; }
.jarticle__meta { margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; color: var(--j-gray); font-size: .88rem; }
.jarticle__author { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--j-ink) !important; }
.jarticle__author img, .jauthor img { border-radius: 50%; object-fit: cover; }
.jarticle__cover { margin: 0 0 2rem; border-radius: 24px; overflow: hidden; background: var(--j-cream); }
.jarticle__cover img { width: 100%; max-height: 640px; object-fit: cover; display: block; }
.jarticle__body { max-width: 720px; margin-inline: auto; }

.jprose { font-size: 1.08rem; line-height: 2.15; }
.jprose > * { margin-block: 0 1.3rem; }
.jprose h2 { font-size: 1.7rem; line-height: 1.6; margin-top: 2.4rem; color: var(--j-burgundy); }
.jprose h3 { font-size: 1.3rem; line-height: 1.6; margin-top: 1.8rem; }
.jprose a { color: var(--j-burgundy); text-decoration: underline; text-underline-offset: 4px; }
.jprose mark { background: rgba(74, 0, 24, .12); color: inherit; padding-inline: .2em; border-radius: 4px; }
.jprose ul, .jprose ol { padding-inline-start: 1.6rem; }
.jprose li { margin-bottom: .35rem; }
.jquote { margin: 2rem 0; padding: 1.4rem 1.6rem; border-inline-start: 4px solid var(--j-burgundy); background: var(--j-cream); border-radius: 0 16px 16px 0; font-size: 1.25rem; line-height: 2; }
.jquote p { margin: 0; }
.jquote footer { margin-top: .6rem; color: var(--j-gray); font-size: .9rem; }
.jfigure, .jgallery, .jembed { margin: 2rem 0; }
.jfigure img { width: 100%; border-radius: 18px; display: block; }
.jprose figcaption { margin-top: .6rem; color: var(--j-gray); font-size: .85rem; text-align: center; line-height: 1.8; }
.jgallery { display: grid; gap: .6rem; grid-template-columns: repeat(2, 1fr); }
.jgallery img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; display: block; transition: transform .4s var(--j-ease); }
.jgallery img:hover { transform: scale(1.02); }
.jgallery--3 { grid-template-columns: repeat(3, 1fr); }
.jgallery--4 { grid-template-columns: repeat(2, 1fr); }
.jgallery figcaption { grid-column: 1 / -1; }
.jembed { position: relative; }
.jembed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 18px; display: block; background: #000; }
.jtable { overflow-x: auto; margin: 2rem 0; border: 1px solid var(--j-line); border-radius: 14px; }
.jtable table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: .95rem; line-height: 1.8; }
.jtable th, .jtable td { padding: .7rem 1rem; text-align: start; border-bottom: 1px solid var(--j-line); }
.jtable th { background: var(--j-cream); color: var(--j-burgundy); }
.jtable tr:last-child td { border-bottom: 0; }
.jdivider { border: 0; height: 1px; background: var(--j-line); margin-block: 2.4rem; position: relative; overflow: visible; }
.jdivider::after { content: "✦"; position: absolute; inset-inline: 0; top: -.8rem; text-align: center; color: var(--j-burgundy); background: transparent; }
.jshop { margin: 2rem 0; padding: 1rem; background: var(--j-cream); border-radius: 22px; }
.jshop--single { max-width: 300px; margin-inline: auto; }
.jref { display: flex; align-items: center; gap: 1rem; margin: 1.6rem 0; padding: 1rem 1.2rem; border: 1px solid var(--j-line); border-radius: 18px; background: #fff; transition: transform .3s var(--j-ease), box-shadow .3s; text-decoration: none !important; color: var(--j-ink) !important; }
.jref:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(74, 0, 24, .1); }
.jref img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.jref span { flex: 1; display: grid; }
.jref small { color: var(--j-gray); }
.jref i { color: var(--j-burgundy); }
.jtags { list-style: none; padding: 0; margin: 2rem 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.jtags a { display: inline-block; padding: .3rem .8rem; border-radius: 999px; background: var(--j-cream); font-size: .85rem; }
.jshare { display: flex; align-items: center; gap: .6rem; padding-block: 1rem; border-block: 1px solid var(--j-line); margin-block: 1.4rem; color: var(--j-gray); font-size: .9rem; }
.jshare a, .jshare button { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--j-line); background: #fff; color: var(--j-burgundy); cursor: pointer; transition: transform .25s var(--j-ease), background .2s, color .2s; }
.jshare a:hover, .jshare button:hover { background: var(--j-burgundy); color: #fff; transform: translateY(-2px); }
.jauthor { display: flex; gap: 1rem; align-items: center; padding: 1.2rem; background: #fff; border: 1px solid var(--j-line); border-radius: 18px; }
.jauthor p { margin: .2rem 0 0; color: var(--j-gray); line-height: 1.9; font-size: .92rem; }

.jcomments { max-width: 760px; margin-top: 3rem; }
.jcomments h2 { color: var(--j-burgundy); }
.jcomments__list { list-style: none; padding: 0; margin: 1rem 0 2rem; display: grid; gap: .8rem; }
.jcomments__list li { background: #fff; border: 1px solid var(--j-line); border-radius: 16px; padding: 1rem 1.2rem; }
.jcomments__list time { color: var(--j-gray); font-size: .78rem; margin-inline-start: .6rem; }
.jcomments__list p { margin: .4rem 0 0; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.jcomments__form { background: var(--j-cream); border-radius: 20px; padding: 1.4rem; }
.jcomments__form h3 { margin: 0 0 .3rem; color: var(--j-burgundy); }
.jcomments__hint { margin: 0 0 1rem; color: var(--j-gray); font-size: .88rem; }
.jcomments__row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 600px) { .jcomments__row { grid-template-columns: 1fr; } }
.jcomments__notice { padding: .8rem 1rem; border-radius: 12px; font-weight: 600; }
.jcomments__notice.is-ok { background: #e6f4ea; color: #1b5e20; }
.jcomments__notice.is-error { background: #fdecea; color: #9b1c1c; }
.jrelated { margin-top: 3rem; }
.jrelated h2 { color: var(--j-burgundy); }
.jrelated__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.jrelated .jcard { margin: 0; }
@media (max-width: 760px) { .jrelated__grid { grid-template-columns: 1fr; } .jprose { font-size: 1.02rem; } .jarticle__cover { border-radius: 16px; margin-inline: -.4rem; } }

/* scroll reveal (progressive: only hidden when JS marked the page) */
.js-reveal .jcard, .js-reveal .jfigure, .js-reveal .jquote, .js-reveal .jshop { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--j-ease), transform .6s var(--j-ease); }
.js-reveal .is-in { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
    .journal *, .studio * { animation: none !important; transition: none !important; }
    .js-reveal .jcard, .js-reveal .jfigure, .js-reveal .jquote, .js-reveal .jshop { opacity: 1; transform: none; }
}

/* ================= Content Studio ================= */
.studio { background: var(--j-bg); min-height: 70vh; padding-bottom: 5rem; }
.studio__bar { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .7rem 1rem; background: rgba(248, 248, 250, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--j-line); }
.studio__bar h1 { font-size: 1rem; margin: 0; color: var(--j-burgundy); flex: 1; min-width: 8rem; }
.studio__status { font-size: .8rem; color: var(--j-gray); display: inline-flex; align-items: center; gap: .4rem; }
.studio__status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #9aa; }
.studio__status.is-saved::before { background: #2e7d32; }
.studio__status.is-dirty::before { background: #e6a700; }
.studio__status.is-error::before { background: #b71c1c; }
.studio__layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.4rem; max-width: 1380px; margin: 1.2rem auto; padding-inline: 1rem; align-items: start; }
@media (max-width: 1000px) { .studio__layout { grid-template-columns: minmax(0, 1fr); } }
.studio__canvas, .studio__side { min-width: 0; }
.studio__canvas img, .studio__canvas iframe { max-width: 100%; }
.studio__canvas { background: #fff; border: 1px solid var(--j-line); border-radius: 22px; padding: clamp(1rem, 3vw, 2.4rem); margin-inline: auto; width: 100%; transition: max-width .3s var(--j-ease); }
.studio__canvas[data-device="tablet"] { max-width: 768px; }
.studio__canvas[data-device="mobile"] { max-width: 390px; }
.studio__side { display: grid; gap: 1rem; position: sticky; top: 4.4rem; max-height: calc(100vh - 5.4rem); overflow: auto; }
@media (max-width: 1000px) { .studio__side { position: static; max-height: none; } }
.spanel { background: #fff; border: 1px solid var(--j-line); border-radius: 18px; padding: 1rem 1.1rem; }
.spanel > summary, .spanel > h2 { font-weight: 700; font-size: .95rem; margin: 0; cursor: pointer; color: var(--j-burgundy); }
.spanel[open] > summary { margin-bottom: .8rem; }
.spanel label { display: grid; gap: .25rem; font-size: .8rem; color: var(--j-gray); margin-bottom: .7rem; }
.spanel label.row { display: flex; align-items: center; gap: .5rem; }
.spanel label.row input { width: auto; }
.stitle { width: 100%; border: 0 !important; box-shadow: none !important; font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; color: var(--j-burgundy); padding: .2rem 0 !important; background: transparent !important; }
.sexcerpt { border: 0 !important; box-shadow: none !important; color: var(--j-gray); line-height: 1.9; resize: vertical; padding-inline: 0 !important; }
.scover { border: 1px dashed var(--j-line); border-radius: 18px; padding: .8rem; margin-bottom: 1.2rem; display: grid; gap: .6rem; }
.scover img { width: 100%; max-height: 280px; object-fit: cover; border-radius: 14px; }

.sblocks { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; margin-top: 1rem; }
.sblock > * { min-width: 0; }
.studio .img-uploader__picker input[type=file] { max-width: 100%; }
.sblock { position: relative; padding: .5rem .6rem .6rem; padding-inline-start: 2.6rem; border: 1px solid transparent; border-radius: 14px; transition: border-color .2s, background .2s, transform .2s; }
.sblock:hover, .sblock:focus-within { border-color: var(--j-line); background: #fcfcfd; }
.sblock.is-dragging { opacity: .4; }
.sblock.is-over { border-color: var(--j-burgundy); background: rgba(74, 0, 24, .04); }
.sblock__rail { position: absolute; inset-inline-start: .3rem; top: .4rem; display: grid; gap: .15rem; opacity: .35; transition: opacity .2s; }
.sblock:hover .sblock__rail, .sblock:focus-within .sblock__rail { opacity: 1; }
.sblock__rail button { width: 1.8rem; height: 1.8rem; border: 0; border-radius: 8px; background: transparent; color: var(--j-gray); cursor: pointer; }
.sblock__rail button:hover { background: var(--j-cream); color: var(--j-burgundy); }
.sblock__rail .drag { cursor: grab; }
.sblock__type { font-size: .7rem; color: var(--j-gray); margin-bottom: .2rem; display: block; }
.sed { min-height: 2.4rem; line-height: 2; font-size: 1.05rem; outline: none; padding: .2rem .1rem; overflow-wrap: anywhere; }
.sed:empty::before { content: attr(data-placeholder); color: #aaa; }
.sed--quote { border-inline-start: 4px solid var(--j-burgundy); padding-inline-start: 1rem; font-size: 1.2rem; }
.sed--h2 { font-size: 1.6rem; font-weight: 800; color: var(--j-burgundy); }
.sed--h3 { font-size: 1.25rem; font-weight: 700; }
.sblock input[type=text], .sblock input[type=url], .sblock textarea { margin-top: .4rem; font-size: .9rem; }
.sblock textarea { min-height: 6rem; line-height: 1.9; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; margin: .5rem 0; }
.sgrid figure { margin: 0; position: relative; }
.sgrid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.sgrid button { position: absolute; top: 4px; inset-inline-end: 4px; border: 0; border-radius: 50%; width: 1.6rem; height: 1.6rem; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; }
.stable { width: 100%; border-collapse: collapse; margin: .5rem 0; }
.stable td { border: 1px solid var(--j-line); padding: 0; }
.stable input { border: 0 !important; border-radius: 0 !important; margin: 0 !important; }
.sref { display: flex; align-items: center; gap: .8rem; padding: .6rem; border: 1px solid var(--j-line); border-radius: 14px; background: #fff; }
.sref img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.sinsert { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; padding: .6rem; border: 1px dashed var(--j-line); border-radius: 16px; background: rgba(245, 241, 237, .5); }
.sinsert button { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .8rem; border: 1px solid var(--j-line); border-radius: 999px; background: #fff; font: inherit; font-size: .82rem; cursor: pointer; transition: transform .2s var(--j-ease), border-color .2s; }
.sinsert button:hover { transform: translateY(-2px); border-color: var(--j-burgundy); color: var(--j-burgundy); }
.stoolbar { position: sticky; top: 3.7rem; z-index: 30; display: flex; flex-wrap: wrap; gap: .25rem; padding: .35rem; margin-bottom: .8rem; background: #fff; border: 1px solid var(--j-line); border-radius: 14px; box-shadow: 0 8px 22px rgba(74, 0, 24, .07); }
.stoolbar button { min-width: 2.1rem; height: 2.1rem; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font: inherit; color: var(--j-ink); }
.stoolbar button:hover { background: var(--j-cream); color: var(--j-burgundy); }
.stoolbar .sep { width: 1px; background: var(--j-line); margin-inline: .2rem; }
.smodal { position: fixed; inset: 0; z-index: 80; background: rgba(20, 8, 12, .55); display: grid; place-items: center; padding: 1rem; animation: sfade .2s; }
.smodal__card { background: #fff; width: min(620px, 100%); max-height: 86vh; overflow: auto; border-radius: 22px; padding: 1.2rem; display: grid; gap: .8rem; }
.smodal__card header { display: flex; justify-content: space-between; align-items: center; }
.smodal__card h2 { margin: 0; font-size: 1.1rem; color: var(--j-burgundy); }
.spick { display: grid; gap: .5rem; }
.spick button { display: flex; gap: .8rem; align-items: center; text-align: start; padding: .6rem; border: 1px solid var(--j-line); border-radius: 14px; background: #fff; font: inherit; cursor: pointer; }
.spick button:hover { border-color: var(--j-burgundy); background: var(--j-bg); }
.spick img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; }
.sdevice { display: inline-flex; border: 1px solid var(--j-line); border-radius: 999px; overflow: hidden; }
.sdevice button { padding: .35rem .8rem; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: .8rem; }
.sdevice button.is-on { background: var(--j-burgundy); color: #fff; }
.sbanner { padding: .8rem 1rem; background: #fff7e0; border: 1px solid #f0d58a; border-radius: 14px; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin: 1rem auto 0; max-width: 1380px; }
.stoast { position: fixed; bottom: 1.2rem; inset-inline-start: 1.2rem; z-index: 90; background: var(--j-burgundy); color: #fff; padding: .7rem 1.1rem; border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); animation: sfade .25s; }
.stoast.is-error { background: #9b1c1c; }
@keyframes sfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- admin journal extras ---- */
.jstatus { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.jstatus--1 { background: #eceff1; color: #455a64; }
.jstatus--2 { background: #fff3cd; color: #8a6d00; }
.jstatus--3 { background: #e6f4ea; color: #1b5e20; }
.jstatus--4 { background: #fdecea; color: #9b1c1c; }
.jcomment { display: grid; gap: .4rem; padding: 1rem; border: 1px solid var(--line, #e5e5e5); border-radius: 14px; background: #fff; }
.jcomment p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
.jcomment__meta { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .8rem; color: #777; }

/* ---- Jalali date picker ---- */
.jdp { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.jdp select { flex: 1 1 auto; min-width: 4.2rem; width: auto; padding: .55rem .6rem; border: 1px solid rgba(74, 0, 24, .18); border-radius: 12px; background: #fff; font: inherit; }
.jdp select:focus { border-color: #4A0018; outline: none; box-shadow: 0 0 0 3px rgba(74, 0, 24, .1); }

/* ---- image layouts: width, crop, alignment, text wrapping ---- */
.jprose { display: flow-root; }
.jfigure { width: var(--jw, 100%); }
.jfigure img { height: auto; object-fit: cover; }
.jfigure--center { margin-inline: auto; }
.jfigure--full { width: 100%; }
.jfigure--left, .jfigure--right { margin-block: .3rem 1rem; }
.jfigure--left { float: left; margin-right: 1.4rem; }
.jfigure--right { float: right; margin-left: 1.4rem; }
.jprose h2, .jprose h3, .jdivider, .jgallery, .jtable, .jembed, .jshop { clear: both; }
@media (max-width: 640px) {
    .jfigure--left, .jfigure--right { float: none; width: 100%; margin-inline: 0; }
    .jfigure[style*="--jw"] { --jw: 100%; }
}
/* studio: live preview + controls */
.simg { display: grid; gap: .7rem; }
.simg__preview { border: 1px dashed var(--j-line); border-radius: 16px; padding: .8rem; background: #fff; max-height: 420px; overflow: auto; }
.simg__preview .jprose { font-size: .95rem; line-height: 2; }
.simg__preview .jprose p { color: #8a8a8a; margin: 0; }
.simg__focus { position: relative; cursor: crosshair; touch-action: none; }
.simg__focus img { width: 100%; display: block; border-radius: 12px; pointer-events: none; user-select: none; }
.simg__dot { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #fff; background: var(--j-burgundy); box-shadow: 0 0 0 2px var(--j-burgundy), 0 4px 10px rgba(0,0,0,.35); pointer-events: none; }
.simg__row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.simg__row > strong { font-size: .8rem; color: var(--j-gray); min-width: 3.2rem; }
.simg__chip { padding: .4rem .8rem; border: 1px solid var(--j-line); border-radius: 999px; background: #fff; font: inherit; font-size: .82rem; cursor: pointer; transition: background .2s, color .2s, transform .2s var(--j-ease); }
.simg__chip:hover { transform: translateY(-1px); border-color: var(--j-burgundy); }
.simg__chip.is-on { background: var(--j-burgundy); color: #fff; border-color: var(--j-burgundy); }
.simg input[type=range] { flex: 1; min-width: 9rem; accent-color: var(--j-burgundy); }

/* ---- interactive crop + image/text media block ---- */
.jcrop { display: block; position: relative; overflow: hidden; width: 100%; }
.jcrop img { position: absolute; max-width: none; height: auto; border-radius: 0; }
.jfigure .jcrop, .jmedia__fig .jcrop { border-radius: 18px; }
.jmedia { display: flex; flex-direction: row; gap: 1.6rem; align-items: flex-start; margin: 2rem 0; clear: both; }
.jmedia--left { flex-direction: row-reverse; }
.jmedia__fig { flex: 0 0 var(--jw, 40%); max-width: var(--jw, 40%); margin: 0; }
.jmedia__fig img { width: 100%; height: auto; display: block; border-radius: 18px; object-fit: cover; }
.jmedia__text { flex: 1; min-width: 0; margin: 0; }
@media (max-width: 640px) {
    .jmedia, .jmedia--left { flex-direction: column; gap: 1rem; }
    .jmedia__fig { flex-basis: auto; max-width: 100%; width: 100%; }
}

/* ---- Notion-style studio: block menu, + buttons, media block, source mode, crop modal ---- */
.sblock__rail .is-on { background: var(--j-burgundy); color: #fff; }
.sadd { display: flex; align-items: center; justify-content: center; width: 100%; height: 1.2rem; margin: -.15rem 0; border: 0; background: transparent; color: var(--j-burgundy); cursor: pointer; opacity: 0; transition: opacity .2s; position: relative; }
.sadd::before { content: ""; position: absolute; inset-inline: 2.6rem 0; top: 50%; height: 1px; background: var(--j-line); }
.sadd i { position: relative; z-index: 1; width: 1.25rem; height: 1.25rem; display: grid; place-items: center; font-size: .7rem; border-radius: 50%; background: #fff; border: 1px solid var(--j-burgundy); }
.sadd:hover, .sadd:focus-visible { opacity: 1; }
@media (hover: none) { .sadd { opacity: .55; } }
.sinsert { border: 0; background: transparent; padding: 0; }
.sinsert__main { display: inline-flex; align-items: center; gap: .5rem; width: 100%; justify-content: center; padding: .9rem; border: 1px dashed var(--j-line); border-radius: 16px; background: transparent; color: var(--j-gray); font: inherit; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.sinsert__main:hover { border-color: var(--j-burgundy); color: var(--j-burgundy); background: rgba(74, 0, 24, .03); }
.sinsert__main small { opacity: .75; }
.smenu { width: min(720px, 100%); }
.smenu__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.smenu__grid button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .7rem; align-items: center; text-align: start; padding: .7rem .8rem; border: 1px solid var(--j-line); border-radius: 14px; background: #fff; font: inherit; cursor: pointer; transition: border-color .2s, transform .2s var(--j-ease), box-shadow .2s; }
.smenu__grid button:hover, .smenu__grid button:focus-visible { border-color: var(--j-burgundy); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(74, 0, 24, .1); }
.smenu__grid i { grid-row: span 2; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 10px; background: var(--j-cream); color: var(--j-burgundy); }
.smenu__grid small { color: var(--j-gray); font-size: .72rem; }
.ssrc { min-height: 7rem; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; line-height: 1.7; }
.ssrc__preview { margin-top: .5rem; padding: .7rem .9rem; border: 1px dashed var(--j-line); border-radius: 12px; background: #fcfcfd; }
.ssrc__preview small { color: var(--j-gray); }
.smedia { display: flex; flex-direction: row; gap: 1rem; align-items: flex-start; }
.smedia--left { flex-direction: row-reverse; }
.smedia__fig { flex: 0 0 40%; min-width: 0; margin: 0; }
.smedia__fig figure { margin: 0; }
.smedia__fig img { width: 100%; display: block; border-radius: 14px; }
.smedia__empty { display: grid; place-items: center; gap: .4rem; min-height: 9rem; border: 2px dashed var(--j-line); border-radius: 14px; color: var(--j-gray); font-size: .85rem; }
.smedia__empty i { font-size: 1.6rem; color: var(--j-burgundy); opacity: .5; }
.smedia__text { flex: 1; min-width: 0; }
@media (max-width: 640px) { .smedia, .smedia--left { flex-direction: column; } .smedia__fig { flex-basis: auto !important; width: 100%; } }
.scropcard { width: min(760px, 100%); }
.scropcard__hint { margin: 0; color: var(--j-gray); font-size: .85rem; }
.scrop { display: grid; place-items: center; background: #1a1114; border-radius: 14px; padding: .6rem; }
.scrop__wrap { position: relative; display: inline-block; max-width: 100%; line-height: 0; overflow: hidden; user-select: none; touch-action: none; }
.scrop__wrap img { max-width: 100%; max-height: 52vh; display: block; }
.scrop__box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(20, 8, 12, .55); cursor: move; touch-action: none;
    background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px); background-size: 33.33% 33.33%; }
.scrop__h { position: absolute; width: 18px; height: 18px; background: #fff; border: 3px solid var(--j-burgundy); border-radius: 50%; box-sizing: border-box; }
.scrop__h--nw { left: -9px; top: -9px; cursor: nwse-resize; } .scrop__h--n { left: calc(50% - 9px); top: -9px; cursor: ns-resize; } .scrop__h--ne { right: -9px; top: -9px; cursor: nesw-resize; }
.scrop__h--e { right: -9px; top: calc(50% - 9px); cursor: ew-resize; } .scrop__h--se { right: -9px; bottom: -9px; cursor: nwse-resize; } .scrop__h--s { left: calc(50% - 9px); bottom: -9px; cursor: ns-resize; }
.scrop__h--sw { left: -9px; bottom: -9px; cursor: nesw-resize; } .scrop__h--w { left: -9px; top: calc(50% - 9px); cursor: ew-resize; }

/* block actions float above the block as a compact toolbar (works for short and tall blocks alike) */
.sblock { padding-inline-start: .6rem; }
.sblock__rail { inset-inline-start: auto; inset-inline-end: .4rem; top: -1.15rem; flex-direction: row; gap: .1rem; padding: .15rem; background: #fff; border: 1px solid var(--j-line); border-radius: 10px; box-shadow: 0 6px 16px rgba(74, 0, 24, .1); opacity: 0; z-index: 5; display: flex; pointer-events: none; }
.sblock:hover .sblock__rail, .sblock:focus-within .sblock__rail { opacity: 1; pointer-events: auto; }
.sblock__rail button { width: 1.9rem; height: 1.9rem; }
@media (hover: none) { .sblock__rail { opacity: .9; pointer-events: auto; } }
.sblock { margin-top: .9rem; }

/* ---- guided tour ---- */
.tour { position: fixed; inset: 0; z-index: 120; direction: rtl; }
.tour__shield { position: absolute; inset: 0; }
.tour__hole { position: fixed; display: none; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(20, 8, 12, .62), 0 0 0 3px #fff, 0 0 0 6px rgba(74, 0, 24, .9); pointer-events: none; transition: top .35s var(--j-ease, ease), left .35s var(--j-ease, ease), width .35s var(--j-ease, ease), height .35s var(--j-ease, ease); }
.tour__card { position: fixed; width: min(380px, calc(100vw - 16px)); background: #fff; color: #1f1a1c; border-radius: 20px; padding: 1.1rem 1.2rem 1rem; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); display: grid; gap: .55rem; animation: sfade .25s; transition: top .35s ease, left .35s ease; }
.tour__count { font-size: .75rem; color: #6D6B6B; }
.tour__title { margin: 0; font-size: 1.1rem; color: #4A0018; line-height: 1.6; }
.tour__text { margin: 0; line-height: 2; font-size: .92rem; color: #333; }
.tour__dots { display: flex; gap: .3rem; flex-wrap: wrap; }
.tour__dots span { width: .45rem; height: .45rem; border-radius: 50%; background: #e3d9dc; transition: background .2s, transform .2s; }
.tour__dots span.is-on { background: #4A0018; transform: scale(1.3); }
.tour__nav { display: flex; justify-content: space-between; gap: .5rem; margin-top: .2rem; }
.tour__links { display: flex; justify-content: space-between; gap: .5rem; }
.tour__links button { border: 0; background: transparent; color: #6D6B6B; font: inherit; font-size: .8rem; cursor: pointer; text-decoration: underline; padding: .2rem 0; }
.tour__links button:hover { color: #4A0018; }
.tour__card--sheet { top: auto !important; left: 8px !important; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; border-radius: 20px 20px 16px 16px; }
@media (prefers-reduced-motion: reduce) { .tour__hole, .tour__card { transition: none; animation: none; } }
.tour__hole--none { box-shadow: 0 0 0 9999px rgba(20, 8, 12, .62); }

/* ---- video embeds ---- */
.jembed { max-width: 100%; }
.jembed iframe { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 18px; background: #000; }
.sembed__preview { margin: .6rem 0; }
.sembed__error { color: #9b1c1c; }
