/* ==========================================================================
   Princess & Paladin — shared stylesheet
   princessandpaladin.com

   Load from any folder depth with an absolute path:
     <link rel="stylesheet" href="/assets/pp.css">

   Page-specific rules stay in that page's own <style> block.
   Exception: the two self-care flowcharts share /assets/self-care.css

   CONTENTS
     1. Fonts
     2. Tokens
     3. Section palettes          <- accent + tint + background, per folder
     4. Base
     5. Layout
     6. Panels
     7. Navigation
     8. Hero + emblem
     9. Ribbon                    <- the compact subpage header
    10. Link cards + tiles
    11. Parchment callout
    12. Buttons, pills, tags
    13. Form controls
    14. Shared widgets           <- modal, coin, toggle, chip, card
    15. Legacy component names   <- .panel .btn .tag .empty .title, etc.
    16. Footer
    17. Dannelore type override
    18. Utilities
    19. Motion + print
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. FONTS
   Google Fonts still load from the HTML <head>. Copy this line into any page:

   <link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Jost:wght@300;400;500;600&display=swap" rel="stylesheet">

   Dannelore pages add these three as well:
   Montserrat:ital,wght@0,500;0,600;0,700;1,500  |  Princess+Sofia  |  Ubuntu:ital,wght@0,300;0,400;0,500;1,400
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   2. TOKENS
   -------------------------------------------------------------------------- */

:root{

  /* --- the six canonical colors --- */
  --pink:      #E87CA6;
  --sage:      #8FA37E;
  --gold:      #9C7440;
  --burgundy:  #6E2430;
  --blade:     #B23A3A;   /* the sword blade, and nothing else */
  --ink:       #2E241F;

  /* --- supporting shades, derived from the six --- */
  --pink-deep: #C85D87;
  --sage-deep: #6D8259;
  --gold-deep: #7C5B30;
  --ink-soft:  #6B5E54;
  --blade-deep:#7C1F2A;

  /* --- two extra hues, for the sections that already had them --- */
  --dusk:        #6B4A78;   /* side quests */
  --dusk-deep:   #523862;
  --pumpkin:     #C96A2E;   /* spooky quest */
  --pumpkin-deep:#A4501C;

  /* --- quest-log currency --- */
  --quest-gold:   #C9A227;
  --quest-copper: #B87333;
  --meow:         #7F77DD;

  /* --- the section accent ---
     Every folder overrides these in section 3. Panels, nav pills, buttons
     and the inset hairline all read from here, so a folder changes color
     by setting a few variables and nothing else. Default is pink. */
  --accent:      var(--pink);
  --accent-deep: var(--pink-deep);
  --accent-soft: rgba(232,124,166,0.14);   /* washes and tints */
  --on-accent:   #fff;                     /* text that sits on the accent */

  /* The inset panel line. Points at the accent so panels follow the folder.
     Set this one line to var(--pink) to put the rose hairline back sitewide. */
  --hairline: var(--accent);

  /* --- surfaces --- */
  --panel:            #FFFDF8;
  --panel-tint:       #FFF7FA;   /* panel on hover */
  --parchment:        #EDE1C3;
  --parchment-border: #C9B688;
  --white:            #FFFFFF;

  /* --- lines --- */
  --line:        rgba(46,36,31,0.16);
  --line-strong: rgba(46,36,31,0.28);
  --line-gold:   rgba(156,116,64,0.32);

  /* --- type --- */
  --font-display: 'Cormorant Garamond',serif;
  --font-serif:   'Cormorant Garamond',serif;
  --font-body:    'Jost',sans-serif;

  /* --- corners --- */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* --- layout ---
     The content column is 980px. A sidebar ADDS to that width rather than
     eating into it, so a page with a sidebar is 980 + sidebar + gap wide. */
  --content:   980px;
  --sidebar:   300px;
  --gap:       24px;
  --pad-x:     24px;

  /* --- shadow --- */
  --lift:    0 2px 10px rgba(46,36,31,0.06);
  --lift-lg: 0 8px 24px rgba(46,36,31,0.12);
}


/* --------------------------------------------------------------------------
   3. SECTION PALETTES
   Put the matching class on <body>. Subfolders use the parent's class:
   every page under /castle/ gets class="pp-castle", and so on.

   Each folder sets its own background + accent (--accent, --accent-deep,
   --accent-soft, --panel, --panel-tint) plus any font override, in a small
   file under /assets/themes/ — home.css, castle.css, dannelore.css,
   side-quests.css, templates.css, vmprman.css. Load the matching one right
   after this file. The components everywhere else in pp.css just read
   var(--accent) etc. and never need to change per folder.
   -------------------------------------------------------------------------- */

body[class*="pp-"]{
  background-attachment: fixed;
}


/* --------------------------------------------------------------------------
   4. BASE
   -------------------------------------------------------------------------- */

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a{ color: var(--accent-deep); text-decoration: none; }
a:hover{ text-decoration: underline; }

:focus-visible{
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

h1,h2,h3,h4{
  font-family: var(--font-serif);
  font-weight: 600;
  margin: 0 0 0.4em;
  line-height: 1.2;
}

.pp-display{ font-family: var(--font-display); font-weight: 400; }


/* --------------------------------------------------------------------------
   5. LAYOUT
   .pp-wrap    — a 980px content column, centered
   .pp-layout  — content column + sidebar, where the sidebar adds width
   -------------------------------------------------------------------------- */

.pp-wrap{
  max-width: calc(var(--content) + (var(--pad-x) * 2));
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* A wider wrap, for the board-style pages */
.pp-wrap-wide{
  max-width: calc(1300px + (var(--pad-x) * 2));
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.pp-layout{
  display: grid;
  grid-template-columns: minmax(0,1fr) var(--sidebar);
  gap: var(--gap);
  align-items: start;
  max-width: calc(var(--content) + var(--sidebar) + var(--gap) + (var(--pad-x) * 2));
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* Sidebar on the left instead */
.pp-layout.pp-layout-left{
  grid-template-columns: var(--sidebar) minmax(0,1fr);
}

.pp-col{
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
}

@media (max-width: 820px){
  .pp-layout,
  .pp-layout.pp-layout-left{ grid-template-columns: 1fr; }
}


/* --------------------------------------------------------------------------
   6. PANELS
   Every panel carries the inset hairline, in the folder's accent. It needs
   room to breathe — keep at least 20px of padding, or use .pp-panel-tight.
   -------------------------------------------------------------------------- */

.pp-panel{
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 26px 28px;
  box-shadow: var(--lift);
}

.pp-panel::before{
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--hairline);
  border-radius: calc(var(--radius-sm) - 6px);
  opacity: 0.35;
  pointer-events: none;
}

.pp-panel-md{ border-radius: var(--radius-md); }
.pp-panel-md::before{ border-radius: calc(var(--radius-md) - 6px); }

.pp-panel-lg{ border-radius: var(--radius-lg); padding: 30px 32px; }
.pp-panel-lg::before{ inset: 10px; border-radius: calc(var(--radius-lg) - 8px); }

/* Small cards: extra padding so the inset line clears the content */
.pp-panel-tight{ padding: 20px 16px; }
.pp-panel-tight::before{ inset: 6px; }

/* Opt out of the inset line entirely */
.pp-panel-plain::before{ display: none; }

.pp-panel-title{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 18px;
}


/* --------------------------------------------------------------------------
   7. NAVIGATION
   Styling only — every page keeps whatever links it already has.
   Works on either <nav class="pp-nav"> or the older .navbar / .site-nav.
   -------------------------------------------------------------------------- */

.pp-nav,
.navbar,
.site-nav{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.pp-nav a,
.navbar a,
.site-nav a{
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line-gold);
  border-radius: 999px;
  padding: 8px 18px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.pp-nav a:hover,
.navbar a:hover,
.site-nav a:hover,
.pp-nav a:focus-visible,
.navbar a:focus-visible,
.site-nav a:focus-visible{
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* Marks the page you're currently on */
.pp-nav a[aria-current="page"],
.navbar a[aria-current="page"],
.site-nav a[aria-current="page"]{
  color: var(--on-accent);
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

/* A second, quieter row of links — used for section sub-navigation */
.pp-subnav{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.pp-subnav a{
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 13px;
  transition: color 0.15s ease, background 0.15s ease;
}
.pp-subnav a:hover,
.pp-subnav a:focus-visible{
  color: var(--accent-deep);
  background: var(--accent-soft);
  text-decoration: none;
}
.pp-subnav a[aria-current="page"]{
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-weight: 600;
}

/* Small italic back-link, for subpages */
.pp-back{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.pp-back:hover{ color: var(--burgundy); text-decoration: none; }


/* --------------------------------------------------------------------------
   8. HERO + EMBLEM
   The full masthead. Folder index pages use this; deeper pages use the
   ribbon in section 9 instead.

   The emblem markup is canonical — copy it from /templates/, never redraw it.
   -------------------------------------------------------------------------- */

.pp-hero{
  text-align: center;
  padding: 24px 0 40px;
}

.pp-emblem{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.pp-emblem svg{
  width: 46px;
  height: 46px;
}

/* Subpages carry the emblem too, just smaller so it doesn't crowd the title */
.pp-emblem-sm{ gap: 10px; margin-bottom: 6px; }
.pp-emblem-sm svg{ width: 30px; height: 30px; }

/* The nav sits between the emblem and the title inside a hero */
.pp-hero .pp-nav{ margin: 28px 0 32px; }

.pp-title{
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 5rem);
  letter-spacing: 0.005em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}

.pp-tagline{
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--gold);
  margin: 12px 0 0;
}

/* Smaller heading for interior pages */
.pp-page-title{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 36px;
}
.pp-page-title svg{ width: 28px; height: 28px; color: var(--burgundy); }
.pp-page-title h2{
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin: 0;
}


/* --------------------------------------------------------------------------
   9. RIBBON
   The compact header for pages below a folder index. Sticks to the top,
   carries the small emblem, the page name and the same six nav links.

     <header class="pp-ribbon">
       <div class="pp-ribbon-inner">
         <a class="pp-ribbon-mark" href="/">…emblem…</a>
         <div class="pp-ribbon-titles">
           <span class="pp-ribbon-eyebrow">Castle Keep</span>
           <span class="pp-ribbon-title">Meal Planner</span>
         </div>
         <nav class="pp-nav">…</nav>
       </div>
     </header>

   Pages that need a live status row (the quest log) add .pp-ribbon-extra
   inside .pp-ribbon-inner and fill it themselves.
   -------------------------------------------------------------------------- */

.pp-ribbon{
  position: sticky;
  top: 0;
  z-index: 50;
  margin-bottom: 22px;
  background: var(--panel);
  border-bottom: 2px solid var(--accent-soft);
  box-shadow: 0 4px 16px rgba(46,36,31,0.08);
}

.pp-ribbon-inner{
  max-width: calc(1300px + (var(--pad-x) * 2));
  margin: 0 auto;
  padding: 12px var(--pad-x);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.pp-ribbon-mark{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
}
.pp-ribbon-mark svg{ width: 30px; height: 30px; }
.pp-ribbon-mark:hover{ text-decoration: none; }

.pp-ribbon-titles{
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: auto;
}
.pp-ribbon-eyebrow{
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.4;
}
.pp-ribbon-title{
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.15;
  color: var(--ink);
}

/* The nav shrinks inside a ribbon and loses the hero's bottom margin */
.pp-ribbon .pp-nav{
  margin: 0;
  justify-content: flex-end;
  gap: 6px;
}
.pp-ribbon .pp-nav a{
  font-size: 0.68rem;
  padding: 6px 13px;
  background: transparent;
}

/* `background: transparent` above ties on specificity with the
   a[aria-current="page"] rule in section 7 and, coming later, wins — which
   left the current folder's pill with white text on no fill. Invisible.
   These two put the fill back for hover and for the page you're on. */
.pp-ribbon .pp-nav > .pp-navitem > a:hover,
.pp-ribbon .pp-nav > .pp-navitem > a:focus-visible{
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}
.pp-ribbon .pp-nav > .pp-navitem > a[aria-current="page"]{
  color: var(--on-accent);
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

/* Full-width row underneath, for live status readouts */
.pp-ribbon-extra{
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px){
  .pp-ribbon-inner{ gap: 12px; }
  .pp-ribbon .pp-nav{ flex: 1 1 100%; justify-content: center; }
  .pp-ribbon-title{ font-size: 1.1rem; }
}


/* --------------------------------------------------------------------------
   10. LINK CARDS + TILES
   -------------------------------------------------------------------------- */

.pp-cards{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.pp-card{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  width: 146px;
  min-height: 146px;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.pp-card:hover,
.pp-card:focus-visible{
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--lift-lg);
  text-decoration: none;
}
.pp-card svg{ width: 26px; height: 26px; color: var(--burgundy); }
.pp-card h3{
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0;
}

/* Square tile grid — side quests, self care, the dannelore wander-to list */
.pp-tiles{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
  margin: 0 0 40px;
}

.pp-tile{
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pp-tile:hover,
.pp-tile:focus-visible{
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--lift-lg);
  text-decoration: none;
}
.pp-tile::before{ opacity: .65; }
.pp-tile h3{
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.2;
  margin: 0;
}
.pp-tile p{
  font-family: var(--font-body);
  font-size: .74rem;
  color: var(--ink-soft);
  line-height: 1.35;
  margin: 0;
}
.pp-tile-icon{ width: 54px; height: 54px; display: block; transition: transform .22s ease; }
.pp-tile:hover .pp-tile-icon{ transform: scale(1.06) rotate(-2deg); }

/* Empty slot, waiting to be filled in */
.pp-tile-empty{
  border-style: dashed;
  border-color: var(--line-strong);
  background: rgba(255,253,248,.55);
  box-shadow: none;
  cursor: default;
}
.pp-tile-empty::before{ display: none; }
.pp-tile-empty:hover{ transform: none; box-shadow: none; border-color: var(--line-strong); }
.pp-tile-empty span{
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .95rem;
  color: var(--ink-soft);
}

/* Horizontal link row, like the home sidebar */
.pp-linkbox{
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 16px 20px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.pp-linkbox svg{ width: 16px; height: 16px; color: var(--gold); flex-shrink: 0; }
.pp-linkbox:hover,
.pp-linkbox:focus-visible{
  transform: translateX(3px);
  box-shadow: var(--lift-lg);
  color: var(--accent-deep);
  text-decoration: none;
}
.pp-linkbox:hover svg,
.pp-linkbox:focus-visible svg{ color: var(--accent); }


/* --------------------------------------------------------------------------
   11. PARCHMENT CALLOUT
   -------------------------------------------------------------------------- */

.pp-parchment{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 26px;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(156,116,64,0.12), transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(156,116,64,0.10), transparent 55%),
    var(--parchment);
  border: 1px solid var(--parchment-border);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), var(--lift);
  color: var(--burgundy);
  font-family: var(--font-serif);
  font-weight: 600;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.4;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pp-parchment:hover,
.pp-parchment:focus-visible{
  transform: translateY(-2px);
  border-color: var(--burgundy);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), var(--lift-lg);
  text-decoration: none;
}


/* --------------------------------------------------------------------------
   12. BUTTONS, PILLS, TAGS
   -------------------------------------------------------------------------- */

.pp-btn{
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--on-accent);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.pp-btn:hover,
.pp-btn:focus-visible{
  background: var(--accent-deep);
  transform: translateY(-2px);
  text-decoration: none;
}
.pp-btn:active{ transform: translateY(0); }

.pp-btn-quiet{
  color: var(--gold);
  background: var(--panel);
  border: 1px solid var(--line-gold);
}
.pp-btn-quiet:hover,
.pp-btn-quiet:focus-visible{
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.pp-btn-sm{ padding: 6px 14px; font-size: 0.8rem; }
.pp-btn-danger{ background: var(--burgundy); }
.pp-btn-danger:hover{ background: var(--blade-deep); }

.pp-tag{
  display: inline-block;
  font-size: 0.74rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(46,36,31,0.08);
  margin: 0 5px 5px 0;
}
.pp-tag-quiet{
  background: var(--parchment);
  border: 1px solid var(--parchment-border);
  color: var(--ink-soft);
}

/* Toggleable filter pill */
.pp-pill{
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--panel);
  border: 1px solid var(--line-gold);
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.pp-pill:hover{ color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.pp-pill[aria-pressed="true"],
.pp-pill.on{ color: var(--on-accent); background: var(--accent-deep); border-color: var(--accent-deep); }

/* Small uppercase label. Gold is low-contrast at body size, so this
   is the only place it should be used for text. */
.pp-label{
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}


/* --------------------------------------------------------------------------
   13. FORM CONTROLS
   The same input treatment was written out on six pages. It lives here now.
   -------------------------------------------------------------------------- */

.pp-field{ display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.pp-field > label,
.pp-field-label{
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.pp-input,
.pp-field input,
.pp-field select,
.pp-field textarea{
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
}
.pp-input:focus,
.pp-field input:focus,
.pp-field select:focus,
.pp-field textarea:focus{
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.pp-field textarea{ min-height: 90px; resize: vertical; }

.pp-hint{
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.pp-check{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.pp-check input[type="checkbox"]{
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}


/* --------------------------------------------------------------------------
   14. SHARED WIDGETS
   Pieces that three or more pages had each written out for themselves.
   -------------------------------------------------------------------------- */

/* --- modal --- */
.pp-modal{
  position: fixed;
  inset: 0;
  background: rgba(46,36,31,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.pp-modal.open{ display: flex; }
.pp-modal-card{
  background: var(--panel);
  border: 3px solid var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(46,36,31,0.3);
}
.pp-modal-card h3{
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 10px 0 6px;
  color: var(--accent-deep);
}
.pp-modal-card p{ font-size: 0.88rem; color: var(--ink-soft); line-height: 1.5; margin: 0; }

/* --- dimming overlay for slide-in panels --- */
.pp-overlay{
  position: fixed;
  inset: 0;
  background: rgba(46,36,31,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 90;
}
.pp-overlay.open{ opacity: 1; pointer-events: auto; }

/* --- currency chips --- */
.pp-coin{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  background: var(--white);
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: var(--lift);
}
.pp-coin .dot{ width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pp-coin.gold{ color: #C9A227; }
.pp-coin.gold .dot{ background: #C9A227; }
.pp-coin.copper{ color: #B87333; }
.pp-coin.copper .dot{ background: #B87333; }
.pp-coin.meow{ color: #7F77DD; }
.pp-coin.meow .dot{ background: #7F77DD; }

/* --- switch --- */
.pp-toggle{
  width: 46px; height: 26px;
  border-radius: 999px;
  background: rgba(46,36,31,0.2);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.pp-toggle i{
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--white);
  transition: transform .2s;
}
.pp-toggle.on{ background: var(--sage); }
.pp-toggle.on i{ transform: translateX(20px); }

/* --- selectable chip --- */
.pp-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.pp-chip.checked,
.pp-chip[aria-pressed="true"]{
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.pp-chip-group{ display: flex; flex-wrap: wrap; gap: 8px; }

/* --- plain card, no hairline --- */
.pp-plaincard{
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}
.pp-plaincard.inactive{ opacity: .6; }


/* --------------------------------------------------------------------------
   15. LEGACY COMPONENT NAMES
   The castle, quest-log and side-quest pages were each carrying their own
   copy of these. They are defined once here so the pages don't have to.

   New pages should use the pp- names above. These stay so the existing
   markup keeps working without a rewrite.
   -------------------------------------------------------------------------- */

.display{ font-family: var(--font-display); font-weight: 400; }

.header{ text-align: center; padding: 10px 0 24px; }
.title{ font-size: 2.3rem; margin: 6px 0 2px; }
.tagline{ font-family: var(--font-serif); font-style: italic; color: var(--gold); margin: 0; }

.back{
  display: inline-block;
  margin: 0 10px 10px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  text-decoration: none;
  color: var(--ink-soft);
}
.back:hover{ color: var(--accent-deep); }

.panel{
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--lift);
  margin-bottom: 18px;
}
.panel::before{
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--hairline);
  border-radius: calc(var(--radius-lg) - 8px);
  opacity: .35;
  pointer-events: none;
}

.btn{
  font-family: var(--font-body);
  font-weight: 500;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  background: var(--accent);
  color: var(--on-accent);
  font-size: .9rem;
  transition: background .15s ease;
}
.btn:hover{ background: var(--accent-deep); }
.btn.secondary{ background: transparent; color: var(--accent-deep); border: 1px solid var(--accent); }
.btn.quiet{ background: var(--panel); color: var(--ink-soft); border: 1px solid var(--line); }
.btn.small{ padding: 6px 14px; font-size: .8rem; }
.btn.danger{ background: var(--burgundy); }

.tag{
  display: inline-block;
  font-size: .72rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(46,36,31,.08);
  margin: 0 5px 5px 0;
}
.tag.inactive-tag{
  background: var(--parchment);
  border: 1px solid var(--parchment-border);
  color: var(--ink-soft);
}

.empty{
  text-align: center;
  padding: 30px;
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--font-serif);
}

.hint{ font-size: .78rem; color: var(--ink-soft); font-style: italic; }

/* The shell wrapper the castle pages use in place of .pp-wrap */
.shell{
  max-width: calc(var(--content) + 36px);
  margin: 0 auto;
  padding: 24px 18px 70px;
}
.shell-wide{
  max-width: calc(var(--content) + var(--sidebar) + var(--gap) + 36px);
}

.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(46,36,31,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.open{ display: flex; }


/* --- quest log: coin readouts, the status row and section headings.
       Shared by the quest board, the pets page and the monsters page. --- */

.currency{ display: flex; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }

.coin{
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 16px;
  background: var(--white);
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: var(--lift);
}
.coin .dot{ width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.coin.gold{ color: var(--quest-gold); }
.coin.gold .dot{ background: var(--quest-gold); }
.coin.copper{ color: var(--quest-copper); }
.coin.copper .dot{ background: var(--quest-copper); }
.coin.meow{ color: var(--meow); }
.coin.meow .dot{ background: var(--meow); }

.section-title{
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  margin: 26px 0 12px;
  color: var(--accent-deep);
}

footer{
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 50px;
  font-style: italic;
}


/* --------------------------------------------------------------------------
   16. FOOTER
   -------------------------------------------------------------------------- */

.pp-footer{
  text-align: center;
  padding: 32px 0 48px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.pp-footer-flourish{
  font-style: normal;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}
.pp-footer-estab{
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}


/* --------------------------------------------------------------------------
   17. UTILITIES
   -------------------------------------------------------------------------- */

.pp-center{ text-align: center; }
.pp-muted{ color: var(--ink-soft); }
.pp-italic{ font-family: var(--font-serif); font-style: italic; }

.pp-empty{
  text-align: center;
  padding: 30px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-style: italic;
}

.pp-divider{
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 20px 0;
}

.pp-sr-only{
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* --------------------------------------------------------------------------
   18. MOTION + PRINT
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
  html{ scroll-behavior: auto; }
  .pp-tile:hover .pp-tile-icon{ transform: none; }
}

@media print{
  body{ background-image: none !important; }
  .pp-nav, .pp-subnav, .navbar, .site-nav{ display: none; }
  .pp-ribbon{ position: static; box-shadow: none; }
  .pp-panel, .panel{ box-shadow: none; }
  .pp-panel::before, .panel::before{ display: none; }
}


/* --------------------------------------------------------------------------
   19b. MINI NAVBAR
   The row under the main nav, listing the section you're standing in. Built
   by pp-nav.js, so every page gets one on the same terms.

   These rules used to live in the four quest-log pages' own <style> blocks,
   which is why only those pages had the in-ribbon version. They're here now.
   -------------------------------------------------------------------------- */

.pp-ribbon-sections{
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  list-style: none;
}

.pp-ribbon-sections .spacer{ flex: 1 1 auto; }

/* The way back up to the folder. Quieter than the section links — it's an
   exit, not a peer. */
.pp-ribbon-sections .exit{
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 5px 4px;
  background: none;
  border: 0;
}
.pp-ribbon-sections .exit:hover{ color: var(--accent-deep); background: none; }

html.pp-paladin .pp-ribbon-sections{ border-top-color: rgba(156,116,64,0.3); }

@media (max-width: 760px){
  .pp-ribbon-sections{ justify-content: center; }
  .pp-ribbon-sections .spacer{ display: none; }
}


/* --------------------------------------------------------------------------
   19. RIBBON NAV DROPDOWNS
   Built by /assets/pp-nav.js. Each folder in the ribbon nav is a
   .pp-navitem holding the folder link, a caret button, and a .pp-dropdown
   listing that folder's pages.

   The menu opens on hover for a mouse and on a caret tap for a phone, where
   hover doesn't exist. The folder name itself is always just a link.
   -------------------------------------------------------------------------- */

.pp-navitem{
  position: relative;
  display: flex;
  align-items: center;
}

/* The caret tucks against the pill rather than sitting beside it, so a
   folder still reads as one control. */
.pp-navitem.has-menu > a{
  padding-right: 26px;
}

.pp-navcaret{
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: inherit;
}
.pp-navcaret span{
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  color: var(--gold);
  opacity: .75;
  transition: transform .15s ease;
}
.pp-navitem.has-menu:hover .pp-navcaret span,
.pp-navitem.has-menu > a[aria-current="page"] ~ .pp-navcaret span{ color: var(--on-accent); opacity: 1; }
.pp-navitem.is-open .pp-navcaret span{ transform: rotate(180deg); }

.pp-dropdown{
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 210px;
  display: none;
  flex-direction: column;
  gap: 1px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm);
  box-shadow: var(--lift-lg);
}
.pp-navitem:hover > .pp-dropdown,
.pp-navitem:focus-within > .pp-dropdown,
.pp-navitem.is-open > .pp-dropdown{ display: flex; }

/* A hover bridge. Without it the menu closes in the 6px gap on the way down. */
.pp-navitem.has-menu::after{
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 8px;
}

/* Dropdown links are rows, not pills — the .pp-nav a rule above would
   otherwise give each one a full outlined capsule. */
.pp-nav .pp-dropdown a{
  display: block;
  text-align: left;
  white-space: nowrap;
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: none;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
}
.pp-nav .pp-dropdown a:hover,
.pp-nav .pp-dropdown a:focus-visible{
  color: var(--accent-deep);
  background: var(--accent-soft);
  border: 0;
}
.pp-nav .pp-dropdown a[aria-current="page"]{
  color: var(--on-accent);
  background: var(--accent-deep);
  border: 0;
  font-weight: 600;
}

.pp-dropdown-head{
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 9px 10px 3px;
}
.pp-dropdown-head:first-child{ padding-top: 2px; }

.pp-dropdown-rule{
  height: 1px;
  background: var(--line);
  margin: 5px 4px;
}

/* On a narrow screen the menu would run off the right edge, so it hangs
   from the right of its folder instead. */
@media (max-width: 760px){
  .pp-dropdown{ left: auto; right: 0; }
  .pp-navitem:first-child .pp-dropdown{ left: 0; right: auto; }
}

@media (prefers-reduced-motion: reduce){
  .pp-navcaret span{ transition: none; }
}

@media print{
  .pp-dropdown, .pp-navcaret{ display: none !important; }
}


/* --------------------------------------------------------------------------
   20. PALADIN RIBBON LEGIBILITY
   Brendon's quest log sets html.pp-paladin, which turns the page behind the
   ribbon burgundy. The ribbon itself stays cream.

   The section sub-nav used to sit below the ribbon, on the red, so it was
   given cream text. It moved up inside the ribbon and the colour didn't
   follow — cream on cream. These selectors carry .pp-ribbon, so they outrank
   the .pp-subnav rules still sitting in the quest-log pages' own <style>
   blocks and the fix lands without editing four files.
   -------------------------------------------------------------------------- */

html.pp-paladin .pp-ribbon .pp-subnav a{
  color: var(--ink-soft);
  background: none;
}
html.pp-paladin .pp-ribbon .pp-subnav a:hover,
html.pp-paladin .pp-ribbon .pp-subnav a:focus-visible{
  color: #FFFDF8;
  background: #9C7440;
}
html.pp-paladin .pp-ribbon .pp-subnav a[aria-current="page"]{
  color: #FFFDF8;
  background: #7C5B30;
  border-color: #7C5B30;
  font-weight: 600;
}
html.pp-paladin .pp-ribbon .pp-subnav .exit{ color: var(--ink-soft); }
html.pp-paladin .pp-ribbon .pp-subnav .exit:hover{ color: #7C5B30; background: none; }

/* Gold at #9C7440 under white text is a shade too light to read comfortably.
   Inside the ribbon the pills use the deeper gold on both hover and current,
   which clears contrast either way. */
html.pp-paladin .pp-ribbon .pp-nav > .pp-navitem > a:hover,
html.pp-paladin .pp-ribbon .pp-nav > .pp-navitem > a:focus-visible,
html.pp-paladin .pp-ribbon .pp-nav > .pp-navitem > a[aria-current="page"]{
  color: #FFFDF8;
  background: #7C5B30;
  border-color: #7C5B30;
}
html.pp-paladin .pp-ribbon .pp-dropdown a[aria-current="page"]{
  color: #FFFDF8;
  background: #7C5B30;
}
html.pp-paladin .pp-ribbon .pp-dropdown a:hover{
  color: #FFFDF8;
  background: #9C7440;
}
