/* ==========================================================================
   Átlátszó / Datawrapper Stílusú KEKVA Kapcsolati Folyamatábra (Iframe Embed)
   Betűtípus: Merriweather | Háttérszín: #f4f4f4
   Reszponzivitás: Szélesség és magasság irányban rugalmas alkalmazkodás
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap');

:root {
  --atl-bg: #f4f4f4;
  --atl-red: #e60000;
  --atl-red-hover: #c40000;
  --atl-dark: #1a1a1a;
  --atl-charcoal: #2c3036;
  --atl-text: #1a1a1a;
  --atl-text-muted: #555555;
  --atl-border: #d2d2d2;
  --atl-border-light: #e2e2e2;
  --atl-card-bg: #ffffff;

  /* Fogadó Szervek Színei */
  --c-kebm: #1d70b8;
  --c-pm: #00833e;
  --c-kultura: #8e44ad;
  --c-agrar: #d35400;
  --c-tech: #0097a7;
  --c-mnv: #34495e;
  --c-mol: #c0392b;
  --c-kornyezet: #2e7d32;
}

/* Teljes alaphelyzetbe állítás & Egységes Merriweather betűtípus */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Merriweather', Georgia, serif !important;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--atl-bg);
}

body.embed-body {
  height: 100%;
  min-height: 100%;
  color: var(--atl-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.embed-wrapper {
  width: 100%;
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 6px 12px 6px 12px;
  display: flex;
  flex-direction: column;
  flex: 1 1 0px;
  min-height: 0;
  gap: 4px;
  box-sizing: border-box;
  overflow: hidden;
}

/* ==========================================================================
   FEJLÉC & KOMPAKT SZŰRŐSÁV (KÖZÉPRE IGAZÍTVA, VONAL NÉLKÜL)
   ========================================================================== */
.chart-header {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  border-bottom: none;
  padding-bottom: 2px;
}

.chart-title {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 900;
  color: var(--atl-dark);
  line-height: 1.25;
  letter-spacing: -0.3px;
  text-align: center;
}

.chart-subtitle {
  font-size: clamp(0.82rem, 1.3vw, 0.92rem);
  font-weight: 300;
  color: #4a4a4a;
  line-height: 1.45;
  max-width: 1050px;
  text-align: center;
  margin: 0 auto;
}

.chart-subtitle strong {
  font-weight: 700;
  color: var(--atl-dark);
}

/* Letisztult szűrősáv: középre igazítva, keret nélkül */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  margin-top: 2px;
  width: 100%;
  max-width: 100%;
  background: transparent;
  padding: 0;
  border: none;
  box-sizing: border-box;
}

.filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  box-sizing: border-box;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: #222222;
  white-space: nowrap;
  flex: 0 0 auto;
}

.custom-select {
  width: auto;
  max-width: 240px;
  min-width: 0;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 400;
  color: var(--atl-dark);
  background-color: #ffffff;
  border: 1px solid #c8c8c8;
  border-radius: 0;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}

.custom-select:focus {
  border-color: var(--atl-red);
  box-shadow: 0 0 0 2px rgba(230, 0, 0, 0.12);
}

/* Visszaállítás gomb */
.reset-view-btn {
  background: #ffffff;
  border: 1px solid var(--atl-red);
  color: var(--atl-red);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.reset-view-btn:hover {
  background: var(--atl-red);
  color: #ffffff;
}

/* ==========================================================================
   FOLYAMATÁBRA SZÍNPAD & RESZPONZÍV SVG
   ========================================================================== */
.chart-stage {
  flex: 1 1 0px;
  width: 100%;
  position: relative;
  background: var(--atl-bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.chart-viewport {
  flex: 1 1 0px;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.flow-svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  user-select: none;
}

/* SVG Kártya Stílusok */
.flow-node {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.flow-node rect {
  transition: stroke 0.15s ease, filter 0.15s ease, fill 0.15s ease;
}

.flow-node:hover rect {
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.12));
}

.flow-node text {
  pointer-events: none;
}

/* Flow Ribbons (Sankey folyamvonalak) */
.flow-ribbon {
  fill: none;
  transition: stroke-opacity 0.2s ease, stroke-width 0.2s ease;
  cursor: pointer;
}

.flow-ribbon:hover {
  stroke-opacity: 0.85 !important;
}

.flow-ribbon.dimmed {
  stroke-opacity: 0.06 !important;
}

.flow-ribbon.highlighted {
  stroke-opacity: 0.9 !important;
}

/* ==========================================================================
   SZERKESZTŐSÉGI LÁBLÉC (VONAL NÉLKÜL, HIVATALOS ÁTLÁTSZÓ SVG LOGÓVAL)
   ========================================================================== */
.chart-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: none;
  padding-top: 6px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--atl-text-muted);
}

.footer-source {
  font-style: normal;
}

.footer-source em {
  font-style: italic;
  color: #333333;
}

.footer-brand {
  display: flex;
  align-items: center;
}

.atl-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.atl-logo-link:hover {
  opacity: 0.85;
}

.atl-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

/* ==========================================================================
   MODAL RÉSZLETEK (Kép & Vagyonelem Info)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid #ccc;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  font-size: 22px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  line-height: 1;
}

.modal-close:hover {
  background: var(--atl-red);
}

.modal-img-large {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.modal-pictogram-header {
  background: #f8f8f8;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.modal-pictogram-icon-wrap {
  width: 52px;
  height: 52px;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-sizing: border-box;
}

.modal-pictogram-icon-wrap svg {
  width: 100%;
  height: 100%;
}

.modal-details-pad {
  padding: 16px 18px;
}

.modal-dest-tag {
  display: inline-block;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--atl-dark);
  margin-bottom: 12px;
  line-height: 1.3;
}

.modal-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
}

.modal-meta-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.4;
}

.modal-meta-label {
  font-weight: 700;
  color: #555555;
  min-width: 105px;
  flex-shrink: 0;
}

.modal-meta-val {
  color: #1a1a1a;
}

.modal-meta-row.modal-val-highlight {
  background: #f4f4f4;
  padding: 6px 10px;
  border: 1px solid #dfdfdf;
  margin-top: 4px;
}

.modal-desc {
  font-size: 12px;
  color: #444444;
  line-height: 1.5;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
  font-style: italic;
}

/* ==========================================================================
   RESZPONZÍV TÖRÉSPONTOK (MOBIL & TABLET)
   ========================================================================== */
@media (max-width: 768px) {
  .embed-wrapper {
    padding: 6px 8px 10px 8px;
    gap: 6px;
  }

  .chart-title {
    font-size: 1.18rem;
    line-height: 1.25;
  }

  .chart-subtitle {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .filters-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
    width: 100%;
  }

  .filter-group {
    flex: 1 1 140px;
    min-width: 130px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .filter-label {
    font-size: 10px;
  }

  .custom-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 3px 5px;
    font-size: 10.5px;
  }

  .reset-view-btn {
    align-self: center;
    width: 100%;
    justify-content: center;
    padding: 3px 6px;
    font-size: 10.5px;
  }

  .flow-svg {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }

  .chart-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    font-size: 10px;
  }

  .atl-logo-img {
    height: 22px;
  }
}

/* ==========================================================================
   MAGASSÁG ALAPÚ RESZPONZÍVITÁS (Kisebb kijelzőmagasság, laptopok, ifram-ek)
   ========================================================================== */
@media (max-height: 750px) {
  .embed-wrapper {
    padding: 6px 12px 6px 12px;
    gap: 4px;
  }
  .chart-header {
    gap: 3px;
    padding-bottom: 0;
  }
  .chart-title {
    font-size: 1.15rem;
  }
  .chart-subtitle {
    font-size: 0.8rem;
    line-height: 1.35;
  }
  .filters-bar {
    gap: 8px;
    margin-top: 1px;
  }
  .custom-select {
    padding: 3px 6px;
    font-size: 11px;
  }
  .reset-view-btn {
    padding: 3px 8px;
    font-size: 11px;
  }
  .chart-footer {
    padding-top: 3px;
    margin-top: 1px;
    font-size: 10.5px;
  }
  .atl-logo-img {
    height: 24px;
  }
}

@media (max-height: 560px) {
  .embed-wrapper {
    padding: 4px 10px 4px 10px;
    gap: 2px;
  }
  .chart-header {
    gap: 2px;
  }
  .chart-title {
    font-size: 1.05rem;
  }
  .chart-subtitle {
    font-size: 0.72rem;
    line-height: 1.25;
  }
  .filters-bar {
    gap: 6px;
  }
  .filter-label {
    font-size: 10.5px;
  }
  .custom-select {
    padding: 2px 5px;
    font-size: 10px;
  }
  .reset-view-btn {
    padding: 2px 6px;
    font-size: 10px;
  }
  .chart-footer {
    padding-top: 2px;
    font-size: 10px;
  }
  .atl-logo-img {
    height: 20px;
  }
}
