
/* ==========================================================
   ICAP 2027 - Universal Responsive Frontend
   Optimized for phones, iPhone/iPad, tablets and laptops.
   This file only changes presentation/layout; conference
   content and backend functionality remain unchanged.
   ========================================================== */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; }
body { width: 100%; max-width: 100%; overflow-x: hidden; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }

/* Better keyboard/touch accessibility */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(13,110,79,.28);
  outline-offset: 2px;
}

/* Navigation: desktop remains unchanged; mobile gets a compact menu. */
.nav-mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(13,110,79,.18);
  border-radius: 8px;
  background: #fff;
  color: #0D6E4F;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nav-mobile-toggle span,
.nav-mobile-toggle span::before,
.nav-mobile-toggle span::after {
  display: block;
  width: 21px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-mobile-toggle span { position: relative; }
.nav-mobile-toggle span::before,
.nav-mobile-toggle span::after { content: ''; position: absolute; left: 0; }
.nav-mobile-toggle span::before { top: -7px; }
.nav-mobile-toggle span::after { top: 7px; }
.nav-mobile-toggle[aria-expanded="true"] span { background: transparent; }
.nav-mobile-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-mobile-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

/* Prevent long conference names/URLs from breaking the layout. */
.nav-logo, .nav-logo img, .nav-links, .nav-links li, .nav-links a { min-width: 0; }
.nav-logo img { max-width: min(170px, 45vw) !important; max-height: 52px !important; object-fit: contain; }

/* Forms */
input, select, textarea { max-width: 100%; }
input[type="file"] { width: 100%; }

/* Tables and embedded content should never force desktop width. */
table { max-width: 100%; }
.table-responsive, .responsive-table { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Flash messages */
#flash-messages { left: 16px !important; right: 16px !important; top: 16px !important; max-width: none !important; width: auto !important; }
#flash-messages > div { width: 100%; }

/* ==========================================================
   TABLETS / SMALL LAPTOPS
   ========================================================== */
@media (max-width: 1000px) {
  nav {
    padding-left: clamp(16px, 3vw, 28px) !important;
    padding-right: clamp(16px, 3vw, 28px) !important;
  }

  .nav-links { gap: clamp(.65rem, 1.8vw, 1.25rem); }
  .nav-links a { white-space: nowrap; }

  .container { width: min(100%, 1100px); }
  section { padding-left: clamp(20px, 4vw, 48px); padding-right: clamp(20px, 4vw, 48px); }

  .hero-content { gap: clamp(2rem, 5vw, 4rem); }
  .hero h1 { font-size: clamp(2.3rem, 5vw, 3.2rem); }

  .committee-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================
   PHONES / iPHONE / SMALL TABLETS
   ========================================================== */
@media (max-width: 767px) {
  body { font-size: 14px; }

  /* Keep the navigation in normal flow on small screens so it can
     expand without covering page content. */
  nav {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    height: auto !important;
    min-height: 68px;
    padding: 10px 14px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
  }

  .nav-logo { flex: 1 1 auto; max-width: calc(100% - 58px); }
  .nav-logo img { max-width: min(170px, 58vw) !important; max-height: 46px !important; }

  .nav-mobile-toggle { display: inline-flex; }

  .nav-links {
    display: none !important;
    width: 100%;
    flex: 0 0 100%;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 3px !important;
    margin: 4px 0 0 !important;
    padding: 8px 0 2px !important;
    border-top: 1px solid rgba(13,110,79,.10);
  }

  nav.nav-menu-open .nav-links { display: flex !important; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: flex !important;
    align-items: center;
    min-height: 44px;
    width: 100%;
    padding: 10px 12px !important;
    border-radius: 7px;
    font-size: .86rem !important;
    letter-spacing: .03em !important;
  }
  .nav-links a:hover { background: rgba(13,110,79,.06); }
  .nav-links .nav-cta { justify-content: center; margin-top: 4px; }

  /* Page spacing after the sticky navigation. */
  .hero { margin-top: 0 !important; min-height: auto !important; padding: 4rem 1.1rem 3rem !important; }
  .hero-content { grid-template-columns: 1fr !important; gap: 2.2rem !important; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.8rem) !important; line-height: 1.16; overflow-wrap: anywhere; }
  .hero-badge { font-size: .64rem; letter-spacing: .11em; max-width: 100%; }
  .hero-theme { margin-bottom: 1.7rem; }
  .hero-btns { display: grid !important; grid-template-columns: 1fr !important; gap: .7rem !important; }
  .hero-btns a { width: 100%; text-align: center; }

  .countdown-box { padding: 1.15rem !important; }
  .countdown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .8rem !important; }
  .countdown-num { font-size: clamp(1.6rem, 8vw, 2rem) !important; }
  .info-cards { grid-template-columns: 1fr !important; }

  section { padding: 3.4rem 1.1rem !important; }
  .container { width: 100% !important; max-width: 100% !important; }
  .section-title { font-size: clamp(1.85rem, 8vw, 2.4rem) !important; overflow-wrap: anywhere; }
  .section-eyebrow { font-size: .66rem; letter-spacing: .14em; }

  .welcome-grid { grid-template-columns: 1fr !important; gap: 2rem !important; }
  .welcome-highlights { gap: 1rem !important; }
  .topics-grid, .committee-grid, .reg-grid, .docs {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .topic-card { width: 100%; text-align: left; }

  /* Existing inline two-column highlight grids become one column. */
  .welcome-highlights > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* Buttons and cards become easy to tap. */
  .btn, .btn-primary, .btn-outline, .btn-secondary,
  .btn-white, .btn-white-outline { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

  /* Registration/payment blocks */
  .reg-card { width: 100%; }
  .reg-price { font-size: clamp(2rem, 9vw, 3rem); }

  /* Technical programme */
  main { padding: 3.5rem 1.1rem 3rem !important; }
  .intro { max-width: 100% !important; }
  .card { min-width: 0; padding: 1.2rem !important; }
  .preview { height: 150px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1 1 120px; }

  /* Forms: 16px prevents iOS Safari auto-zoom when focusing fields. */
  form .grid { grid-template-columns: 1fr !important; }
  input, select, textarea { width: 100% !important; min-height: 44px; font-size: 16px !important; }
  textarea { min-height: 110px; }
  button, .submit-btn { min-height: 44px; }
  .captcha-row { width: 100%; }
  .captcha-row input { max-width: none !important; }
  .captcha-refresh { min-height: 44px; }

  /* Modals */
  .topic-modal-content { width: calc(100vw - 28px) !important; max-width: none !important; max-height: 85vh; overflow-y: auto; padding: 1.25rem !important; }

  footer { padding: 2.2rem 1.1rem 1.2rem !important; }
  .footer-grid { grid-template-columns: 1fr !important; gap: 1.4rem !important; }
  .footer-bottom { flex-direction: column !important; text-align: center !important; gap: .45rem !important; line-height: 1.5; }

  /* Brochure standalone page */
  .container { margin-left: auto !important; margin-right: auto !important; }
  header h1 { font-size: clamp(1.6rem, 7vw, 2.3rem); line-height: 1.2; }
}

/* ==========================================================
   VERY SMALL PHONES (including narrow iPhone widths)
   ========================================================== */
@media (max-width: 420px) {
  nav { padding-left: 10px !important; padding-right: 10px !important; }
  .nav-logo img { max-width: 58vw !important; }
  .hero { padding-left: .9rem !important; padding-right: .9rem !important; }
  section, main { padding-left: .9rem !important; padding-right: .9rem !important; }
  .countdown-grid { gap: .55rem !important; }
  .countdown-box { padding: .9rem !important; }
  .highlight-card, .reg-card, .card { padding: 1rem !important; }
  .actions .btn { flex-basis: 100%; }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Dropdown navigation for Speakers and Information */
.nav-dropdown{position:relative}
.nav-dropdown>a{display:flex;align-items:center;gap:.3rem}
.nav-submenu{display:none;position:absolute;top:100%;left:0;min-width:230px;background:#fff;border:1px solid rgba(13,110,79,.12);box-shadow:0 10px 25px rgba(0,0,0,.12);padding:.45rem 0;list-style:none;z-index:1200}
.nav-dropdown:hover>.nav-submenu,.nav-dropdown:focus-within>.nav-submenu{display:block}
.nav-submenu li{margin:0!important}
.nav-submenu a{display:block!important;padding:.65rem 1rem!important;white-space:nowrap;text-transform:none!important;letter-spacing:0!important;font-size:.85rem!important;color:#1A1A1A!important}
.nav-submenu a:hover{background:#E8F5F0;color:#0D6E4F!important}
@media(max-width:767px){.nav-dropdown>a{justify-content:space-between}.nav-submenu{position:static;display:none;box-shadow:none;border:0;border-left:2px solid rgba(13,110,79,.18);margin:.2rem 0 .3rem 1rem;padding:0;background:rgba(13,110,79,.025)}.nav-dropdown:hover>.nav-submenu{display:none}nav.nav-menu-open .nav-dropdown:focus-within>.nav-submenu,nav.nav-menu-open .nav-dropdown:has(>a:focus)>.nav-submenu{display:block}.nav-submenu a{min-height:40px!important;padding:8px 12px!important}}


/* Requested conference-wide visual adjustments: styling only. */
footer { background-color: #FDE2E2 !important; background-image: none !important; }
.nav-cta { background: #F4B6B6 !important; color: #5A1E1E !important; }
.nav-cta:hover { background: #EEA0A0 !important; color: #5A1E1E !important; }

/* Final conference-wide footer styling */
footer, .site-footer { background:#E54746 !important; background-image:none !important; color:#000 !important; }
footer *, .site-footer * { color:#000 !important; }
footer a, .site-footer a { color:#000 !important; text-decoration:none; }
footer a:hover, .site-footer a:hover { color:#000 !important; opacity:.75; }

/* Uniform red theme across responsive navigation and calls to action */
.nav-submenu a:hover{background:#FDE2E2!important;color:#C93635!important}
.nav-cta,.nav-cta:hover{background:#E54746!important;color:#fff!important}
