/* Pages opened from buttons: .pg--small (card in the centre) and .pg--large (panel on the left half of the screen) */
.pg { position: fixed; inset: 0; z-index: 9100; font-family: "Roboto", system-ui, sans-serif; font-size: 17px; line-height: 1.6; color: #35300f; }
.pg *, .pg *::before, .pg *::after { box-sizing: border-box; }
.pg__scrim { position: absolute; inset: 0; background: rgba(30, 24, 12, .62); backdrop-filter: blur(5px); opacity: 0; transition: opacity .35s; }
.pg.is-open .pg__scrim { opacity: 1; }
.pg__box { position: absolute; display: flex; flex-direction: column; background: #f6ecdc; outline: none; }
.pg__x {
  position: absolute; z-index: 3; top: 16px; right: 16px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: #b54c39; color: #fff; cursor: pointer; transition: background-color .25s, transform .45s cubic-bezier(.22, 1, .36, 1);
}
.pg__x svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.pg__x:hover { background: #8f3a2b; transform: rotate(90deg); }
.pg__x:focus-visible, .pg__body:focus-visible { outline: 3px solid #f2c46d; outline-offset: 2px; }
.pg__title { margin: 0; font: 800 clamp(22px, 2.4vw, 32px)/1.1 "Montserrat", sans-serif; text-transform: uppercase; color: #b54c39; overflow-wrap: anywhere; }

/* text from the editor */
.pg__text > :first-child { margin-top: 0; }
.pg__text p { margin: 0 0 1em; }
.pg__text h2 { margin: 1.4em 0 .5em; font: 800 1.35em/1.2 "Montserrat", sans-serif; text-transform: uppercase; color: #2f3f2f; }
.pg__text h3 { margin: 1.2em 0 .4em; font: 700 1.12em/1.25 "Montserrat", sans-serif; color: #b54c39; }
.pg__text ul, .pg__text ol { margin: 0 0 1em; padding-left: 1.4em; }
.pg__text li { margin: .25em 0; padding-left: .2em; }
.pg__text li::marker { color: #b54c39; font-weight: 700; }
.pg__text blockquote { margin: 1.2em 0; padding: .6em 1em; border-left: 5px solid #b54c39; background: rgba(181, 76, 57, .08); border-radius: 0 12px 12px 0; font-style: italic; }
.pg__text a { color: #b54c39; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pg__text a:hover { color: #8f3a2b; }
.pg__text .ql-align-center { text-align: center; }
.pg__text .ql-align-right { text-align: right; }
.pg__text .ql-align-justify { text-align: justify; }
.pg__empty { color: #6b6340; font-style: italic; }
.pg__skel i { display: block; height: 14px; margin: 0 0 14px; border-radius: 7px; background: linear-gradient(90deg, #e8d9c2 25%, #f3e8d6 50%, #e8d9c2 75%) 0 0 / 300% 100%; animation: pg-shimmer 1.2s linear infinite; }
.pg__skel i:nth-child(2) { width: 85%; } .pg__skel i:nth-child(3) { width: 92%; } .pg__skel i:nth-child(4) { width: 55%; }
@keyframes pg-shimmer { to { background-position: -300% 0; } }

/* nice scrollbar */
.pg__body { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b54c39 rgba(181, 76, 57, .12); }
.pg__body::-webkit-scrollbar { width: 12px; }
.pg__body::-webkit-scrollbar-track { margin: 8px 0; border-radius: 12px; background: rgba(181, 76, 57, .1); box-shadow: inset 0 0 0 1px rgba(181, 76, 57, .08); }
.pg__body::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 12px; background: linear-gradient(180deg, #c9604b, #b54c39 60%, #8f3a2b) padding-box; }
.pg__body::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #d4705a, #b54c39) padding-box; }

/* ---------- large: left half of the screen, full height ---------- */
.pg--large .pg__box {
  left: 0; top: 0; width: 50vw; height: 100vh; height: 100dvh; box-shadow: 30px 0 80px rgba(0, 0, 0, .45);
  transform: translateX(-102%); transition: transform .55s cubic-bezier(.22, 1, .36, 1);
}
.pg--large.is-open .pg__box { transform: none; }
.pg--large .pg__box { padding-right: 10px; }
.pg--large .pg__box::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 10px; background: repeating-linear-gradient(180deg, #b54c39 0 14px, #f2c46d 14px 20px); pointer-events: none; }
.pg--large .pg__head { padding: 28px 70px 18px 44px; border-bottom: 2px solid rgba(181, 76, 57, .22); background: linear-gradient(180deg, #efe3d2, #f6ecdc); }
.pg--large .pg__body { flex: 1 1 auto; min-height: 0; padding: 30px 36px 44px 44px; }
@media (max-width: 900px) { .pg--large .pg__box { width: 100vw; padding-right: 0; } .pg--large .pg__box::after { display: none; } .pg--large .pg__head { padding: 22px 64px 14px 22px; } .pg--large .pg__body { padding: 22px 14px 36px 22px; } }

/* ---------- small: a "postage stamp" card in the centre ---------- */
.pg--small { display: grid; place-items: center; padding: 22px 14px; }
.pg--small .pg__box {
  position: relative; width: 100%; max-width: 560px; max-height: min(86vh, 760px); padding: 46px 10px 12px; border-radius: 6px;
  background:
    radial-gradient(circle at 50% -60px, rgba(181, 76, 57, .14) 0 140px, transparent 141px),
    #f6ecdc;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .5), 0 0 0 10px #f6ecdc, 0 0 0 11px rgba(181, 76, 57, .35);
  opacity: 0; transform: translateY(26px) rotate(-1.6deg) scale(.94); transition: opacity .35s, transform .6s cubic-bezier(.34, 1.56, .64, 1);
}
.pg--small.is-open .pg__box { opacity: 1; transform: none; }
.pg--small.is-closing .pg__box { opacity: 0; transform: translateY(14px) scale(.96); transition-duration: .3s; }
/* perforated inner frame, like the edge of a stamp */
.pg--small .pg__box::before { content: ""; position: absolute; inset: 8px; border: 2px dashed rgba(181, 76, 57, .5); border-radius: 4px; pointer-events: none; }
.pg__badge { position: absolute; left: 50%; top: -30px; z-index: 2; width: 60px; height: 60px; margin-left: -30px; display: grid; place-items: center; border-radius: 50%; background: #b54c39; color: #f2c46d; box-shadow: 0 0 0 6px #f6ecdc, 0 8px 20px rgba(0, 0, 0, .35); }
.pg__badge svg { width: 28px; height: 28px; fill: currentColor; }
.pg--small .pg__x { top: 14px; right: 14px; width: 34px; height: 34px; background: rgba(181, 76, 57, .14); color: #b54c39; }
.pg--small .pg__x:hover { background: #b54c39; color: #fff; }
.pg--small .pg__head { padding: 8px 54px 14px; text-align: center; }
.pg--small .pg__title { font-size: clamp(20px, 3vw, 26px); }
.pg--small .pg__head::after { content: ""; display: block; width: 90px; height: 6px; margin: 14px auto 0; background: radial-gradient(circle, #b54c39 2.5px, transparent 3px) 0 0 / 15px 6px repeat-x; }
.pg--small .pg__body { flex: 1 1 auto; min-height: 0; margin: 0 8px; padding: 6px 24px 26px; }
.pg--small .pg__text { font-size: 16.5px; }

@media (prefers-reduced-motion: reduce) { .pg__scrim, .pg__box, .pg__x { transition: none !important; } .pg__skel i { animation: none; } }
