/* =========================================================
   KIRA GLOBAL RESPONSIVE LAYER
   Applies to all public website pages.
   ========================================================= */

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.container {
  width: min(calc(100% - 32px), 1480px);
}

/* Prevent grid and flex children from forcing horizontal overflow. */

.nav-shell,
.hero-grid,
.content-grid,
.footer-grid,
.feature-grid,
.events-top-grid,
.upcoming-grid,
.catalogue-grid,
.journey-actions,
.pro-hero-grid,
.pro-card-grid,
.pro-step-grid,
.legal-layout {
  min-width: 0;
}

.nav-shell > *,
.hero-grid > *,
.content-grid > *,
.footer-grid > *,
.feature-grid > *,
.events-top-grid > *,
.upcoming-grid > *,
.catalogue-grid > *,
.journey-actions > *,
.pro-hero-grid > *,
.pro-card-grid > *,
.pro-step-grid > *,
.legal-layout > * {
  min-width: 0;
}

/* =========================================================
   NAVIGATION
   ========================================================= */

.menu-toggle {
  display: none;
}

@media (max-width: 1180px) {
  .nav-shell {
    grid-template-columns: 190px 1fr auto;
    gap: 14px;
  }

  .logo img {
    width: 172px;
  }

  .primary-nav {
    gap: 13px;
  }

  .nav-link,
  .nav-button,
  .language-control,
  .nav-actions .button {
    font-size: 0.82rem;
  }

  .nav-actions .button {
    padding-inline: 12px;
  }
}

@media (max-width: 980px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 2000;
  }

  .nav-shell {
    min-height: 68px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .logo img {
    width: 165px;
  }

  .menu-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 2px solid #208d4b;
    border-radius: 10px;
    color: #07563a;
    background: #ffffff;
    font-size: 1.25rem;
  }

  .nav-actions {
    display: none;
  }

  .primary-nav {
    display: none;
  }

  .primary-nav.mobile-visible {
    position: fixed;
    top: 68px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1999;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    overflow-y: auto;
    padding: 16px 20px 32px;
    background: #f8fdf9;
    box-shadow: 0 20px 40px rgba(4, 62, 45, 0.16);
  }

  .primary-nav.mobile-visible .nav-link,
  .primary-nav.mobile-visible .nav-button {
    width: 100%;
    padding: 15px 5px;
    border-bottom: 1px solid #d1e5d8;
    text-align: left;
    font-size: 0.95rem;
  }

  .primary-nav.mobile-visible::after {
    content: "Sign In   •   Create an Event";
    display: block;
    margin-top: 18px;
    padding: 13px 15px;
    border: 2px solid #168f45;
    border-radius: 10px;
    color: #ffffff;
    background: #168f45;
    text-align: center;
    font-weight: 700;
  }
}

/* =========================================================
   HOMEPAGE HERO
   ========================================================= */

@media (max-width: 980px) {
  .hero {
    min-height: auto;
  }

  .hero-grid {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 18px;
  }

  .hero-copy {
    max-width: none;
    padding: 18px 0 20px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.25rem, 8vw, 3.6rem);
    line-height: 1.02;
  }

  .hero-description {
    max-width: 620px;
    font-size: 0.95rem;
  }

  .ai-search {
    width: 100%;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-visual {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    min-height: 350px;
  }

  .hero-image-card {
    position: relative;
    inset: auto;
    min-height: 330px;
    border-radius: 24px;
    background-position: center top;
  }

  .trust-panel {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    min-width: 0;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-visual {
    min-height: 310px;
  }

  .hero-image-card {
    min-height: 290px;
  }

  .trust-panel {
    padding: 8px;
    font-size: 0.72rem;
  }

  .trust-item {
    min-height: 40px;
    padding: 7px;
  }

  .trust-icon {
    width: 28px;
    height: 28px;
  }
}

/* =========================================================
   HOMEPAGE FEATURE CARDS
   ========================================================= */

@media (max-width: 1100px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 245px;
  }

  .cta-bar {
    grid-template-columns: 1fr;
    gap: 14px;
    text-align: center;
  }

  .concierge-link {
    justify-content: center;
    padding: 14px 0 0;
    border-top: 1px solid #b7d9c2;
    border-left: 0;
  }
}

/* =========================================================
   EVENTS PAGE
   ========================================================= */

@media (max-width: 1050px) {
  .events-page .events-top-grid {
    grid-template-columns: 1fr;
  }

  .events-page .upcoming-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .events-page .catalogue-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .events-page .events-top-trio {
    padding: 10px 0;
  }

  .events-page .top-tile {
    min-height: 0;
    padding: 14px;
  }

  .events-page .top-tile--action {
    display: grid;
    grid-template-columns: 58px 1fr;
  }

  .events-page .top-icon {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    font-size: 1.25rem;
  }

  .events-page .top-tile--intro h1 {
    font-size: 1.2rem;
  }

  .events-page .upcoming-grid {
    grid-template-columns: 1fr;
  }

  .events-page .event-image {
    height: 190px;
  }

  .events-page .catalogue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .events-page .journey-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .events-page .top-tile--action {
    grid-template-columns: 1fr;
  }

  .events-page .catalogue-grid {
    grid-template-columns: 1fr;
  }

  .events-page .catalogue-item {
    min-height: 54px;
  }

  .events-page .events-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* =========================================================
   STANDARD INNER PAGES
   ========================================================= */

@media (max-width: 980px) {
  .content-hero {
    padding: 38px 0 30px;
  }

  .content-hero h1 {
    font-size: clamp(1.75rem, 6vw, 3rem);
  }

  .content-hero p {
    font-size: 0.95rem;
  }

  .content-section {
    padding: 34px 0 45px;
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .content-hero {
    padding: 25px 0 22px;
  }

  .content-hero h1 {
    font-size: 1.65rem;
  }

  .content-hero p {
    font-size: 0.88rem;
  }

  .content-section {
    padding: 24px 0 30px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .content-card {
    min-height: 0;
    padding: 18px;
  }
}

/* =========================================================
   PROFESSIONAL PAGE CLASSES, WHERE PRESENT
   ========================================================= */

@media (max-width: 900px) {
  .pro-hero-grid {
    grid-template-columns: 1fr;
  }

  .pro-hero-image img {
    height: 280px;
  }

  .pro-intro-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .pro-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pro-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pro-cta-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .pro-card-grid,
  .pro-step-grid {
    grid-template-columns: 1fr;
  }

  .pro-hero-image img {
    height: 220px;
  }
}

/* =========================================================
   LEGAL PAGES
   ========================================================= */

@media (max-width: 850px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .legal-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 7px;
    scrollbar-width: thin;
  }

  .legal-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    border: 1px solid #cee2d5;
    background: #ffffff;
  }
}

/* =========================================================
   TABLES AND DATA AREAS
   ========================================================= */

table {
  width: 100%;
  border-collapse: collapse;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 700px) {
  table {
    min-width: 640px;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */

@media (max-width: 1050px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  .site-footer {
    padding-top: 24px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 18px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }

  .footer-bottom .language-footer {
    justify-self: center;
  }
}

@media (max-width: 420px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: auto;
  }
}

/* =========================================================
   SMALL MOBILE DEVICES
   ========================================================= */

@media (max-width: 480px) {
  .container {
    width: min(calc(100% - 20px), 1480px);
  }

  .button,
  .small-button {
    min-height: 40px;
  }

  .nav-shell {
    min-height: 62px;
  }

  .primary-nav.mobile-visible {
    top: 62px;
  }

  .logo img {
    width: 145px;
  }
}

/* ===== Mobile navigation overlay correction ===== */

@media (max-width: 980px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10000;
    isolation: isolate;
  }

  .nav-shell {
    position: relative;
    z-index: 10002;
    background: #ffffff;
  }

  .menu-toggle {
    position: relative;
    z-index: 10003;
  }

  .primary-nav.mobile-visible {
    position: fixed !important;
    top: 68px !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;

    z-index: 10001 !important;

    display: flex !important;
    flex-direction: column;
    align-items: stretch;

    width: 100vw;
    height: calc(100dvh - 68px);
    max-height: calc(100dvh - 68px);

    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    padding: 18px 20px 36px;

    background: #f7fcf8 !important;
    opacity: 1 !important;
    box-shadow: 0 18px 40px rgba(4, 62, 45, 0.22);
  }

  body.menu-open {
    overflow: hidden;
    touch-action: none;
  }

  body.menu-open main,
  body.menu-open .site-footer {
    pointer-events: none;
  }
}

@media (max-width: 480px) {
  .primary-nav.mobile-visible {
    top: 62px !important;
    height: calc(100dvh - 62px);
    max-height: calc(100dvh - 62px);
  }
}

/* =========================================================
   DEFINITIVE FULL-SCREEN MOBILE MENU OVERLAY
   ========================================================= */

@media (max-width: 980px) {

  /* Eliminate stacking contexts that may cover the navigation. */
  html,
  body,
  .site-header,
  .nav-shell,
  .primary-nav {
    transform: none !important;
    filter: none !important;
    perspective: none !important;
  }

  .site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 2147483646 !important;
    isolation: auto !important;
  }

  /* When the menu is open, the complete header becomes a viewport overlay. */
  body.menu-open .site-header {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    z-index: 2147483647 !important;
    background: #ffffff !important;
  }

  body.menu-open .nav-shell {
    position: relative !important;
    width: 100% !important;
    height: 68px !important;
    min-height: 68px !important;
    z-index: 3 !important;
    background: #ffffff !important;
    border-bottom: 1px solid #b8d8c1 !important;
  }

  body.menu-open .menu-toggle {
    position: relative !important;
    z-index: 5 !important;
  }

  body.menu-open .primary-nav.mobile-visible {
    position: absolute !important;
    top: 68px !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;

    z-index: 4 !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;

    width: 100% !important;
    height: calc(100dvh - 68px) !important;
    max-height: calc(100dvh - 68px) !important;

    margin: 0 !important;
    padding: 18px 20px 36px !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;

    opacity: 1 !important;
    visibility: visible !important;

    background: #f4faf6 !important;
    box-shadow: none !important;
  }

  body.menu-open .primary-nav.mobile-visible .nav-link,
  body.menu-open .primary-nav.mobile-visible .nav-button {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    padding: 15px 6px !important;
    border-bottom: 1px solid #bed9c6 !important;
    color: #073f31 !important;
    background: transparent !important;
    text-align: left !important;
    font-size: 0.96rem !important;
    font-weight: 700 !important;
  }

  /* Underlying page cannot appear above or interact with the overlay. */
  body.menu-open main,
  body.menu-open .site-footer {
    position: relative !important;
    z-index: -1 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.menu-open {
    width: 100% !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }
}

@media (max-width: 480px) {
  body.menu-open .nav-shell {
    height: 62px !important;
    min-height: 62px !important;
  }

  body.menu-open .primary-nav.mobile-visible {
    top: 62px !important;
    height: calc(100dvh - 62px) !important;
    max-height: calc(100dvh - 62px) !important;
  }
}

/* Remove obsolete malformed homepage hero search control. */
body.home-page .ai-search,
body.home-page .hero-search,
.home-page .ai-search,
.home-page .hero-search {
  display: none !important;
}
