/* Someh Contact — cross-theme compatibility and skin bridge 1.0.0 */

/* Foreign themes occasionally apply vertical writing or letter-level breaks
   to address widgets. Keep the content in a normal Persian text flow. */
html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf,
html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf *,
html body.someh-site-skin-active .fic-card.tmc-contact-card,
html body.someh-site-skin-active .fic-card.tmc-contact-card * {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf {
  --tmcmf-accent: var(--someh-skin-accent, #f59e0b) !important;
  --tmcmf-site-bg: var(--someh-skin-primary, #111827) !important;
  --tmcmf-site-on: #ffffff !important;
  --tmcmf-site-muted: rgba(255,255,255,.76) !important;
  --tmcmf-site-line: rgba(255,255,255,.20) !important;
  color: #ffffff !important;
  background: linear-gradient(135deg,var(--someh-skin-primary,#111827),var(--someh-skin-secondary,#293548)) !important;
  border-top-color: var(--someh-skin-accent, #f59e0b) !important;
}

html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__shell {
  width: min(calc(100% - 28px), 1360px) !important;
  max-width: 1360px !important;
  min-width: 0 !important;
}

html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__content {
  min-width: 0 !important;
  max-width: 100% !important;
}

html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__address-card {
  display: grid !important;
  grid-template-columns: 52px minmax(0,1fr) auto !important;
  grid-template-rows: auto !important;
  align-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 142px !important;
  padding: 22px !important;
  overflow: hidden !important;
  direction: rtl !important;
  background: color-mix(in srgb,var(--someh-skin-surface,#fff) 96%,var(--someh-skin-primary,#111827) 4%) !important;
  border: 1px solid var(--someh-skin-line, #d6dee8) !important;
  border-radius: 20px 6px 20px 6px !important;
  color: var(--someh-skin-ink, #1e293b) !important;
}

html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__icon-wrap {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 48px !important;
  height: 48px !important;
  margin: 0 !important;
  transform: rotate(45deg) !important;
  background: var(--someh-skin-accent, #f59e0b) !important;
}

html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__address-copy {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  direction: rtl !important;
  unicode-bidi: plaintext !important;
  text-align: right !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  letter-spacing: normal !important;
}

html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__address-copy .tmcmf__label,
html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__address-copy strong {
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  letter-spacing: normal !important;
  line-height: 1.95 !important;
  transform: none !important;
}
html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__address-copy .tmcmf__label {
  margin-bottom: 5px !important;
  color: var(--someh-skin-muted, #526274) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}
html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__address-copy strong {
  color: var(--someh-skin-ink, #1e293b) !important;
  font-size: clamp(15px,1.6vw,19px) !important;
  font-weight: 850 !important;
}

html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__map-btn {
  grid-column: 3 !important;
  grid-row: 1 !important;
  align-self: center !important;
  min-width: 86px !important;
  max-width: 150px !important;
  white-space: nowrap !important;
  color: var(--someh-skin-primary, #111827) !important;
  background: color-mix(in srgb,var(--someh-skin-accent,#f59e0b) 25%,#fff) !important;
  border-color: var(--someh-skin-accent, #f59e0b) !important;
}

html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__phone-copy,
html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__phone-copy b {
  min-width: 0 !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  letter-spacing: normal !important;
}
html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__phone-copy b {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  white-space: nowrap !important;
}

/* The same guard covers the embedded Contact Card and its old standalone
   markup, so installing this package beside older versions remains safe. */
html body.someh-site-skin-active .fic-card.tmc-contact-card .fic-shell,
html body.someh-site-skin-active .fic-card.tmc-contact-card .fic-items,
html body.someh-site-skin-active .fic-card.tmc-contact-card .fic-addr,
html body.someh-site-skin-active .fic-card.tmc-contact-card .fic-hours {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
html body.someh-site-skin-active .fic-card.tmc-contact-card :is(.fic-addr,.fic-hours,.fic-addr *, .fic-hours *) {
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
  letter-spacing: normal !important;
}

@media (max-width: 980px) {
  html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__content { grid-template-columns: 1fr !important; }
  html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__address-card { grid-column: 1 !important; }
  html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__phones { grid-column: 1 !important; }
}
@media (max-width: 720px) {
  html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__address-card {
    grid-template-columns: 44px minmax(0,1fr) !important;
    min-height: 126px !important;
    padding: 16px !important;
  }
  html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__icon-wrap { width: 40px !important; height: 40px !important; }
  html body.someh-site-skin-active #tmc-modern-footer-contact.tmcmf .tmcmf__map-btn {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    min-height: 36px !important;
    margin-top: 8px !important;
  }
}

/* Universal last-resort guard: this part intentionally does not require the
   Someh theme body class, because the original regression is theme-driven. */
html body #tmc-modern-footer-contact.tmcmf .tmcmf__address-card,
html body #tmc-modern-footer-contact.tmcmf .tmcmf__address-copy,
html body #tmc-modern-footer-contact.tmcmf .tmcmf__address-copy strong,
html body #tmc-modern-footer-contact.tmcmf .tmcmf__address-copy .tmcmf__label {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  white-space: normal !important;
  word-break: normal !important;
  letter-spacing: normal !important;
}
html body #tmc-modern-footer-contact.tmcmf .tmcmf__address-card {
  min-width: 0 !important;
  max-width: 100% !important;
}
html body #tmc-modern-footer-contact.tmcmf .tmcmf__address-copy {
  min-width: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}
html body #tmc-modern-footer-contact.tmcmf .tmcmf__address-copy strong {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  transform: none !important;
}

/* Desktop RTL grid repair: the marketplace footer originally auto-placed the
   intro into column 2 and the contact content into the narrow column 1. That
   leaves the address card with only a few pixels for Persian text, so every
   character appears on its own line. Keep the visual order RTL, but explicitly
   place the narrow intro on the right and the wide contact content on the left. */
@media (min-width: 981px) {
  html body #tmc-modern-footer-contact.tmcmf .tmcmf__shell {
    grid-template-columns: minmax(250px,.72fr) minmax(0,1.55fr) !important;
  }
  html body #tmc-modern-footer-contact.tmcmf .tmcmf__intro {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }
  html body #tmc-modern-footer-contact.tmcmf .tmcmf__content {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 980px) {
  html body #tmc-modern-footer-contact.tmcmf .tmcmf__shell {
    grid-template-columns: 1fr !important;
  }
  html body #tmc-modern-footer-contact.tmcmf .tmcmf__intro,
  html body #tmc-modern-footer-contact.tmcmf .tmcmf__content {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
  html body #tmc-modern-footer-contact.tmcmf .tmcmf__content { grid-template-columns: 1fr !important; }
}
