/* =========================================================
   EPHARO – PPA / EU SUBSIDY CALLS DETAIL PAGE
   /ppa-vyzvy/

   Rules:
   - WordPress page is only shell.
   - Detail page uses global header/footer.
   - Back link uses global .eph-page-back.
   - Xenyra button uses global xenyra-combo primitives.
   - No custom close X here.
   - API-ready layout.
   ========================================================= */

.eph-ppa-detail-page {
  width: min(1120px, calc(100% - 36px));
  margin: 46px auto 76px;
  color: #103f2d;
  position: relative;
  z-index: 1;
}

.eph-ppa-detail-topline {
  margin-bottom: 30px;
}

.eph-ppa-detail-hero {
  position: relative;
  padding: 0 0 28px;
}

.eph-ppa-detail-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  color: #6b986e;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eph-ppa-detail-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: #79b86f;
  box-shadow: 0 0 0 6px rgba(121, 184, 111, 0.13);
  flex: 0 0 auto;
}

.eph-ppa-detail-title {
  margin: 0;
  max-width: 880px;
  color: #103f2d;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  font-weight: 950;
}

.eph-ppa-detail-lead {
  margin: 18px 0 0;
  max-width: 800px;
  color: rgba(16, 63, 45, 0.68);
  font-size: 16px;
  line-height: 1.58;
  font-weight: 550;
}

.eph-ppa-detail-toolbar {
  position: relative;
  z-index: 50;
  margin-top: 8px;
  display: grid;
  justify-items: start;
  gap: 12px;
}

.eph-ppa-detail-control-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  flex-wrap: nowrap;
  width: 100%;
}

.eph-ppa-detail-select {
  position: relative;
  width: 260px;
  flex: 0 0 260px;
}
.eph-ppa-detail-ai-row {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  align-self: center;
}

.eph-ppa-detail-ai-row .eph-xenyra-trigger-wrap {
  position: relative;
  z-index: 20;
}

.eph-ppa-detail-ai-row .eph-xenyra-tooltip {
  z-index: 9999;
}

.eph-ppa-detail-select-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 12px 16px;
  border-radius: 17px;
  border: 1px solid rgba(25, 83, 56, 0.13);
  background: linear-gradient(135deg, #0f6b3c, #16884e);
  color: #fff;
  box-shadow: 0 14px 30px rgba(16, 105, 61, 0.22);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.eph-ppa-detail-country-flag {
  font-size: 16px;
  line-height: 1;
}

.eph-ppa-detail-select-arrow {
  margin-left: auto;
  opacity: 0.78;
  font-size: 15px;
}

.eph-ppa-detail-country-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(360px, calc(100vw - 42px));
  max-height: 320px;
  display: none;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.985);
  border: 1px solid rgba(25, 83, 56, 0.13);
  box-shadow:
    0 24px 64px rgba(21, 52, 38, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  z-index: 9999;
}

.eph-ppa-detail-country-menu.is-open {
  display: grid;
}

.eph-ppa-detail-country-option {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 37px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: #103f2d;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.eph-ppa-detail-country-option span:first-child {
  width: 20px;
  min-width: 20px;
  text-align: center;
  line-height: 1;
}

.eph-ppa-detail-country-option:hover,
.eph-ppa-detail-country-option.is-active {
  background: rgba(223, 241, 226, 0.92);
  color: #0f6b3c;
}

.eph-ppa-detail-note {
  width: min(100%, 680px);
  margin: 0;
  color: rgba(16, 63, 45, 0.54);
  font-size: 12px;
  line-height: 1.42;
}

.eph-ppa-detail-info {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.eph-ppa-detail-info > div {
  min-height: 104px;
  padding: 18px 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 10%, rgba(121, 184, 111, 0.10), transparent 34%),
    rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(25, 83, 56, 0.09);
  box-shadow: 0 14px 34px rgba(22, 71, 48, 0.07);
}

.eph-ppa-detail-info span {
  display: block;
  margin-bottom: 8px;
  color: #6b986e;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eph-ppa-detail-info strong {
  display: block;
  max-width: 470px;
  color: rgba(16, 63, 45, 0.72);
  font-size: 14px;
  line-height: 1.52;
  font-weight: 700;
}

.eph-ppa-detail-panel {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  border-radius: 30px;
  padding: 28px;
  background:
    radial-gradient(circle at 92% 8%, rgba(121, 184, 111, 0.16), transparent 30%),
    radial-gradient(circle at 8% 100%, rgba(15, 107, 60, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 251, 247, 0.96));
  border: 1px solid rgba(25, 83, 56, 0.12);
  box-shadow: 0 26px 70px rgba(21, 52, 38, 0.13);
}

.eph-ppa-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.eph-ppa-detail-summary > div {
  min-height: 82px;
  padding: 15px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(25, 83, 56, 0.09);
  box-shadow: 0 12px 28px rgba(22, 71, 48, 0.07);
}

.eph-ppa-detail-summary span {
  display: block;
  margin-bottom: 7px;
  color: rgba(16, 63, 45, 0.52);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eph-ppa-detail-summary strong {
  display: block;
  color: #103f2d;
  font-size: 23px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 950;
}

.eph-ppa-detail-meta {
  margin-top: 14px;
  color: rgba(16, 63, 45, 0.52);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 650;
}

.eph-ppa-detail-meta strong {
  color: rgba(16, 63, 45, 0.70);
}

.eph-ppa-detail-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.eph-ppa-detail-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 19px 19px 19px 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(25, 83, 56, 0.10);
  box-shadow: 0 14px 32px rgba(22, 71, 48, 0.08);
}

.eph-ppa-detail-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px;
  bottom: 19px;
  width: 4px;
  border-radius: 999px;
  background: #79b86f;
}

.eph-ppa-detail-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 10px;
}

.eph-ppa-detail-status,
.eph-ppa-detail-type,
.eph-ppa-detail-deadline {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eph-ppa-detail-status {
  background: rgba(223, 241, 226, 0.95);
  color: #12613b;
}

.eph-ppa-detail-status.is-open {
  background: rgba(219, 244, 225, 0.98);
  color: #0f6b3c;
}

.eph-ppa-detail-status.is-upcoming {
  background: rgba(239, 244, 224, 0.98);
  color: #776313;
}

.eph-ppa-detail-status.is-closing {
  background: rgba(255, 238, 218, 0.98);
  color: #9b5a14;
}

.eph-ppa-detail-status.is-closed {
  background: rgba(233, 236, 232, 0.98);
  color: rgba(16, 63, 45, 0.62);
}

.eph-ppa-detail-type,
.eph-ppa-detail-deadline {
  background: rgba(241, 248, 242, 0.86);
  color: rgba(16, 63, 45, 0.70);
}

.eph-ppa-detail-card-title {
  margin: 0;
  color: #103f2d;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 950;
}

.eph-ppa-detail-card-text {
  margin: 9px 0 0;
  max-width: 860px;
  color: rgba(16, 63, 45, 0.66);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 520;
}

.eph-ppa-detail-card-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.eph-ppa-detail-card-grid div {
  padding: 11px 12px;
  border-radius: 15px;
  background: rgba(245, 251, 247, 0.90);
  border: 1px solid rgba(25, 83, 56, 0.08);
}

.eph-ppa-detail-card-grid span {
  display: block;
  margin-bottom: 4px;
  color: rgba(16, 63, 45, 0.48);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eph-ppa-detail-card-grid strong {
  display: block;
  color: #103f2d;
  font-size: 12px;
  line-height: 1.28;
  font-weight: 900;
}

.eph-ppa-detail-card-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.eph-ppa-detail-source {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid rgba(25, 83, 56, 0.10);
  background: rgba(239, 248, 241, 0.96);
  color: #145739;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.eph-ppa-detail-source:hover {
  background: rgba(224, 241, 227, 0.98);
}

.eph-ppa-detail-card-actions .xenyra-combo {
  flex: 0 0 auto;
}

.eph-ppa-detail-empty {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed rgba(25, 83, 56, 0.18);
  color: rgba(16, 63, 45, 0.66);
  font-size: 13px;
  line-height: 1.48;
  font-weight: 650;
}

@media (max-width: 980px) {
  .eph-ppa-detail-page {
    width: min(100% - 28px, 760px);
    margin: 42px auto 64px;
  }

  .eph-ppa-detail-info,
  .eph-ppa-detail-summary {
    grid-template-columns: 1fr;
  }

  .eph-ppa-detail-card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .eph-ppa-detail-page {
    width: min(100% - 22px, 520px);
    margin: 34px auto 56px;
  }

  .eph-ppa-detail-title {
    font-size: 40px;
    line-height: 0.98;
  }

  .eph-ppa-detail-panel {
    padding: 21px;
    border-radius: 26px;
  }

  .eph-ppa-detail-card-grid {
    grid-template-columns: 1fr;
  }

  .eph-ppa-detail-card-actions {
    display: grid;
    justify-items: start;
  }

  .eph-ppa-detail-control-row {
    display: grid;
    gap: 16px;
  }

  .eph-ppa-detail-select {
    width: 100%;
    flex: none;
  }

  .eph-ppa-detail-ai-row {
    margin-top: 0;
  }
}