/* ============================================================
   CIAC-PLDIS 2026 — responsive polish
   Version 2.9.5
   Loaded last on all CIAC-PLDIS Safe Suite public templates.
   ============================================================ */

/* Resilient media and long content. */
body.ciacps-page,
body.ciac-home-editable-page {
  overflow-x: hidden;
}

body.ciacps-page img,
body.ciacps-page svg,
body.ciacps-page video,
body.ciacps-page canvas,
body.ciacps-page iframe,
body.ciac-home-editable-page img,
body.ciac-home-editable-page svg,
body.ciac-home-editable-page video,
body.ciac-home-editable-page canvas,
body.ciac-home-editable-page iframe {
  max-width: 100%;
}

body.ciacps-page img,
body.ciac-home-editable-page img {
  height: auto;
}

body.ciacps-page main,
body.ciac-home-editable-page main,
body.ciacps-page .ciac-container,
body.ciac-home-editable-page .ciac-container {
  min-width: 0;
}

body.ciacps-page p,
body.ciacps-page li,
body.ciacps-page address,
body.ciacps-page a,
body.ciac-home-editable-page p,
body.ciac-home-editable-page li,
body.ciac-home-editable-page address,
body.ciac-home-editable-page a {
  overflow-wrap: break-word;
}

/* Keep long URLs, DOI strings and email addresses inside cards. */
.ciac-wp-content a,
.ciac-contact-card a,
.ciac-ro-item a,
.ciac-report-card,
.ciac-partnership-card a,
.ciac-member-links a {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Rich/editor content should never force the viewport wider. */
.ciac-wp-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ciac-wp-content pre,
.ciac-wp-content code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
}
.ciac-wp-content iframe {
  width: 100%;
}

/* Touch targets and form behaviour, including iOS zoom prevention. */
.ciacps-page button,
.ciacps-page input,
.ciacps-page select,
.ciacps-page textarea,
.ciac-home-editable-page button,
.ciac-home-editable-page input,
.ciac-home-editable-page select,
.ciac-home-editable-page textarea {
  max-width: 100%;
}
.ciacps-page input,
.ciacps-page select,
.ciacps-page textarea,
.ciac-home-editable-page input,
.ciac-home-editable-page select,
.ciac-home-editable-page textarea {
  font-size: max(16px, 1em);
}
.ciac-btn,
.ciac-calendar-nav a,
.ciac-menu-toggle,
.ciac-team-filters button {
  min-height: 44px;
}

/* Strong, visible keyboard focus without changing the visual language. */
.ciacps-page :where(a, button, input, select, textarea):focus-visible,
.ciac-home-editable-page :where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(211, 3, 72, .28);
  outline-offset: 3px;
}

/* Header/menu: mobile panel scrolls independently and never runs off-screen. */
@media (max-width: 980px) {
  .ciac-site-header {
    width: 100%;
  }
  .ciac-header-inner {
    position: relative;
    gap: 14px;
  }
  .ciac-menu-toggle {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    cursor: pointer;
  }
  .ciac-menu-toggle span:not(.screen-reader-text) {
    transition: transform .18s ease, opacity .18s ease;
    transform-origin: center;
  }
  .ciac-menu-toggle[aria-expanded="true"] span:not(.screen-reader-text):nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .ciac-menu-toggle[aria-expanded="true"] span:not(.screen-reader-text):nth-child(2) {
    opacity: 0;
  }
  .ciac-menu-toggle[aria-expanded="true"] span:not(.screen-reader-text):nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
  .ciac-header-nav-wrap {
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px max(20px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }
  body.admin-bar .ciac-header-nav-wrap {
    max-height: calc(100dvh - 118px);
  }
  .ciac-main-nav a,
  .ciac-submenu a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .ciac-submenu {
    padding-left: 14px;
  }
  .ciac-lang {
    gap: 8px;
    padding-top: 10px;
  }
  .ciac-lang-link,
  .ciac-lang-preview span {
    min-width: 44px;
    min-height: 40px;
  }
}

/* Tablet: preserve generous layout while avoiding oversized hero typography/cards. */
@media (max-width: 820px) {
  .ciac-container {
    width: min(calc(100% - 32px), var(--ciac-max));
  }
  .ciac-section {
    padding: 72px 0;
  }
  .ciac-section-head {
    margin-bottom: 32px;
  }
  .ciac-section h2,
  .ciac-calendar-head h2 {
    font-size: clamp(1.9rem, 7vw, 3rem);
  }
  .ciac-card,
  .ciac-project,
  .ciac-contact-card,
  .ciac-axis-card,
  .ciac-strategy-objective-grid article {
    padding: 24px;
  }
  .ciac-cta-inner {
    padding: 38px 30px;
  }
  .ciac-footer-main {
    gap: 38px;
  }
  .ciac-hp-hero-visual {
    min-height: 300px;
  }
  .ciac-hp-hero-logo {
    max-height: 220px;
  }
  .ciac-about-hero h1,
  .ciac-strategy-hero h1,
  .ciac-team-hero h1,
  .ciac-ro-hero h1,
  .ciac-workgroups-hero h1,
  .ciac-events-hero h1,
  .ciac-contact-hero h1,
  .ciac-hp-hero h1 {
    font-size: clamp(3rem, 10vw, 5rem);
  }
}

/* Phones: compact spacing, legible text, one-hand friendly controls. */
@media (max-width: 640px) {
  .ciac-container {
    width: min(calc(100% - 28px), var(--ciac-max));
  }
  .ciac-section {
    padding: 58px 0;
  }
  .ciac-section-head {
    gap: 20px;
    margin-bottom: 28px;
  }
  .ciac-kicker,
  .ciac-eyebrow {
    font-size: .72rem;
    letter-spacing: .11em;
  }
  .ciac-lead,
  .ciac-about-lead,
  .ciac-strategy-lead,
  .ciac-team-lead,
  .ciac-ro-lead,
  .ciac-hp-lead,
  .ciac-contact-lead {
    font-size: 1.04rem;
    line-height: 1.62;
  }
  .ciac-actions {
    gap: 10px;
  }
  .ciac-btn {
    min-height: 48px;
    padding-inline: 20px;
  }
  .ciac-card,
  .ciac-project,
  .ciac-contact-card,
  .ciac-axis-card,
  .ciac-strategy-objective-grid article,
  .ciac-hp-area-card {
    border-radius: 20px;
  }
  .ciac-card,
  .ciac-project,
  .ciac-contact-card,
  .ciac-axis-card,
  .ciac-strategy-objective-grid article {
    padding: 22px 20px;
  }
  .ciac-card {
    min-height: auto;
  }
  .ciac-card h3,
  .ciac-project h3 {
    margin-top: 28px;
  }
  .ciac-cta-inner {
    border-radius: 24px;
  }

  /* Homepage */
  .ciac-hp-hero {
    padding-top: 66px;
  }
  .ciac-hp-hero h1 {
    font-size: clamp(2.7rem, 14vw, 4.25rem);
    line-height: .94;
  }
  .ciac-hp-hero-visual {
    min-height: 250px;
    border-radius: 28px;
  }
  .ciac-hp-hero-visual--brand {
    padding: 24px;
  }
  .ciac-hp-hero-logo {
    width: min(94%, 350px);
    max-height: 190px;
  }
  .ciac-hp-area-card {
    min-height: 250px;
    padding: 24px;
  }
  .ciac-hp-area-card h3 {
    margin-top: 30px;
  }
  .ciac-hp-feature-card {
    min-height: auto;
    padding: 26px 22px;
    border-radius: 22px;
  }
  .ciac-hp-journal-mark,
  .ciac-hp-partners-number {
    border-radius: 24px;
  }
  .ciac-hp-opportunity-links a {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 17px;
  }

  /* Team */
  .ciac-team-count {
    min-width: 0;
    width: 100%;
    max-width: 360px;
    padding: 26px;
  }
  .ciac-team-count strong {
    font-size: clamp(4rem, 22vw, 6.5rem);
  }
  .ciac-team-filters {
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .ciac-member-card {
    border-radius: 20px;
  }

  /* Working groups */
  .ciac-workgroup-card {
    border-radius: 22px;
  }
  .ciac-workgroup-number {
    padding: 14px 20px;
  }
  .ciac-workgroup-main {
    padding: 24px 18px;
  }
  .ciac-workgroup-objectives {
    padding: 20px;
  }
  .ciac-workgroup-person {
    align-items: flex-start;
  }
  .ciac-workgroup-person img {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
  }

  /* Events/calendar */
  .ciac-calendar {
    border-radius: 20px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .ciac-calendar-weekdays,
  .ciac-calendar-days {
    min-width: 700px;
  }
  .ciac-calendar-nav a {
    min-width: 44px;
  }

  /* Research filters */
  .ciac-ro-toolbar {
    padding: 10px;
    border-radius: 16px;
  }
  .ciac-ro-toolbar input,
  .ciac-ro-toolbar select {
    min-height: 48px;
  }

  /* Footer */
  .ciac-site-footer {
    padding-top: 48px;
  }
  .ciac-footer-main {
    gap: 36px;
    padding-bottom: 36px;
  }
  .ciac-footer-social a {
    width: 46px;
    height: 46px;
  }
}

/* Narrow phones (roughly 360–480 px). */
@media (max-width: 480px) {
  .ciac-container,
  .ciac-team-directory .ciac-container {
    width: min(calc(100% - 24px), var(--ciac-max));
  }
  .ciac-header-inner {
    min-height: 66px;
  }
  .ciac-header-brand img.ciac-header-logo--compact {
    width: 82px;
    max-height: 38px;
  }
  .ciac-header-nav-wrap {
    max-height: calc(100dvh - 66px);
    padding-inline: 14px;
  }
  body.admin-bar .ciac-header-nav-wrap {
    max-height: calc(100dvh - 112px);
  }
  .ciac-section {
    padding: 52px 0;
  }
  .ciac-about-hero,
  .ciac-strategy-hero,
  .ciac-team-hero,
  .ciac-ro-hero,
  .ciac-workgroups-hero,
  .ciac-events-hero,
  .ciac-contact-hero,
  .ciac-opp-hero,
  .ciac-news-hero,
  .ciac-partnerships-hero,
  .ciac-hp-hero {
    padding-top: 58px;
    padding-bottom: 50px;
  }
  .ciac-about-hero h1,
  .ciac-strategy-hero h1,
  .ciac-team-hero h1,
  .ciac-ro-hero h1,
  .ciac-workgroups-hero h1,
  .ciac-events-hero h1,
  .ciac-contact-hero h1,
  .ciac-hp-hero h1,
  .ciac-standard-hero h1 {
    font-size: clamp(2.45rem, 13vw, 3.65rem);
    letter-spacing: -.045em;
  }
  .ciac-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .ciac-actions .ciac-btn {
    width: 100%;
  }
  .ciac-hp-hero-visual {
    min-height: 220px;
  }
  .ciac-hp-journal-mark {
    min-height: 210px;
    padding: 24px 20px;
  }
  .ciac-hp-live-col,
  .ciac-intern-form-wrap,
  .ciac-join-form-card {
    padding: 20px 16px;
  }
  .ciac-hp-live-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .ciac-hp-event-item {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 12px;
  }
  .ciac-hp-date {
    width: 50px;
    height: 58px;
  }
  .ciac-hp-opportunity-links a {
    grid-template-columns: 1fr auto;
  }
  .ciac-hp-opportunity-links a > span {
    grid-column: 1 / -1;
  }
  .ciac-footer-logo-grid .ciac-logo-ciac,
  .ciac-footer-logo-grid .ciac-logo-fct,
  .ciac-footer-logo-grid .ciac-logo-uni {
    width: min(100%, 250px);
  }
  .ciac-footer-funding p {
    font-size: .78rem;
  }
  .ciac-calendar-weekdays,
  .ciac-calendar-days {
    min-width: 630px;
  }
}

/* Landscape phones/tablets: keep the opened menu usable. */
@media (max-width: 980px) and (max-height: 560px) and (orientation: landscape) {
  .ciac-header-nav-wrap {
    max-height: calc(100dvh - 64px);
  }
  body.admin-bar .ciac-header-nav-wrap {
    max-height: calc(100dvh - 96px);
  }
}

/* Respect motion preferences for the mobile menu as well. */
@media (prefers-reduced-motion: reduce) {
  .ciac-menu-toggle span:not(.screen-reader-text) {
    transition: none !important;
  }
}
