/* ==========================================================================
   MYCV — DESIGNED PAGES, SCHEMA VERSION 2
   The blocks and behaviours that came with the open-markup platform: the
   sticky header, the social profile, tabs, free HTML, the configurable nav,
   icons, and the companion rules of the behaviours runtime. Everything is
   drawn from the theme tokens (--pg-*), so it follows the light/dark
   palettes on its own. Loaded after page_styles.css or page_bare.css, only
   for designs that use something from version 2.
   ========================================================================== */

/* ── Runtime companions ─────────────────────────────────────────────── */
.pg-theme-anim, .pg-theme-anim * { transition: background-color .2s ease, border-color .2s ease, color .2s ease !important; }
@media (prefers-reduced-motion: reduce) { .pg-theme-anim, .pg-theme-anim * { transition: none !important; } }
[data-reveal] { opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease; }
[data-reveal][data-revealed] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } }
@media (scripting: none) { [data-reveal] { opacity: 1; transform: none; } }
[data-tab-panel][hidden] { display: none !important; }
[hidden] { display: none !important; }
[data-copy][data-copied] { color: var(--pg-accent); }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; }
/* theme-toggle icons: both are in the markup, the page shows the right one */
[data-theme-toggle] .icon-sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .icon-sun { display: inline; }
:root[data-theme="dark"] [data-theme-toggle] .icon-moon { display: none; }
:root[data-theme-mode="dark"]:not([data-theme="light"]) [data-theme-toggle] .icon-sun { display: inline; }
:root[data-theme-mode="dark"]:not([data-theme="light"]) [data-theme-toggle] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme-mode="light"]) [data-theme-toggle] .icon-sun { display: inline; }
  :root:not([data-theme="light"]):not([data-theme-mode="light"]) [data-theme-toggle] .icon-moon { display: none; }
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
:focus-visible { outline: 2px solid var(--pg-accent); outline-offset: 2px; }

/* ── Actions (profile, header, nav) ─────────────────────────────────── */
.pg-act {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--pg-field);
  border-radius: 9999px;
  background: transparent;
  color: var(--pg-ink);
  font: inherit;
  font-family: var(--pg-body);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.pg-act:hover { background: var(--pg-hover); text-decoration: none; }
.pg-act .icon { width: 18px; height: 18px; }
.pg-act.is-primary { background: var(--pg-primary-bg); border-color: var(--pg-primary-bg); color: var(--pg-primary-ink); }
.pg-act.is-primary:hover { opacity: 0.9; background: var(--pg-primary-bg); }
.pg-act.is-accent { background: var(--pg-accent); border-color: var(--pg-accent); color: var(--pg-on-accent); }
.pg-act.is-accent:hover { filter: brightness(0.94); background: var(--pg-accent); }
.pg-act.is-ghost { border-color: transparent; }
.pg-act.is-icon { width: 40px; min-height: 40px; padding: 0; border-color: transparent; border-radius: 50%; }
.pg-act.is-icon:hover { background: var(--pg-accent-soft); color: var(--pg-accent); }
.pg-act.is-icon .icon { width: 20px; height: 20px; }
.pg-badge { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.16em; margin-left: 2px; }

/* ── Header block ───────────────────────────────────────────────────── */
.pg-header { position: relative; z-index: 30; background: var(--pg-background); color: var(--pg-ink); font-family: var(--pg-body); }
.pg-header.is-sticky { position: sticky; top: 0; }
.pg-header.is-glass { background: var(--pg-bar); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.pg-header-inner { display: flex; align-items: center; gap: 12px; max-width: var(--pg-width); min-height: 53px; margin: 0 auto; padding: 0 8px 0 16px; }
.pg-header-text { flex: 1; min-width: 0; }
.pg-header-title { display: flex; align-items: center; gap: 2px; font-family: var(--pg-display); font-size: 1.1875rem; font-weight: 800; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-header-sub { display: block; color: var(--pg-muted); font-size: 0.8125rem; line-height: 16px; }
.pg-header-lead, .pg-header-trail { display: flex; align-items: center; gap: 4px; flex: none; }
/* Two bars stuck to the top would overlap: the owner's bar lets go. */
.pg-ownerbar:has(~ .pg-header.is-sticky) { position: static; }

/* ── Profile block ──────────────────────────────────────────────────── */
.pg-profile { --pg-ring: var(--pg-background); padding: 0; }
.pg-cover { height: var(--pg-cover-h, 200px); overflow: hidden; background: var(--pg-surface); }
.pg-cover img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.pg-cover.is-top img { object-position: top; }
.pg-cover.is-bottom img { object-position: bottom; }
.pg-cover.is-empty { background: linear-gradient(135deg, var(--pg-accent-soft), var(--pg-surface)); }
.pg-profile-body { padding: 12px 16px 0; }
.pg-profile-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-height: calc(var(--pg-avatar, 134px) / 2 + 3px); }
.pg-avatar { flex: none; width: var(--pg-avatar, 134px); height: var(--pg-avatar, 134px); overflow: hidden; border-radius: 50%; background: var(--pg-surface); display: grid; place-items: center; color: var(--pg-muted); font-family: var(--pg-display); font-size: calc(var(--pg-avatar, 134px) * 0.4); font-weight: 700; }
.pg-avatar.is-rounded { border-radius: calc(var(--pg-radius) + 4px); }
.pg-avatar.is-square { border-radius: 0; }
.pg-avatar.has-ring { border: 4px solid var(--pg-ring); }
.pg-avatar img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.pg-profile.has-cover .pg-avatar, .pg-profile.is-social .pg-avatar { margin-top: calc(var(--pg-avatar, 134px) / -2 - 12px); }
.pg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pg-name { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 4px 0 0; font-family: var(--pg-display); font-size: 1.25rem; font-weight: 800; line-height: 1.2; letter-spacing: normal; }
.pg-handle { margin: 2px 0 0; color: var(--pg-muted); }
.pg-bio { margin: 12px 0; }
.pg-bio p { margin: 0; }
.pg-bio p + p { margin-top: 0.6em; }
.pg-bio a, .pg-meta a, .pg-html a { color: var(--pg-accent-text); text-decoration: none; }
.pg-html a:hover { text-decoration: underline; }
.pg-bio a:hover, .pg-meta a:hover { text-decoration: underline; }
.pg-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 12px; padding: 0; color: var(--pg-muted); }
.pg-meta li { display: inline-flex; align-items: center; gap: 4px; list-style: none; }
.pg-meta .icon { width: 18px; height: 18px; }
.pg-stats { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 4px; padding: 0; color: var(--pg-muted); font-size: 0.875rem; }
.pg-stats li { list-style: none; }
.pg-stats b { color: var(--pg-ink); font-weight: 700; }

.pg-profile.is-centered .pg-profile-body { text-align: center; }
.pg-profile.is-centered .pg-profile-row { flex-direction: column; align-items: center; }
.pg-profile.is-centered .pg-actions, .pg-profile.is-centered .pg-name,
.pg-profile.is-centered .pg-meta, .pg-profile.is-centered .pg-stats { justify-content: center; }
.pg-profile.is-centered:not(.has-cover) .pg-avatar { margin-top: 0; }
@media (min-width: 700px) {
  .pg-profile.is-split:not(.has-cover) .pg-profile-body { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .pg-profile.is-split:not(.has-cover) .pg-profile-row { grid-row: 1 / span 6; flex-direction: column; min-height: 0; }
  .pg-profile.is-split:not(.has-cover) .pg-avatar { margin-top: 0; }
  .pg-profile.is-split:not(.has-cover) .pg-actions { justify-content: flex-start; }
}
@media (max-width: 500px) {
  .pg-profile { --pg-cover-h-sm: 130px; }
  .pg-cover { height: min(var(--pg-cover-h, 200px), 130px); }
  .pg-avatar { width: min(var(--pg-avatar, 134px), 84px); height: min(var(--pg-avatar, 134px), 84px); font-size: 2rem; }
  .pg-avatar.has-ring { border-width: 3px; }
  .pg-profile.has-cover .pg-avatar, .pg-profile.is-social .pg-avatar { margin-top: -54px; }
  .pg-profile-row { min-height: 45px; }
  .pg-act { min-height: 34px; padding: 0 14px; font-size: 0.875rem; }
  .pg-actions .pg-act.is-outline:not(.keep-mobile) { display: none; }
}

/* ── Tabs block ─────────────────────────────────────────────────────── */
.pg-tabs { padding: 0; }
.pg-tablist { display: flex; border-bottom: 1px solid var(--pg-line); overflow-x: auto; scrollbar-width: none; }
.pg-tablist::-webkit-scrollbar { display: none; }
.pg-tablist.is-sticky { position: sticky; top: var(--pg-sticky-h, 0px); z-index: 15; background: var(--pg-bar); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.pg-tab { appearance: none; flex: 1 0 auto; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 53px; padding: 0 16px; border: 0; background: transparent; color: var(--pg-muted); font: inherit; font-family: var(--pg-body); font-weight: 500; cursor: pointer; }
.pg-tab:hover { background: var(--pg-hover); }
.pg-tab[aria-selected="true"] { color: var(--pg-ink); font-weight: 700; }
.pg-tabs.is-underline .pg-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 56px; max-width: 70%; height: 4px; border-radius: 9999px; background: var(--pg-accent); transform: translateX(-50%); }
.pg-tabs.is-pills .pg-tablist { gap: 8px; padding: 10px 16px; border-bottom: 0; }
.pg-tabs.is-pills .pg-tab { flex: 0 0 auto; min-height: 36px; border: 1px solid var(--pg-field); border-radius: 9999px; }
.pg-tabs.is-pills .pg-tab[aria-selected="true"] { background: var(--pg-primary-bg); border-color: var(--pg-primary-bg); color: var(--pg-primary-ink); }
.pg-tabs.is-segmented .pg-tablist { gap: 2px; margin: 10px 16px; padding: 3px; border: 0; border-radius: calc(var(--pg-radius) * 0.6 + 4px); background: var(--pg-surface); }
.pg-tabs.is-segmented .pg-tab { min-height: 36px; border-radius: calc(var(--pg-radius) * 0.6); }
.pg-tabs.is-segmented .pg-tab[aria-selected="true"] { background: var(--pg-background); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.pg-tabpanel { display: grid; gap: var(--pg-gap, 0); min-width: 0; }
.pg-tabpanel-title { margin: 1.25rem 16px 0.25rem; font-family: var(--pg-display); font-size: 1.25rem; }
/* Until the runtime takes over, every panel is on the page under its label:
   that is what a visitor without JavaScript keeps. Where scripting is on, the
   stacked state is held back for a moment so it does not flash, and comes
   back by itself if the runtime never arrives. */
.pg-tabs:not([data-tabs-ready]) .pg-tablist { display: none; }
.pg-tabs[data-tabs-ready] .pg-tabpanel-title { display: none; }
@media (scripting: enabled) {
  /* The bar keeps its place from the first paint, so nothing jumps when the
     runtime wakes it up. */
  .pg-tabs:not([data-tabs-ready]) .pg-tablist { display: flex; }
  .pg-tabs:not([data-tabs-ready]) .pg-tabpanel:not(.is-default),
  .pg-tabs:not([data-tabs-ready]) .pg-tabpanel-title { visibility: hidden; height: 0; margin: 0; overflow: hidden; animation: pg-tabs-fallback 0s linear 4s forwards; }
}
@keyframes pg-tabs-fallback { to { visibility: visible; height: auto; margin: revert-layer; overflow: visible; } }
/* A style's card treatment is for top-level blocks; a tabs block is only a
   frame around other blocks, which bring their own. */
html[data-style] body .pg-block.pg-tabs { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }

/* ── HTML block and template partials ───────────────────────────────── */
.pg-html { min-width: 0; }
.pg-html img, .pg-prose img { max-width: 100%; height: auto; }
.pg-template-error { margin: 0.5rem 0; padding: 0.6rem 0.8rem; border: 1px dashed #d92d20; border-radius: 8px; color: #b42318; font-size: 0.85rem; }
.pg-t-avatar { display: inline-block; flex: none; border-radius: 50%; object-fit: cover; background: var(--pg-surface); }
span.pg-t-avatar.is-empty { width: 40px; height: 40px; }
.pg-t-badge { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.16em; }
.pg-t-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pg-t-chips > * { padding: 6px 12px; border: 1px solid var(--pg-line); border-radius: 9999px; font-size: 0.875rem; list-style: none; }
.pg-t-entry, .pg-t-post { padding: 12px 16px; border-bottom: 1px solid var(--pg-line); }
.pg-t-post { display: flex; gap: 12px; }
.pg-t-post:hover { background: var(--pg-hover); }

/* ── Links with icons ───────────────────────────────────────────────── */
.pg-link-icon { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; margin-right: 12px; border: 1px solid var(--pg-line); border-radius: 50%; }
.pg-link-icon .icon { width: 20px; height: 20px; }
.pg-link-list li.has-icon a { display: flex; align-items: center; }
.pg-link-text { display: grid; flex: 1; min-width: 0; }
.pg-link-text .pg-link-note { margin: 0; }

/* ── Navigation, configured ─────────────────────────────────────────── */
.pg-nav[class*="is-"] { font-family: var(--pg-body); }
.pg-nav-item { appearance: none; display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 0.45rem 0.85rem; border: 0; border-radius: 9999px; background: transparent; color: inherit; font: inherit; font-size: 0.8125rem; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; }
.pg-nav-item:hover { background: var(--pg-accent-soft); color: var(--pg-accent); }
.pg-nav-item .icon { width: 18px; height: 18px; }
.pg-nav.no-labels .pg-nav-item > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pg-nav.is-dock, .pg-nav.is-bar, .pg-nav.is-sidebar, .pg-nav.is-bottom {
  display: flex; max-width: none; margin: 0; border-radius: 0; box-shadow: none; transform: none;
  background: var(--pg-bar); color: var(--pg-ink); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  overflow-x: auto; scrollbar-width: none;
}
.pg-nav.is-dock { position: fixed; left: 50%; right: auto; top: auto; bottom: 1.25rem; z-index: 30; gap: 2px; max-width: calc(100vw - 2rem); padding: 0.3rem; border: 1px solid var(--pg-line); border-radius: 9999px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18); transform: translateX(-50%); }
.pg-nav.is-bar { position: sticky; left: auto; top: 0; bottom: auto; z-index: 31; justify-content: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--pg-line); }
.pg-nav.is-bottom { position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 30; justify-content: space-around; padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--pg-line); }
.pg-nav.is-bottom .pg-nav-item { flex-direction: column; gap: 2px; padding: 0.35rem 0.6rem; font-size: 0.6875rem; }
.pg-nav.is-bottom .pg-nav-item .icon { width: 22px; height: 22px; }
body.has-nav-bottom .pg-main { padding-bottom: 5.5rem; }
.pg-nav.is-sidebar { position: fixed; top: 0; bottom: 0; left: max(0px, calc(50% - var(--pg-width) / 2 - 250px)); z-index: 29; flex-direction: column; align-items: flex-start; gap: 4px; width: 240px; padding: 12px; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; overflow-y: auto; }
.pg-nav.is-sidebar .pg-nav-item { padding: 0.75rem 1rem; font-size: 1.125rem; font-weight: 500; }
.pg-nav.is-sidebar .pg-nav-item .icon { width: 26px; height: 26px; }
@media (max-width: 999px) {
  /* The rail has no room: it becomes what data-mobile asks for. */
  .pg-nav.is-sidebar { top: auto; width: auto; flex-direction: row; align-items: center; background: var(--pg-bar); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); overflow-y: visible; }
  .pg-nav.is-sidebar .pg-nav-item { padding: 0.45rem 0.85rem; font-size: 0.8125rem; font-weight: 600; }
  .pg-nav.is-sidebar .pg-nav-item .icon { width: 18px; height: 18px; }
  .pg-nav.is-sidebar[data-mobile="bottom"], .pg-nav.is-sidebar[data-mobile="bar"] { left: 0; right: 0; bottom: 0; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--pg-line); }
  .pg-nav.is-sidebar[data-mobile="bottom"] .pg-nav-item { flex-direction: column; gap: 2px; font-size: 0.6875rem; }
  .pg-nav.is-sidebar[data-mobile="dock"] { left: 50%; bottom: 1rem; gap: 2px; max-width: calc(100vw - 2rem); padding: 0.3rem; border: 1px solid var(--pg-line); border-radius: 9999px; transform: translateX(-50%); }
  body.has-nav-sidebar .pg-main { padding-bottom: 5.5rem; }
}
@media (max-width: 699px) {
  .pg-nav[data-mobile="hide"] { display: none; }
  .pg-nav.is-dock[data-mobile="bottom"], .pg-nav.is-bar[data-mobile="bottom"] { position: fixed; left: 0; right: 0; top: auto; bottom: 0; justify-content: space-around; max-width: none; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--pg-line); border-radius: 0; box-shadow: none; transform: none; }
  .pg-nav.is-dock[data-mobile="bottom"] .pg-nav-item, .pg-nav.is-bar[data-mobile="bottom"] .pg-nav-item { flex-direction: column; gap: 2px; font-size: 0.6875rem; }
  body.has-nav-dock .pg-main, body.has-nav-bar .pg-main { padding-bottom: 5.5rem; }
}
.pg-builder .pg-nav { display: none; }
@media print { .pg-nav, .pg-header.is-sticky { position: static; } }
