/* HM Announcements — styles (gradient lilac–blue, square popup) */
:root{
  --hma-primary:#3b82f6; /* blue */
  --hma-purple:#8b5cf6; /* lilac */
  --hma-border:#e5e7eb;
  --hma-shadow:0 14px 40px rgba(0,0,0,.18);
}

/* Popup root */
#hma-popup-root{ position:fixed; inset:0 auto auto 0; width:100%; z-index:99999; pointer-events:none; }

/* Square popup card που κατεβαίνει από πάνω */
.hma-popup{
  position:fixed; top:-200px; left:50%; transform:translate(-50%, -12px);
  width:min(680px, 92vw);
  background: linear-gradient(135deg, var(--hma-purple) 0%, var(--hma-primary) 100%);
  color:#fff; border-radius:12px;
  box-shadow: var(--hma-shadow);
  border:1px solid rgba(255,255,255,.25);
  padding:0; overflow:hidden; pointer-events:auto;
  transition: top .35s ease, transform .35s ease;
  /* Μην ξεχειλώνει ποτέ κάθετα */
  max-height: calc(100dvh - 32px);
}
.hma-popup.is-open{ top:16px; transform:translate(-50%, 0); }

.hma-popup__inner{ display:grid; grid-template-columns: 100px 1fr; gap:16px; padding:14px 16px; align-items:center; }
.hma-popup__img{ width:100%; height:100px; object-fit:cover; border-radius:10px; }
.hma-popup__title{ margin:0; font-size:18px; line-height:1.2; }

/* Περιεχόμενο + Read more/less καταστάσεις */
.hma-popup__content{
  font-size:14px; line-height:1.45; opacity:.95;
  position:relative;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Κλειστό (κόβει + fade) */
.hma-popup__content.is-collapsed{
  max-height: var(--hma-collapsed-max, 140px);
  overflow: hidden;
}
.hma-popup__content.is-collapsed::after{
  content:"";
  position:absolute; left:0; right:0; bottom:0; height:40px;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(17,17,17,.22) 100%);
  pointer-events:none;
}

/* Ανοιχτό (scroll μέσα στο content) */
.hma-popup__content.is-expanded{
  max-height: var(--hma-expanded-max, min(520px, calc(100dvh - 160px)));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Link “Μάθε περισσότερα” πάνω στο gradient (ίδιο look) */
.hma-popup__link{
  display:inline-block;
  margin-top:8px;
  background: transparent;
  color:#fff;
  padding:8px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.45);
  text-decoration:none;
}
.hma-popup__link:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.6);
}

/* Κουμπί κλεισίματος */
.hma-popup__close{
  position:absolute; top:6px; right:10px;
  font-size:28px; background:transparent; color:#fff;
  border:none; cursor:pointer; line-height:1;
}

/* Κουμπί Read more/less — ίδιο χρώμα με το παράθυρο (πάνω στο gradient) */
.hma-popup__toggle{
  margin-top:8px;
  display:inline-flex; align-items:center; gap:6px;
  background: transparent;         /* ίδιο υπόβαθρο με το popup */
  color:#fff;                      /* λευκά γράμματα */
  padding:8px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.45);
  cursor:pointer;
  font:inherit;
}
.hma-popup__toggle:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.6);
}
.hma-popup__toggle:active{
  background: rgba(255,255,255,.16);
}
.hma-popup__toggle .arrow{
  display:inline-block; transition: transform .2s ease; color: currentColor; opacity:.95;
}
.hma-popup__toggle[aria-expanded="true"] .arrow{ transform: rotate(180deg); }

/* Levels tweaks */
.hma-popup.level-warn{ filter: saturate(1.1); }
.hma-popup.level-alert{ box-shadow:0 14px 40px rgba(220,38,38,.45); }

/* Sidebar list cards */
.hma-list{ display:grid; gap:12px; }
.hma-list .hma-card{ display:grid; grid-template-columns: 72px 1fr; gap:12px; padding:10px; border:1px solid var(--hma-border); border-radius:12px; background:#fff; box-shadow:0 6px 20px rgba(0,0,0,.06); }
.hma-list .hma-card .hma-thumb{ width:72px; height:72px; object-fit:cover; border-radius:10px; }
.hma-list .hma-card .hma-title{ margin:0 0 4px; font-size:16px; }
.hma-list .hma-card .hma-excerpt{ font-size:13px; color:#334155; }
.hma-list .hma-card .hma-link{ margin-top:6px; display:inline-block; font-size:13px; color:var(--hma-primary); text-decoration:none; border-bottom:1px dashed var(--hma-primary); }

/* Small screens */
@media (max-width:520px){
  .hma-popup__inner{ grid-template-columns: 1fr; }
  .hma-popup__img{ height:120px; }
}

/* No-image layout: force single column */
.hma-popup__inner.no-image { grid-template-columns: 1fr; }

/* Focus visibility */
.hma-popup__link:focus,
.hma-popup__close:focus,
.hma-popup__toggle:focus {
  outline: 2px solid rgba(255,255,255,.9);
  outline-offset: 2px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .hma-popup{ transition:none; }
}