/**
 * Support Details Section Styles
 * 
 * Component: components/support/support-details/
 * Loader: smart-support-loader.php
 * Dependencies: site-grid-rails.css (layout), style.css (colors/fonts)
 * 
 * Features:
 * - Two-column responsive layout (content + donation form)
 * - Direct image tags for icons (Cloudflare CDN friendly)
 * - Highlight link effects with gradient backgrounds
 * - Iframe container with loading states and CLS prevention
 * - Responsive font sizing with clamp()
 * - Mobile-first responsive design
 */

/* Highlight link styles */
.highlight {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 50%, #C6D62B7A 50%);
    text-decoration: none;
    transition: all 0.3s ease;
}

.highlight:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 50%, #C6D62B7A 50%);
    text-decoration: underline;
}

.support-details {
  background-color: var(--ica-bg);
  padding: var(--global-padding-desktop) 0;
  /* Core Web Vitals optimizations */
  contain: layout style;
  will-change: auto;
}

/* Content container now uses section__inner--wide from site-grid-rails.css */

/* Two Column Layout - 60/40 */
.support-details__columns {
  display: grid;
  grid-template-columns: 1fr 0.67fr;
  gap: 3rem;
  align-items: start;
}

/* Left Column - Content (60%) */
.support-details__content-column {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  order: 1;
}

/* Right Column - Donation Form (40%) */
.support-details__form-column {
  position: sticky;
  top: 2rem;
  order: 2;
  display: flex;
  flex-direction: column;
}

/* CLS Prevention: Fixed height iframe container */
.support-details__iframe-container {
  width: 100%;
  height: 700px; /* Fixed height to prevent CLS */
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(30, 49, 47, 0.1);
  position: relative;
  contain: layout style paint;
  will-change: auto;
}

/* Loading placeholder */
.support-details__iframe-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--ica-bg);
  border-radius: 8px;
  z-index: 1;
}

.support-details__loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--ica-mint);
  border-top: 3px solid var(--ica-green-deep);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.support-details__iframe-loading p {
  font-family: var(--font-body);
  color: var(--ica-green-deep);
  font-size: 14px;
  margin: 0;
}

.support-details__form-column iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  /* CLS Prevention */
  contain: layout style;
}

/* Section Styling */
.support-details__section {
  margin-bottom: 0;
}

/* "Your Support Will Provide" heading - Termina, responsive font size */
.support-details__section:first-child h2 {
  font-family: var(--font-ui) !important;
  color: var(--ica-green-deep);
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  background-color: #ffffff;
  padding: 0.5rem 1rem;
  display: inline-block;
}

/* "How to Give" and "Our Impact" headings - IvyPresto Display, responsive font size */
.support-details__section:not(:first-child) h2 {
  font-family: var(--font-heading);
  color: var(--ica-green-deep);
  font-size: clamp(40px, 8vw, 45px);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  text-align: left;
}

/* List Styling */
.support-details__list {
  font-family: var(--font-body);
  color: var(--ica-green-deep);
  padding-left: 0;
  list-style: none;
  margin: 0;
}

/* List items - Roboto Condensed, responsive font size */
.support-details__list--done li,
.support-details__list--check li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: clamp(16px, 4vw, 20px);
}

/* "Our Impact" list items - Roboto Condensed, responsive font size */
.support-details__section:last-child .support-details__list--done li {
  font-size: clamp(18px, 3.5vw, 20px);
}

/* List icon styling for direct img tags */
.support-details__list-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

/* Highlight link styles are handled by .highlight class (used in template) */

/* Tax Information - Roboto Condensed, responsive font size */
.support-details__tax-info {
  font-family: var(--font-body);
  color: var(--ica-green-deep);
  font-size: clamp(16px, 4vw, 20px);
  font-style: italic;
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: var(--ica-mint);
  border-radius: 4px;
  border-left: 4px solid var(--ica-teal);
}

/* Impact Introduction - Termina, responsive font size */
.support-details__impact-intro {
  font-family: var(--font-ui);
  color: var(--ica-green-deep);
  font-size: clamp(12px, 2vw, 15px);
  line-height: 1.6;
  text-align: justify;
  margin-bottom: 1.5rem;
  font-weight: 500;
  letter-spacing: 1px;
}

/* Call to Action Button */
.support-details__cta {
  margin-top: 2rem;
}

/* Base Button Styles */
.support-details__button {
  font-family: var(--font-ui);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--ica-green-deep);
  padding: 1rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all 250ms ease;
}

/* Default Button (inline) */
.support-details__button:not(.support-details__button--annual-report) {
  display: inline-block;
  background-color: var(--ica-lime);
  font-size: 1rem;
}

.support-details__button:not(.support-details__button--annual-report):hover {
  background-color: white;
  color: var(--ica-green-deep);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Annual Report Button with Waterfall Icon */
.support-details__button--annual-report {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  background-color: var(--ica-lavender);
  fill: var(--ica-green-deep);
  font-size: 15px;
  box-sizing: border-box;
}

.support-details__button--annual-report:hover,
.support-details__button--annual-report:active {
  background-color: var(--ica-lime);
  color: var(--ica-green-deep);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.support-details__button-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.support-details__button-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.support-details__button-text {
  white-space: nowrap;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .support-details__columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .support-details__form-column {
    position: static;
    order: 2;
    height: 600px; /* Fixed height for mobile */
  }
  
  .support-details__iframe-container {
    height: 600px; /* Fixed height for mobile */
  }
  
  .support-details__content-column {
    gap: 2rem;
  }
  
  /* "How to Give" and "Our Impact" headings - center aligned on mobile */
  .support-details__section:not(:first-child) h2 {
    text-align: center;
  }
  
  /* Font sizes are handled by clamp() - no overrides needed */
  
  /* List items - margin adjustment for mobile */
  .support-details__list--done li,
  .support-details__list--check li {
    margin-bottom: 0.75rem;
  }
  
  /* Tax info - padding adjustment for mobile */
  .support-details__tax-info {
    padding: 0.75rem;
  }
  
  /* Font sizes are handled by clamp() - no overrides needed */
  .support-details__button {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .support-details {
    padding: var(--global-padding-mobile) 0 !important;
  }
  
  .support-details__columns {
    gap: 1.5rem;
  }
  
  .support-details__form-column {
    height: 500px; /* Fixed height for small mobile */
  }
  
  .support-details__iframe-container {
    height: 500px; /* Fixed height for small mobile */
  }
  
  .support-details__content-column {
    gap: 1.5rem;
  }
  
  /* Font sizes are handled by clamp() - no additional mobile rules needed */
  /* Icon sizes remain consistent with base styles */
  
  .support-details__button {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
  }
}
