/*
 Theme Name: Emotionsmedizin Astra Child
 Theme URI: https://emotionsmedizin.de
 Description: Child Theme für Astra (Emotionsmedizin)
 Author: Andreas
 Template: astra
 Version: 1.0.0
 Text Domain: emotionsmedizin-astra-child
*/

/* =========================
   EMediKey Karten – Grundlayout
   ========================= */

.emedikey-wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.emedikey-card {
  background: #ffffff;
  padding: 36px 36px 40px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Mobile: etwas weniger Padding */
@media (max-width: 600px) {
  .emedikey-card {
    padding: 26px 18px 30px;
  }
}

/* Logo oben */
.emedikey-top {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.emedikey-logo {
  max-width: 160px;
  height: auto;
}

/* Titel */
.emedikey-header {
  text-align: center;
  margin-bottom: 18px;
}

.emedikey-title {
  font-size: 2.1rem;
  line-height: 1.25;
  margin: 0;
  color: #000091;
}

/* Einleitung */
.emedikey-intro {
  font-size: 1.08rem;
  line-height: 1.65;
  color: #222;
  margin-bottom: 22px;
}

.emedikey-intro p {
  margin-bottom: 1.2em;
}

.emedikey-intro-fallback {
  font-size: 0.95rem;
  color: #666;
  font-style: italic;
}

/* =========================
   (Optional/Alt) Accordion
   ========================= */

.emedikey-accordion {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  background: #fafcff;
}

.emedikey-summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  color: #000091;
  list-style: none;
}

.emedikey-summary::-webkit-details-marker {
  display: none;
}

.emedikey-summary::after {
  content: "▾";
  float: right;
  font-weight: 700;
}

.emedikey-accordion[open] .emedikey-summary::after {
  content: "▴";
}

/* Karteninhalt */
.emedikey-content {
  padding: 18px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #222;
  background: #fff;
}

.emedikey-content p {
  margin-bottom: 1.2em;
}

/* =========================
   (Optional/Alt) PDF Aktionen (Accordion)
   ========================= */

.emedikey-pdf-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.emedikey-download-button {
  display: inline-block;
  padding: 12px 22px;
  background-color: #000091;
  color: #ffffff;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.emedikey-download-button:hover {
  background-color: #000070;
}

/* =========================
   NEU: Modal + Buttons
   ========================= */

.emedikey-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
}

/* optionaler Link neben Buttons */
.emedikey-open-link {
  font-size: 0.95rem;
  color: #000091;
  text-decoration: underline;
}

/* Fullscreen Modal */
.emedikey-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 999999;
}

.emedikey-modal.is-open {
  display: block;
}

.emedikey-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

/* Panel: passt exakt in den Viewport */
.emedikey-modal__panel {
  position: relative;
  width: min(1100px, calc(100% - 16px));

  height: calc(100vh - 16px);   /* Fallback */
  height: calc(100dvh - 16px);  /* dynamische Viewport-Höhe */

  margin: 8px auto;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/* Header/Footer fix */
.emedikey-modal__header,
.emedikey-modal__footer {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.emedikey-modal__header {
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

.emedikey-modal__footer {
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
}

.emedikey-modal__title {
  font-weight: 700;
  color: #000091;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

/* Body muss shrinkable sein */
.emedikey-modal__body {
  flex: 1;
  min-height: 0; /* KRITISCH */
  background: #f7fafc;
}

/* Viewer-Wrapper: img + iframe bekommen exakt die verfügbare Höhe */
.emedikey-modal__viewer {
  height: 100%;
  width: 100%;
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Bild-Preview (Safari bevorzugt via JS) */
.emedikey-modal__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain; /* 1-seitige PDF-Vorschau passt ohne Scroll */
  background: #ffffff;
}

/* PDF iFrame (Fallback/andere Browser) */
.emedikey-modal__iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
