/* ==========================================================================
   MYCV — DESIGNED PAGES, BARE BASE  (design.base: "bare")
   Structure, visibility and accessibility only: the column, sane element
   defaults, the form's layout, the CV frame, the builder's handles. None of
   a page style's decoration is here, so a design that brings its own CSS
   starts from a clean page instead of fighting ours with !important.
   The theme still arrives as --pg-* tokens on :root.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.pg {
  margin: 0;
  background: var(--pg-background);
  color: var(--pg-ink);
  font-family: var(--pg-body);
  font-size: 0.9375rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--pg-accent-text, var(--pg-accent)); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-family: var(--pg-display); line-height: 1.2; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }

.pg-main { max-width: var(--pg-width); min-height: 100vh; margin: 0 auto; }
.pg-block { position: relative; min-width: 0; }
.pg-empty { padding: 12px 16px; color: var(--pg-muted); font-size: 0.875rem; }
.pg-ico { flex: none; width: 18px; height: 18px; }

/* ── Owner bar ──────────────────────────────────────────────────────── */
.pg-ownerbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0.55rem 1rem; padding: 0.55rem 1rem;
  background: #111114; color: #d8d8de;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.8125rem;
}
.pg-ownerbar-note { min-width: 0; flex: 1 1 12rem; line-height: 1.35; }
.pg-ownerbar-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; flex: none; margin-left: auto; }
.pg-ownerbar a {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; padding: 0.35rem 0.75rem;
  border-radius: 999px; background: rgba(255, 255, 255, 0.1); white-space: nowrap;
}

/* ── The automatic dock ─────────────────────────────────────────────── */
.pg-nav { position: fixed; left: 50%; bottom: 1.25rem; z-index: 30; display: flex; gap: 2px; max-width: calc(100vw - 2rem); padding: 0.3rem; border: 1px solid var(--pg-line); border-radius: 999px; background: var(--pg-bar); color: var(--pg-ink); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transform: translateX(-50%); overflow-x: auto; scrollbar-width: none; }
.pg-nav::-webkit-scrollbar { display: none; }
.pg-nav > a { flex: none; padding: 0.4rem 0.8rem; border-radius: 999px; color: inherit; font-size: 0.8125rem; font-weight: 500; white-space: nowrap; }
.pg-nav > a:hover { background: var(--pg-accent-soft); text-decoration: none; }

/* ── Blocks: layout only ────────────────────────────────────────────── */
.pg-hero, .pg-facts, .pg-section, .pg-text, .pg-gallery, .pg-links, .pg-doc, .pg-contact, .pg-form { padding: 16px; }
.pg-hero-inner { display: grid; gap: 16px; }
.pg-hero.is-split.has-image .pg-hero-inner { grid-template-columns: minmax(0, 160px) minmax(0, 1fr); align-items: center; }
.pg-hero.is-center .pg-hero-inner { justify-items: center; text-align: center; }
.pg-hero-media img { display: block; width: 100%; max-width: 160px; aspect-ratio: 1; object-fit: cover; }
.pg-buttons, .pg-contacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pg-contacts li, .pg-tags li, .pg-link-list li, .pg-meta li, .pg-stats li { list-style: none; }
.pg-contacts a, .pg-contact-item { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
.pg-btn { display: inline-flex; align-items: 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-weight: 700; text-decoration: none; cursor: pointer; }
.pg-btn:hover { background: var(--pg-hover); text-decoration: none; }
.pg-btn.is-primary { background: var(--pg-accent); border-color: var(--pg-accent); color: var(--pg-on-accent); }
.pg-btn[disabled] { opacity: 0.6; cursor: default; }
.pg-section-head { margin-bottom: 12px; }
.pg-intro, .pg-entry-date, .pg-entry-org, .pg-entry-sub, .pg-link-note { color: var(--pg-muted); }
.pg-entries { display: grid; gap: 16px; }
.pg-bullets { padding-left: 18px; }
.pg-bullets li { margin: 2px 0; }
.pg-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pg-skills { display: grid; gap: 12px; }
.pg-facts-list { display: grid; gap: 8px; }
.pg-fact { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr); gap: 12px; }
.pg-fact dt { color: var(--pg-muted); }
.pg-gallery-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-gallery.cols-1 .pg-gallery-grid { grid-template-columns: 1fr; }
.pg-gallery.cols-3 .pg-gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pg-tile { margin: 0; }
.pg-tile img { display: block; width: 100%; }
.pg-link-list a { display: flex; align-items: center; gap: 8px; padding: 12px 0; color: inherit; }
.pg-link-label { font-weight: 700; }
.pg-link-arrow { margin-left: auto; color: var(--pg-muted); }
.pg-prose > * + * { margin-top: 0.7em; }
.pg-prose ul, .pg-prose ol { padding-left: 1.25em; }
.pg-divider { height: 1px; margin: 0; border: 0; background: var(--pg-line); }

/* ── Contact form ───────────────────────────────────────────────────── */
.pg-form-body { position: relative; display: grid; gap: 12px; max-width: 40rem; margin-top: 12px; }
.pg-form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pg-form-body label { display: grid; gap: 4px; color: var(--pg-muted); font-size: 0.85rem; }
.pg-form-body input, .pg-form-body textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--pg-field); border-radius: 8px; background: var(--pg-background); color: var(--pg-ink); font: inherit; }
.pg-form-body input:focus, .pg-form-body textarea:focus { outline: 2px solid var(--pg-accent); outline-offset: 1px; border-color: transparent; }
.pg-form-body .pg-btn { justify-self: start; }
.pg-form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pg-form-note { color: #b42318; font-size: 0.85rem; }
.pg-form-done { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--pg-accent-soft); }

/* ── The CV frame ───────────────────────────────────────────────────── */
.pg-paper { max-width: 210mm; margin: 12px auto 0; background: #fff; overflow: hidden; }
.pg-paper.is-letter { max-width: 8.5in; }
.pg-paper.is-placeholder { display: grid; place-items: center; min-height: 240px; color: #6b6b73; }
.pg-frame { display: block; width: 100%; min-height: 600px; border: 0; }

/* ── Builder preview: handles ───────────────────────────────────────── */
.pg-builder [data-block] { outline: 1.5px dashed transparent; outline-offset: -2px; cursor: pointer; }
.pg-builder [data-block]:hover { outline-color: var(--pg-accent); }
.pg-builder [data-block].is-selected { outline: 2px solid var(--pg-accent); }
.pg-builder [data-edit] { cursor: text; }
.pg-builder [data-edit]:focus { outline: none; box-shadow: 0 0 0 2px var(--pg-accent); }
.pg-builder [data-edit]:empty::before { content: attr(data-placeholder); color: var(--pg-muted); opacity: 0.6; }
.pg-builder .pg-nav { display: none; }

@media (max-width: 720px) {
  .pg-hero.is-split.has-image .pg-hero-inner, .pg-fact { grid-template-columns: 1fr; }
  .pg-gallery-grid, .pg-gallery.cols-3 .pg-gallery-grid { grid-template-columns: 1fr; }
  .pg-ownerbar {
    flex-direction: column; align-items: stretch; gap: 0.55rem; padding: 0.65rem 0.85rem;
  }
  .pg-ownerbar-note { flex: none; }
  .pg-ownerbar-actions {
    margin-left: 0; width: 100%;
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem;
  }
  .pg-ownerbar a { width: 100%; padding: 0.5rem 0.65rem; font-size: 0.78rem; }
}
@media (max-width: 380px) {
  .pg-ownerbar-actions { grid-template-columns: 1fr; }
}
