/* Container */
.character-card {
  display: grid;
  grid-template-columns: 30% 70%;
  gap: var(--gap);
  background: var(--card-bg);
  border: var(--card-bd);
  border-radius: var(--radius);
  padding: var(--pad);
  align-items: stretch;
}

/* Left column (image) */
.character-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 420px;
}

.character-photo {
  flex: 7 1;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.character-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 5%;
  background: rgba(99, 44, 5, 0.25);  
  border: 5px solid rgba(0, 0, 0, 0.60);
}

.story-focuses {
  flex: 3 1 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);  /* tweak to 4 if your icons are tiny */
  gap: 8px;
  align-content: start;
}
.story-focuses img {
  width: 100%;
  aspect-ratio: 1 / 1;               /* keeps them square */
  object-fit: contain;               /* preserves PNG edges/transparency */
  background: rgba(68, 29, 2, 0.6);      /* subtle backdrop for transparency */
  border: 5px solid rgba(0, 0, 0, 0.40);
  border-radius: 15%;
  padding: 6px;                      /* breathing room for icons */
}

/* Right column (title + table) */
.character-moodboard-info,
.character-info {
  width: 100%;
}

.gallery-title,
.character-section-title,
.character-name {
  margin: 1.5% 0 !important;
  line-height: 1.2;
}

.gallery-title,
h5.character-section-title,
h3.character-section-title,
h2.character-moodboard-info,
h2.character-info,
h2.character-name {
    text-align: center !important;
}

.character-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* prevents layout wiggle on long text */
  color: var(--text);
}

.character-table th,
.character-table td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.character-table th {
  width: 32%;              /* keeps the label column tidy */
  text-align: left;
  font-weight: 700;
  color: var(--text-alt);
  white-space: nowrap;
}

/* Responsive: stack on small screens */
@media (max-width: 930px) {
    .character-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .character-card {
    grid-template-columns: 1fr;
  }
  .character-photo img {
    /* optional: make the portrait a nice banner on mobile */
    width: 100%;
  }
  .character-table th {
    width: 38%;
  }
  .character-left {
    min-height: 360px;               /* adjust if you want a shorter mobile card */
  }
  .character-extras {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* 4-col table layout */
.character-table.four-col {
  table-layout: fixed;
}

.character-table.four-col .label-col { width: 22%; }
.character-table.four-col .value-col { width: 28%; }
/* 22 + 28 + 22 + 28 = 100% */

.character-table.four-col th {
  font-style: italic;      /* matches your markup intent */
  font-weight: 700;
  color: var(--text-alt);
  white-space: normal;
}

.character-table.four-col td {
  word-wrap: break-word;
}

/* Small screens: keep content usable via horizontal scroll */
.character-info {
  overflow-x: auto;     /* allows table to scroll if it gets tight */
}

/* Optional: if you prefer wrapping instead of scrolling on narrow screens,
   you can drop to two columns by stacking each pair into its own row.
   Uncomment to try it: */


@media (max-width: 560px) {
  .character-table.four-col,
  .character-table.four-col tbody,
  .character-table.four-col tr,
  .character-table.four-col th,
  .character-table.four-col td {
    display: block;
  }

  .character-table.four-col tr {
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding-bottom: 8px;
  }

  .character-table.four-col th { margin-top: 6px; }
}

.FamilyTreeNotes {
  text-align: center;
  font-size: 0.75em;
}

/* Character Palette */
.characterpalette {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(2, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  height: 15vh;
  width: 100%;
  margin: 2.5% 0;
}

.characterpalette{
  border-left: 2.5px solid rgb(0, 0, 0);
  border-right: 2.5px solid rgb(0, 0, 0);
}

.HairColorName { grid-area: 1 / 1 / 2 / 2; }
.SkinColorName { grid-area: 1 / 2 / 2 / 3; }
.EyesWhitesName { grid-area: 1 / 3 / 2 / 4; }
.EyesPupilName { grid-area: 1 / 4 / 2 / 5; }
.EyesIrisName { grid-area: 1 / 5 / 2 / 6; }
.EyesHighlightName { grid-area: 1 / 6 / 2 / 7; }
.EyebrowsColorName { grid-area: 1 / 7 / 2 / 8; }
.HairColor { grid-area: 2 / 1 / 3 / 2; }
.SkinColor { grid-area: 2 / 2 / 3 / 3; }
.EyesWhites { grid-area: 2 / 3 / 3 / 4; }
.EyesPupil { grid-area: 2 / 4 / 3 / 5; }
.EyesIris { grid-area: 2 / 5 / 3 / 6; }
.EyesHighlight { grid-area: 2 / 6 / 3 / 7; }
.EyebrowsColor { grid-area: 2 / 7 / 3 / 8; }

.HairColorName, .SkinColorName, .EyesWhitesName, .EyesPupilName, .EyesIrisName, .EyesHighlightName, .EyebrowsColorName {
  text-align: center;
  font-weight: 700;
  color: rgba(33, 16, 1, 0.95);
}

.HairColorName, .SkinColorName, .EyesWhitesName, .EyesPupilName, .EyesIrisName, .EyesHighlightName, .EyebrowsColorName,
.HairColor, .SkinColor, .EyesWhites, .EyesPupil, .EyesIris, .EyesHighlight, .EyebrowsColor {
  border: 2.5px solid rgb(0, 0, 0);
}
.HairColorName, .SkinColorName, .EyesWhitesName, .EyesPupilName, .EyesIrisName, .EyesHighlightName, .EyebrowsColorName {
  border-top: 5px solid rgb(0, 0, 0);
  padding-top: 1.5vh;
  background: rgba(250, 244, 236, 0.70);
}
.HairColor, .SkinColor, .EyesWhites, .EyesPupil, .EyesIris, .EyesHighlight, .EyebrowsColor {
  border-bottom: 5px solid rgb(0, 0, 0);
}

@media (max-width: 800px) {
  .characterpalette {
    font-size: 0.75em !important;
  }
}



/* Character Moodboard */
.Moodboard {
  display: grid;
  grid-template-columns: 34% 33% 33%;
  grid-template-rows: 50% 50%;
  gap: 0px 0px;
  grid-auto-flow: row;
  grid-template-areas:
    "largemood topleftmood toprightmood"
    "largemood bottomleftmood bottomrightmood";
  width: 100%;
  height: 75vh;
}

.largemood img, .topleftmood img, .toprightmood img, .bottomleftmood img, .bottomrightmood img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  place-items: center; 
}

.largemood { grid-area: largemood; }

.topleftmood { grid-area: topleftmood; }

.bottomleftmood { grid-area: bottomleftmood; }

.toprightmood { grid-area: toprightmood; }

.bottomrightmood { grid-area: bottomrightmood; }

.MoodboardContainer {
  overflow-x: none !important;
}