/* ==========================================================================
   SHARELY UPGRADES.CSS
   Auto-Poster Fallbacks, Safety Interstitial Modal, Light Cookie Consent,
   Responsive Google Form Portal, Collapsible SEO Knowledge Hub, & >=44px Targets
   ========================================================================== */

/* 1. Automated Domain-Branded Fallback Posters */
.poster-thumbnail-wrapper {
  position: relative;
  overflow: hidden;
  display: block;
  background: #EEF2FF;
}

.poster-thumbnail-img,
.link-poster-hero {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-thumbnail-img.is-loaded,
.link-poster-hero.is-loaded {
  animation: posterFadeIn 0.3s ease forwards;
}

@keyframes posterFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.poster-auto-fallback {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 14px;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
  user-select: none;
}

.poster-auto-fallback.is-hero {
  min-height: 260px;
  padding: 32px 24px;
  border-radius: 16px;
}

.poster-auto-fallback.is-hidden {
  display: none !important;
}

.poster-auto-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(79, 70, 229, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(79, 70, 229, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.poster-auto-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 92%;
}

.poster-auto-emblem {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid rgba(79, 70, 229, 0.16);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.poster-auto-fallback.is-hero .poster-auto-emblem {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.poster-auto-favicon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.poster-auto-fallback.is-hero .poster-auto-favicon {
  width: 34px;
  height: 34px;
}

.poster-auto-monogram {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #4F46E5;
}

.poster-auto-fallback.is-hero .poster-auto-monogram {
  font-size: 1.6rem;
}

.poster-auto-domain-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4338CA;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(79, 70, 229, 0.16);
  padding: 3px 10px;
  border-radius: 9999px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.poster-auto-title-preview {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  color: #0F172A;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.poster-auto-fallback.is-hero .poster-auto-title-preview {
  font-size: 1.15rem;
  max-width: 440px;
}

.link-poster-wrapper {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  aspect-ratio: 16 / 9;
}

.link-poster-wrapper .poster-auto-fallback.is-hero {
  height: 100%;
  min-height: 100%;
  border-radius: 0;
}

/* 2. Safety Redirect Interstitial Modal */
.safety-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.safety-modal-overlay.is-open {
  display: flex;
  animation: safetyFadeIn 0.18s ease forwards;
}

@keyframes safetyFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.safety-modal-card {
  width: 100%;
  max-width: 460px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  box-sizing: border-box;
  color: #0F172A;
}

.safety-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.safety-modal-shield {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  color: #4F46E5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.safety-modal-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4F46E5;
  margin-bottom: 2px;
}

.safety-modal-title {
  margin: 0 !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #0F172A;
  line-height: 1.2;
}

.safety-modal-close {
  margin-left: auto;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.safety-modal-close:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.safety-modal-copy {
  margin: 0 0 14px 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: #475569;
  word-break: break-word;
}

.safety-modal-domain-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.safety-modal-domain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.safety-modal-domain-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748B;
}

.safety-modal-platform-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4F46E5;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  padding: 2px 8px;
  border-radius: 9999px;
}

.safety-modal-domain-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0F172A;
  word-break: break-word;
  margin-bottom: 4px;
}

.safety-modal-full-url {
  font-size: 0.78rem;
  color: #64748B;
  word-break: break-all;
  line-height: 1.4;
}

.safety-modal-countdown-wrap {
  margin-bottom: 18px;
}

.safety-modal-countdown-text {
  font-size: 0.88rem;
  color: #334155;
  margin-bottom: 8px;
}

.safety-modal-countdown-text strong {
  color: #4F46E5;
}

.safety-modal-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: #E2E8F0;
  overflow: hidden;
}

.safety-modal-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #4F46E5 0%, #6366F1 100%);
  transition: width 3s linear;
}

.safety-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.safety-modal-btn {
  min-height: 44px !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  text-decoration: none;
}

/* 3. Light, Non-Blocking Cookie Consent Banner */
.cookie-consent-banner {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1800;
  max-width: 440px;
  width: calc(100vw - 32px);
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-top: 3px solid #4F46E5;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  padding: 14px 16px;
  box-sizing: border-box;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cookie-consent-banner.is-dismissing {
  opacity: 0;
  transform: translateY(10px);
}

.cookie-consent-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cookie-consent-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #475569;
}

.cookie-consent-copy strong {
  color: #0F172A;
  font-size: 0.9rem;
}

.cookie-consent-copy a {
  color: #4F46E5;
  font-weight: 600;
  text-decoration: underline;
}

.cookie-consent-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.cookie-btn-essential,
.cookie-btn-accept {
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 14px !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  flex: 1 1 auto;
}

@media (max-width: 640px) {
  .cookie-consent-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
    padding: 12px 14px;
  }
}

/* 4. Premium SaaS Submit Portal & Responsive No-Scrollbar Google Form */
.submit-portal-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 0 48px;
}

.submit-portal-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.submit-portal-step-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.submit-portal-step-num {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #EEF2FF;
  color: #4F46E5;
  font-weight: 800;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.submit-portal-step-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 3px;
}

.submit-portal-step-desc {
  font-size: 0.82rem;
  color: #64748B;
  line-height: 1.45;
  margin: 0;
}

.submit-saas-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-top: 4px solid #4F46E5;
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(79, 70, 229, 0.08), 0 4px 14px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  padding: 24px 20px 20px;
}

.submit-saas-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #F1F5F9;
}

.submit-saas-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: #EEF2FF;
  color: #4338CA;
  font-size: 0.78rem;
  font-weight: 700;
}

.submit-iframe-frame-wrap {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #FFFFFF;
}

.submit-google-form-iframe {
  display: block;
  width: 100%;
  border: 0;
  overflow: hidden;
  height: 1320px;
  background: #FFFFFF;
}

@media (max-width: 900px) {
  .submit-portal-steps {
    grid-template-columns: 1fr;
  }
  .submit-google-form-iframe {
    height: 1480px;
  }
}

@media (max-width: 540px) {
  .submit-saas-card {
    padding: 18px 10px 16px;
    border-radius: 16px;
  }
  .submit-google-form-iframe {
    height: 1680px;
  }
}

/* 5. Collapsible SEO Knowledge Hub & Multi-Line FAQ Accordion Fix */
.seo-knowledge-section {
  padding: 40px 0 24px;
}

.seo-knowledge-shell {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}

.seo-knowledge-header {
  max-width: 780px;
  margin-bottom: 24px;
}

.seo-knowledge-header h2 {
  margin: 8px 0 10px;
  font-size: 1.65rem;
  font-weight: 800;
  color: #0F172A;
}

.seo-knowledge-header p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: #475569;
}

.seo-knowledge-accordion .faq-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
}

.seo-knowledge-accordion .faq-item.is-expanded {
  background: #FFFFFF;
  border-color: #C7D2FE;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.06);
}

.faq-question,
.seo-accordion-trigger {
  min-height: 52px !important;
  height: auto !important;
  max-height: none !important;
  white-space: normal !important;
  text-align: left !important;
  line-height: 1.4 !important;
  padding: 14px 18px !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  box-sizing: border-box !important;
}

.seo-knowledge-prose p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #334155;
  margin: 0 0 12px;
}

.seo-knowledge-prose p:last-child {
  margin-bottom: 0;
}

.seo-knowledge-prose h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #0F172A;
  margin: 14px 0 6px;
}

.seo-knowledge-prose ul {
  margin: 6px 0 12px 18px;
  padding: 0;
  color: #334155;
  line-height: 1.65;
  font-size: 0.94rem;
}

@media (max-width: 640px) {
  .seo-knowledge-shell {
    padding: 20px 14px;
    border-radius: 16px;
  }
  .seo-knowledge-header h2 {
    font-size: 1.35rem;
  }
}

/* 6. Global Mobile Tap-Target & Horizontal Overflow Safeguards */
@media (max-width: 767px) {
  html,
  body {
    overflow-x: clip !important;
    max-width: 100vw !important;
  }

  .mobile-drawer-close-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .mobile-menu-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .explore-category-chip-btn {
    min-height: 44px !important;
  }
}

/* 7. Desktop Card Text & Action Button Overflow Safeguards */
.poster-card-body > div:last-child .btn,
.poster-card-body > div:last-child a.btn {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

