/* ============================================
   NTUA Alumni - Full-screen Search Overlay
   ============================================

   Theming tokens (override via admin Settings → Αναζήτηση):
     --ntua-search-overlay : backdrop colour (alpha applied internally)
     --ntua-search-accent  : highlights (gold)
     --ntua-search-card    : result card surface (alpha applied internally)
     --ntua-search-text    : result title text colour
   ============================================ */

.ntua-search-overlay {
  --ntua-search-overlay: #1A2E26;                 /* deep forest green (darker than header #2F4F4F) */
  --ntua-search-accent:  #C5A572;
  --ntua-search-card:    #FFFFFF;
  --ntua-search-text:    #FFFFFF;

  /* Top offset is set by JS on open() to the sticky header's bottom edge,
     so the header stays visible above the overlay. 0 fallback = full-screen. */
  --ntua-search-header-offset: 0px;
}

/* Search trigger button (header) — gold pill, fill-flip on hover */
.ntua-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent !important;             /* kill Astra/Elementor button bg */
  border: 1.5px solid #C5A572;
  color: #C5A572;                                 /* gold icon + text at rest */
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;                           /* full pill */
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  line-height: 1.2;
}

.ntua-search-trigger:hover,
.ntua-search-trigger:focus-visible {
  background: #C5A572 !important;                 /* fill-flip to gold */
  color: #1B3A6B;                                 /* dark navy icon + text */
  border-color: #C5A572;
  outline: none;
}

.ntua-search-trigger svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Overlay backdrop — starts BELOW the sticky header so it stays visible.
   The --ntua-search-header-offset is set by JS just before opening. */
.ntua-search-overlay {
  position: fixed;
  top: var(--ntua-search-header-offset, 0px);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: color-mix(in srgb, var(--ntua-search-overlay) 95%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99990;          /* below typical sticky header z-indexes (Astra uses 100000+ on stuck state) but above page content */
  display: none;
  flex-direction: column;
  padding: 28px 24px 40px;  /* reduced top padding since the header is no longer covered */
  opacity: 0;
  transition: opacity 0.25s ease;
  overflow-y: auto;
}

.ntua-search-overlay.is-open {
  display: flex;
  opacity: 1;
}

/* Close button (top-right) — square, no border at rest. Gold X on transparent;
   on hover the bg fills gold and the X turns dark navy. */
.ntua-search-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: 0;                           /* no border at rest */
  color: var(--ntua-search-accent);    /* gold X at rest */
  width: 38px;
  height: 38px;
  border-radius: 0;                    /* fully square */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease, color .15s ease;
  font-size: 22px;
  line-height: 1;
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ntua-search-close:hover,
.ntua-search-close:focus-visible {
  background-color: var(--ntua-search-accent);
  color: #1B3A6B;                      /* dark navy X on gold bg */
  outline: none;
}

/* Search input container — no leading icon (removed by request, was visually
   cluttering the field). */
.ntua-search-input-wrap {
  max-width: 720px;
  margin: 30px auto 0;
  width: 100%;
  position: relative;
}

.ntua-search-input {
  width: 100%;
  /* Symmetric horizontal padding now that there's no leading icon */
  padding: 22px 60px 22px 26px;
  background-color: #FFFFFF;
  border: 3px solid transparent;
  border-radius: 12px;
  color: #1B3A6B;
  font-size: 22px;
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ntua-search-input:focus {
  outline: none;
  border-color: var(--ntua-search-accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ntua-search-accent) 25%, transparent);
}

.ntua-search-input::placeholder {
  color: #8A92A8;
  font-style: italic;
}

.ntua-search-clear {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #8A92A8;
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ntua-search-clear.is-visible {
  display: flex;
}

.ntua-search-clear:hover {
  background-color: #F1EEE6;
  color: #1B3A6B;
}

/* Empty-state help text — shown below the input until the user issues
   their first search; the JS toggles .is-hidden once results render. */
.ntua-search-help {
  max-width: 720px;
  margin: 24px auto 0;
  padding: 18px 22px;
  background: color-mix(in srgb, var(--ntua-search-card) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--ntua-search-card) 12%, transparent);
  border-radius: 12px;
  color: color-mix(in srgb, var(--ntua-search-text) 85%, transparent);
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  transition: opacity .2s ease, max-height .25s ease, padding .25s ease, margin .25s ease;
}
.ntua-search-help.is-hidden {
  opacity: 0;
  max-height: 0;
  margin: 0 auto;
  padding-top: 0;
  padding-bottom: 0;
  border: 0;
  overflow: hidden;
  pointer-events: none;
}
.ntua-search-help-intro {
  margin: 0 0 14px;
}
.ntua-search-help-intro em {
  color: var(--ntua-search-accent);
  font-style: normal;
  font-weight: 600;
}
.ntua-search-help-section-title {
  margin: 0 0 8px;
  color: var(--ntua-search-accent);
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 12px;
  text-transform: uppercase;
}
.ntua-search-help-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
}
.ntua-search-help-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.ntua-search-help-list li > div {
  flex: 1;
  min-width: 0;
}
.ntua-search-help-list strong {
  color: var(--ntua-search-text);
  font-weight: 700;
}
.ntua-search-help-icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.2;
}
.ntua-search-help-example {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--ntua-search-card) 12%, transparent);
  font-size: 12.5px;
  color: color-mix(in srgb, var(--ntua-search-text) 70%, transparent);
}
.ntua-search-help-example em {
  color: var(--ntua-search-accent);
  font-style: italic;
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .ntua-search-help {
    margin: 18px 12px 0;
    padding: 14px 16px;
    font-size: 13px;
  }
  .ntua-search-help-list {
    grid-template-columns: 1fr;
  }
}

/* Status text */
.ntua-search-status {
  max-width: 720px;
  margin: 16px auto 0;
  color: color-mix(in srgb, var(--ntua-search-text) 70%, transparent);
  font-size: 14px;
  text-align: center;
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 22px;
}

.ntua-search-status strong {
  color: var(--ntua-search-accent);
}

/* Results area */
.ntua-search-results {
  max-width: 1000px;
  margin: 32px auto 0;
  width: 100%;
}

.ntua-search-results-group {
  margin-bottom: 36px;
}

.ntua-search-group-title {
  color: var(--ntua-search-accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: bold;
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--ntua-search-accent) 30%, transparent);
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ntua-search-results-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.ntua-search-result {
  display: flex;
  gap: 14px;
  padding: 16px;
  background-color: color-mix(in srgb, var(--ntua-search-card) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--ntua-search-card) 10%, transparent);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  cursor: pointer;
  align-items: flex-start;
}

.ntua-search-result:hover {
  background-color: color-mix(in srgb, var(--ntua-search-accent) 15%, transparent);
  border-color: var(--ntua-search-accent);
  transform: translateY(-2px);
}

.ntua-search-result-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background-color: color-mix(in srgb, var(--ntua-search-accent) 20%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ntua-search-accent);
  font-size: 24px;
  font-weight: bold;
}

.ntua-search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ntua-search-result-content {
  flex: 1;
  min-width: 0;
}

.ntua-search-result-title {
  color: var(--ntua-search-text);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
  line-height: 22px;
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ntua-search-result-excerpt {
  color: color-mix(in srgb, var(--ntua-search-text) 70%, transparent);
  font-size: 13px;
  line-height: 18px;
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ntua-search-result-date {
  color: color-mix(in srgb, var(--ntua-search-accent) 70%, transparent);
  font-size: 12px;
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ntua-search-empty {
  text-align: center;
  padding: 60px 20px;
  color: color-mix(in srgb, var(--ntua-search-text) 60%, transparent);
  font-size: 16px;
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ntua-search-empty strong {
  color: var(--ntua-search-accent);
}

.ntua-search-loading {
  text-align: center;
  padding: 40px 20px;
  color: color-mix(in srgb, var(--ntua-search-text) 60%, transparent);
  font-size: 14px;
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ntua-search-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid color-mix(in srgb, var(--ntua-search-accent) 30%, transparent);
  border-top-color: var(--ntua-search-accent);
  border-radius: 50%;
  animation: ntua-spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes ntua-spin {
  to { transform: rotate(360deg); }
}

/* Body scroll lock when overlay open */
body.ntua-search-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .ntua-search-overlay {
    padding: 50px 16px 30px;
  }

  .ntua-search-close {
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 18px;
    border-radius: 0;
  }

  .ntua-search-input {
    padding: 16px 48px 16px 18px;
    font-size: 18px;
  }

  .ntua-search-results-list {
    grid-template-columns: 1fr;
  }

  .ntua-search-result-thumb {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}
