/* ================================================================
   INESC CONTENT — EVENTS LAYOUT
   Events-specific layout only. Design tokens (--ip-* + legacy aliases), the
   filter bar (.inesc-filter-tabs), the pagination (.inesc-pagination) and the
   listing box-model (.inesc-listing) come from this plugin's own shared set,
   assets/shared/ (`inesc-content-*` handles) — shared with the posts module.
   ================================================================ */


/* Empty-state message ("No events to show."), printed by frontend.php
   render_grid() as `p.inesc-events__empty`. The legacy
   `.inesc-events-listing__empty` name is kept in case custom CSS or old
   markup still uses it. */
.inesc-events__empty,
.inesc-events-listing__empty {
  font-family: var(--font-main);
  font-size: var(--text-20);
  color: var(--gray);
  text-align: center;
  margin: 3rem 0;
}


/* =========================================================
   GRID
========================================================= */

.inesc-events__grid {
  display: grid !important;
  /* Cards per row. Set inline on .inesc-events by the shortcode attributes
     (frontend.php render_listing()): --inesc-events-cols(-tablet/-mobile)
     from `columns*` for both sections, overridden per section by
     --inesc-events-upcoming-cols* / --inesc-events-past-cols*
     (`columns_upcoming*` / `columns_past*`). Unset = 2 / 1 / 1.
     --ie-cols(-t/-m) hold the resolved value for this grid. */
  --ie-cols:   var(--inesc-events-cols, 2);
  --ie-cols-t: var(--inesc-events-cols-tablet, 1);
  --ie-cols-m: var(--inesc-events-cols-mobile, 1);
  grid-template-columns: repeat(var(--ie-cols), minmax(0, 1fr));

  column-gap: clamp(1.88rem, 7.52vw, 9.4rem);
  row-gap: 4rem;
  list-style: none !important;
  /* Outer margin lives on the section (.inesc-listing__block); grid is flush. */
  margin: 1.5rem 0 0 !important;
  padding: 0 !important;
}

.inesc-events__grid--upcoming {
  --ie-cols:   var(--inesc-events-upcoming-cols, var(--inesc-events-cols, 2));
  --ie-cols-t: var(--inesc-events-upcoming-cols-tablet, var(--inesc-events-cols-tablet, 1));
  --ie-cols-m: var(--inesc-events-upcoming-cols-mobile, var(--inesc-events-cols-mobile, 1));
}

.inesc-events__grid--past {
  --ie-cols:   var(--inesc-events-past-cols, var(--inesc-events-cols, 2));
  --ie-cols-t: var(--inesc-events-past-cols-tablet, var(--inesc-events-cols-tablet, 1));
  --ie-cols-m: var(--inesc-events-past-cols-mobile, var(--inesc-events-cols-mobile, 1));
  /* With the same column count in both sections (the default), the PAST
     grid shares the columns and column-gap of the UPCOMING one, so the PAST
     columns line up EXACTLY under the UPCOMING ones (as in the mockup: same
     column position in both sections). The image and body are narrower than
     the column and sit flush left — the right side of the column stays
     empty, as in the mockup.
     --past-card-w = UPCOMING image width = column − date column (11rem) −
     gap (1.4rem), so the PAST photo has the SAME width as the UPCOMING one.
     Keep 12.4rem in sync with .inesc-event-card--upcoming below (date
     column max 11rem + column-gap 1.4rem). */
  --past-card-w: calc(100% - 12.4rem);
}

/* PAST with its own column count (`columns_past*`, frontend.php adds the
   modifier): its columns no longer match the UPCOMING ones, so the cards
   fill their column instead of shrinking to the UPCOMING photo width. */
.inesc-events--past-cols .inesc-events__grid--past {
  --past-card-w: 100%;
}

@media (max-width: 900px) {
  /* minmax(0, 1fr) — not plain 1fr — so the column can shrink below the
     card's intrinsic width (the past card media has a fixed --past-card-w);
     otherwise the track grows past the section margin and the card overflows. */
  .inesc-events__grid {
    grid-template-columns: repeat(var(--ie-cols-t), minmax(0, 1fr));
    column-gap: 2rem; /* only used when more than one column is chosen */
  }
}

@media (max-width: 600px) {
  .inesc-events__grid {
    grid-template-columns: repeat(var(--ie-cols-m), minmax(0, 1fr));
    column-gap: 1.25rem;
  }
}

/* =========================================================
   GENERAL CARD RESET
========================================================= */

.inesc-event-card {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: block;
}

.inesc-event-card__body{
  border-left: 3px solid var(--green);
  padding-left: 1.5rem;
  margin-top: 0.8rem;
}

/* =========================================================
   IMAGE
========================================================= */

.inesc-event-card__media {
  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  aspect-ratio: 511 / 359;
  background: #d9d9d9;
  border: 3px solid var(--green);
  border-radius: var(--radius-lg) 0 var(--radius-lg) 0;
  overflow: hidden;
  margin-bottom: 1rem;
}

.inesc-event-card__img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

/* =========================================================
   UPCOMING EVENTS
   Base card grid; the column template and __top/__body placement are
   overridden further down (SECTION FRAMING block).
========================================================= */

.inesc-event-card--upcoming {
  display: grid;
  grid-template-columns: 1fr 90px;
  column-gap: 1rem !important;
  align-items: start;
}

.inesc-event-card--upcoming .inesc-event-card__media {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 0;
}

.inesc-event-card--upcoming .inesc-event-card__top {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 3.5rem;
}

.inesc-event-card--upcoming .inesc-event-card__body {
  grid-column: 1;
  grid-row: 2;
   border-left: 3px solid var(--green);
  padding-left: 1.5rem;
  margin-top: 0.8rem;
}

/* =========================================================
   DATE
========================================================= */

.inesc-event-card__date {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.inesc-event-card__day {
  font-size: var(--text-35);
  font-weight: var(--bold);
  color: var(--blue);
  line-height: 1;
}

.inesc-event-card__month {
  font-size: var(--text-35);
  font-weight: var(--light);
  color: var(--blue);
  text-transform: none;
  letter-spacing: 0;
  /* Space between the day (00th) and the month (~0.86em, per the mockup);
     a smaller gap makes the two large lines touch. On mobile (≤600px) .date
     becomes a single line and this margin is reset to 0 (rule further down). */
  margin-top: 0.9rem;
}

/* =========================================================
   SMALL LABEL BUTTON
========================================================= */

.inesc-event-card__btn {
  display: inline-block;
  padding: 0.2rem 1rem;
  font-size: var(--text-11);
  line-height: 1;
  letter-spacing: 0.08em;
  background: var(--blue) !important;
  color: #fff !important;
  border-radius: 0;
  font-weight: 700;
  text-transform: uppercase;
  min-width: auto;
  text-decoration: none !important;
}

/* Category chip is a link to the filtered events overview (?type=…). */
a.inesc-event-card__btn:hover,
a.inesc-event-card__btn:focus {
  background: var(--green) !important;
  color: #fff !important;
}


/* =========================================================
   TITLE
========================================================= */

.inesc-events .inesc-event-card__title,
.inesc-events .inesc-event-card__title a {
  font-size: var(--text-22);
  line-height: 1.6 !important;      /* extra spacing between title lines */
  font-weight: var(--bold) !important;
  color: var(--blue) !important;
  margin: 0 0 1rem !important;
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.inesc-events .inesc-event-card__title a:hover {
  color: var(--green, #97ca3d) !important;
}

/* Upcoming cards: title + excerpt add up to at most 6 lines. The title is
   shown in full (up to the budget) and carousel.js gives the remaining lines
   to the excerpt via --ip-excerpt-lines, at most 2. This 6-line clamp is the no-JS
   fallback. */
.inesc-events .inesc-event-card--upcoming .inesc-event-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}

/* =========================================================
   EXCERPT
========================================================= */

.inesc-events .inesc-event-card__excerpt {
  font-size: var(--text-17) !important;
  line-height: 1.8 !important;
  color: var(--blue);
  margin-bottom: 1.2rem !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  display: -webkit-box;
  /* Excerpt lines = 6 − title lines, at most 2 (set by carousel.js in
     --ip-excerpt-lines). No-JS fallback: 2 lines. */
  -webkit-line-clamp: var(--ip-excerpt-lines, 2);
  line-clamp: var(--ip-excerpt-lines, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: calc(1.8em * var(--ip-excerpt-lines, 2));
}

/* =========================================================
   LOCATION
========================================================= */

.inesc-events .inesc-event-card__location {
  font-size: var(--text-21) !important;
  font-weight: var(--semi-bold);
  color: var(--green) !important;
  margin-bottom: 0.4rem !important;
  /* Written as entered (no caps); long locations wrap onto a second line. */
  white-space: normal;
  overflow-wrap: anywhere;
}

/* =========================================================
   READ MORE
========================================================= */

.inesc-event-card__readmore {
  font-size: var(--text-19-5);
  font-style: italic;
  color: var(--gray);
  text-decoration: none;
}

.inesc-event-card__readmore:hover {
  color: var(--green);
}

/* =========================================================
   PAST EVENTS
========================================================= */

.inesc-event-card--past {
  display: block;
  /* --past-card-w is inherited from the grid (.inesc-events__grid--past) */
}

.inesc-event-card--past .inesc-event-card__media {
  width: var(--past-card-w);  /* same width as the UPCOMING photo (column − 12.4rem) */
  height: auto;
  max-width: 100%;     /* shrinks proportionally on narrow screens */
  aspect-ratio: 31.75 / 22.125;  /* keeps the same image ratio */
}


.inesc-event-card--past .inesc-event-card__body {
  width: var(--past-card-w);  /* body as wide as the image: the text ends where the image ends */
  max-width: 100%;
  box-sizing: border-box;     /* border + padding count towards the width, so the right edge lines up with the image */
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Between 600–900px the UPCOMING card still has the date beside the image, so
   the PAST photo keeps `calc(100% − 12.4rem)` and stays equal to the UPCOMING
   one. Only at ≤600px, where UPCOMING stacks the image at full width, does
   PAST go to 100% (otherwise subtracting 12.4rem would leave a tiny photo on
   narrow screens). */
@media (max-width: 600px) {
  .inesc-event-card--past .inesc-event-card__media,
  .inesc-event-card--past .inesc-event-card__body {
    width: 100%;
  }
}

.inesc-event-card--past .inesc-event-card__date-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 0.8rem;
  width: 100%;
}

.inesc-event-card--past .inesc-event-card__date-line {
  font-size: var(--text-19-5);
  font-style: italic;
  color: var(--blue);
  margin: 0 !important;
  grid-column: 1;
}


.inesc-event-card--past .inesc-event-card__date-row .inesc-event-card__btn {
  grid-column: 2;
  justify-self: end;
}

.inesc-event-card--past .inesc-event-card__title,
.inesc-event-card--past .inesc-event-card__title a {
  font-size: var(--text-22);
  line-height: 1.5 !important;
}

/* =========================================================
   SECTION HEADINGS
========================================================= */

.inesc-events .inesc-events__heading {
  font-size: var(--text-36) !important;
  font-weight: var(--semi-bold) !important;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0;
  margin: 1rem 0!important;
}

/* =========================================================
   SECTION FRAMING (+ UPCOMING card layout)
========================================================= */

/* Box-model unified with the news listing via assets/shared/listing.css: the
   flush wrapper comes from .inesc-listing and the per-section margin from
   .inesc-listing__block, so both pages are framed identically. Only the
   events-specific section decoration stays here. */
.inesc-events__section--past {
  padding-top: 2.81rem;  /* distance from the green rule to the PAST EVENTS heading */
  border-top: 3px solid var(--green);
}

/* The heading adds no top margin of its own: the distance to the green rule
   is controlled only by the section's padding-top (rule above). */
.inesc-events__section--past .inesc-events__heading {
  margin-top: 0 !important;
}

/* UPCOMING: image on the left + date on the right */
.inesc-event-card--upcoming {
  display: grid !important;
  /* image ~75% + date column ~22% (as in the mockup). The date column is
     wide enough that a long label does not push the block down. The 11rem +
     1.4rem gap feed --past-card-w (.inesc-events__grid--past). */
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 11rem) !important;
  column-gap: 1.4rem;
  align-items: start;
  /* All cards in a row stretch to the height of the tallest (longest
     title). Without this, the shorter card's extra height would be spread
     over the `auto` rows (align-content default = stretch), stretching ROW 1
     past the image — and the date (align-self:end) would drop below the
     image. With `start` the rows stay at the top, the date always lines up
     with the bottom of the image and the slack goes to the bottom of the
     card. */
  align-content: start;
}

.inesc-event-card--upcoming .inesc-event-card__media {
  grid-column: 1;
  grid-row: 1;
  margin: 0 !important;
  /* Same image as the past cards: same class, same ratio, same
     border/radius (inherited from .inesc-event-card__media). */
  aspect-ratio: 31.75 / 22.125;
}

/* Body is a real grid item (row 2, full width) so its green left bar
   (border-left, inherited from .inesc-event-card__body) has a box to be
   painted on. __top is a sibling of the body in the HTML, so it places
   itself in the right-hand column of the card grid. */
.inesc-event-card--upcoming .inesc-event-card__body {
  grid-column: 1 / -1;
  grid-row: 2;
}

.inesc-event-card--upcoming .inesc-event-card__top {
  grid-column: 2;
  grid-row: 1;

  /* Anchors the date block to the bottom of the image without stretching
     the row: the date + label line up with the base of the image and never
     spill over the title (the taller image sets the row height). */
  align-self: end;

  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;

  min-width: 0;
  padding-bottom: 0.3rem;

  border: 0 !important;
}

/* =========================================================
   SEE ALL TOGGLE (mobile only; hidden on desktop)
========================================================= */

/* CSS-only "see all" for the UPCOMING section (frontend.php render_listing):
   a checkbox precedes the grid and is toggled by the
   label.inesc-events__see-all-btn. The show/hide rules live in the
   ≤ 600px block below, so on desktop all upcoming cards are visible.
   Keyboard: the checkbox itself is the focusable control (Tab, then Space);
   it is display:none on desktop so it is not an empty tab stop there, and
   visually hidden (but focusable) on mobile, where its focus ring is drawn
   on the label. */

.inesc-events__see-all-toggle {
  display: none;
}

.inesc-events__see-all-btn {
  display: none;
}

/* =========================================================
   MOBILE (≤ 600px) — single-column stack
========================================================= */

@media (max-width: 600px) {

  .inesc-events .inesc-events__heading {
    text-align: center;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 1.2rem !important;
  }

  /* Section outer margin stays unified with the news grid via
     .inesc-listing__block; only the past section's top padding differs. */
  .inesc-events__section--past {
    padding-top: 1.8rem;
  }

  .inesc-events__section--upcoming {
    display: flex;
    flex-direction: column;
  }

  .inesc-events__grid--upcoming {
    grid-template-columns: repeat(var(--ie-cols-m), minmax(0, 1fr)) !important;
    row-gap: 2rem !important;
  }

  /* Upcoming card: image on top, then body (date, label, title, …) */
  .inesc-event-card--upcoming {
    display: flex !important;
    flex-direction: column !important;
    gap: 0;
    min-width: 0;
  }

  .inesc-event-card--upcoming .inesc-event-card__media {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    max-width: 100%;
    margin: 0 0 1rem 0 !important;
  }

  /* Body is the flex column for the text (date row, title, excerpt…). */
  .inesc-event-card--upcoming .inesc-event-card__body {
    display: flex !important;
    flex-direction: column;
    margin-left: 0 !important;
    min-width: 0;
  }

  .inesc-event-card--upcoming .inesc-event-card__top {
    grid-column: auto !important;
    grid-row: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    height: auto !important;
    padding: 0 !important;
    margin-bottom: 0.6rem;
    gap: 0.45rem;
    border: 0 !important;
  }

  .inesc-event-card--upcoming .inesc-event-card__date {
    flex-direction: row;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0;
  }

  .inesc-event-card--upcoming .inesc-event-card__day,
  .inesc-event-card--upcoming .inesc-event-card__month {
    font-size: var(--text-22) !important;
    margin: 0 !important;
  }

  .inesc-event-card--upcoming .inesc-event-card__title,
  .inesc-event-card--upcoming .inesc-event-card__excerpt,
  .inesc-event-card--upcoming .inesc-event-card__location,
  .inesc-event-card--upcoming .inesc-event-card__readmore {
    grid-column: auto !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
  }

  .inesc-event-card--upcoming .inesc-event-card__title {
    margin-top: 0 !important;
    margin-bottom: 0.6rem !important;
  }

  .inesc-events .inesc-event-card__title,
  .inesc-events .inesc-event-card__title a {
    font-size: var(--text-19) !important;
    line-height: 1.35 !important;
  }

  .inesc-events .inesc-event-card__excerpt {
    line-height: 1.6 !important;
    margin-bottom: 0.8rem !important;
    min-height: calc(1.6em * var(--ip-excerpt-lines, 2));
  }

  .inesc-events .inesc-event-card__location {
    margin-bottom: 0.3rem !important;
  }

  /* See-all button — visible on mobile, only when toggle is present */
  .inesc-events__see-all-btn {
    display: inline-block;
    align-self: center;
    margin: 1.5rem auto 0;
    padding: 0.35rem 1.1rem;
    background: transparent;
    color: var(--green) !important;
    border: 1px solid var(--green);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-weight: var(--semi-bold);
    letter-spacing: 0.04em;
    cursor: pointer;
    user-select: none;
    text-align: center;
    line-height: 1.4;
  }

  .inesc-events__see-all-btn:hover,
  .inesc-events__see-all-btn:focus,
  .inesc-events__see-all-toggle:focus-visible ~ .inesc-events__see-all-btn {
    background: var(--green);
    color: #fff !important;
  }

  .inesc-events__see-all-toggle:focus-visible ~ .inesc-events__see-all-btn {
    outline: 2px solid var(--green);
    outline-offset: 2px;
  }

  /* Visually hidden but focusable (see the note at the top of this section). */
  .inesc-events__see-all-toggle {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* Hide 4th+ upcoming cards until toggle is checked */
  .inesc-events__see-all-toggle ~ .inesc-events__grid--upcoming > .inesc-event-card:nth-child(n+4) {
    display: none !important;
  }

  .inesc-events__see-all-toggle:checked ~ .inesc-events__grid--upcoming > .inesc-event-card:nth-child(n+4) {
    display: flex !important;
  }

  .inesc-events__see-all-toggle:checked ~ .inesc-events__see-all-btn {
    display: none;
  }

  /* Past events: typography tuning on small screens. */
  .inesc-event-card--past .inesc-event-card__title,
  .inesc-event-card--past .inesc-event-card__title a {
    font-size: var(--text-16) !important;
  }

  .inesc-event-card--past .inesc-event-card__date-line {
    font-size: var(--text-14) !important;
  }

}

/* =========================================================
   SINGLE EVENT PAGE
========================================================= */

.inesc-event-single__container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 2rem var(--ip-gutter) 4rem;
}

/* ---- Row 1: text (left) + image (right) ---- */

.inesc-event-single__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  column-gap: 3rem;
  align-items: start;
  margin-bottom: 2rem;
}

.inesc-event-single__left {
  display: flex;
  flex-direction: column;
}

.inesc-event-single__date {
  font-family: var(--font-main);
  font-size: var(--text-30);
  color: var(--blue);
  margin: 0 0 0.4rem !important;
  line-height: 1.1;
}

.inesc-event-single__day {
  font-weight: var(--bold);
}

.inesc-event-single__month {
  font-weight: var(--normal);
  margin-left: 0.3rem;
}

.inesc-event-single__time {
  font-family: var(--font-main);
  font-size: var(--text-24);
  font-weight: var(--normal);
  color: var(--blue);
  margin: 0 0 0.6rem !important;
  line-height: 1.1;
}

.inesc-event-single__location {
  font-family: var(--font-main);
  font-size: var(--text-22);
  font-weight: var(--bold);
  color: var(--green);
  margin: 0 0 1rem !important;
  line-height: 1.2;
}

.inesc-event-single__main-label-wrap {
  margin: 0 0 1.5rem !important;
}

.inesc-event-single__main-label {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-main);
  font-size: var(--text-11);
  font-weight: var(--bold);
  letter-spacing: 0.08em;
  color: #fff !important;
  background: var(--blue);
  line-height: 1;
  text-transform: uppercase;
  border-radius: 0;
  text-decoration: none !important;
}

/* Category chip is a link to the filtered events overview (?type=…). */
a.inesc-event-single__main-label:hover,
a.inesc-event-single__main-label:focus {
  background: var(--green);
  color: #fff !important;
}

.inesc-event-single__title {
  font-family: var(--font-main);
  font-size: var(--text-30) !important;
  font-weight: var(--bold) !important;
  color: var(--blue) !important;
  line-height: 1.2 !important;
  margin: 0 0 1.5rem !important;
  padding-left: 1rem;
  border-left: 3px solid var(--green);
}

.inesc-event-single__book-wrap {
  margin: 0 !important;
}

.inesc-event-single__book {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  background: transparent;
  border: 1.5px solid var(--green);
  color: var(--green) !important;
  font-family: var(--font-main);
  font-size: var(--text-14);
  font-weight: var(--bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none !important;
  line-height: 1;
  border-radius: var(--radius-sm);
}

.inesc-event-single__book:hover,
.inesc-event-single__book:focus {
  background: var(--green);
  color: #fff !important;
}

.inesc-event-single__media {
  width: 100%;
  aspect-ratio: 16 / 11;
  background: #d9d9d9;
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-lg) 0 var(--radius-lg) 0;
}

.inesc-event-single__img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  position: absolute;
  inset: 0;
  display: block;
}

.inesc-event-single__img--placeholder {
  background: #d9d9d9;
}

/* ---- Row 2: body (70%) + actions (30%) ---- */

.inesc-event-single__body-row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  column-gap: 2rem;
  align-items: start;
}

.inesc-event-single__actions {
  display: flex;
  flex-direction: column;
  /* Centred (not flush right): the ADD TO CALENDAR / SHARE THIS buttons sit
     centred above the row of social icons, on the same axis. */
  align-items: center;
  gap: 0.7rem;
  margin: 0 !important;
  position: relative;
  z-index: 9999;
}

.inesc-event-single__share,
.inesc-event-single__socials,
.inesc-event-single__social {
  position: relative;
  z-index: 9999;
}

.inesc-event-single__gcal {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  background: var(--dark-blue);
  color: #fff !important;
  font-family: var(--font-main);
  font-size: var(--text-14);
  font-weight: var(--bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none !important;
  line-height: 1;
  border-radius: var(--radius-sm);
}

.inesc-event-single__gcal:hover,
.inesc-event-single__gcal:focus {
  background: var(--blue);
}

.inesc-event-single__share {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  background: var(--green);
  color: #fff !important;
  font-family: var(--font-main);
  font-size: var(--text-14);
  font-weight: var(--bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none !important;
  line-height: 1;
  border-radius: var(--radius-sm);
  /* It is a real <button> (copies the link): strip native chrome. */
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.inesc-event-single__share:hover,
.inesc-event-single__share:focus {
  background: #84b62f;
  color: #fff !important;
}

.inesc-event-single__share-icon {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-16);
  line-height: 1;
}

.inesc-event-single__share-icon .fa-share-nodes,
.inesc-event-single__share-icon .fa-brands,
.inesc-event-single__share-icon .fa-regular,
.inesc-event-single__share-icon .fa-solid {
  font-size: var(--text-17-5);
  line-height: 1;
}

.inesc-event-single__socials {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  gap: 0.5rem;
}

.inesc-event-single__socials li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.inesc-event-single__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--dark-blue);
  color: #fff !important;
  font-size: var(--text-17-5);
  text-decoration: none !important;
  border-radius: 3px;
  line-height: 1;
}

.inesc-event-single__social .fa-brands,
.inesc-event-single__social .fa-solid,
.inesc-event-single__social .fa-regular {
  font-size: var(--text-16);
  line-height: 1;
  color: #fff;
}

.inesc-event-single__social:hover,
.inesc-event-single__social:focus {
  background: var(--blue);
}

.inesc-event-single__body {
  font-family: var(--font-main);
  font-size: var(--text-18) !important;
  line-height: 1.7;
  color: var(--blue);
}

.inesc-event-single__body p {
  margin: 0 0 1rem;
}

.inesc-event-single__body h2,
.inesc-event-single__body h3,
.inesc-event-single__body h4 {
  font-size: var(--text-26) !important;
  font-weight: var(--semi-bold) !important;
  color: var(--blue);
  margin: 1.8rem 0 0.8rem;
  line-height: 1.3;
}



.inesc-event-single__body img {
  max-width: 100%;
  height: auto;
}

/* =========================================================
   RELATED UPCOMING (single event page footer)
========================================================= */

.inesc-event-related {
  max-width: var(--container-width);
  margin: 3rem auto 0;
  padding: 2rem var(--ip-gutter) 4rem;
  border-top: 1px solid var(--green);
}

.inesc-event-related__heading {
  font-family: var(--font-main);
  font-size: var(--text-36) !important;
  font-weight: var(--semi-bold) !important;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0;
  margin: 0 0 2rem !important;
}

/* Heading + carousel arrows on one row. */
.inesc-event-related__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 2rem;
}

.inesc-event-related__head .inesc-event-related__heading {
  margin: 0 !important;
}

/* Carousel arrows (shared look across related posts + upcoming events). */
.inesc-carousel-nav {
  display: flex;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.inesc-carousel-nav[hidden] {
  display: none;
}

.inesc-carousel-nav__btn {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: transparent;
  color: var(--green);
  /* The arrow is drawn as a mask (::before) so it's perfectly centred; the
     ‹ › text entity is hidden. */
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

/* Chevron drawn via SVG mask, sized to the circle and centred. Inherits the
   button colour (green → white on hover) through currentColor. */
.inesc-carousel-nav__btn::before {
  content: "";
  width: 45%;
  height: 45%;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat;
          mask: center / contain no-repeat;
}

.inesc-carousel-nav__btn[data-carousel-prev]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5 L8 12 L15 19'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5 L8 12 L15 19'/%3E%3C/svg%3E");
}

.inesc-carousel-nav__btn[data-carousel-next]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5 L16 12 L9 19'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5 L16 12 L9 19'/%3E%3C/svg%3E");
}

.inesc-carousel-nav__btn:hover:not(:disabled),
.inesc-carousel-nav__btn:focus-visible:not(:disabled) {
  background: var(--green);
  color: #fff;
}

.inesc-carousel-nav__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Carousel dots (below the track, created by carousel.js) — matches the
   theme's .carousel-dot look: a filled green dot, the active one a hollow
   green ring. carousel.js sets [hidden] on the container when the track does
   not overflow. */
.inesc-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}

.inesc-carousel-dots[hidden] {
  width: 10px;
  height: 10px;
  background: transparent;
  border: none;
  box-shadow: 0 0 0 3px var(--dark_blue);
}

.inesc-carousel-dots__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.inesc-carousel-dots__dot.is-active {
  width: 10px;
  height: 10px;
  background: transparent;
  border: none;
  box-shadow: 0 0 0 3px var(--green);
}

/* Carousel track: 3 cards per view, but a horizontal scroll-snap row so it
   can hold every related card (up to 9, see render_related_upcoming()),
   paged by the arrows in assets/carousel.js. Scrollbar hidden. */
.inesc-event-related__grid {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.inesc-event-related__grid::-webkit-scrollbar {
  display: none;
}

.inesc-event-related__card {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* Three cards per view (2 gaps of 2rem). */
  flex: 0 0 calc((100% - 2 * 2rem) / 3);
  scroll-snap-align: start;
}

.inesc-event-related__media {
  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  aspect-ratio: 4 / 3;
  background: #d9d9d9;
  border: 2px solid var(--green);
  border-radius: var(--radius-lg) 0 var(--radius-lg) 0;
  overflow: hidden;
  margin-bottom: 1rem;
}

.inesc-event-related__img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.inesc-event-related__img--placeholder {
  background: #d9d9d9;
}

.inesc-event-related__body {
  border-left: 2px solid var(--green);
  padding-left: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.inesc-event-related__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.inesc-event-related__date {
  font-family: var(--font-main);
  font-size: var(--text-19-5);
  font-style: italic;
  color: var(--blue);
  line-height: 1.2;
}

.inesc-event-related__label {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: var(--blue);
  color: #fff !important;
  font-family: var(--font-main);
  font-size: var(--text-11);
  font-weight: var(--bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  text-decoration: none !important;
}

/* Category chip is a link to the filtered events overview (?type=…). */
a.inesc-event-related__label:hover,
a.inesc-event-related__label:focus {
  background: var(--green);
  color: #fff !important;
}

.inesc-event-related__title {
  margin: 0 !important;
  font-family: var(--font-main);
  font-size: var(--text-22) !important;
  font-weight: var(--bold) !important;
  line-height: 1.3 !important;
  color: var(--blue) !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  /* Title stays complete: JS (balanceCard) measures its real height and gives
     the excerpt whatever remains of the 6-line budget. The 6-line clamp here
     is only the no-JS fallback (and lets JS measure up to the full budget). */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}

.inesc-event-related__title a {
  color: var(--blue) !important;
  text-decoration: none !important;
}

.inesc-event-related__title a:hover,
.inesc-event-related__title a:focus {
  color: var(--green) !important;
}

.inesc-event-related__excerpt {
  margin: 0 !important;
  font-family: var(--font-main);
  font-size: var(--text-17) !important;
  line-height: 1.6 !important;
  color: var(--blue);
  overflow-wrap: anywhere;
  word-break: break-word;
  /* Excerpt fills the rest of the 6-line budget: JS sets --ip-excerpt-lines
     (6 − title lines). Fallback 4 before JS runs / if JS is off. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--ip-excerpt-lines, 4);
  line-clamp: var(--ip-excerpt-lines, 4);
  overflow: hidden;
}

/* ---- Related upcoming events — responsive ---- */

@media (max-width: 900px) {
  /* Smaller screens: the same scroll-snap row (swipeable without JS), with
     narrower gaps and cards at 85% width so the next one peeks in. */
  .inesc-event-related__grid {
    display: flex;
    grid-template-columns: none;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-padding-left: 0;
    padding-bottom: 0.5rem !important;
    scrollbar-width: none; /* Firefox */
  }
  .inesc-event-related__grid::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Edge */
  }
  .inesc-event-related__card {
    flex: 0 0 85%; /* leaves the next card peeking, hinting it's swipeable */
    scroll-snap-align: start;
  }
}

@media (max-width: 600px) {
  .inesc-event-related {
    padding: 1.5rem 5vw 2.5rem;
    margin-top: 2rem;
  }

  .inesc-event-related__heading {
    margin-bottom: 1.2rem !important;
  }

}

/* ---- Responsive ---- */
/* Single event page (.inesc-event-single__*): both rows collapse to one
   column at ≤ 900px; tighter spacing/typography at ≤ 600px. */

@media (max-width: 900px) {
  .inesc-event-single__head,
  .inesc-event-single__body-row {
    grid-template-columns: 1fr;
    row-gap: 1.5rem;
  }

  /* Mockup (mobile): the featured image sits ABOVE the date/title text. */
  .inesc-event-single__media {
    order: -1;
  }

  /* Mockup (mobile): actions stack and centre below the body content. */
  .inesc-event-single__actions {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.5rem !important;
  }

  .inesc-event-single__socials {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .inesc-event-single__container {
    padding: 1.5rem 5vw 2.5rem;
  }

  .inesc-event-single__date {


  .inesc-event-single__actions {
    align-items: center;
    justify-content: center;
  }

  .inesc-event-single__gcal,
  .inesc-event-single__share,
  .inesc-event-single__book {
    padding: 0.5rem 0.9rem;
  }
}


/* =========================================================
   .header-image — page-header banner
   Not output by any plugin template: meant to be added by hand as an extra
   CSS class on a WPBakery row (e.g. in the editable page header). Hard-coded
   upload path: update it if the image moves.
   Note: only applies on pages where this stylesheet is enqueued.
========================================================= */
.header-image {
  padding:15vh 0;
  background-image: url('/wp-content/uploads/2026/04/g464.png');
  background-size: cover !important;       
  background-position: top;
}

@media (max-width: 768px) {
  .header-image {
    padding:10vh 0;
    background-size: contain !important;  
    background-position: center;
    background-repeat: no-repeat;

  } 
}