html, body {
  max-width: 100%;
  overflow-x: hidden;
}


/* ================================================
   ADMIN + BASE RESET
================================================ */
.contextual, .contextual ul, .contextual li,
.contextual-links, .contextual-links ul, .contextual-links li,
.toolbar, .toolbar ul, .toolbar li,
#toolbar-administration, #toolbar-administration ul, #toolbar-administration li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.contextual-region ul { list-style: none !important; margin: 0 !important; padding: 0 !important; }

#site-header #block-basileia-style-main-menu .contextual,
#site-header #block-basileia-style-main-menu .contextual-links {
  display: none !important;
}

/* ================================================
   BASE RESET & TYPOGRAPHY
================================================ */
body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: #333;
  background: #fdfdfd;
}
h1, h2.title, .section-heading {
  font-family: 'Luckiest Guy', cursive;
  color: #1261A0;
  letter-spacing: 1.5px;
}

/* ================================================
   HEADER + NAVIGATION
================================================ */
#site-header {
  background-color: #000;
  padding: 8px 20px; /* slightly tighter */
}
#site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0;

}
.site-logo img {
 height: 64px;      /* pick one size (64px works well) */
  width: auto;
  max-width: 100%;
  display: block;
  padding-right: 0;  /* remove the big 80px push */
}

@media (max-width: 768px) {
  #site-header .site-logo img { height: 48px; }
}

@media (max-width: 900px) {
  #site-header .header-inner {
    flex-wrap: nowrap !important;  /* force logo and toggle onto same line */
    align-items: center !important;
    justify-content: space-between !important;
  }

  .site-logo {
    flex: 0 1 auto;   /* allow logo to shrink if needed */
  }

  .menu-toggle {
    flex: 0 0 auto;
    margin-left: auto; /* pushes toggle to far right */
  }
}

.main-menu ul {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.main-menu ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 0.05em;
}
.main-menu ul li a:hover { text-decoration: underline; }
.menu-toggle {
  display: none;
  font-size: 2rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

/* ================================================
   SEARCH BAR BELOW HEADER
================================================ */
.header-search {
  background: none;
  padding: 10px 0;
  text-align: right;
  max-width: 1200px;
  margin: 0 auto;
}
.header-search form { display: inline-flex; gap: 0.5rem; }
.header-search input[type="search"] {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 14px;
}

/* ================================================
   HERO SLIDER (Homepage)
================================================ */
.hero-banner {
  width: 100%;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}
.hero-banner .hero-swiper { width: 100%; height: 450px; overflow: hidden; }
.hero-banner .hero-swiper img,
.hero-banner .hero-fallback img {
  width: 100%;
  height: 450px;
  object-fit: cover;
  object-position: center;
  display: block;
}
@media (max-width: 768px) {
  .hero-banner .hero-swiper,
  .hero-banner .hero-fallback img { height: 320px; }
}
@media (max-width: 480px) {
  .hero-banner .hero-swiper,
  .hero-banner .hero-fallback img { height: 280px; }
}

/* ================================================
   WELCOME TEXT BELOW SLIDER
================================================ */
.welcome-text {
  background: linear-gradient(to bottom, #f7f7f7, #e0e7f0);
  padding: 0 20px 20px;
  text-align: center;
  border-top: 4px solid #1261A0;
  border-bottom: 4px solid #1261A0;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}
.welcome-text h2 {
  font-family: 'Luckiest Guy', cursive;
  color: #1261A0;
  font-size: 2.75rem;
  letter-spacing: 1.8px;
}
.welcome-text p {
  font-size: 1.15rem;
  max-width: 900px;
  margin: 0 auto;
}

/* ================================================
   MAIN CONTENT WRAPPER
================================================ */
.layout-content {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/*==========================================================
          CLEAN UP STARTS HERE GALLERY
==========================================================*/

/* ============================================================================
   SCRITTORS — Consolidated & SAFE CSS
   - Consolidated multiple duplicated blocks into one canonical set of rules.
   - Tightened card spacing and removed excessive min-heights/padding to make
     cards compact while preserving responsive behavior and hover effects.
   - Ensures image/title/nickname are clickable via .scrittor-link (flex layout).
   - Dual buttons available: .card-btn.about and .card-btn.stories
   ============================================================================ */

/* -------------------------
   Theme variables (easy tuning)
   ------------------------- */
:root{
  --blue-main: #1261A0;
  --blue-mid:  #0d5a92;
  --blue-cta:  #1582d2;
  --light-blue:#E6F1FB;
  --card-radius: 12px;
  --card-shadow: 0 3px 8px rgba(0,0,0,0.10);
  --gap: 1.5rem;
  --card-width: 220px;         /* final card width */
}

/* =====================================================
   GALLERY GRID
   ===================================================== */
.path-gallery .views-view-grid.horizontal .views-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: 1.75rem;
  margin: 0 auto;
  max-width: 1200px;
  box-sizing: border-box;
}
.path-gallery .views-col {
  flex: 0 1 calc(25% - 1.75rem);
  display: flex;
  justify-content: center;
  align-items: stretch;
  box-sizing: border-box;
}

/* =====================================================
   GALLERY SEARCH / FILTERS
   (consolidated single form styling)
   ===================================================== */
.path-gallery .views-exposed-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 0.75rem 0.9rem;

  background: #eaf3ff;
  border: 1px solid #bcd2f0;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(18,97,160,0.08);
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  box-sizing: border-box;
}

/* full width search field row */
.path-gallery .views-exposed-form .form-item-combine {
  flex: 1 1 100%;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.25rem;
}
.path-gallery .views-exposed-form .form-item-combine label {
  font-weight: 600;
  color: var(--blue-mid);
  font-size: 0.9rem;
  white-space: nowrap;
}
.path-gallery .views-exposed-form .form-item-combine input[type="text"],
.path-gallery .views-exposed-form .form-item-combine input[type="search"] {
  flex: 1;
  max-width: 420px;
  height: 32px;
  border-radius: 5px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  background: #fff;
  box-sizing: border-box;
}

/* selects & dropdowns */
.path-gallery .views-exposed-form .form-item:not(.form-item-combine):not(.form-actions) {
  display: flex;
  flex-direction: column;
  margin: 0;
  flex: 0 1 auto;
}
.path-gallery .views-exposed-form label { /* generic label */
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-mid);
  margin-bottom: 0.2rem;
}
.path-gallery .views-exposed-form select {
  height: 32px;
  min-width: 120px;
  max-width: 190px;
  padding: 0.25rem 1.8rem 0.25rem 0.4rem;
  font-size: 0.85rem;
  border: 1px solid #bcd2f0;
  border-radius: 5px;
  background:
    #ffffff url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='6'><path d='M0 0l4 6 4-6z' fill='%231261A0'/></svg>") no-repeat right 8px center;
  background-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.path-gallery .views-exposed-form select:hover { border-color:#8bb9e5; box-shadow:0 2px 4px rgba(18,97,160,0.1); }
.path-gallery .views-exposed-form select:focus { outline: 1px solid var(--blue-main); box-shadow:0 2px 6px rgba(0,0,0,0.12); }
.path-gallery .views-exposed-form select[multiple], .path-gallery .views-exposed-form select[size] {
  height: 32px !important; overflow: hidden !important;
}

/* submit button */
.path-gallery .views-exposed-form .form-actions { display:flex; align-items:flex-end; gap:0.5rem; }
.path-gallery .views-exposed-form .form-actions input[type="submit"] {
  background: var(--blue-main);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  height: 32px;
  transition: background 0.25s ease;
}
.path-gallery .views-exposed-form .form-actions input[type="submit"]:hover { background:#0a4d82; }

/* wider collection select */
.path-gallery .views-exposed-form #edit-field-collection-target-id { min-width:170px !important; max-width:190px !important; }

/* ================================================
   SCRITTOR CARD — compact, balanced, predictable
   ================================================ */
.scrittor-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  margin: 2rem auto;
  box-sizing: border-box;
}

/* base card */
.scrittor-card {
  width: var(--card-width);
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  text-align: center;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;   /* compact: do NOT stretch content vertically */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

/* hover */
.scrittor-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

/* CLICKABLE area: wrap the image + title + nickname in this anchor */
.scrittor-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
  /* make the clickable area expand but avoid pushing buttons: */
  padding: 0.25rem 0;
}

/* image block (maximize inside available space) */
.scrittor-card__image {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.25rem;
}
.scrittor-card__image img {
  width: 100%;
  max-height: 160px;          /* slightly reduced to make cards compact */
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0.25rem auto;
}

/* name + nickname spacing tightened */
.scrittor-card__name, .scrittor-card h3 {
  color: var(--blue-main);
  font-weight: 800;
  font-size: 1rem;
  margin: 0.2rem 0 0.15rem 0;
  line-height: 1.05;
  min-height: 1.2em;           /* keeps names aligned with small footprint */
}
.scrittor-card__name a { color: inherit; text-decoration: none; }

.scrittor-card__nickname {
  font-style: italic;
  color: var(--blue-mid);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  min-height: 1.2em;
}

/* Dual buttons inline, compact */
.scrittor-card__buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
  margin-top: 0.2rem;
  box-sizing: border-box;
}

.card-btn {
  flex: 0 0 auto;
  text-align: center;
  color: #fff;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.18s ease, transform 0.08s ease;
  display: inline-block;
  line-height: 1;
}
.card-btn:hover { transform: translateY(-1px); }

/* color variants */
.card-btn.about { background: var(--blue-main); }
.card-btn.about:hover { background: #0f5490; }

.card-btn.stories { background: #4CC9F0; color: #033047; }
.card-btn.stories:hover { background: #3bc0ea; }

/* legacy lore-link fallback (kept minimal) */
.scrittor-card__button .lore-link {
  display:inline-block;
  background-color: var(--blue-main);
  color:#fff;
  padding:6px 14px;
  border-radius:6px;
  font-weight:700;
  text-decoration:none;
}

/* link style hygiene inside cards */
.path-gallery .scrittor-card h3 a,
.path-gallery .scrittor-card__nickname a {
  text-decoration: none;
}
.path-gallery .scrittor-card h3 a:hover { color:#0a4d82; }

/* ===================================================
   PROFILE PAGE LAYOUT (unchanged except cleaned)
   =================================================== */
.page-node-type-scrittor-profiles .scrittor-profile {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 6px;
  padding-bottom: 24px;
  box-sizing: border-box;
}
.page-node-type-scrittor-profiles .profile-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 420px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1024px) {
  .page-node-type-scrittor-profiles .profile-layout { grid-template-columns: 1fr; }
}
.page-node-type-scrittor-profiles .profile-card-image-top img {
  display: block; width: 100%; max-width: 420px; height: auto;
  border-radius: 12px; box-shadow: 0 12px 24px rgba(0,0,0,.12);
}
.page-node-type-scrittor-profiles .profile-nickname { text-align:center; margin-top:8px; font-style:italic; }

/* THRC boxes */
.page-node-type-scrittor-profiles .profile-thrc-icons-group { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:24px 0; }
.page-node-type-scrittor-profiles .profile-thrc-icon {
  display:grid; grid-template-columns:64px 1fr; gap:12px; align-items:start;
  padding:12px; background:#fff; border:1px solid #ddd; border-radius:12px; box-shadow:0 2px 10px rgba(0,0,0,.04);
}
.page-node-type-scrittor-profiles .profile-thrc-icon img { width:64px; height:64px; object-fit:contain; }
img { max-width:100%; height:auto; }

/* Abilities box */
.page-node-type-scrittor-profiles .abilities-box {
  background: var(--light-blue);
  border: 1px solid #c5dcf4;
  border-radius: 12px;
  padding: 15px 18px;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.page-node-type-scrittor-profiles .abilities-box strong { color: var(--blue-main); font-weight:700; }

/* King's code (unchanged visual) */
.kings-code-wrapper { background-color: var(--light-blue); border-radius:12px; display:inline-block; padding:8px; margin-top:15px; }
.kings-code-button { display:inline-block; background-color:var(--blue-main); color:#fff; font-size:1rem; font-weight:700; border:none; border-radius:10px; padding:12px 20px; cursor:pointer; box-shadow:0 2px 4px rgba(0,0,0,0.1); }
.kings-code-button:hover { background:#0f5490; transform:translateY(-1px); }

/* ======================
   FINAL PAGE TITLES — consistent
   ====================== */
.lore-page-title, .path-gallery .gallery-heading, .page-node-type-scrittor-profiles .scrittor-profile h1.profile-title, .front .layout-content > h1:first-child, .page-node-type-page .layout-content > h1:first-child {
  font-family: 'Luckiest Guy', cursive;
  color: var(--blue-main);
  letter-spacing: 1.5px;
  font-size: 2.6rem !important;
  font-weight: 400;
  position: relative;
  line-height: 1.1;
  padding-bottom: 0.35rem !important;
  margin: 0.25rem 0 1.25rem !important;
}
.lore-page-title::after, .path-gallery .gallery-heading::after, .page-node-type-scrittor-profiles .scrittor-profile h1.profile-title::after, .front .layout-content > h1:first-child::after, .page-node-type-page .layout-content > h1:first-child::after {
  content:""; position:absolute; left:0; bottom:0; width:100%; height:2.5px; background-color:var(--blue-main); transform: translateY(1px);
}
.page-node-type-scrittor-profiles .scrittor-profile h1.profile-title { margin-top:-0.1rem !important; padding-top:0 !important; line-height:1.05 !important; }

/* ===================================================
   RESPONSIVE: Gallery + Profile
   - Cards stack on small screens, image/names remain clickable.
   =================================================== */
@media (max-width: 768px) {
  .path-gallery .views-exposed-form .form-item-combine { flex-direction:column !important; align-items:flex-start !important; }
  .path-gallery .views-exposed-form .form-item-combine input[type="text"],
  .path-gallery .views-exposed-form .form-item-combine input[type="search"] { width:100% !important; max-width:100% !important; box-sizing:border-box !important; }

  /* stack cards */
  .path-gallery .views-view-grid.horizontal .views-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1.5rem !important;
  }
  .path-gallery .views-col { flex: 0 1 100% !important; max-width:95% !important; }
  .scrittor-card { width: 100% !important; max-width: 360px !important; margin: 0 auto; padding: 0.75rem; }
  .scrittor-card__image img { max-height: 200px; } /* allow a hair larger on mobile if useful */
  .kings-code-button { width: 100% !important; }
}

/* ===================================================
   Header / nav small tweaks (kept safe) 
   =================================================== */
#site-header { background: #000 !important; width:100%; z-index:9999; }
#site-header .header-inner { display:flex; align-items:center; justify-content:space-between; max-width:1200px; margin:0 auto; padding:8px 20px; box-sizing:border-box; }
#site-header .site-logo img { height:64px; width:auto; display:block; }

/* mobile nav toggle preserved */
@media (max-width:900px) {
  #site-header .menu-toggle { display:block !important; }
  #site-header .main-menu { display:none; position:absolute; top:70px; left:0; width:100%; background:#000; z-index:9998; }
  #site-header .main-menu.active { display:block; }
  #site-header .main-menu ul { flex-direction:column; align-items:flex-start; gap:0; }
  #site-header .main-menu li a { display:block; width:100%; padding:12px 20px; color:#fff !important; }
  #site-header .main-menu li a:hover { background: #1261A0; }
}

/* ---- Responsive: 5-col on very large screens, 4-col otherwise ---- */
/* Keeps existing behavior for most users; enables 5 across for wide displays */
@media (min-width: 1400px) {
  .path-gallery .views-col {
    /* 5 columns: subtract the gap proportionally */
    flex: 0 1 calc(20% - 1.75rem);
    max-width: calc(20% - 1.75rem);
  }

  /* optional tweak: slightly reduce card width so they don't feel cramped */
  .scrittor-card { width: 200px; } /* change to 200px only on very large screens */
}

/* fallback/balanced rules for other breakpoints */
@media (min-width: 1200px) and (max-width: 1399px) {
  .path-gallery .views-col { flex: 0 1 calc(25% - 1.75rem); max-width: calc(25% - 1.75rem); } /* 4-col */
}
@media (min-width: 800px) and (max-width: 1199px) {
  .path-gallery .views-col { flex: 0 1 calc(33.333% - 1.75rem); max-width: calc(33.333% - 1.75rem); } /* 3-col */
}
@media (max-width: 799px) {
  .path-gallery .views-col { flex: 0 1 100%; max-width: 100%; } /* stacked */
}

/* ---------- Mobile: make gallery cards wider (comfortable view) ---------- */
@media (max-width: 768px) {
  /* let each grid column occupy nearly full width */
  .path-gallery .views-col {
    flex: 0 1 95% !important;
    max-width: 95% !important;
  }

  /* make the card stretch across the viewport a bit more */
  .scrittor-card {
    width: 90vw !important;         /* nearly full viewport width */
    max-width: 420px !important;    /* keep a sensible max for large phones */
    margin: 0.75rem auto !important;
    padding: 1rem !important;
    min-height: 0;                  /* remove enforced tallness on mobile */
  }

  /* increase image space on phones so the scrittor appears larger */
  .scrittor-card__image img {
    width: auto !important;
    max-width: 86% !important;
    height: auto !important;
    max-height: 300px !important;
    display: block;
    margin: 0.25rem auto 0.5rem auto !important;
  }

  /* slightly larger name text on phones (optional) */
  .scrittor-card__name { font-size: 1.15rem !important; }
  .scrittor-card__nickname { font-size: 1rem !important; margin-bottom: 0.6rem !important; }
}



/* ======================
  PROFILE — THRC GRID (force 2x2 boxes & consistent look)
   - fixes (1) 2x2 grid, (6) ability title bold/blue
====================== */
.page-node-type-scrittor-profiles .profile-thrc-icons-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 1rem 1.25rem !important;
  margin: 1rem 0 !important;
  align-items: start !important;
}

.page-node-type-scrittor-profiles .profile-thrc-icon {
  display: grid !important;
  grid-template-columns: 72px 1fr !important;
  gap: 12px !important;
  align-items: center !important;
  padding: 12px !important;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Icon sizing */
.page-node-type-scrittor-profiles .profile-thrc-icon img {
  width: 64px !important;
  height: 64px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

/* Title (Ability label) — ensure blue and bold */
.page-node-type-scrittor-profiles .profile-thrc-icon .icon-text strong,
.page-node-type-scrittor-profiles .profile-thrc-icon h4,
.page-node-type-scrittor-profiles .profile-thrc-icon .ability-title {
  color: #1261A0 !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
  margin: 0 !important;
}

/* Subtitle / short description under each icon */
.page-node-type-scrittor-profiles .profile-thrc-icon .icon-text em,
.page-node-type-scrittor-profiles .profile-thrc-icon .ability-sub {
  font-style: italic !important;
  color: #444 !important;
  margin-top: 4px !important;
}

/* Make first row boxes a little shorter and bottom row slightly taller for balance */
.page-node-type-scrittor-profiles .profile-thrc-icon:nth-child(1),
.page-node-type-scrittor-profiles .profile-thrc-icon:nth-child(2) {
  min-height: 82px !important;
}
.page-node-type-scrittor-profiles .profile-thrc-icon:nth-child(3),
.page-node-type-scrittor-profiles .profile-thrc-icon:nth-child(4) {
  min-height: 110px !important;
}


/* ================================================== 
         KING'S CODE MODAL (cleaned and working)
/* ================================================== 
         KING'S CODE MODAL (with fade transitions)
====================================================== */

.kings-code-modal {
  position: fixed;
  inset: 0;
  display: flex; /* Always render, but hide visually */
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.45);
  box-sizing: border-box;

  /* Transition setup */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.kings-code-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.kings-code-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99990;
}

.kings-code-modal__content,
.kings-code-modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  position: relative;
  z-index: 99991;

  /* Entry transition */
  transform: scale(0.97);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.kings-code-modal.active .kings-code-modal__content {
  transform: scale(1);
  opacity: 1;
}

.kings-code-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 2rem;
  line-height: 1;
  color: #333;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 99992;
}

/* CTA box styling */
.kings-code-cta {
  padding: 1.25rem 1rem 1.1rem;
  background: #eef6ff;
  border-radius: 12px;
  margin-top: 1.25rem;
  text-align: center;
}

.kings-code-button {
  font-size: 1rem;
  background-color: #1261A0;
  color: white;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
}

.kings-code-button:hover {
  background-color: #0f4e80;
}

/* Add spacing below the King’s Code button (especially for mobile) */
.lore-side .kings-code-cta {
  margin-bottom: 1.25rem; /* or 1.5rem for more space */
}


/* === LORE SIDEBAR TWEAKS === */
.lore-side .card-body {
  font-family: 'Arial', sans-serif; /* or your preferred standard font */
  font-size: 16px;
  color: #333;
}

.lore-side .card-body strong {
  color: #1261A0; /* Basileia blue */
  font-weight: bold;
  font-family: 'Arial', sans-serif;
}

/* Player Connection italic style (no heading) */
.lore-side .kings-clue-card + .image-card {
  margin-top: 1rem;
}

.lore-side .card-body em,
.lore-side .card-body i {
  font-style: italic;
  color: #333;
}

/* Optional: Add soft blue background to More Stories card */
.more-lore-card {
  background: #eef7ff;
  border-radius: 8px;
}
.image-card .meta-item {
  margin-top: 0.5rem;
  font-size: 15px;
  color: #333;
}

/* Uncrop sidebar image on Lore pages */
.lore-side .image-card img {
  width: 100%;
  height: auto;
  object-fit: contain;  /* show full image */
  border-radius: 12px;
  display: block;
  margin: 0 auto;
}
.lore-side .image-card img {
  max-height: 360px;
  width: auto;
  height: auto;
  object-fit: contain;
}


img.sidebar-square {
  aspect-ratio: auto !important;
  object-fit: contain !important;
  height: auto !important;
  max-height: none !important;  /* optional if you want full height */
}

/* =========ADD TO LIMIT HEIGHT====== 
  img.sidebar-square {
  aspect-ratio: auto !important;
  object-fit: contain !important;
  height: auto !important;
  max-height: 360px !important;
}*/


/* ===================================================
   LORE SIDEBAR — Clean Label Font Update
   =================================================== */

/* Sidebar card headings (e.g. King's Clue, More from Ryter, Symbol) */
.lore-side .card-heading {
  font-family: 'Arial', sans-serif !important;
  font-weight: 1000 !important;
  font-size: 1.1rem !important; 
  color: #1261A0 !important;
  text-transform: uppercase;
  letter-spacing: -0.6px; !important;
  margin-bottom: -.5rem; !important;
}
/* Optional: keep consistent spacing between cards */
.lore-side .card {
  margin-bottom: 1rem;
}

/* Optional: italic body text (Player Connection, quotes) remains readable */
.lore-side .card-body {
  font-family: 'Arial', sans-serif;
  line-height: 1.5;
}

/* King’s Clue can have a slightly emphasized title style */
.kings-clue-card .card-heading {
  font-weight: 1000 !important;
  font-size: 1rem !important;
}

/* Connection can have a slightly emphasized title style */
.more-lore-card .card-heading {
  font-weight: 1000 !important;
  font-size: 1rem !important;
}

/* Details can have a slightly emphasized title style */
.meta-card .card-heading {
  font-weight: 1000 !important;
  font-size: 1rem !important;
}


/* Remove old font inheritance from Luckiest Guy */
.lore-side h3.card-heading,
.lore-side .card-heading {
  font-family: 'Arial', sans-serif !important;
}

.origin-popup-buttons .btn {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background-color: #1261A0;
  color: white;
  text-decoration: none;
  display: inline-block;
}

.origin-popup-buttons .btn-secondary {
  background-color: #ccc;
  color: #333;
}

.origin-popup-buttons .btn:hover {
  background-color: #0f4e7c;
}


@media (max-width: 768px) {
  #site-header .header-inner {
    flex-wrap: nowrap !important;
  }

  .site-logo {
    flex: 0 1 auto;
  }

  .menu-toggle {
    flex: 0 0 auto;
    margin-left: auto;
  }

  nav.main-menu {
    flex: 1 1 100%;
    order: 2;
    display: none;
  }

  nav.main-menu.active {
    display: block;
  }
}



