/* Footer No-Wrap Guarantee */
/* Ensures ICP and copyright info never breaks across lines */

/* Primary no-wrap enforcement */
.icp-footer {
  /* Prevent any wrapping at container level */
  white-space: nowrap;
  overflow-x: auto; /* Allow horizontal scroll if absolutely necessary */
  overflow-y: hidden;
  
  /* Ensure container can accommodate content */
  min-width: 100%;
  box-sizing: border-box;
}

.icp-footer .container {
  /* Reinforce no-wrap at container level */
  white-space: nowrap;
  display: flex;
  justify-content: center;
  align-items: center;
  
  /* Allow container to expand if needed */
  width: auto;
  max-width: none;
}

.icp-link {
  /* Triple-layer protection against text wrapping */
  white-space: nowrap !important;
  word-break: keep-all !important;
  word-wrap: normal !important;
  
  /* Prevent any text breaking mechanisms */
  hyphens: none;
  overflow-wrap: normal;
  
  /* Ensure inline display for proper nowrap behavior */
  display: inline;
  
  /* Text should never be clipped */
  text-overflow: visible;
  overflow: visible;
}

/* Extra protection for extreme screen sizes */
@media (max-width: 320px) {
  /* iPhone 5/SE and similar ultra-narrow screens */
  .icp-footer {
    font-size: clamp(10px, 2.5vw, 14px); /* Dynamic font scaling */
    padding: var(--space-1) var(--space-2);
  }
  
  .icp-link {
    /* Reduce padding to save space but maintain readability */
    padding: var(--space-1);
  }
  
  .icp-link::after {
    /* Hide external link indicator on tiny screens to save space */
    display: none;
  }
}

/* Extreme width protection */
@media (max-width: 280px) {
  /* For extremely narrow screens (rare but possible) */
  .icp-footer {
    font-size: 10px; /* Absolute minimum readable size */
    line-height: 1.2;
  }
  
  .footer {
    padding: 0 var(--space-1) var(--space-1); /* Minimal padding */
  }
}

/* Landscape phone optimization */
@media (max-height: 400px) and (orientation: landscape) {
  .icp-footer {
    font-size: var(--font-size-xs); /* Smaller in landscape */
    line-height: 1;
  }
  
  .icp-link {
    padding: 2px 4px; /* Minimal padding for landscape */
  }
}

/* High-resolution display optimization */
@media (-webkit-min-device-pixel-ratio: 2) {
  .icp-link {
    /* Ensure crisp text rendering on high-DPI displays */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Debug helper for testing (remove in production) */
.debug-footer-wrap .icp-footer {
  border: 1px dashed red;
  background: rgba(255, 0, 0, 0.1);
}

.debug-footer-wrap .icp-link {
  border: 1px dashed blue;
  background: rgba(0, 0, 255, 0.1);
}

/* Accessibility: Ensure text remains readable */
@media (prefers-contrast: high) {
  .icp-link {
    color: var(--color-text-primary);
    text-shadow: none; /* Remove shadow for better contrast */
  }
}

/* Reduced motion: Remove transitions if user prefers */
@media (prefers-reduced-motion: reduce) {
  .icp-link {
    transition: none;
  }
  
  .icp-link::after {
    transition: none;
  }
}
