/* ============================================================
   UE Funding Cards
   - Square corners
   - Image top
   - Title + reason
   - INFO / FUND buttons
   - "NOK raised / goal"
   - One thick progress bar
   - Layer accent drives FUND + progress fill
   ============================================================ */

/* Layer colors (brand constants) */
:root{
  --fundue-accent-agora:    #9fc38f;
  --fundue-accent-councils: #c3805c;
  --fundue-accent-powers:   #3e6db0;

  /* Base (light) */
  --fundue-card-bg: #ebebeb;
  --fundue-card-border: rgba(0,0,0,0.15);
  --fundue-text: #111111;
  --fundue-muted: rgba(0,0,0,0.65);

  --fundue-progress-track: rgba(0,0,0,0.12);
}

/* Ensure UE Funding cards remain opaque on transparent pages */
.ue-page-transparent .fundue-card{
  background-color: var(--fundue-card-bg, #ebebeb) !important;
  background-image: none;
}

/* Grid */
.fundue-grid { display: grid; gap: 30px; }
.fundue-grid.fundue-cols-1 { grid-template-columns: 1fr; }
.fundue-grid.fundue-cols-2 { grid-template-columns: 1fr 1fr; }
.fundue-grid.fundue-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.fundue-grid.fundue-cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

@media (max-width: 900px) {
  .fundue-grid.fundue-cols-2,
  .fundue-grid.fundue-cols-3,
  .fundue-grid.fundue-cols-4 { grid-template-columns: 1fr; }
}

/* Card base */
.fundue-card{
  --fundue-accent: var(--fundue-accent-agora);

  background: var(--fundue-card-bg);
  border: 1px solid var(--fundue-card-border);
  border-radius: 8px;
  color: var(--fundue-text);
  overflow: hidden;
}

/* Accent mapping by layer */
.fundue-card[data-layer="agora"]    { --fundue-accent: var(--fundue-accent-agora); }
.fundue-card[data-layer="councils"] { --fundue-accent: var(--fundue-accent-councils); }
.fundue-card[data-layer="powers"]   { --fundue-accent: var(--fundue-accent-powers); }

/* Media */
.fundue-card__media{
  width: 100%;
  overflow: hidden;
  background: rgba(0,0,0,0.04);
}
.fundue-card__img{
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Body */
.fundue-card__body{
  padding: 18px 18px 16px;
}

.fundue-card__title{
  margin: 2px 0 10px 0;     /* more vertical space */
  line-height: 1.25;       /* prevents glyph clipping */
  font-size: 24px;         /* slightly larger title */

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fundue-card__reason{
  margin: 0 0 40px 0;   /* digest space lives here */
  color: var(--fundue-muted);
  line-height: 1.35;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fundue-card__actions{
  margin: 0 0 16px 0;   /* normal spacing below buttons */
}



/* ============================================================
   Buttons: INFO / FUND
   - Always black text
   - INFO: light grey fill
   - FUND: layer accent fill
   - Rounded corners
   - Subtle shadow at rest, reduced on hover
   ============================================================ */

.fundue-card a.fundue-btn,
.fundue-card a.fundue-btn:visited,
.fundue-card a.fundue-btn:hover,
.fundue-card a.fundue-btn:focus,
.fundue-card a.fundue-btn:active{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 18px;
  border-radius: 8px;                 /* rounded corners */
  border: 1px solid rgba(0,0,0,0.14); /* subtle frame */

  text-decoration: none !important;
  font-weight: 700;
  letter-spacing: 0.02em;

  color: #000 !important;
  cursor: pointer;

  /* subtle shadow at rest */
  box-shadow: 0 2px 6px rgba(0,0,0,0.14);

  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.05s ease,
    filter 0.15s ease;
}

/* Ensure inner spans/icons never inherit theme colors */
.fundue-card a.fundue-btn *{
  color: #000 !important;
}

/* Hover/focus: flatten (reduce shadow) */
.fundue-card a.fundue-btn:hover,
.fundue-card a.fundue-btn:focus{
  box-shadow: 0 0 0 rgba(0,0,0,0.0);  /* almost none */
  transform: translateY(0);           /* no lift */
}

/* Keyboard accessibility */
.fundue-card a.fundue-btn:focus-visible{
  outline: 2px solid rgba(0,0,0,0.35);
  outline-offset: 2px;
}

/* INFO button: preserve the original grey unless a global card color is saved. */
.fundue-btn--info{
  background: var(--fundue-info-button-bg, rgba(0,0,0,0.06));
}

.fundue-card a.fundue-btn--info:hover,
.fundue-card a.fundue-btn--info:focus{
  background: var(--fundue-info-button-bg-hover, rgba(0,0,0,0.09));
  filter: var(--fundue-info-button-hover-filter, none);
}

/* FUND button and bar may be customized independently; otherwise use layer accents. */
.fundue-card a.fundue-btn--fund{
  background: var(--fundue-fund-button-bg, var(--fundue-accent));
  border-color: var(--fundue-fund-button-bg, var(--fundue-accent));
}

.fundue-card a.fundue-btn--fund:hover,
.fundue-card a.fundue-btn--fund:focus{
  background: var(--fundue-fund-button-bg, var(--fundue-accent));
  filter: brightness(0.95);
}


/* Amount line */
.fundue-card__amount{
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px 0;
  letter-spacing: 0.01em;
}

/* Progress */
.fundue-progress{
  height: 12px; /* thicker */
  background: var(--fundue-progress-track);
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 0;
  overflow: hidden;
}
.fundue-progress__fill{
  height: 100%;
  width: 0;
  background: var(--fundue-progress-fill, var(--fundue-accent));
}


/* Multichannel Funding — one campaign progress, multiple payment destinations. */
.ue-funding-panel{
 --ue-funding-panel-bg:#d6e8c3;--ue-funding-panel-text:#111111;--ue-funding-panel-fill:#9fc38f;
 --ue-funding-panel-button-bg:#fff;--ue-funding-panel-button-text:#111;--ue-funding-panel-button-border:#899882;
 box-sizing:border-box;width:100%;min-width:0;padding:clamp(22px,4vw,42px);margin:26px 0;
 background:var(--ue-funding-panel-bg);color:var(--ue-funding-panel-text);scroll-margin-top:30px;
}
.ue-funding-panel *,.ue-funding-panel *::before,.ue-funding-panel *::after{box-sizing:border-box;}
.ue-funding-panel__heading{margin:0 0 12px;color:inherit;line-height:1.2;}
.ue-funding-panel__purpose{margin:0 0 18px;max-width:68ch;line-height:1.45;color:inherit;white-space:pre-line;}
.ue-funding-panel__amount{font-size:clamp(20px,2.8vw,30px);font-weight:800;letter-spacing:.01em;margin:0 0 10px;}
.ue-funding-panel__progress{height:15px;width:100%;background:rgba(0,0,0,.12);border:1px solid rgba(0,0,0,.25);overflow:hidden;margin-bottom:25px;}
.ue-funding-panel__fill{height:100%;background:var(--ue-funding-panel-fill);}
.ue-funding-panel__channels{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,185px),1fr));gap:16px;align-items:stretch;}
.ue-funding-panel a.ue-funding-panel__channel,.ue-funding-panel a.ue-funding-panel__channel:link,.ue-funding-panel a.ue-funding-panel__channel:visited{
 display:block;min-height:146px;min-width:0;padding:var(--ue-funding-panel-button-padding,17px 12px);background:var(--ue-funding-panel-button-bg);
 color:var(--ue-funding-panel-button-text)!important;border:1px solid var(--ue-funding-panel-button-border);
 border-radius:6px;text-decoration:none!important;box-shadow:0 2px 4px rgba(0,0,0,.06);
 container-type:inline-size;
}
.ue-funding-panel a.ue-funding-panel__channel:hover{filter:brightness(.96);}
.ue-funding-panel a.ue-funding-panel__channel:focus-visible{outline:3px solid currentColor;outline-offset:3px;}
/* Two logical columns: columns are mirrored automatically by dir=rtl. */
.ue-funding-panel__channel-inner{
 display:grid;min-width:0;column-gap:var(--ue-funding-panel-logo-text-gap,12px);row-gap:12px;align-items:center;justify-content:center;
 width:100%;height:100%;grid-template-columns:minmax(0,43fr) minmax(0,57fr);
 grid-template-rows:auto auto;
}
.ue-funding-panel__visual{grid-column:1;grid-row:1;min-width:0;display:flex;align-items:center;justify-content:center;padding:var(--ue-funding-panel-logo-padding,0px);}
.ue-funding-panel__logo{display:block;max-width:min(100%,160px);width:auto;max-height:70px;height:auto;object-fit:contain;margin:0 auto;}
.ue-funding-panel__methods{grid-column:1;grid-row:2;display:flex;gap:4px;align-items:center;justify-content:center;flex-wrap:nowrap;min-width:0;}
.ue-funding-panel__method{display:block;max-width:34px;max-height:25px;width:auto;height:auto;object-fit:contain;}
.ue-funding-panel__copy{grid-column:2;grid-row:1 / span 2;display:flex;flex-direction:column;gap:6px;min-width:0;text-align:start;overflow-wrap:anywhere;align-self:start;}
.ue-funding-panel__channel-header{font-size:16px;font-weight:750;line-height:1.22;color:inherit;}
.ue-funding-panel__channel-text{font-size:13px;line-height:1.35;color:inherit;}
.ue-funding-panel--logos-right .ue-funding-panel__visual,.ue-funding-panel--logos-right .ue-funding-panel__methods{grid-column:2;}
.ue-funding-panel--logos-right .ue-funding-panel__copy{grid-column:1;}
.ue-funding-panel--vertical .ue-funding-panel__channel-inner{
 grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;text-align:center;
}
.ue-funding-panel--vertical .ue-funding-panel__visual{grid-column:1;grid-row:1;}
.ue-funding-panel--vertical .ue-funding-panel__copy{grid-column:1;grid-row:2;text-align:center;}
.ue-funding-panel--vertical .ue-funding-panel__methods{grid-column:1;grid-row:3;}
.ue-funding-panel--vertical .ue-funding-panel__method{max-width:49px;}
.ue-funding-panel__footnote{margin:20px 0 0;font-size:13px;line-height:1.4;color:inherit;}
/* Container queries use the actual button width, not the browser viewport. */
@container (max-width:230px){
 .ue-funding-panel--responsive .ue-funding-panel__channel-inner{
  grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;text-align:center;
 }
 .ue-funding-panel--responsive .ue-funding-panel__visual{grid-column:1;grid-row:1;}
 .ue-funding-panel--responsive .ue-funding-panel__copy{grid-column:1;grid-row:2;text-align:center;}
 .ue-funding-panel--responsive .ue-funding-panel__methods{grid-column:1;grid-row:3;}
 .ue-funding-panel--responsive .ue-funding-panel__method{max-width:49px;}
}
@media(max-width:650px){
 .ue-funding-panel__channels{grid-template-columns:1fr;}
 .ue-funding-panel a.ue-funding-panel__channel{min-height:112px;}
}

