/* === IFA brand tokens === */
:root{
  /* Core palette */
  --ifa-green:#49B461;
  --ifa-dark-blue:#203248;
  --ifa-light-mint:#EDF7F4;
  --ifa-dark-teal:#255F71;
  --ifa-teal:#29A5A1;
  --ifa-purple:#A05793;

  /* Derivatives */
  --brand-text:var(--ifa-dark-blue);
  --brand-accent:var(--ifa-teal);
  --brand-bg:#fff;

  /* Buttons */
  --btn-bg:var(--ifa-dark-blue);
  --btn-bg-hover:var(--ifa-dark-teal);
  --btn-text:#fff;

  /* Subtle UI */
  --card-border:rgba(32,50,72,.14);
  --card-shadow:0 4px 12px rgba(32,50,72,.08);
}

/* ===== TEC list base ===== */
.tribe-events .tribe-events-calendar-list__event-date-tag{display:none!important}
.tribe-events .tribe-events-calendar-list{display:block;margin:0;padding:0}
.tec-row{list-style:none;margin:0 0 24px}
.tec-row:not(:last-child)::after{
  content:"";display:block;width:20%;height:2px;background:var(--ifa-green);
  margin:10px auto;border-radius:1px;
}

/* ===== Card layout (3-col grid) ===== */
.tec-card{
  display:grid !important;
  grid-template-columns:
    minmax(0, .9fr)
    minmax(0, 2.6fr)
    minmax(0, .5fr);
  gap:24px;
  align-items:start;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  overflow:hidden;                /* keep content inside the card */
  padding:18px;
  box-sizing:border-box;
}
.tec-card{grid-template-areas:"meta content media";}
.tec-col--meta{grid-area:meta}
.tec-col--content{grid-area:content}
.tec-col--media{grid-area:media}

/* Grid items must be shrinkable */
.tec-col{min-width:0}             /* KEY: prevents track overflow */

/* ===== Column: meta ===== */
.tec-col--meta{display:flex;flex-direction:column;gap:10px}
.tec-meta__dates{font-weight:600;font-size:.95rem}
.tec-meta__loc{display:flex;align-items:center;gap:8px;font-size:.92rem;opacity:.9;font-weight:600}
.tec-pin{display:inline-block;width:18px;height:18px;fill:var(--ifa-dark-teal);flex-shrink:0}

/* Categories line */
.tec-meta__cats{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap;line-height:1.3}
.tec-globe{flex:0 0 auto;width:18px;height:18px;fill:var(--ifa-dark-teal)}
.tec-cats-text{min-width:0;font-weight:600}

/* ===== Column: content ===== */
.tec-col--content{display:flex;flex-direction:column;gap:10px;min-width:0}
.tec-col--content > *{min-width:0;max-width:100%}

/* Titles: no hyphens, wrap between words, never overflow */
.tec-title{font-size:1.2rem;line-height:1.3;margin:0 0 12px 0}
.tec-title,
.tec-title a{
  display:block;max-width:100%;
  hyphens:none !important;-webkit-hyphens:none !important;-moz-hyphens:none !important;-ms-hyphens:none !important;
  word-break:normal !important;overflow-wrap:normal !important;white-space:normal !important;
  text-decoration:none;
}

/* Excerpt */
.tec-excerpt{margin:0 0 16px 0}
.tec-excerpt,
.tec-excerpt *{
  hyphens:none !important;-webkit-hyphens:none !important;-moz-hyphens:none !important;-ms-hyphens:none !important;
  word-break:normal !important;overflow-wrap:normal !important;white-space:normal !important;
}

/* ===== Column: media ===== */
.tec-col--media{display:block}
.tec-media{display:block;position:relative;aspect-ratio:16/10;overflow:hidden;border-radius:10px}
.tec-media__img{width:100%;height:100%;object-fit:cover;display:block}

/* ===== Typography ===== */
.tribe-events{
  font-family:"Open Sans",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
.tribe-events .tec-title,
.tribe-events h1,.tribe-events h2,.tribe-events h3,.tribe-events h4,.tribe-events h5,.tribe-events h6{
  font-family:"Libre Baskerville",Georgia,"Times New Roman",serif;font-weight:700;
}
.tribe-events .tec-excerpt,
.tribe-events .tec-meta__dates,
.tribe-events .tec-meta__loc,
.tribe-events .tec-meta__cats{
  font-family:"Open Sans",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* ===== Buttons ===== */
.tribe-events .tribe-events-c-search .tribe-events-c-search__button.tribe-common-c-btn,
.tribe-events .tec-btn--primary{
  background:var(--ifa-dark-blue) !important;border:1px solid var(--ifa-dark-blue) !important;
  color:#fff !important;border-radius:8px;padding:10px 18px;font-weight:600;font-size:15px;line-height:1.1;
  text-decoration:none;display:inline-block;transition:background .25s,border-color .25s,color .25s;
}
.tribe-events .tribe-events-c-search .tribe-events-c-search__button.tribe-common-c-btn:hover,
.tribe-events .tec-btn--primary:hover{
  background:var(--ifa-dark-teal) !important;border-color:var(--ifa-dark-teal) !important;color:#fff !important;
}
.tec-card__actions{margin-top:auto}
.tec-btn--ghost{
  display:inline-block;padding:.6rem 1rem;border-radius:10px;font-weight:600;background:transparent;
  color:var(--ifa-dark-blue);border:1px solid var(--ifa-dark-blue);text-decoration:none;
  transition:background .25s,color .25s,border-color .25s;
}
.tec-btn--ghost:hover{background:var(--ifa-dark-blue);color:#fff}

/* ===== Header tagline above search ===== */
.tribe-events-header .ifa-events-header{text-align:left;margin:2rem auto 1rem;padding:1rem;position:relative;max-width:1200px}
.tribe-events-header .ifa-events-header::after{content:"";display:block;width:80px;height:4px;background:var(--ifa-green);margin:1rem 0 0;border-radius:2px}
.tribe-events-header .tribe-events-header__events-bar{margin-top:2rem !important}
.ifa-events__h1{position:absolute !important;left:-9999px !important;top:auto !important;width:1px !important;height:1px !important;overflow:hidden !important;white-space:nowrap !important}
.ifa-events__tagline{
  font-family:"Libre Baskerville",Georgia,serif !important;font-weight:700 !important;font-size:1.75rem !important;
  color:var(--ifa-dark-blue) !important;line-height:1.3 !important;margin:0 !important;letter-spacing:.01em !important;text-align:center !important;
}

/* ===== Datepickers ===== */
.tribe-events .flatpickr-calendar,
.tribe-events .pika-single{border:1px solid var(--card-border) !important;box-shadow:var(--card-shadow) !important;border-radius:12px !important;overflow:hidden}
.tribe-events .flatpickr-months,.tribe-events .flatpickr-current-month,
.tribe-events .pika-title,.tribe-events .pika-label{font-family:"Libre Baskerville",Georgia,serif !important;color:var(--ifa-dark-blue) !important;font-weight:700 !important}
.tribe-events .flatpickr-prev-month svg,.tribe-events .flatpickr-next-month svg{fill:var(--ifa-dark-blue) !important}
.tribe-events .flatpickr-weekday,.tribe-events .flatpickr-weekdays,
.tribe-events .pika-table th{color:var(--ifa-dark-teal) !important;font-family:"Open Sans",system-ui,sans-serif !important;font-weight:600 !important}
.tribe-events .flatpickr-day,.tribe-events .pika-button{border-radius:8px !important;font-family:"Open Sans",system-ui,sans-serif !important}
.tribe-events .flatpickr-day:hover,.tribe-events .pika-button:hover{background:var(--ifa-light-mint) !important;color:var(--ifa-dark-blue) !important}
.tribe-events .flatpickr-day.today,.tribe-events .is-today .pika-button{box-shadow:inset 0 0 0 2px var(--ifa-teal) !important;color:var(--ifa-dark-blue) !important}
.tribe-events .flatpickr-day.selected,.tribe-events .flatpickr-day.startRange,.tribe-events .flatpickr-day.endRange,
.tribe-events .is-selected .pika-button{background:var(--ifa-dark-blue) !important;border-color:var(--ifa-dark-blue) !important;color:#fff !important}

/* ===== Top bar / Upcoming title / Today ===== */
.tribe-events .tribe-events-c-top-bar__nav-title,
.tribe-events .tribe-events-c-top-bar__nav-title button,
.tribe-events .tribe-events-c-top-bar__nav-title [role="button"]{
  font-family:"Libre Baskerville",Georgia,serif !important;font-weight:700 !important;letter-spacing:.01em;color:var(--ifa-dark-blue) !important;
}
.tribe-events .tribe-events-c-top-bar__nav-title svg,
.tribe-events .tribe-events-c-top-bar__nav-title [class*="icon"]{fill:var(--ifa-dark-blue) !important;color:var(--ifa-dark-blue) !important}
.post-type-archive-tribe_events .tribe-events .tribe-events-c-top-bar__today-button.tribe-common-c-btn{
  font-family:"Open Sans",system-ui,sans-serif;font-weight:600;background:var(--ifa-light-mint) !important;color:var(--ifa-dark-blue) !important;
  border:1px solid var(--ifa-dark-blue) !important;border-radius:8px;padding:10px 14px;
}
.post-type-archive-tribe_events .tribe-events .tribe-events-c-top-bar__today-button.tribe-common-c-btn:hover{
  background:var(--ifa-dark-blue) !important;color:#fff !important;border-color:var(--ifa-dark-blue) !important;
}

/* ===== Single event tweaks ===== */
.single-tribe_events .tribe-events-single-event-title,
.single-tribe_events h1,.single-tribe_events h2,.single-tribe_events h3{
  font-family:"Libre Baskerville",Georgia,serif;font-weight:700;
}
.single-tribe_events{font-family:"Open Sans",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif}
.single-tribe_events .tribe-events-event-image{
  max-width:60%;margin:1rem auto 2rem;display:block;border-radius:12px;overflow:hidden;box-shadow:0 4px 16px rgba(32,50,72,.12);
}
.single-tribe_events .tribe-events-event-image img{width:100%;height:auto;border-radius:12px;object-fit:cover}

/* ===== Single Event: stop the H1 from overflowing ===== */

/* 1) Let the TEC grid/flex wrappers actually shrink */
.single-tribe_events .tribe-common-l-container,
.single-tribe_events .tribe-common-g-row,
.single-tribe_events .tribe-common-g-col,
.single-tribe_events #tribe-events-content,
.single-tribe_events .tribe-events-single,
.single-tribe_events .tribe-events-content {
  min-width: 0 !important;
}

/* 2) H1 must wrap and respect the container */
.single-tribe_events .tribe-events-single-event-title,
.single-tribe_events .tribe-events-single-event-title a {
  display: block;
  max-width: 100%;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere;   /* <— the "nuke" that wraps even stubborn cases */
  hyphens: none !important;
  box-sizing: border-box;
}

/* (Optional) if some theme rule is forcing nowrap on headings globally */
.single-tribe_events h1 { white-space: normal !important; }

/* ===== Utilities ===== */
.tec-card *{max-width:100%;box-sizing:border-box}

/* ===== Responsive ===== */
@media (max-width:980px){
  .tec-card{
    grid-template-columns:1fr;
    grid-template-areas: 
      "media"
      "content" 
      "meta";
    gap:16px;
  }
  .tec-col--media{order:-1}
  .tec-media{aspect-ratio:16/9}
}
@media (max-width:768px){
  .tribe-events-header .ifa-events-header{margin:1.5rem auto .5rem;padding:.5rem;text-align:center}
  .ifa-events__tagline{font-size:1.4rem}
  .tribe-events-header .ifa-events-header::after{width:60px;height:3px;margin:1rem auto 0}
  .tribe-events-header .tribe-events-header__events-bar{margin-top:1.5rem !important}
}