/* ==========================================================
   ICPHAi Macao 2026 — Global Responsive Styles
   Targets: 1440 / 1200 / 1024 / 900 / 768 / 480 / 390 / 360
   ========================================================== */

/* ── OVERFLOW PREVENTION ── */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
*, *::before, *::after {
  box-sizing: border-box;
}

/* ── OVERFLOW SAFETY on major containers ──
   NOTE: Do NOT add overflow:hidden to the masthead or any nav ancestor.
   Overflow-x:hidden on nav containers clips absolutely-positioned
   dropdown sub-menus. Only apply it to content blocks below the header. */
.ast-article-single,
.entry-content,
.site-content,
.site-footer {
  max-width: 100%;
  overflow-x: hidden;
}
/* ast-container inside the header must stay visible for dropdowns;
   ast-container inside content areas is fine to clip horizontally */
.site-content .ast-container,
.site-footer .ast-container {
  max-width: 100%;
  overflow-x: hidden;
}

/* ==========================================================
   HOMEPAGE CONTENT — Two-column responsive grid
   ========================================================== */

/* Cancel Astra auto-centering that can decouple blocks */
.icphai-entry-content {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 100% !important;
}

.icphai-article-inner {
  width: 100%;
}

/* Two-column grid: heading left (~28%), content right (~72%) */
.icphai-intro-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(0, 1.7fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: start;
  width: 100%;
}

.icphai-intro-heading,
.icphai-intro-content {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.icphai-intro-heading {
  align-self: start;
}

/* Section headings — yellow bar rendered via ::after so it always
   sits BELOW the last line of text, even when the heading wraps.
   Never use text-decoration here: it crosses through multi-line text. */
.icphai-section-heading {
  font-size: 1.4375rem;
  font-weight: 900;
  line-height: 1.4em;
  color: #ffffff;
  text-decoration: none;          /* remove any inherited underline  */
  display: block;                 /* ensure width is calculated correctly */
  margin: 0 0 1.5rem 0;          /* space below heading + bar combined */
  padding-bottom: 0;              /* bar is separate, not padding-based */
}

/* Yellow decorative bar — always rendered after the full heading block */
.icphai-section-heading::after {
  content: "";
  display: block;
  width: min(100%, 300px);
  height: 5px;
  background: #F5B70A;
  margin-top: 10px;               /* gap between last text line and bar */
  border-radius: 2px;
}

/* Section spacing */
.icphai-section {
  margin-bottom: 2.75rem;
}

/* Welcome paragraph */
.icphai-welcome-para {
  margin-bottom: 2.25rem;
  line-height: 1.7;
}

/* Small intro text above card groups */
.icphai-section-intro {
  margin: 0 0 1.25rem 0;
  opacity: 0.88;
  line-height: 1.6;
}

/* ==========================================================
   JOIN US CARD
   ========================================================== */
.icphai-joinus-card {
  background: rgba(245, 183, 10, 0.08);
  border: 1px solid rgba(245, 183, 10, 0.35);
  border-left: 4px solid #F5B70A;
  border-radius: 4px;
  padding: 1.25rem 1.4rem;
}
.icphai-joinus-date {
  font-size: 1.25rem;
  font-weight: 800;
  color: #F5B70A;
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}
.icphai-joinus-venue {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.6rem;
  line-height: 1.5;
}
.icphai-joinus-desc {
  margin: 0;
  font-size: 0.93em;
  opacity: 0.8;
  line-height: 1.6;
}

/* ==========================================================
   TRACK CARDS (Conference Themes)
   ========================================================== */
.icphai-track-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 183, 10, 0.2);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.9rem;
  transition: border-color 0.2s ease;
}
.icphai-track-card:hover {
  border-color: rgba(245, 183, 10, 0.55);
}
.icphai-track-number {
  flex-shrink: 0;
  background: #F5B70A;
  color: #013E75;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  align-self: flex-start;
  white-space: nowrap;
  margin-top: 2px;
}
.icphai-track-body {
  min-width: 0;
}
.icphai-track-title {
  margin: 0 0 0.35rem 0;
  font-weight: 700;
  font-size: 0.97em;
  color: #ffffff;
  line-height: 1.4;
}
.icphai-track-desc {
  margin: 0;
  font-size: 0.88em;
  opacity: 0.78;
  line-height: 1.55;
}

/* Generic arrow link (Themes, Organizers, etc.) */
.icphai-link-btn {
  display: inline-block;
  margin-top: 1rem;
  color: #F5B70A;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: opacity 0.2s ease;
}
.icphai-link-btn:hover {
  opacity: 0.75;
}

/* ==========================================================
   ORGANIZERS
   ========================================================== */
.icphai-org-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #F5B70A;
  margin: 0 0 0.7rem 0;
}
.icphai-org-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}
.icphai-org-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1rem 1.1rem;
}
/* Logo-only card — remove extra padding since logo-wrap fills it */
.icphai-org-card--logo-only {
  padding: 0;
  background: transparent;
  border: none;
}
.icphai-org-logo-wrap {
  background: #fff;
  border-radius: 6px;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  width: 100%;
}
.icphai-org-logo {
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
  display: block;
}
/* Supporting org cards: 2-per-row then 4 on wider screens */
.icphai-org-cards--supporting {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px) {
  .icphai-org-cards--supporting {
    grid-template-columns: repeat(4, 1fr);
  }
}
.icphai-org-name {
  margin: 0 0 0.3rem 0;
  font-weight: 600;
  font-size: 0.9em;
  color: #ffffff;
  line-height: 1.5;
}
.icphai-org-location {
  margin: 0;
  font-size: 0.82em;
  color: rgba(255,255,255,0.55);
}
.icphai-org-tbc {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 0.9rem;
  margin-bottom: 0.5rem;
}
.icphai-org-tbc p {
  margin: 0 0 0.35rem 0;
  font-size: 0.9em;
}
.icphai-tbc-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255,255,255,0.55);
  font-size: 0.8em;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15);
  vertical-align: middle;
}
.icphai-org-note {
  font-size: 0.86em;
  font-style: italic;
  opacity: 0.6;
  margin: 0;
}

/* ==========================================================
   QUICK ACCESS SIDEBAR
   ========================================================== */
.icphai-sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #F5B70A;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.icphai-sidebar-links {
  list-style: none;
  margin: 0 0 1rem 0;
  padding: 0;
}
.icphai-sidebar-links li {
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.icphai-sidebar-links li a {
  display: block;
  padding: 8px 4px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.icphai-sidebar-links li a:hover {
  color: #F5B70A;
  padding-left: 8px;
}
/* ==========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================== */

/* Tablet + mobile: stack to single column */
@media (max-width: 900px) {
  .icphai-intro-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .icphai-intro-heading,
  .icphai-section-heading {
    max-width: 100%;
  }

  .icphai-section {
    margin-bottom: 2rem;
  }

  /* Org cards: stack on mobile */
  .icphai-org-cards {
    grid-template-columns: 1fr;
  }
}

/* Small mobile: tighten spacing */
@media (max-width: 600px) {
  .icphai-track-card {
    flex-direction: column;
    gap: 0.6rem;
  }

  .icphai-section-heading {
    font-size: 1.25rem;
  }

  .icphai-section {
    margin-bottom: 1.5rem;
  }
}

/* Very small screens */
@media (max-width: 390px) {
  .icphai-section {
    margin-bottom: 1.25rem;
  }
  .icphai-joinus-date {
    font-size: 1.1rem;
  }
}

/* ==========================================================
   H1 ENTRY TITLE — override text-decoration underline from
   style_557642d57c7f.css. Use ::after block so the yellow bar
   always appears below the full heading, even when it wraps.
   ========================================================== */
h1.entry-title,
.entry-header .entry-title,
.home .entry-header .entry-title,
.post-999 .entry-title,
#post-999 .entry-title {
  text-decoration: none !important;  /* cancel the text-decoration underline */
  display: block;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

h1.entry-title::after,
.entry-header .entry-title::after,
.post-999 .entry-title::after,
#post-999 .entry-title::after {
  content: "";
  display: block;
  width: min(100%, 360px);
  height: 5px;
  background: #F5B70A;
  margin-top: 10px;
  border-radius: 2px;
}

/* Also remove text-decoration from the generic h1 rule that affects
   any other h1 on the page */
h1 {
  text-decoration: none !important;
}

/* ==========================================================
   MASTHEAD — sticky positioning
   ========================================================== */

/*
 * STACKING CONTEXT STRATEGY
 * ─────────────────────────
 * Problem: giving #masthead a z-index while it has `position: sticky`
 * creates a new stacking context. Any z-index set on children (e.g.
 * sub-menus at z-index:99999) is then relative to that context, not
 * the document root — so dropdowns that visually escape the header
 * can still be clipped by later stacking contexts (hero, page content).
 *
 * Fix: #masthead is sticky so it stays on top naturally. We give it
 * a high z-index ONLY to beat the hero/content layers below it.
 * The desktop-header wrapper must NOT create its own stacking context
 * (no transform, no filter, no isolation) so that sub-menu z-indexes
 * are resolved against the document root where they can beat everything.
 *
 * Sub-menus use `position: absolute; z-index: 99999` (from
 * style_e5887fb628b6.css) and are therefore above all page content.
 */
#masthead {
  position: sticky;
  top: 0;
  z-index: 9000;       /* beats hero (z-index:1) and page sections        */
  width: 100%;
  /* IMPORTANT: overflow must be visible so dropdowns can extend          */
  overflow: visible !important;
}

/* Desktop header wrapper — must stay overflow:visible for dropdowns */
#ast-desktop-header {
  overflow: visible !important;
}

/* Nav containers must never clip their absolutely-positioned sub-menus */
.ast-above-header-bar,
.site-above-header-wrap,
.ast-builder-grid-row,
.ast-builder-menu-1,
.main-navigation,
.main-header-menu,
.ast-nav-menu {
  overflow: visible !important;
}

/* Sub-menus: ensure they render above the hero and all page content     */
.main-header-menu .sub-menu {
  z-index: 99999 !important;
  position: absolute !important;
}

/* Hero and main page content sit below the sticky header */
.front-img,
#content,
.site-content,
.ast-article-single,
.entry-content {
  position: relative;
  z-index: 1;
}

/* ==========================================================
   MOBILE HEADER
   ========================================================== */
#icphai-mobile-header {
  position: sticky;
  top: 0;
  z-index: 9000;
  width: 100%;
}
#icphai-mobile-nav {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 9001;        /* above everything including sticky header        */
  overflow-y: auto;
  max-height: calc(100vh - 64px);
}

/* ==========================================================
   TABLET / MOBILE LAYOUT FIXES
   ========================================================== */
@media (max-width: 1023px) {
  #secondary {
    display: none !important;
  }
  #primary {
    width: 100% !important;
  }
}

/* Keep the full horizontal menu on tablets and smaller laptops. */
@media (max-width: 1200px) and (min-width: 768px) {
  .ast-builder-menu-1 .menu-item > .menu-link {
    font-size: clamp(0.66rem, 1.08vw, 0.82rem);
    padding-left: 2px;
    padding-right: clamp(4px, 0.85vw, 12px);
  }

  .ast-builder-menu-1 .ast-header-navigation-arrow svg {
    width: 14px;
    height: 10px;
  }

  .ast-builder-menu-1 .main-header-menu {
    margin-left: 4px;
    margin-right: 4px;
  }
}

/* ==========================================================
   MAIN CONTENT PADDING on small screens
   ========================================================== */
@media (max-width: 767px) {
  .ast-article-single,
  .ast-separate-container .ast-article-single {
    padding: 1.5rem 1rem !important;
  }
  .entry-content[data-ast-blocks-layout] > * {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* ==========================================================
   FOOTER
   ========================================================== */
@media (max-width: 544px) {
  .ast-builder-grid-row-container.ast-builder-grid-row-mobile-full
    .ast-builder-grid-row {
    grid-template-columns: 1fr !important;
  }
  .site-footer-section {
    border-right: none;
  }
}
@media (max-width: 767px) {
  .site-above-footer-wrap {
    padding-top: 16px;
    padding-bottom: 16px;
  }
}

/* ==========================================================
   TOUCH TARGETS
   ========================================================== */
a, button {
  -webkit-tap-highlight-color: rgba(245, 183, 10, 0.2);
}

/* ==========================================================
   SUBPAGE BODY WRAPPER (About, Themes, etc.)
   ========================================================== */
.icphai-subpage-body {
  background: #011f40;
  min-height: 60vh;
  color: #fff;
  padding: 3rem 2rem;
}
.icphai-subpage-body > div {
  max-width: 960px;
  margin: 0 auto;
}

@media (max-width: 767px) {
  .icphai-subpage-body {
    padding: 2rem 1rem;
  }
}
@media (max-width: 480px) {
  .icphai-subpage-body {
    padding: 1.5rem 0.75rem;
  }
}

/* ==========================================================
   PROGRAMME PAGE — two-column layout with sidebar
   ========================================================== */
.icphai-programme-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 2.5rem;
  align-items: start;
}
.icphai-session-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 0.7rem 1.2rem;
  align-items: center;
}

@media (max-width: 767px) {
  .icphai-programme-grid {
    grid-template-columns: 1fr;
  }
  .icphai-programme-grid > div:last-child {
    display: none;
  }
  .icphai-session-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

/* ==========================================================
   CONTACT PAGE — two-column grid
   ========================================================== */
.icphai-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 767px) {
  .icphai-contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   MASTHEAD container padding on mobile
   ========================================================== */
@media (max-width: 1023px) {
  #masthead .ast-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
