/**
 * RojaGold Footer Styles
 * Pixel-perfect matching with React version
 * Light theme footer
 */

/* Main Footer Container - Light Theme */
footer .wp-block-group,
footer > .wp-block-group {
  background-color: #f9fbfd !important;
}

/* Contact Cards - Equal Height */
.wp-block-columns:has(.wp-block-group[style*="border-radius:1rem"])
  .wp-block-column {
  display: flex;
}

.wp-block-columns:has(.wp-block-group[style*="border-radius:1rem"])
  .wp-block-column
  > .wp-block-group {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 100px;
  transition: all 0.3s ease;
}

/* Contact Cards Hover Effect - FIXED */
.wp-block-group[style*="border-radius:1rem"]:hover {
  background: rgba(255, 255, 255, 0) !important;
  border-color: rgba(204, 255, 243, 0.2) !important;
  transform: translateY(-2px) !important;
}

/* Remove underlines from all links */
footer a {
  text-decoration: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* Link hover effect */
footer a:hover {
  color: #ccfff3 !important;
}

/* RTL Support */
footer [dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* ========================================
   CRITICAL FIX: Bottom Row Layout
   ======================================== */

/* ========================================
   CRITICAL FIX: Bottom Row Layout - Centered
   ======================================== */

/* Bottom section: social + copyright centered vertically */
footer > .wp-block-group > .wp-block-group:last-of-type {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  gap: 1.25rem !important;
}

/* Social Icons Section - Centered */
footer
  > .wp-block-group
  > .wp-block-group:last-of-type
  > .wp-block-group:first-child {
  justify-content: center !important;
}

/* Copyright Section - Centered */
footer
  > .wp-block-group
  > .wp-block-group:last-of-type
  > .wp-block-group:last-child {
  align-items: center !important;
  text-align: center !important;
}

/* Social Icons Hover */
footer a[style*="border-radius:50%"] {
  transition: all 0.3s ease;
}

footer a[style*="border-radius:50%"]:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(204, 255, 243, 0.3) !important;
  transform: translateY(-2px) !important;
}

footer a[style*="border-radius:50%"]:hover svg {
  stroke: #ccfff3 !important;
}

/* ========================================
   Separator Lines - Remove extra borders
   ======================================== */

footer .wp-block-separator {
  opacity: 1 !important;
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
  background: rgba(255, 255, 255, 0.1) !important;
  height: 1px !important;
  margin-top: 2rem !important;
  margin-bottom: 2rem !important;
}

/* ========================================
   Oben Origin Credit Section
   ======================================== */

/* ========================================
   Oben Origin Credit Bar (PHP rendered)
   ======================================== */
.oben-credit-bar {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: #2f3542;
}

.footer-credit-text {
  margin: 0;
  width: auto;
  text-align: right;
  direction: rtl;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.8;
}

.footer-studio-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: auto;
}

.footer-studio-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: all 0.3s ease;
}

.footer-studio-link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.footer-studio-logo {
  width: auto;
  height: 28px;
  max-width: 130px;
  object-fit: contain;
  display: block;
}

/* Menu columns spacing */
footer .wp-block-columns[dir="rtl"] .wp-block-column {
  text-align: right;
}

/* Contact Card Icons - Maintain size */
footer [style*="width:48px;height:48px"] {
  flex-shrink: 0 !important;
}

/* =====================================
   CRITICAL FIX: Icon-Text Gap in Contact Cards
   فاصله بین آیکون و متن
   ===================================== */

/* Contact Cards Container - Add gap between icon and text */
.wp-block-group[style*="border-radius:1rem"] {
  gap: 0.5rem !important; /* 8px فاصله بین آیکون و متن */
}

/* اطمینان از اینکه gap در همه حالات اعمال میشه */
footer .wp-block-group.has-border-color[style*="border-radius:1rem"] {
  gap: 0.5rem !important;
  display: flex !important;
}

/* Icon container - No additional margin needed */
footer
  .wp-block-group[style*="border-radius:1rem"]
  > .wp-block-group:first-child {
  margin: 0 !important;
}

/* Text container - No additional margin needed */
footer
  .wp-block-group[style*="border-radius:1rem"]
  > .wp-block-group:last-child {
  margin: 0 !important;
}

/* Typography */
footer h3 {
  font-weight: 600;
}

footer h4 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Links in menus */
footer .wp-block-paragraph:has(a) {
  margin-bottom: 0.875rem;
}

footer .wp-block-paragraph:last-child {
  margin-bottom: 0;
}

/* Copyright symbol and year */
footer .wp-block-group:has(> p[style*="font-size:1.5rem"]) p {
  margin: 0;
  line-height: 1;
}

/* Ensure icons stay centered */
footer [style*="display:flex;align-items:center;justify-content:center"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Phone number LTR */
footer p[dir="ltr"] {
  direction: ltr !important;
  text-align: left !important;
}

/* But keep the container RTL */
footer .wp-block-group[dir="rtl"] p[dir="ltr"] {
  text-align: right !important;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  /* Contact Cards */
  .wp-block-group[style*="border-radius:1rem"] {
    flex-direction: row !important;
    padding: 1rem !important;
  }

  /* All Columns Stack */
  footer .wp-block-columns {
    flex-direction: column !important;
  }

  /* Social Icons smaller */
  footer a[style*="border-radius:50%"] {
    width: 36px !important;
    height: 36px !important;
  }

  /* Oben Origin Credit: Compact on mobile */
  .oben-credit-bar {
    padding: 10px 12px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
  }

  .footer-studio-links {
    justify-content: center;
    gap: 10px;
    width: 100%;
  }

  .footer-credit-text {
    text-align: center;
    width: 100%;
  }

  .footer-studio-link {
    gap: 8px;
    padding: 6px 10px;
  }

  .footer-studio-logo {
    height: 24px;
    max-width: 108px;
  }
}

/* ========================================
   WordPress Block Editor Compatibility
   ======================================== */

/* Remove WordPress default margins that might interfere */
footer .wp-block-group.is-layout-flex {
  gap: inherit !important;
}

/* Ensure our flex rules take precedence */
footer .wp-block-group.is-content-justification-space-between.is-layout-flex {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Ensure vertical groups inside don't break layout */
footer .wp-block-group.is-vertical {
  display: flex !important;
  flex-direction: column !important;
}

/* Ensure nowrap groups stay inline */
footer .wp-block-group.is-nowrap {
  flex-wrap: nowrap !important;
}

/* ========================================
   Trust Badges / مجوزها Section
   ======================================== */

/* Trust badges container */
footer .wp-block-group:has(.wp-block-image) {
  gap: 1rem !important;
}

/* Trust badge image wrapper - کادر دور لوگو */
footer .wp-block-image {
  width: 70px !important;
  height: 70px !important;
  margin: 0 !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 21px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px !important;
  transition: all 0.3s ease !important;
}

/* Trust badge image itself */
footer .wp-block-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 12px !important;
}

/* Hover effect */
footer .wp-block-image:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  border-color: #cbd5e1 !important;
}
