/* Publication page: the article head with the cover as a book beside the text, and the PDF as the main action.
   Loads after ../article/article.built.css and reuses its tokens. */
.pub-head{padding-block-end:clamp(36px,calc(5*var(--vw)),72px)}
.pub-grid{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:clamp(28px,calc(5*var(--vw)),72px);align-items:start}
.pub-text{min-inline-size:0}
.pub-side{display:flex;flex-direction:column;align-items:stretch;inline-size:clamp(220px,calc(28*var(--vw)),320px)}
.pub-side .pub-cover{inline-size:100%}
.pub-head .art-title{max-inline-size:20ch}
.pub-lead{margin-block-start:clamp(18px,calc(2.4*var(--vw)),28px);font-size:var(--body);line-height:1.9;color:var(--ink);max-inline-size:36ch}

/* the cover is shown whole, never cropped: a book, not a banner. Width is fixed so a 380 px scan is never stretched past ~1.2x */
.pub-cover{margin:0;inline-size:clamp(220px,calc(28*var(--vw)),320px);position:relative}
.pub-cover img{display:block;inline-size:100%;block-size:auto;border-radius:3px 8px 8px 3px;box-shadow:0 2px 0 rgba(21,22,59,.12),0 28px 48px -24px rgba(21,22,59,.55)}
[dir=rtl] .pub-cover img{border-radius:8px 3px 3px 8px}
/* spine highlight on the binding side */
.pub-cover:not(.pub-cover--none)::after{content:"";position:absolute;inset-block:0;inset-inline-end:0;inline-size:7%;border-radius:inherit;background:linear-gradient(to left,rgba(0,0,0,.14),rgba(255,255,255,.18) 40%,transparent);pointer-events:none}
[dir=ltr] .pub-cover:not(.pub-cover--none)::after{background:linear-gradient(to right,rgba(0,0,0,.14),rgba(255,255,255,.18) 40%,transparent);inset-inline-end:auto;inset-inline-start:0}

/* no cover: an intentional brand cover instead of the legacy grey placeholder. The title is real text (accessible, translatable) */
.pub-cover--none{aspect-ratio:3/4;display:grid;place-items:center;padding:12% 11%;text-align:center;color:#fff;background:
  linear-gradient(135deg,transparent 0 60%,rgba(3,151,177,.35) 60% 100%),
  linear-gradient(var(--navy),var(--navy));border-radius:8px 3px 3px 8px;box-shadow:0 2px 0 rgba(21,22,59,.12),0 28px 48px -24px rgba(21,22,59,.55);border-inline-end:10px solid rgba(255,255,255,.14)}
.pub-cover--none span{font-family:var(--title);font-weight:700;font-size:clamp(22px,calc(2.6*var(--vw)),30px);line-height:1.5;text-wrap:balance;padding-block:.9em;border-block:2px solid rgba(255,255,255,.4)}

/* the PDF action: one large button, with what the reader gets under it */
.pub-dl{display:flex;flex-direction:column;align-items:stretch;text-align:center;gap:10px;margin-block-start:clamp(22px,calc(3*var(--vw)),36px);color:var(--navy);text-decoration:none}
.pub-dl-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-block-size:44px;padding:4px 24px;border-radius:0;font-weight:700;font-size:17px;line-height:1.2;border:2px solid transparent;cursor:pointer;font-family:inherit;--ogee:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='48' viewBox='0 0 30 48' preserveAspectRatio='none'%3E%3Cpath d='M30%2C0C18%2C0 13%2C3 10%2C10C8%2C15 5%2C20 0%2C24C5%2C28 8%2C33 10%2C38C13%2C45 18%2C48 30%2C48Z'/%3E%3C/svg%3E") left/var(--og) 100% no-repeat,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='48' viewBox='0 0 30 48' preserveAspectRatio='none'%3E%3Cpath d='M0%2C0C12%2C0 17%2C3 20%2C10C22%2C15 25%2C20 30%2C24C25%2C28 22%2C33 20%2C38C17%2C45 12%2C48 0%2C48Z'/%3E%3C/svg%3E") right/var(--og) 100% no-repeat,linear-gradient(#000 0 0) center/calc(100% - 2*var(--og) + 4px) 100% no-repeat;mask:var(--ogee);--og:26px;-webkit-mask:var(--ogee);padding-inline:42px;min-block-size:56px;padding:4px 42px;font-size:20px;font-weight:800;background:var(--navy);color:#fff;border-radius:0;transition:background-color .25s,translate .3s}
.pub-dl-btn{--dl:url("data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2024%2024%22%20fill=%22none%22%20stroke=%22%23000%22%20stroke-width=%221.8%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M12%204v11M7.500%2011l4.500%204.500%204.500-4.500M5%2020h14%22/%3E%3C/svg%3E")}
.pub-dl-btn i{inline-size:24px;block-size:24px;background:currentColor;-webkit-mask:var(--dl) center/contain no-repeat;mask:var(--dl) center/contain no-repeat;transition:translate .35s cubic-bezier(.2,.8,.2,1)}
.pub-dl-info{font-size:15px;color:var(--muted)}
.pub-dl-btn{inline-size:100%}
.pub-dl:hover .pub-dl-btn{background:var(--teal-deep)}
.pub-dl:hover .pub-dl-btn i{translate:0 3px}
.pub-dl:focus-visible{outline:3px solid var(--navy);outline-offset:6px;border-radius:8px}
@media (prefers-reduced-motion:reduce){.pub-dl-btn,.pub-dl-btn i{transition:none}.pub-dl:hover .pub-dl-btn i{translate:none}}

@media (max-width:759px){
  .pub-grid{grid-template-columns:1fr;justify-items:center;text-align:start}
  .pub-text{justify-self:stretch;order:2}
  .pub-side{order:1;inline-size:min(72%,300px)}
  .pub-dl,.pub-dl-btn{inline-size:100%;justify-content:center}.pub-dl{align-items:stretch}.pub-dl-info{text-align:center}
}

/* optional abstract: its own section under the blue header, at reading width. Without one the page goes straight to the pager */
.pub-abstract{inline-size:min(var(--measure),100% - 2*var(--gap));margin-inline:auto;margin-block-start:clamp(36px,calc(5*var(--vw)),64px)}
.pub-abstract h2{display:flex;align-items:center;gap:14px;font-family:var(--title);font-size:clamp(22px,calc(2.6*var(--vw)),26px);color:var(--teal-deep);margin-block-end:6px}

.pub-abstract p{font-size:18px;line-height:1.9;color:var(--ink)}
.pub-draft{display:inline-block;margin-block-start:10px;padding:0 10px;font-size:13px;font-weight:700;color:var(--muted);border:1px dashed var(--muted);border-radius:4px}


/* one white panel holds the banner content and the abstract, framed by the Ibad ornament border (brand/shapes/ibad-border).
   The border image is a navy copy at 38% (img/ibad-border-navy.svg) so the frame is faded; --o sets its size (.22 = 40 px band, the floor is .2) */
.pub-card{--ic:rgba(35,58,146,.38);border-image-source:url(img/ibad-border-navy.svg);background:#fff;padding:clamp(4px,calc(2*var(--vw)),24px) clamp(0px,calc(2*var(--vw)),20px)}
.pub-card .pub-abstract{inline-size:auto;max-inline-size:none;margin:clamp(22px,calc(3*var(--vw)),34px) 0 0}

/* no diamond divider between the panel and the previous/next pager: the pager starts right after the blue section */
.pub .art-after{margin-block-start:3px}
.pub .art-after::before{display:none}
.pub-head{border-block-end:0}

/* room outside the ornament border, so the frame never sits on the edge of the blue section */
.pub-card{margin-inline:clamp(8px,calc(2.5*var(--vw)),56px)}

/* bigger ornament: .32 = 59 px band on desktop; phones keep the .2 floor so the content keeps its width */
.pub-card{--o:.32}
@media (max-width:759px){.pub-card{--o:.2}}

/* same colour inside and outside the framed block: the whole section is white */
.pub-head{background:#fff}

/* phones: the book column is wider so "تحميل PDF" stays on one line; slightly tighter button and body type */
@media (max-width:759px){
  .pub-side{inline-size:min(86%,320px)}
  .pub-dl-btn{padding-inline:30px;white-space:nowrap;font-size:19px}
  .pub-abstract p{font-size:16.5px;line-height:1.85}
}
@media (max-width:379px){.pub-dl-btn{padding-inline:22px;font-size:18px}}

/* previous / next: a solid navy text part plus a cover part with the whole book (aspect ratio kept, never cropped) */
.pub-pager{display:grid;grid-template-columns:1fr 1fr;gap:3px;inline-size:100%}
.pub-pg{display:flex;align-items:stretch;background:var(--navy);color:#fff;text-decoration:none;min-inline-size:0;transition:background-color .3s}
.pub-pg-next{flex-direction:row-reverse}
.pg-cover{flex:none;inline-size:clamp(120px,calc(15*var(--vw)),200px);padding:clamp(16px,calc(2.2*var(--vw)),30px);background:#1B2C78;display:grid;align-content:center}
.pg-cover img{display:block;inline-size:100%;block-size:auto;border-radius:3px;box-shadow:0 14px 26px -14px rgba(0,0,0,.6);transition:transform .5s cubic-bezier(.2,.8,.2,1)}
.pg-none{aspect-ratio:3/4;display:grid;place-items:center;padding:10%;text-align:center;background:var(--teal-deep);border-radius:3px;font-family:var(--title);font-weight:700;font-size:15px;line-height:1.4;color:#fff;overflow:hidden}
.pg-solid{flex:1;min-inline-size:0;display:flex;flex-direction:column;justify-content:center;gap:6px;padding:clamp(18px,calc(2.6*var(--vw)),40px)}
.pg-solid small{font-size:14px;font-weight:800;color:#8fd6e4;letter-spacing:.02em}
.pg-solid strong{font-family:var(--title);font-size:clamp(20px,calc(2.4*var(--vw)),30px);line-height:1.4;text-wrap:balance}
.pg-solid time{font-size:15px;opacity:.8}
.pub-pg:hover{background:#2c47ad}
.pub-pg:hover .pg-cover img{transform:scale(1.04)}
.pub-pg:focus-visible{outline:3px solid #fff;outline-offset:-6px}
@media (prefers-reduced-motion:reduce){.pg-cover img,.pub-pg{transition:none}.pub-pg:hover .pg-cover img{transform:none}}
@media (max-width:760px){.pub-pager{grid-template-columns:1fr}.pub-pg-next{flex-direction:row}.pg-cover{inline-size:112px}}

/* the cover touches the edges of its part: no padding, no frame; aspect ratio kept (height follows the width), anchored to the top */
.pg-cover{padding:0;display:block;overflow:hidden;inline-size:clamp(112px,calc(13*var(--vw)),190px)}
.pg-cover img{border-radius:0;box-shadow:none}
.pg-none{border-radius:0;block-size:100%;min-block-size:100%}
@media (max-width:760px){.pg-cover{inline-size:112px}}

/* both covers sit on the start side (right in Arabic), not mirrored */
.pub-pg-next{flex-direction:row}

/* the book column floats to the end side and the text wraps around it, then runs full width under the book when it is long */
.pub-grid{display:flow-root}
.pub-side{float:inline-end;margin-inline-start:clamp(28px,calc(5*var(--vw)),72px);margin-block-end:clamp(18px,calc(2.5*var(--vw)),32px)}
@media (max-width:759px){.pub-side{float:none;margin-inline:auto}}

/* phones: the abstract leaves the framed block and sits under it on the white section (a second copy of the same text; one is hidden at each size) */
.pub-abstract--out{display:none}
@media (max-width:759px){
  .pub-card .pub-abstract{display:none}
  .pub-abstract--out{display:block;inline-size:auto;max-inline-size:none;margin:clamp(22px,calc(6*var(--vw)),32px) 0 0}
}

/* the type label (كتيّب): same plain style as before, just bigger */
.pub .art-kind{font-size:20px}
