/* ==========================================================================
   BREAD & BROADSWORD — MAGES GUILD & RESEARCH ACADEMY STYLES
   Illuminated Masteries Chronicles with Panoramic Header & Concise Lore
   ========================================================================== */

.research-window {
  width: 1240px;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--parchment-base);
  color: var(--parchment-text);
  border: 2px solid #845e2a;
}

.research-window-body {
  padding: 12px 16px 16px 16px;
  background: #dfcbab url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" opacity="0.03"><rect width="80" height="80" fill="%23000"/></svg>');
}

/* ==========================================================================
   MAGES GUILD PANORAMIC ART BANNER
   ========================================================================== */
.res-d3-chronicles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.res-mages-guild-banner {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 4px;
  overflow: hidden;
  border: 1.5px solid #a88349;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22), inset 0 0 20px rgba(0, 0, 0, 0.35);
  background: #190f1d;
}

.res-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  display: block;
}

.res-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(25, 12, 38, 0.45) 100%);
  pointer-events: none;
}

.res-banner-badge {
  position: absolute;
  bottom: 8px;
  left: 12px;
  background: rgba(35, 18, 52, 0.85);
  border: 1px solid #d4a753;
  border-radius: 3px;
  padding: 5px 12px;
  font-size: var(--fs-base, 13px);
  font-weight: 800;
  color: #ffdca1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  letter-spacing: 0.3px;
}

/* ==========================================================================
   2-COLUMN RESPONSIVE MASTERIES GRID
   ========================================================================== */
.res-d3-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-right: 4px;
}

.res-d3-grid::-webkit-scrollbar {
  width: 7px;
}
.res-d3-grid::-webkit-scrollbar-track {
  background: #d8c29d;
  border-radius: 3px;
}
.res-d3-grid::-webkit-scrollbar-thumb {
  background: #8b6834;
  border-radius: 3px;
}

/* Mastery Folio Card */
.res-chronicle-card {
  background: #fbf5e8;
  border: 1.5px solid #c4ad87;
  border-radius: 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08), inset 0 0 30px rgba(180, 140, 70, 0.06);
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 13px;
  align-items: stretch;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.res-chronicle-card:hover {
  background: #fffaf0;
  border-color: #9f753c;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12), inset 0 0 35px rgba(180, 140, 70, 0.1);
}

/* Left Art Column */
.res-chronicle-art-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}

.res-chronicle-art-frame {
  position: relative;
  width: 160px;
  height: 160px;
  border: 2px solid #6b441a;
  border-radius: 3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 0 8px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  background: #111;
}

.res-chronicle-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Corner Accents (Disabled) */
.res-chronicle-corner-ornament {
  display: none !important;
}

/* Specialization-Specific Ribbons Only */
.res-chronicle-meta-tag.specialization {
  font-size: var(--fs-xs, 11px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 6px;
  border-radius: 2px;
  text-align: center;
  width: 160px;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.res-chronicle-meta-tag.specialization.warrior {
  background: #f7e6e6;
  border: 1px solid #a83d3d;
  color: #7a1515;
}

.res-chronicle-meta-tag.specialization.trader {
  background: #fdf5e6;
  border: 1px solid #c99645;
  color: #68410d;
}

.res-chronicle-meta-tag.specialization.farmer {
  background: #eef6e9;
  border: 1px solid #6b9e54;
  color: #235212;
}

/* Right Content Pane */
.res-chronicle-content-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

/* Title & Level Badge Row */
.res-chronicle-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #d4c19d;
  padding-bottom: 4px;
}

.res-title-lockup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.res-chronicle-title {
  margin: 0;
  font-size: var(--fs-md, 15px);
  font-weight: 900;
  color: #1f1207;
  letter-spacing: 0.3px;
  font-family: var(--font-primary, 'Marcellus', serif);
}

.res-title-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fff9ee 0%, #ecd7b1 100%);
  border: 1.2px solid #8f642a;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: var(--fs-sm, 12px);
  font-weight: 900;
  color: #4a270a;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Concise Narrative Lore (Standard Game Font, No Drop Cap) */
.res-chronicle-prose {
  font-size: var(--fs-base, 12.5px);
  line-height: 1.45;
  color: #3b2512;
  font-family: var(--font-primary, 'Marcellus', serif);
  font-style: italic;
  background: rgba(255, 255, 255, 0.45);
  border-left: 2.5px solid #a67c3b;
  padding: 6px 9px;
  border-radius: 0 3px 3px 0;
}

/* Stats Progress Strip */
.res-chronicle-stats-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0e3cc;
  border: 1px solid #c9b48e;
  border-radius: 3px;
  padding: 6px 10px;
}

.res-chronicle-stat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cs-label {
  font-size: var(--fs-xs, 11px);
  font-weight: 800;
  color: #6d5135;
  letter-spacing: 0.4px;
}

.cs-val {
  font-size: var(--fs-md, 13.5px);
  font-weight: 900;
  color: #1d5c21;
}

.cs-val.next {
  color: #197a20;
}

.cs-sub {
  font-size: var(--fs-xs, 11.5px);
  color: #553b22;
}

.cs-arrow {
  color: #8a6328;
  font-size: 14px;
  font-weight: bold;
}

/* Footer: Metrics (Cost, Duration) & Commission Button */
.res-chronicle-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px dotted #d4c09d;
  gap: 10px;
}

.res-chronicle-metrics {
  display: flex;
  gap: 12px;
  align-items: center;
}

.res-metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.res-metric-label {
  font-size: var(--fs-xs, 11px);
  font-weight: 800;
  color: #6a4d2c;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.res-metric-val {
  font-size: var(--fs-base, 12.5px);
  color: #241407;
  display: flex;
  align-items: center;
  gap: 4px;
}

.res-metric-val strong {
  color: #8a170d;
}

.res-guild-bonus {
  font-size: var(--fs-xs, 11.5px);
  font-weight: 800;
  color: #632291;
}

.btn-chronicle-upgrade {
  background: linear-gradient(180deg, #912117 0%, #680e08 100%);
  border: 1.5px solid #d49a46;
  border-radius: 3px;
  color: #fff3c9;
  font-family: inherit;
  font-size: var(--fs-sm, 12.5px);
  font-weight: 800;
  padding: 7px 13px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-chronicle-upgrade:hover {
  background: linear-gradient(180deg, #a82a1f 0%, #7d130c 100%);
  border-color: #ffd885;
  color: #ffffff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.btn-chronicle-upgrade:active {
  transform: translateY(0);
}
