/* ==========================================================================
   Monograph Interactive Modules & Conceptual Metaphors
   CSS Component Library for Psychoterapia.no
   ========================================================================== */

:root {
  --mono-gold: #947600;
  --mono-gold-light: #f7edd0;
  --mono-gold-hover: #735c00;
  --mono-navy: #1b2a4a;
  --mono-navy-light: #e8ecf4;
  --mono-teal: #2c5957;
  --mono-teal-light: #e3edea;
  --mono-terracotta: #9a4833;
  --mono-terracotta-light: #faeae6;
  --mono-surface: #ffffff;
  --mono-surface-alt: #fdfbf7;
  --mono-border: rgba(148, 118, 0, 0.22);
  --mono-border-subtle: rgba(0, 0, 0, 0.08);
  --mono-text: #1a202c;
  --mono-text-muted: #4a5568;
  --mono-radius: 12px;
  --mono-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --mono-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
}

/* Container Section */
.monograph-module-section {
  margin: 50px auto;
  max-width: 1040px;
  padding: 0 20px;
}

.monograph-module-card {
  background: var(--mono-surface-alt);
  border: 1px solid var(--mono-border);
  border-radius: var(--mono-radius);
  box-shadow: var(--mono-shadow-md);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
}

.monograph-module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--mono-gold), #c8963e, var(--mono-teal));
}

/* Module Header */
.module-header {
  margin-bottom: 24px;
}

.module-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.module-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--mono-gold-light);
  color: var(--mono-gold-hover);
  border: 1px solid rgba(148, 118, 0, 0.3);
}

.module-catalog-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mono-gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.module-catalog-link:hover {
  color: var(--mono-gold-hover);
  transform: translateX(3px);
  text-decoration: underline;
}

.module-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.85rem;
  color: var(--mono-text);
  line-height: 1.3;
  margin: 0 0 10px;
}

.module-description {
  font-size: 1.05rem;
  color: var(--mono-text-muted);
  line-height: 1.6;
  margin: 0 0 20px;
}

/* Cautions & Limitations Notice Box */
.module-notice-box {
  background: #ffffff;
  border-left: 4px solid var(--mono-gold);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 18px 0 24px;
  font-size: 0.88rem;
  color: #555;
  line-height: 1.55;
  box-shadow: var(--mono-shadow-sm);
}

.module-notice-box strong {
  color: var(--mono-text);
}

/* ==========================================================================
   Moduł A: Interaktywna Wizualizacja (Filtr/Kroki/Przełącznik)
   ========================================================================== */

.viz-workspace {
  background: #ffffff;
  border: 1px solid var(--mono-border-subtle);
  border-radius: 10px;
  padding: 24px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

/* Control Pills / Tab Buttons */
.viz-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--mono-border-subtle);
}

.viz-btn {
  background: #f8f6f0;
  border: 1px solid var(--mono-border);
  color: var(--mono-text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.viz-btn:hover {
  background: #f0e9d6;
  border-color: var(--mono-gold);
}

.viz-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(148, 118, 0, 0.35);
}

.viz-btn.active {
  background: var(--mono-gold);
  color: #ffffff;
  border-color: var(--mono-gold-hover);
  box-shadow: 0 2px 8px rgba(148, 118, 0, 0.28);
}

/* Interactive Display Area */
.viz-display-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .viz-display-panel.split-view {
    grid-template-columns: 1.4fr 1fr;
  }
}

.viz-flow-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.viz-node-card {
  background: #fdfbf7;
  border: 1px solid var(--mono-border);
  border-radius: 8px;
  padding: 14px 18px;
  transition: border-color 0.2s ease, transform 0.2s ease;
  position: relative;
}

.viz-node-card:focus-visible {
  outline: 2px solid var(--mono-gold);
  outline-offset: 2px;
}

.viz-node-card.active-node {
  border-color: var(--mono-gold);
  background: #fffcee;
  box-shadow: 0 4px 12px rgba(148, 118, 0, 0.1);
  transform: translateX(4px);
}

.viz-node-step {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mono-gold);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.viz-node-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mono-text);
  margin: 0 0 6px;
}

.viz-node-desc {
  font-size: 0.92rem;
  color: var(--mono-text-muted);
  line-height: 1.5;
  margin: 0;
}

.viz-detail-box {
  background: #fcf9f2;
  border: 1px solid var(--mono-border);
  border-radius: 8px;
  padding: 20px;
}

.viz-detail-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mono-navy);
  margin-top: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 8px;
}

/* Sources & Methodology Footer */
.module-footer-meta {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--mono-border-subtle);
  font-size: 0.85rem;
  color: #666;
  line-height: 1.5;
}

.module-footer-meta strong {
  color: var(--mono-text);
}

/* ==========================================================================
   Moduł B: Metafora Koncepcyjna (Obraz, Odwzorowanie, Granice)
   ========================================================================== */

.metaphor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 820px) {
  .metaphor-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

.metaphor-visual-figure {
  margin: 0;
}

.metaphor-visual-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--mono-border);
  display: block;
  box-shadow: var(--mono-shadow-sm);
}

.metaphor-analogy-box {
  background: #ffffff;
  border: 1px solid var(--mono-border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.metaphor-lead-text {
  font-size: 1.05rem;
  font-style: italic;
  color: #2c2416;
  line-height: 1.65;
  margin-bottom: 0;
}

.metaphor-content-side {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table of Mapping (Odwzorowanie Metafory) */
.metaphor-mapping-table {
  width: 100%;
  min-width: 280px;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.9rem;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--mono-border);
}

.metaphor-mapping-table th {
  background: #f7f2e4;
  color: var(--mono-text);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--mono-border);
}

.metaphor-mapping-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--mono-border-subtle);
  color: var(--mono-text-muted);
  vertical-align: top;
  line-height: 1.45;
}

.metaphor-mapping-table tr:last-child td {
  border-bottom: none;
}

.metaphor-mapping-table td strong {
  color: var(--mono-text);
}
