/* Scoped UI for OLF Foundation Suite */
:root{
  --olf-ink: var(--ink, #0b1a3a);
  --olf-pink: var(--pink, #ff3e9e);
  --olf-red: #d83a3a;
  --olf-card: #ffffff;
  --olf-soft: rgba(11,26,58,.08);
  --olf-soft2: rgba(11,26,58,.14);
}

.olf-suite{max-width: 1160px; margin: 0 auto; padding: 18px 18px 40px;}
.olf-suite-head{display:flex; flex-direction:column; align-items:center; gap:14px; margin: 6px 0 22px;}
.olf-suite-title{font-size: clamp(36px, 4vw, 56px); line-height:1.05; margin:0; color: var(--olf-ink); font-weight: 800; letter-spacing:-.02em;}

/* Tabs */
.olf-suite-tabs{display:inline-flex; gap:0; border-radius: 999px; background:#f1f3f7; padding: 4px; box-shadow: 0 8px 18px var(--olf-soft);}
.olf-suite-tab{border:0; background:transparent; padding: 10px 18px; border-radius: 999px; font-weight: 700; cursor:pointer; color: #556;}
.olf-suite-tab.is-active{background: var(--olf-pink); color:#fff;}

/* Year tabs: strong segmented control, active year highlighted in red */
.olf-suite-tabs.is-years{
  gap: 0 !important;
  padding: 0 !important;
  border-radius: 12px !important;
  background: #ececef !important;
  box-shadow: none !important;
  overflow: hidden;
}
.olf-suite-tabs.is-years .olf-suite-tab{
  min-width: 92px;
  padding: 14px 24px !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #6a6f82 !important;
  font-weight: 800;
}
.olf-suite-tabs.is-years .olf-suite-tab + .olf-suite-tab{border-left: 1px solid rgba(11,26,58,.06);}
.olf-suite[data-olf-suite="events"] .olf-suite-tabs.is-years .olf-suite-tab.is-active,
.olf-suite-tabs.is-years .olf-suite-tab.is-active{
  background: var(--olf-red) !important;
  color:#fff !important;
  box-shadow: none !important;
}

/* Beneficiaries grid */
.olf-suite-grid{display:grid; gap: 26px;}
.olf-suite-grid--1{grid-template-columns: 1fr;}
.olf-suite-grid--2{grid-template-columns: repeat(2, 1fr);}
.olf-suite-grid--3{grid-template-columns: repeat(3, 1fr);}

@media (max-width: 900px){
  .olf-suite{padding: 12px 14px 30px;}
  .olf-suite-grid--2,.olf-suite-grid--3{grid-template-columns: 1fr;}
}

.olf-suite-card{background: var(--olf-card); border-radius: 22px; box-shadow: 0 14px 30px var(--olf-soft); overflow:hidden; border: 1px solid rgba(11,26,58,.06);}
.olf-suite-card__bar{background: var(--olf-pink); padding: 16px 18px;}
.olf-suite-card__ttl{margin:0; color:#fff; font-weight: 800; font-size: 18px; text-align:center;}

.olf-suite-video{display:block; width:100%; border:0; padding:0; background:transparent; cursor:pointer; text-align:left; position:relative; text-decoration:none; color:inherit;}
.olf-suite-video[disabled]{opacity:.6; cursor:not-allowed;}
.olf-suite-video__frame{display:block; position:relative; aspect-ratio: 16/9; background-size: cover; background-position: center;}
.olf-suite-video__frame::after{content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.30));}
.olf-suite-video__play{position:absolute; left:50%; top:50%; transform: translate(-50%,-50%);
  z-index:2;
  width:74px; height:74px; border-radius: 999px; border: 4px solid rgba(255,255,255,.92);
  box-shadow: 0 14px 28px rgba(0,0,0,.25);
}
.olf-suite-video__play::before{content:""; position:absolute; left:52%; top:50%; transform: translate(-40%,-50%);
  width:0; height:0; border-left: 18px solid rgba(255,255,255,.95);
  border-top: 12px solid transparent; border-bottom: 12px solid transparent;
}
.olf-suite-video__play.is-gallery::before{
  content:"\1F4F7";
  width:auto; height:auto;
  border:0;
  left:50%;
  transform: translate(-50%,-50%);
  font-size: 26px;
  line-height: 1;
}
.olf-suite-video__cap{display:block; padding: 14px 16px 18px; color: rgba(11,26,58,.85); font-size: 14px;}

/* Secondary action (Photos) when a post has BOTH YouTube + gallery */
.olf-suite-cardActions{padding: 0 16px 16px; display:flex; justify-content:flex-start;}
.olf-suite-miniBtn{display:inline-flex; align-items:center; gap:8px; border: 1px solid rgba(11,26,58,.18);
  background: rgba(255,255,255,.92); color: var(--olf-ink);
  padding: 8px 12px; border-radius: 999px;
  font-weight: 800; font-size: 12px; cursor:pointer;
  box-shadow: 0 10px 20px var(--olf-soft);
}
.olf-suite-miniBtn::before{content:"\1F4F7"; font-size: 14px; opacity:.85;}
.olf-suite-miniBtn:hover{transform: translateY(-1px);}
.olf-suite-event__meta .olf-suite-miniBtn{padding: 6px 10px; font-size: 12px; box-shadow:none; background: rgba(11,26,58,.04);}

/* Events list (cleaner version of screenshot layout) */
.olf-suite-events{display:flex; flex-direction:column; gap: 26px;}
.olf-suite-event{display:grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: center;}
.olf-suite-event__media{border-radius: 22px; overflow:hidden; box-shadow: 0 14px 30px var(--olf-soft); border: 1px solid rgba(11,26,58,.06); background:#f3f4f7; min-height: 260px; position:relative; display:block; text-decoration:none;}
.olf-suite-event__media img{width:100%; height:100%; object-fit: cover; display:block;}
.olf-suite-event__media.is-video::after{content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.32));}
.olf-suite-event__media.is-video .olf-suite-video__play{pointer-events:none;}

.olf-suite-event__ph{display:block; width:100%; height:100%;}
.olf-suite-event__body{padding: 6px 0; min-height: 100%; display:flex; flex-direction:column; justify-content:center;}
.olf-suite-event__meta{display:flex; flex-wrap:wrap; gap: 10px 12px; align-items:center; margin-bottom: 10px;}
.olf-suite-date{display:inline-flex; align-items:center; gap: 8px; color: rgba(11,26,58,.65); font-weight: 600;}
.olf-suite-date::before{content:"\1F551"; font-size: 14px; opacity:.7;}

.olf-suite-badge{display:inline-flex; align-items:center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing:.02em;}
.olf-suite-badge.is-upcoming{background: rgba(255,62,158,.12); color: var(--olf-pink);}
.olf-suite-badge.is-past{background: rgba(11,26,58,.08); color: var(--olf-ink);}
.olf-suite-badge.is-cancelled{background: rgba(220,53,69,.12); color: #dc3545;}

.olf-suite-event__ttl{margin: 0 0 10px; font-size: clamp(22px, 2.2vw, 34px); line-height:1.12; color: var(--olf-ink); font-weight: 800;}
.olf-suite-event__ttl a{color: inherit; text-decoration:none;}
.olf-suite-event__ttl a:hover{opacity:.92;}
.olf-suite-event__txt{margin: 0 0 16px; color: rgba(11,26,58,.78); font-size: 16px; line-height:1.55; max-width: 56ch;}

.olf-suite-event.is-no-excerpt .olf-suite-event__ttl{margin-bottom: 0;}
.olf-suite-event.is-no-excerpt .olf-suite-event__body{justify-content:center;}
.olf-suite-event.is-no-excerpt .olf-suite-btn{margin-top: 16px;}

.olf-suite-btn{display:inline-flex; align-items:center; justify-content:center;
  padding: 12px 18px; border-radius: 14px; text-decoration:none;
  font-weight: 800; border: 2px solid rgba(11,26,58,.25); color: var(--olf-ink);
  background: #fff; box-shadow: 0 10px 20px var(--olf-soft);
}
.olf-suite-btn:hover{transform: translateY(-1px);}
.olf-suite-btn.is-primary{background: var(--olf-pink); border-color: var(--olf-pink); color:#fff;}

@media (max-width: 900px){
  .olf-suite-event{grid-template-columns: 1fr;}
  .olf-suite-event__media{min-height: 220px;}
}

/* Contact */
.olf-suite-contact{display:grid; grid-template-columns: .9fr 1.1fr; gap: 24px; background: #fff; border-radius: 28px; box-shadow: 0 18px 40px var(--olf-soft); border: 1px solid rgba(11,26,58,.06); overflow:hidden;}
.olf-suite-contact__media{min-height: 520px; background: #2e4680; background-size: cover; background-position: center;}
.olf-suite-contact__form{padding: 26px 22px;}

.olf-suite-form{display:flex; flex-direction:column; gap: 16px;}
.olf-suite-field input,.olf-suite-field textarea{width:100%; border-radius: 16px; border: 1px solid rgba(11,26,58,.10); background:#f6f7fb; padding: 14px 14px; font-size: 16px; outline: none;}
.olf-suite-field textarea{min-height: 180px; resize: vertical;}
.olf-suite-field input:focus,.olf-suite-field textarea:focus{border-color: rgba(255,62,158,.45); box-shadow: 0 0 0 4px rgba(255,62,158,.10); background:#fff;}

.olf-suite-radio{display:flex; align-items:center; gap: 10px; padding: 10px 12px; border-radius: 14px; background:#f6f7fb; border: 1px solid rgba(11,26,58,.08); margin-bottom: 10px;}
.olf-suite-radio input{margin:0;}

.olf-suite-actions{display:flex; justify-content:flex-end;}

@media (max-width: 900px){
  .olf-suite-contact{grid-template-columns: 1fr;}
  .olf-suite-contact__media{min-height: 220px;}
}

.olf-suite-alert{padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-weight: 700;}
.olf-suite-alert.is-ok{background: rgba(25,135,84,.10); color: #198754;}
.olf-suite-alert.is-err{background: rgba(220,53,69,.10); color: #dc3545;}

.olf-suite-empty{padding: 18px; border-radius: 18px; background: rgba(11,26,58,.06); color: rgba(11,26,58,.75); text-align:center;}

/* Modal */
.olf-suite-modal{position:fixed; inset:0; display:none; z-index: 99999;}
.olf-suite-modal[aria-hidden="false"]{display:block;}
.olf-suite-modal__backdrop{position:absolute; inset:0; background: rgba(0,0,0,.55);}
.olf-suite-modal__dialog{position:relative; width:min(980px, 92vw); margin: 8vh auto 0; background:#0b0f1a; border-radius: 18px; overflow:hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45);}
.olf-suite-modal__dialog.is-gallery{background:#0b0f1a;}
.olf-suite-modal__close{position:absolute; right: 10px; top: 8px; width: 44px; height: 44px; border:0; border-radius: 999px; background: rgba(255,255,255,.12); color:#fff; font-size: 26px; cursor:pointer;}
.olf-suite-modal__ratio{position:relative; padding-top: 56.25%;}
.olf-suite-modal__iframe{position:absolute; inset:0; width:100%; height:100%; border:0;}

/* Gallery modal */
.olf-suite-galNav{position:absolute; top:50%; transform: translateY(-50%);
  width: 44px; height: 56px; border:0; border-radius: 14px;
  background: rgba(255,255,255,.10); color:#fff; font-size: 34px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.olf-suite-galNav.is-prev{left: 12px;}
.olf-suite-galNav.is-next{right: 12px;}

.olf-suite-galFig{margin:0; padding: 52px 16px 14px;}
.olf-suite-galImg{display:block; width:100%; height: min(62vh, 560px); object-fit: contain; background: #0b0f1a;}
.olf-suite-galCap{color:#fff; padding: 10px 6px 0; opacity: .95;}
.olf-suite-galTtl{font-weight: 800; font-size: 16px;}
.olf-suite-galTxt{font-size: 13px; opacity: .85; margin-top: 2px;}

.olf-suite-galThumbs{display:flex; gap: 8px; padding: 0 14px 14px; overflow:auto;}
.olf-suite-galThumb{border: 2px solid rgba(255,255,255,.18); background: transparent; padding:0; border-radius: 10px; cursor:pointer;}
.olf-suite-galThumb.is-active{border-color: rgba(255,62,158,.85);}
.olf-suite-galThumb img{display:block; width: 64px; height: 48px; object-fit: cover; border-radius: 8px;}

@media (max-width: 900px){
  .olf-suite-galImg{height: min(56vh, 420px);}
  .olf-suite-galNav{display:none;}
}

html.olf-suite-modalOpen{overflow:hidden;}


/* Make event media button behave like a block media (no default button styles). */
button.olf-suite-event__media{border:0; padding:0; width:100%; background:transparent; cursor:pointer; text-align:left;}

/* Hide "blog-like" meta (publish date / site / author) on our CPT singles when the theme prints it. */
body.single-olf_event .entry-meta,
body.single-olf_event .post-meta,
body.single-olf_event .post-info,
body.single-olf_event .single-post-meta,
body.single-olf_event .meta,
body.single-olf_beneficiary .entry-meta,
body.single-olf_beneficiary .post-meta,
body.single-olf_beneficiary .post-info,
body.single-olf_beneficiary .single-post-meta,
body.single-olf_beneficiary .meta{
  display:none !important;
}


/* Ensure year filtering always works, even if the theme overrides [hidden] */
.olf-suite .olf-suite-event[hidden]{ display:none !important; }

/* Gallery: never show attachment titles (often filenames) */
.olf-suite .olf-suite-galTtl{ display:none !important; }

/* Hide caption wrapper when empty (JS toggles [hidden]) */
.olf-suite .olf-suite-galCap[hidden]{ display:none !important; }


/* =====================
   Merge: Activities + Beneficiaries (single page)
===================== */
.olf-suite-merge{padding-bottom: 10px;}
.olf-suite-merge.is-noTitle .olf-suite-mergeHead{padding-top: 0; gap: 0;}
.olf-suite-merge.is-noTitle .olf-suite-mergePanels{margin-top: 0;}
.olf-suite-mergeHead{
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px 18px 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}
.olf-suite-mergePanels{margin-top: 6px;}
/* reduce top padding inside panels to keep layout tight */
.olf-suite-mergePanels .olf-suite{padding-top: 10px;}

/* anchors for redirects */
#activites, #beneficiaires{position:relative; top:-90px; height:0; display:block;}

@media (max-width: 900px){
  .olf-suite-mergeHead{padding: 12px 14px 0;}
}

/* v0.4.6 SAFE — force active year visual state even if theme/button styles override it */
.olf-suite-tabs.is-years .olf-suite-tab{
  -webkit-appearance: none !important;
  appearance: none !important;
  border: 0 !important;
  outline: none !important;
}
.olf-suite-tabs.is-years .olf-suite-tab[data-active="1"],
.olf-suite-tabs.is-years .olf-suite-tab[aria-pressed="true"],
.olf-suite-tabs.is-years .olf-suite-tab.is-active,
.olf-suite[data-olf-suite="events"] .olf-suite-tabs.is-years .olf-suite-tab[data-active="1"],
.olf-suite[data-olf-suite="events"] .olf-suite-tabs.is-years .olf-suite-tab[aria-pressed="true"],
.olf-suite[data-olf-suite="events"] .olf-suite-tabs.is-years .olf-suite-tab.is-active,
.olf-suite-tabs.is-years .olf-suite-tab.is-active:focus,
.olf-suite-tabs.is-years .olf-suite-tab.is-active:focus-visible,
.olf-suite-tabs.is-years .olf-suite-tab[data-active="1"]:focus,
.olf-suite-tabs.is-years .olf-suite-tab[data-active="1"]:focus-visible{
  background: #d83a3a !important;
  color: #ffffff !important;
  border-color: #d83a3a !important;
  box-shadow: none !important;
  outline: none !important;
}
.olf-suite-tabs.is-years .olf-suite-tab:not(.is-active):focus,
.olf-suite-tabs.is-years .olf-suite-tab[data-active="0"]:focus,
.olf-suite-tabs.is-years .olf-suite-tab[data-active="0"]:focus-visible{
  outline: none !important;
  box-shadow: none !important;
}
/* better balance when there is no excerpt */
.olf-suite-event.is-no-excerpt .olf-suite-event__body{
  min-height: 220px;
  justify-content: center;
}
