/**
 * Extral EU Dotacje — scoped frontend styles.
 * Scoped to .extral-eu-project and .extral-eu-* blocks only.
 */

.extral-eu-project .extral-eu-removed-pdf-link,
.extral-eu-dotacje-pdf-filter-page .extral-eu-removed-pdf-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  cursor: default;
  pointer-events: none;
}

.extral-eu-project .extral-eu-pdf-note,
.extral-eu-dotacje-pdf-filter-page .extral-eu-pdf-note {
  font-style: italic;
}

.extral-eu-project {
  /* Contrast-safe tokens (WCAG 4.5:1 for normal text on pale backgrounds) */
  --extral-eu-text: #1f2933;
  --extral-eu-muted: #4b5563;
  --extral-eu-heading: #1f2933;
  --extral-eu-accent: #7a8500;
  --extral-eu-accent-strong: #5f6800;
  --extral-eu-accent-bg: #f4f6e8;
  --extral-eu-border-accent: #c5ce7a;

  --eed-text: var(--extral-eu-text);
  --eed-text-muted: var(--extral-eu-muted);
  --eed-heading: var(--extral-eu-heading);
  --eed-border: #e4e4e4;
  --eed-bg: #ffffff;
  --eed-accent: var(--extral-eu-accent);
  --eed-accent-dark: var(--extral-eu-accent-strong);
  --eed-accent-soft: var(--extral-eu-accent-bg);
  --eed-radius: 4px;
  --eed-font-base: 1rem;
  --eed-font-sm: 0.9375rem;
  --eed-font-label: 0.75rem;

  margin: 0 0 2.5rem;
  padding: 0;
  color: var(--eed-text);
  font-size: var(--eed-font-base);
  line-height: 1.5;
  font-weight: 400;
  background: var(--eed-bg);
  text-align: left;
}

.extral-eu-project h1,
.extral-eu-project h2 {
  color: var(--eed-heading);
  font-weight: 700;
  line-height: 1.15;
}

.extral-eu-project h1 {
  font-size: clamp(1.625rem, 2.2vw, 2rem);
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.extral-eu-project h2 {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  margin: 0 0 0.85rem;
}

.extral-eu-project p {
  margin: 0 0 1rem;
  font-size: var(--eed-font-base);
  line-height: 1.5;
}

.extral-eu-project a {
  color: var(--extral-eu-accent-strong, var(--eed-accent-dark));
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.extral-eu-project a:hover {
  color: var(--eed-heading);
}

.extral-eu-project a:focus-visible {
  color: var(--extral-eu-accent-strong, var(--eed-accent-dark));
  outline: 2px solid var(--extral-eu-heading, var(--eed-heading));
  outline-offset: 2px;
}

/* Logo strip — required EU/Fundusze marking */
.extral-eu-logos {
  margin: 1.75rem 0 2.5rem;
  padding: 1.35rem 1.5rem;
  background: var(--eed-bg);
  border: 1px solid var(--eed-border);
  border-radius: var(--eed-radius);
}

.extral-eu-logos--has-image {
  padding: 1.5rem 1.5rem 1.65rem;
}

.extral-eu-logos__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.extral-eu-logos--has-image .extral-eu-logos__inner {
  min-height: 56px;
}

.extral-eu-logos__figure {
  margin: 0;
  width: 100%;
  max-width: 100%;
}

.extral-eu-logos__img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 40px;
}

.extral-eu-logos--has-image .extral-eu-logos__img {
  max-width: min(100%, 920px);
}

/* Admin-only: missing logo placeholder in logo strip position */
.extral-eu-logos--missing-admin {
  padding: 1.15rem 1.35rem;
  border-color: #e6c200;
  background: #fffdf5;
}

.extral-eu-logos--missing-admin .extral-eu-logos__inner {
  min-height: 52px;
  align-items: stretch;
}

.extral-eu-logos__placeholder {
  width: 100%;
  margin: 0;
  padding: 0.9rem 1.1rem;
  font-size: var(--eed-font-sm);
  line-height: 1.55;
  font-weight: 400;
  color: #5c4a00;
  background: #fff8e5;
  border: 1px solid #e6c200;
  border-left: 4px solid #dba800;
  border-radius: var(--eed-radius);
}

.extral-eu-logos__placeholder ul {
  margin: 0.5rem 0 0 1.1rem;
  padding: 0;
}

/* Assembled logo strip */
.extral-eu-logo-strip__items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.35rem;
  width: 100%;
}

.extral-eu-logo-strip__item {
  margin: 0;
  flex: 0 1 auto;
  max-width: 100%;
}

.extral-eu-logo-strip__img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 72px;
  background: none;
}

.extral-eu-logo-strip__item--programme .extral-eu-logo-strip__img {
  max-height: 80px;
}

.extral-eu-logo-strip__item--rp .extral-eu-logo-strip__img,
.extral-eu-logo-strip__item--ue .extral-eu-logo-strip__img {
  max-height: 64px;
}

.extral-eu-logo-strip__item--regional .extral-eu-logo-strip__img {
  max-height: 70px;
}

.extral-eu-logo-strip__separator {
  display: inline-block;
  width: 1px;
  height: 48px;
  margin: 0 0.15rem;
  background: var(--eed-border);
  flex-shrink: 0;
}

.extral-eu-logo-strip__combined .extral-eu-logo-strip__img {
  max-height: none;
  max-width: 100%;
}

@media (max-width: 640px) {
  .extral-eu-logo-strip__items {
    gap: 0.85rem 1rem;
  }

  .extral-eu-logo-strip__separator {
    display: none;
  }

  .extral-eu-logo-strip__item {
    flex: 1 1 45%;
    min-width: 120px;
  }
}

/* Header */
.extral-eu-header {
  margin: 0 0 2.25rem;
}

.extral-eu-header__lead {
  max-width: 52rem;
  margin-bottom: 1.25rem;
  font-size: var(--eed-font-base);
  line-height: 1.65;
  color: var(--eed-text);
}

/* Header meta list — flex bullets (override theme/Elementor dotted-list) */
.extral-eu-project .extral-eu-header__meta {
  list-style: none;
  margin: 0;
  padding: 0;
}

.extral-eu-project .extral-eu-header__meta-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1.45;
  margin: 0 0 0.45rem;
  padding: 0;
  position: static;
  color: var(--eed-text-muted);
  font-size: var(--eed-font-sm);
}

.extral-eu-project .extral-eu-header__meta-item::before {
  content: "";
  width: 7px;
  height: 7px;
  min-width: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--extral-eu-accent, var(--eed-accent, #a7b400));
  display: block;
  position: static;
  top: auto;
  left: auto;
  margin: 0;
  padding: 0;
  align-self: center;
  transform: none;
  font-size: 0;
  line-height: 0;
  color: transparent;
}

.extral-eu-project .extral-eu-header__meta-label {
  font-weight: 600;
  color: var(--eed-heading);
  line-height: 1.45;
}

.extral-eu-project .extral-eu-header__meta-value {
  line-height: 1.45;
  color: var(--eed-text);
}

/* Facts grid */
.extral-eu-facts {
  margin: 0 0 2.5rem;
}

.extral-eu-facts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.extral-eu-facts__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 5.5rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--eed-border);
  border-radius: var(--eed-radius);
  background: #fafafa;
}

.extral-eu-facts__card--accent {
  border-color: var(--extral-eu-border-accent, #c5ce7a);
  background: var(--eed-accent-soft);
}

.extral-eu-facts__card--accent .extral-eu-facts__label {
  color: var(--extral-eu-muted, var(--eed-text-muted));
}

.extral-eu-facts__card--accent .extral-eu-facts__value {
  color: var(--extral-eu-heading, var(--eed-heading));
  font-weight: 700;
}

.extral-eu-facts__label {
  margin: 0 0 0.65rem;
  font-size: var(--eed-font-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
  color: var(--eed-text-muted);
}

.extral-eu-facts__card .extral-eu-facts__label {
  font-size: var(--eed-font-label);
  margin-bottom: 0.65rem;
}

.extral-eu-facts__value {
  flex: 1;
  color: var(--eed-heading);
  font-size: var(--eed-font-sm);
  font-weight: 600;
  line-height: 1.5;
}

.extral-eu-facts__value ul,
.extral-eu-facts__value ol {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  font-size: var(--eed-font-sm);
  font-weight: 400;
  line-height: 1.55;
}

.extral-eu-facts__value li {
  margin: 0.25rem 0;
}

/* Content sections */
.extral-eu-sections {
  margin: 0 0 2rem;
}

.extral-eu-section {
  margin: 0 0 2.25rem;
  padding: 0 0 1.75rem;
  border-bottom: 1px solid var(--eed-border);
}

.extral-eu-section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
  padding-bottom: 0;
}

.extral-eu-section__title {
  margin-bottom: 1rem;
}

.extral-eu-section__body {
  font-size: var(--eed-font-base);
  line-height: 1.65;
  color: var(--eed-text);
}

.extral-eu-section__body p {
  margin-bottom: 1rem;
}

.extral-eu-section__body ul,
.extral-eu-section__body ol {
  margin: 0.65rem 0 1rem 1.35rem;
  padding: 0;
}

.extral-eu-section__body li {
  margin: 0.35rem 0;
}

/* Poster (link-only on frontend; legacy image styles kept harmless) */
.extral-eu-poster {
  margin: 0 0 2rem;
}

.extral-eu-poster--link-only {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.extral-eu-poster__actions {
  margin: 0;
}

.extral-eu-poster__file-link {
  font-weight: 600;
  text-decoration: underline;
}

.extral-eu-poster__file-link:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.extral-eu-poster__title {
  margin: 0 0 0.85rem;
}

.extral-eu-poster__figure {
  max-width: 460px;
  margin: 1rem 0;
}

.extral-eu-poster__link {
  display: block;
  line-height: 0;
  text-decoration: none;
}

.extral-eu-poster__link:hover .extral-eu-poster__image,
.extral-eu-poster__link:focus .extral-eu-poster__image {
  opacity: 0.92;
}

.extral-eu-poster__image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--eed-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.extral-eu-poster__caption {
  margin: 0.5rem 0 0;
  font-size: var(--eed-font-sm);
  color: var(--eed-text-muted);
  line-height: 1.45;
}

/* Funding box (all templates) */
.extral-eu-project .extral-eu-funding-box {
  margin: 0 0 1.75rem;
  padding: 1.2rem 1.35rem 1.25rem;
  background: var(--extral-eu-accent-bg, var(--eed-accent-soft));
  color: var(--extral-eu-text, var(--eed-text));
  border: 1px solid var(--extral-eu-border-accent, #c5ce7a);
  border-left: 4px solid var(--extral-eu-accent, var(--eed-accent));
  border-radius: var(--eed-radius);
}

.extral-eu-project .extral-eu-funding-box__title {
  margin: 0 0 0.85rem;
  color: var(--extral-eu-heading, var(--eed-heading));
  font-weight: 700;
  line-height: 1.15;
}

.extral-eu-project .extral-eu-funding-box__list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr;
  gap: 0.35rem 1rem;
  align-items: baseline;
}

.extral-eu-project .extral-eu-funding-box__label,
.extral-eu-project .extral-eu-funding-box__list dt {
  margin: 0;
  font-weight: 600;
  font-size: var(--eed-font-sm);
  color: var(--extral-eu-heading, var(--eed-heading));
}

.extral-eu-project .extral-eu-funding-box__value,
.extral-eu-project .extral-eu-funding-box__list dd {
  margin: 0 0 0.4rem;
  font-size: var(--eed-font-base);
  font-weight: 700;
  color: var(--extral-eu-heading, var(--eed-heading));
  line-height: 1.5;
}

.extral-eu-project .extral-eu-funding-box__value--eu,
.extral-eu-project .extral-eu-funding-box__list dd.extral-eu-funding-box__value--eu {
  color: var(--extral-eu-heading, var(--eed-heading));
}

@media (max-width: 640px) {
  .extral-eu-project .extral-eu-funding-box__list {
    grid-template-columns: 1fr;
  }
}

/* Downloads */
.extral-eu-downloads {
  margin: 0 0 2rem;
  padding: 0.5rem 0 0;
  font-size: var(--eed-font-base);
}

.extral-eu-downloads__list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.extral-eu-downloads__item {
  margin: 0.25rem 0;
}

.extral-eu-downloads__link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0;
  font-size: var(--eed-font-sm);
  font-weight: 600;
}

/* Admin-only notes (outside logo strip) */
.extral-eu-project > .extral-eu-admin-warnings,
.extral-eu-project > .extral-eu-admin-note {
  font-size: var(--eed-font-sm);
  line-height: 1.55;
}

.extral-eu-admin-warnings {
  padding: 1rem 1.15rem;
  margin: 0 0 1.25rem;
  background: #fff8e5;
  border: 1px solid #e6c200;
  border-radius: var(--eed-radius);
}

.extral-eu-admin-warnings ul {
  margin: 0.5rem 0 0 1.15rem;
  padding: 0;
}

.extral-eu-project > .extral-eu-admin-note {
  padding: 0.85rem 1.1rem;
  margin: 0 0 1rem;
  background: #fff8e5;
  border-left: 3px solid #e6c200;
  color: #5c4a00;
}

.extral-eu-project--missing {
  padding: 1rem 1.15rem;
  background: #f8f8f8;
  border: 1px dashed #ccc;
  font-size: var(--eed-font-sm);
}

@media (max-width: 768px) {
  .extral-eu-project {
    font-size: 0.9375rem;
  }

  .extral-eu-project h1 {
    font-size: 1.5rem;
    margin-bottom: 0.85rem;
  }

  .extral-eu-project h2,
  .extral-eu-section__title {
    font-size: 1.125rem;
  }

  .extral-eu-header {
    margin-bottom: 1.75rem;
  }

  .extral-eu-header__lead {
    margin-bottom: 1rem;
  }

  .extral-eu-facts {
    margin-bottom: 2rem;
  }

  .extral-eu-facts__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .extral-eu-facts__card {
    min-height: 0;
    padding: 1.15rem 1.2rem;
  }

  .extral-eu-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.35rem;
  }

  .extral-eu-logos {
    padding: 1rem 1.15rem;
  }
}

