/* ============================================================
   The Shadow Over Aldermere — digital character profiles
   ------------------------------------------------------------
   Screen-first "character page" for viewing on a phone, tablet,
   or computer. This is NOT the printed sheet. It pairs with
   style.css (which supplies the colour tokens and the fonts);
   link BOTH, style.css first:

     <link rel="stylesheet" href="style.css">
     <link rel="stylesheet" href="profile.css">

   Each character page sets a body class like  theme-lysander
   which only changes one thing: the accent colour.
   ============================================================ */

/* ---- Per-character accent (the only thing the theme changes) ---- */
.profile-body { --accent: #8a2e2e; }
.theme-lysander { --accent: #b0892e; }  /* holy gold   */
.theme-telstar  { --accent: #4a7a4a; }  /* moss green  */
.theme-thraka   { --accent: #a3502a; }  /* bear rust   */
.theme-khaleesi { --accent: #8a2e2e; }  /* dragon red  */
.theme-sai      { --accent: #2f6b6b; }  /* monk teal   */
.theme-samsara  { --accent: #4146a0; }  /* arcane indigo */
.theme-npc      { --accent: #4a6b8a; }  /* steel blue, neutral NPC */
.theme-foe      { --accent: #8a2e2e; }  /* enemy red */
.theme-place    { --accent: #6d5b3a; }  /* old-map sepia, locations */
.theme-truf     { --accent: #7a4a8c; }  /* tarot violet */

/* ---- Page frame (gives the "border around the edge" feel) ---- */
.profile-body {
  background: #2a2622;            /* dark gallery wall */
  color: var(--ink);
  padding: 28px 16px 56px;
  line-height: 1.3;
}
.profile {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.18);
  box-shadow: 0 12px 44px rgba(0,0,0,0.45);
}

/* ---- Top navigation strip ---- */
.profile-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px;
  background: var(--fill);
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.profile-nav a { text-decoration: none; font-weight: 700; color: #4a443d; }
.profile-nav .nav-back:hover { color: var(--accent); }
.profile-nav .nav-print {
  color: #fff; background: var(--accent);
  padding: 8px 16px; border-radius: 7px;
}
.profile-nav .nav-print:hover { filter: brightness(1.08); }

/* ---- Hero band: art + name + description ---- */
.hero {
  position: relative;
  display: flex; gap: 28px; align-items: stretch;
  padding: 30px;
  background-color: #1a1715;
  background-image: var(--art);              /* set per page: style="--art:url('hero/x.jpg')" */
  background-size: cover; background-position: center 30%;
  color: #f3efe7;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(20,18,16,0.80), rgba(20,18,16,0.93));
}
.hero > * { position: relative; }   /* sit above the dark wash */

.hero-portrait {
  position: relative;
  flex: 0 0 300px; width: 300px;
  min-height: 390px;
  display: flex;
  border-radius: 8px; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.16);
  background: #0e0c0b;
  box-shadow: 0 8px 22px rgba(0,0,0,0.55);
}
/* Blurred fill so portrait OR landscape art fills the frame nicely. */
.hero-portrait::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--art); background-size: cover; background-position: center;
  filter: blur(14px) brightness(0.55); transform: scale(1.18);
}
.hero-portrait img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; }

/* Wide (landscape) paintings: fill the frame and zoom toward the hero,
   trimming the edge detail. object-position picks which part stays in view;
   scale() sets how close. Tune these two lines per character. */
.theme-samsara .hero-portrait img {
  object-fit: cover; object-position: center 40%;
  transform: scale(1.22); transform-origin: center 40%;
}

/* Portrait-oriented images — gentle zoom so the image fills the frame
   instead of showing empty space at the sides. */
.theme-khaleesi .hero-portrait img,
.theme-lysander .hero-portrait img,
.theme-truf     .hero-portrait img {
  object-fit: cover; object-position: center 18%;
  transform: scale(1.10); transform-origin: center 18%;
}
/* Thraka: nudge up and slightly left within the portrait frame */
.theme-thraka .hero-portrait img {
  object-fit: cover; object-position: 100% 20%;
  transform: scale(1.10); transform-origin: 50% 100%;
}

/* Background image position — lower percentage anchors the view higher in
   the source image, which drops the subject lower in the hero band.
   Default is center 30%; go below that to drop the image further. */
.theme-khaleesi .hero { background-position: center 16%; }
.theme-sai      .hero { background-position: center 20%; }
.theme-truf     .hero { background-position: center 12%; }

.hero-info { flex: 1 1 auto; min-width: 0; align-self: center; }
/* Campaign title — centered banner ABOVE the card, on the dark page. */
.site-title {
  max-width: 1000px;
  margin: 0 auto 20px;
  text-align: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 30px; letter-spacing: 1.5px;
  color: #efe7d6; text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

/* ---- Hub tab bar (rendered by nav.js) ---- */
.tabbar {
  max-width: 1000px; margin: 0 auto 22px;
  display: flex; flex-wrap: wrap; gap: 7px; justify-content: center;
}
.tabbar .tab {
  font-family: var(--font-display); font-weight: 700;
  font-size: 15px; letter-spacing: 0.4px; text-decoration: none;
  color: #cdc5b4; padding: 9px 18px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05);
  transition: background 0.1s ease, color 0.1s ease;
}
.tabbar .tab:hover { color: #fff; background: rgba(255,255,255,0.12); }
.tabbar .tab.active { color: #1a1a1a; background: #efe7d6; border-color: #efe7d6; }

/* ---- Empty state inside a group panel (reveal-as-discovered) ---- */
.empty-state {
  text-align: center; color: #6b6760; font-size: 15px; line-height: 1.5;
  padding: 34px 18px; border: 2px dashed var(--rule); border-radius: 10px;
}

/* ---- Simplified NPC / enemy profile: a compact inline stat strip ---- */
.statline { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 24px 2px; }
.statline .s {
  background: var(--abilityFill); border: 1.5px solid var(--rule); border-radius: 8px;
  padding: 7px 14px; font-size: 14.5px; color: #4a443d;
}
.statline .s b { font-family: var(--font-display); font-size: 17px; color: var(--ink); margin-right: 4px; }

/* ---- Hub: group panels + character / location cards (index, npcs, enemies, locations) ---- */
.group {
  max-width: 1000px; margin: 0 auto 22px;
  background: var(--paper); border: 1px solid rgba(0,0,0,0.18); border-radius: 12px;
  box-shadow: 0 12px 44px rgba(0,0,0,0.45); padding: 20px 24px 26px;
}
.group-title {
  font-family: var(--font-display); font-weight: 700; font-size: 21px; color: var(--ink);
  margin: 4px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--neutral);
}
.group.foes .group-title { border-bottom-color: var(--offense); }

.char-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.char-card {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--paper);
  box-shadow: 0 2px 8px rgba(0,0,0,0.16); transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.char-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,0.30); }
.cc-art { height: 210px; background: #0e0c0b; border-bottom: 1px solid var(--rule); overflow: hidden; }
.cc-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; }
.cc-info { padding: 12px 14px 15px; }
.cc-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.05; }
.cc-class { font-size: 14px; margin-top: 3px; color: #2a2622; }
.cc-player { font-size: 13px; font-style: italic; color: #6b6760; margin-top: 5px; }
.cc-tag { font-size: 12px; color: #8a8275; }
.char-card.foe { border-color: var(--offense); }
.char-card.map .cc-art { height: 160px; object-position: center; }

@media (max-width: 700px) {
  .char-grid { grid-template-columns: repeat(2, 1fr); }
  .cc-art { height: 175px; }
}
@media (max-width: 460px) {
  .char-grid { grid-template-columns: 1fr; }
}

/* ---- Story so far (text recap page) ---- */
.story-intro { font-size: 16px; line-height: 1.6; color: #2a2622; margin: 2px 0 18px; }
.story-entry { padding: 14px 0; border-top: 1px solid var(--rule); }
.story-entry:first-of-type { border-top: none; padding-top: 2px; }
.story-entry h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin: 0 0 6px; color: var(--ink); }
.story-entry h3 .se-meta { color: #6b6760; font-weight: 400; font-size: 13.5px; }
.story-entry p { font-size: 15.5px; line-height: 1.55; margin: 0 0 8px; color: #2a2622; }

/* ---- Location profile: a wide map banner instead of the portrait hero ---- */
.loc-hero { position: relative; background: #0e0c0b; }
.loc-hero img { display: block; width: 100%; max-height: 360px; object-fit: cover; object-position: center; }
.loc-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 24px 16px;
  background: linear-gradient(transparent, rgba(20,18,16,0.88)); color: #f3efe7;
}
.loc-name { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.05; color: #fff; }
.loc-sub { font-size: 15px; color: #e8e2d6; margin-top: 3px; }
.hero-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 44px; line-height: 1.02; margin: 8px 0 5px; color: #fff;
}
.hero-sub { font-size: 18px; font-weight: 700; color: #e8e2d6; }
.hero-player { font-style: italic; color: #b8b0a2; margin-top: 3px; font-size: 15px; }
.hero-desc {
  font-size: 16.5px; line-height: 1.55; margin: 15px 0 0;
  color: #ece7dd; max-width: 48ch;
}
.hero-tags { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  border: 1.5px solid var(--accent); color: #fff;
  background: rgba(255,255,255,0.05);
  border-radius: 999px; padding: 4px 13px; font-size: 13px; font-weight: 700;
}

/* ---- Key stats row ---- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--rule); border-bottom: 1px solid var(--rule);
}
.stat { background: var(--paper); text-align: center; padding: 16px 8px; }
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; }
.stat-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.6px; color: #6b6760; margin-top: 6px; }

/* ---- Abilities ---- */
.abilities-row {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  padding: 22px 24px 6px;
}
.abil {
  border: 1.5px solid var(--rule); background: var(--abilityFill);
  border-radius: 8px; text-align: center; padding: 12px 4px;
}
.abil.key { border-color: var(--accent); border-width: 2px; }
.abil-mod { display: block; font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.abil-name { display: block; font-size: 12px; color: #4a443d; margin-top: 3px; }

/* ---- Content blocks ---- */
.block { padding: 12px 24px 18px; }
.block-title {
  font-family: var(--font-display); font-weight: 700; font-size: 21px;
  margin: 6px 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--accent);
}
.block-note { font-size: 14px; color: #6b6760; margin: 8px 0 14px; }

/* ---- Signature moves ---- */
.moves { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.move {
  border: 1px solid var(--rule); border-left: 5px solid var(--neutral);
  border-radius: 6px; padding: 12px 15px; background: #fcfbf8;
}
.move.offense { border-left-color: var(--offense); }
.move.support { border-left-color: var(--support); }
.move.control { border-left-color: var(--control); }
.move-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.move-name { font-weight: 700; font-size: 16.5px; }
.move-tag { font-size: 12px; font-style: italic; color: var(--cost-ink); white-space: nowrap; }
.move-body { font-size: 15px; line-height: 1.45; margin: 6px 0 9px; color: #2a2622; }
.move-stat { font-weight: 700; font-size: 14.5px; }

/* ---- Skill chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  background: var(--fill); border: 1px solid var(--rule); border-radius: 999px;
  padding: 7px 14px; font-size: 14.5px; font-weight: 700;
}
.chip .c-num { color: var(--accent); }

/* ---- Always-on feature list ---- */
.feature-list { margin: 0; padding: 0; list-style: none; }
.feature-list li {
  padding: 9px 0; border-bottom: 1px dotted var(--rule);
  font-size: 15.5px; line-height: 1.45;
}
.feature-list li:last-child { border-bottom: none; }

/* ---- Footer ---- */
.profile-foot { padding: 10px 24px 30px; text-align: center; }
.btn-print {
  display: inline-block; background: var(--accent); color: #fff;
  text-decoration: none; font-weight: 700; font-size: 16px;
  padding: 13px 28px; border-radius: 8px; box-shadow: 0 3px 12px rgba(0,0,0,0.22);
}
.btn-print:hover { filter: brightness(1.08); }

/* ---- Narrow screens (phones) ---- */
@media (max-width: 700px) {
  .profile-body { padding: 12px 8px 40px; }
  .site-title { font-size: 23px; }
  .tabbar .tab { font-size: 13px; padding: 8px 13px; }
  .hero { flex-direction: column; padding: 22px; }
  .hero-portrait { flex-basis: auto; width: 100%; min-height: 320px; }
  .hero-name { font-size: 34px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .abilities-row { grid-template-columns: repeat(3, 1fr); }
  .moves { grid-template-columns: 1fr; }
}

/* ---- If someone prints a profile, drop the nav and button ---- */
@media print { .profile-nav, .profile-foot { display: none; } }
