/* Simple namespaced modal CSS - change as desired */

/* Import Google Fonts: Fraunces (600, 700) and Barlow (400) */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Barlow:wght@400&display=swap');

/* Font stack definitions:
 * - Fraunces: serif fallback
 * - Barlow: system UI sans-serif fallback
 */
@keyframes eir-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes eir-modal-popup {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes eir-drawer-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.eir-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99998;
  display: none;
  animation: eir-fade-in 0.2s ease-out;
  backdrop-filter: blur(2px);
}

.eir-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 900px;
  background: #252525;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 99999;
  display: none;
  padding: 0;
  animation: eir-modal-popup 0.3s ease-out;
  overflow: hidden;
}

.eir-modal-header {
  padding: 32px 24px 32px 24px;
  position: relative;
  background-color: #dc2626;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-top: 8px solid #252525;
  border-bottom: 1px solid #e8eaed;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 16px;
}

.eir-header-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eir-header-logo svg {
  display: block;
  width: 132px;
  height: auto;
  object-fit: contain;
  max-width: 100%;
}

.eir-logo-image {
  display: block;
  width: 132px;
  height: auto;
  object-fit: contain;
  max-width: 100%;
}

.eir-modal-title {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: 45px;
  font-weight: 600;
  line-height: 1.3;
  color: #ffffff;
  position: relative;
  z-index: 1;
  letter-spacing: -0.01em;
}

.eir-articles {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 24px 24px 24px;
}

.eir-article {
  display: flex;
  flex-direction: row;
  gap: 16px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  width: 100%;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
  align-items: flex-start;
  padding: 8px;
  border-radius: 8px;
}

.eir-article:hover {
  transform: translateX(4px);
  background-color: rgba(139, 61, 255, 0.05);
  opacity: 0.95;
}

.eir-article > div:not(.eir-article-image-container) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  justify-content: center;
  padding-top: 4px;
  overflow: visible;
}

.eir-article-image-container {
  width: 140px;
  min-width: 140px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f0f1f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.eir-article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eir-image-placeholder {
  background-color: #e8eaed;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath fill='%23a0a0a0' d='M50 30c-11.046 0-20 8.954-20 20s8.954 20 20 20 20-8.954 20-20-8.954-20-20-20zm0 32c-6.627 0-12-5.373-12-12s5.373-12 12-12 12 5.373 12 12-5.373 12-12 12z'/%3E%3Cpath fill='%23a0a0a0' d='M20 80h60v-5H20v5zm0-10h60v-5H20v5z'/%3E%3C/svg%3E");
  background-size: 60px 60px;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.eir-image-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.05);
}

.eir-title {
  font-family: 'Barlow', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 20px;
  font-weight: 400;
  margin: 0 0 4px 0;
  line-height: 1.5;
  color: #ffffff;
  letter-spacing: -0.01em;
  flex: 1;
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
}

.eir-author {
  font-size: 13px;
  color: #b0b0b0;
  margin: 0;
  font-weight: 400;
  line-height: 1.4;
}

.eir-modal-footer {
  margin-top: 20px;
  padding: 16px;
  border-top: 1px solid #333333;
  text-align: center;
}

.eir-cta-prompt {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #ffffff;
  font-weight: 500;
}

.eir-cta-button {
  display: inline-block;
  padding: 12px 24px;
  background-color: #dc2626;
  color: #fff;
  text-decoration: none;
  border-radius: 32px;
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 700;
  transition: background-color 0.2s ease, transform 0.1s ease;
  cursor: pointer;
}

.eir-cta-button:hover {
  background-color: #b91c1c;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.eir-cta-button:active {
  transform: translateY(0);
}

.eir-modal-close {
  position: absolute;
  right: 20px;
  top: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  font-size: 24px;
  cursor: pointer;
  z-index: 2;
  color: #ffffff;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.eir-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.eir-modal-close:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .eir-modal {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    transform: translateY(100%);
    border-radius: 12px 12px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    animation: none;
    -webkit-overflow-scrolling: touch;
  }

  .eir-modal--open-mobile {
    transform: translateY(0);
    animation: eir-drawer-slide-up 0.3s ease-out;
  }

  .eir-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
  }

  .eir-modal-header {
    padding: 24px 20px 20px 20px;
    position: sticky;
    top: 0;
    background-color: #dc2626;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
  }

  .eir-header-logo svg {
    width: 80px;
    height: 80px;
  }

  .eir-logo-image {
    width: 93.75px;
    height: auto;
    max-width: 93.75px;
  }

  .eir-modal-title {
    font-family: 'Fraunces', serif;
    font-size: 26px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.6em;
    min-width: 0;
    /* flex: 1; */
    word-break: break-word;
    letter-spacing: -0.01em;
  }

  .eir-modal-close {
    display: none;
  }

  .eir-articles {
    flex-direction: column;
    gap: 15px;
    padding: 20px 20px 20px 20px;
  }

  .eir-article {
    flex-direction: row;
    gap: 15px;
    align-items: flex-start;
  }

  .eir-article-image-container {
    width: 100px;
    min-width: 100px;
    height: 70px;
    flex-shrink: 0;
  }

  .eir-article > div:not(.eir-article-image-container) {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 0;
  }

  .eir-title {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.4em;
    line-height: 1.2;
    word-break: break-word;
  }

  .eir-modal-footer {
    position: sticky;
    bottom: 0;
    background: #252525;
    z-index: 10;
    margin-top: 0;
    padding-top: 16px;
  }

  .eir-modal-close {
    right: 16px;
    top: 16px;
    font-size: 28px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}




