/*
 * Homepage "Hotline Bling" contact section (components/home/ContactSection.tsx).
 * Refines the legacy layout in assets/css/style.min.css — yellow speech-bubble card, dark form
 * panel — without replacing it. Logical properties throughout, so Arabic mirrors on its own
 * (the panel/bubble mirroring itself is in rtl.css).
 */
#contactus {
  --ct-ink: #1e2333;
  --ct-yellow: #f5d253;
  --ct-accent: #ffeb3b;
}

/* The form is centred by its flex panel, not by the legacy .middle offset */
#contactus .cf.middle {
  position: static;
  top: auto;
  transform: none;
  padding: 0;
}

/* ---- Side by side (≥992px): both panels share one height, content centred --------------- */
@media (min-width: 992px) {
  #contactus .contactInfo > .row {
    align-items: stretch;
  }
  #contactus .contactLeft {
    top: 0;
    transform: none;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  #contactus .contactRight {
    height: 100%;
    display: flex;
    align-items: center;
  }
}

@media (min-width: 1101px) {
  /* a little wider than the legacy 900px, so the address and the affiliate row breathe */
  #contactus .contactInfo {
    width: 980px;
  }
  #contactus .contactLeft {
    padding: 44px 46px 40px;
  }
  #contactus .contactRight {
    padding-block: 44px 40px;
    padding-inline: 56px 48px;
  }
}

/* Short desktop screens (e.g. 1280×600): tighter rhythm so the card clears the section title */
@media (min-width: 992px) and (max-height: 760px) {
  #contactus .contactLeft {
    padding-block: 28px 24px;
  }
  #contactus .contactRight {
    padding-block: 28px 24px;
  }
  #contactus .contactLeft h4 {
    margin-bottom: 16px;
  }
  #contactus .cl-list {
    gap: 8px;
  }
  #contactus .cl-item {
    line-height: 1.4;
  }
  #contactus .cl-qr img {
    width: 60px;
    height: 60px;
  }
  #contactus .cl-affiliates {
    margin-top: 16px;
    padding-top: 12px;
  }
  #contactus .contactLeft p.cl-copy {
    padding-top: 12px;
  }
  #contactus .cf-head {
    margin-bottom: 12px;
  }
  #contactus .cf-head h3 {
    font-size: 19px;
  }
  /* the intro line is the first thing to give up its space */
  #contactus .cf-head p {
    display: none;
  }
  #contactus .cf-field {
    margin-bottom: 8px;
  }
  #contactus .cf textarea.field {
    min-height: 46px;
  }
  #contactus .cf-actions {
    margin-top: 14px;
  }
}

/* ---- Yellow card ----------------------------------------------------------------------- */
#contactus .contactLeft h4 {
  margin-bottom: 26px;
}

#contactus .cl-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#contactus .cl-country-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid rgba(30, 35, 51, 0.22);
  border-radius: 999px;
  margin-bottom: 26px;
}

#contactus .cl-country-toggle button {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: var(--ct-ink);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

#contactus .cl-country-toggle button.is-active {
  background: var(--ct-ink);
  color: var(--ct-yellow);
}

#contactus .cl-country-toggle button:focus-visible {
  outline: 2px solid var(--ct-ink);
  outline-offset: 2px;
}

#contactus .contactLeft {
  perspective: 1000px;
  transform-style: preserve-3d;
}

#contactus .cl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

#contactus .cl-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: start;
  column-gap: 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ct-ink);
}

#contactus .cl-item--address {
  grid-template-columns: 30px 1fr auto;
}

#contactus .cl-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ct-ink);
  color: var(--ct-yellow);
  font-size: 12px;
}

#contactus .cl-link {
  align-self: center;
  color: var(--ct-ink);
  text-decoration: none;
  text-underline-offset: 3px;
}

#contactus .cl-link:hover,
#contactus .cl-link:focus-visible {
  color: var(--ct-ink);
  text-decoration: underline;
}

#contactus .cl-qr {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-inline-start: 6px;
  color: rgba(30, 35, 51, 0.7);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

#contactus .cl-qr img {
  display: block;
  width: 72px;
  height: 72px;
  padding: 4px;
  background: #fff;
  border-radius: 8px;
}

#contactus .cl-qr:hover,
#contactus .cl-qr:focus-visible {
  color: var(--ct-ink);
}

/* Affiliates: one quiet row of names */
#contactus .cl-affiliates {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(30, 35, 51, 0.16);
}

#contactus .contactLeft p.cl-eyebrow {
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(30, 35, 51, 0.62);
}

#contactus .cl-affiliates ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

#contactus .cl-affiliates a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ct-ink);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.2s ease;
}

#contactus .cl-affiliates a:hover,
#contactus .cl-affiliates a:focus-visible {
  border-bottom-color: var(--ct-ink);
}

#contactus .cl-arrow {
  font-size: 10px;
  transform: rotate(-45deg);
  transition: translate 0.2s ease;
}

#contactus .cl-affiliates a:hover .cl-arrow {
  translate: 2px -2px;
}

#contactus .contactLeft p.cl-copy {
  margin: auto 0 0;
  padding: 22px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  color: rgba(30, 35, 51, 0.7);
}

#contactus .cl-nowrap {
  white-space: nowrap;
}

#contactus .contactLeft a:focus-visible {
  outline: 2px solid var(--ct-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Form panel ------------------------------------------------------------------------ */
#contactus .cf {
  width: 100%;
}

#contactus .cf-head {
  margin-bottom: 22px;
}

#contactus .cf-head h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

#contactus .cf-head p {
  margin: 6px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}

#contactus .cf-field {
  position: relative;
  margin-bottom: 14px;
}

#contactus .cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}

#contactus .cf-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

#contactus .cf .field {
  margin: 0;
  padding: 8px 0 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  transition: border-color 0.2s ease;
}

#contactus .cf textarea.field {
  resize: vertical;
  min-height: 78px;
}

#contactus .cf-field:focus-within .cf-label {
  color: var(--ct-accent);
}

#contactus .cf .field:focus {
  border-bottom-color: var(--ct-accent);
  box-shadow: 0 1px 0 var(--ct-accent);
}

#contactus .cf .field.errorMsg {
  border-bottom-color: #ff9b8a;
}

/* jQuery Validation messages (label.errorMsg) and the form-level message: soft coral, readable on navy */
#contactus .cf label.errorMsg {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #ffb3a6;
}

#contactus .submitMsg p,
#contactus .submitMsg .text-danger {
  margin: 0;
  color: #ffb3a6 !important; /* overrides the inline red set by site-init.ts */
}

#contactus .cf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 22px;
}

#contactus .contactFormBtn {
  min-height: 46px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--ct-yellow);
  color: var(--ct-ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#contactus .contactFormBtn:hover {
  background: #fff;
}

#contactus .contactFormBtn:active {
  transform: translateY(1px);
}

#contactus .contactFormBtn:focus-visible,
#contactus .cf-alt a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

#contactus .cf-alt {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}

#contactus .cf-alt a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 4px;
  white-space: nowrap;
  transition: text-decoration-color 0.2s ease;
}

#contactus .cf-alt a:hover {
  text-decoration-color: var(--ct-accent);
}

#contactus .cf-alt i {
  margin-inline-end: 3px;
  color: var(--ct-accent);
}

#contactus .submitMsg {
  margin-top: 14px;
}

/* ---- Small screens --------------------------------------------------------------------- */
@media (max-width: 1100px) {
  #contactus .contactLeft,
  html[dir="rtl"] #contactus .contactLeft {
    display: flex;
    flex-direction: column;
    border-radius: 0; /* the stacked cards are square, as in English */
  }
  #contactus .contactLeft p.cl-copy {
    margin-top: 0;
  }
}

@media (max-width: 575px) {
  #contactus .cf-row {
    grid-template-columns: 1fr;
  }
  #contactus .cl-item {
    font-size: 14px;
  }
  #contactus .cl-qr img {
    width: 64px;
    height: 64px;
  }
}

/* ---- Arabic: no Latin tracking/uppercase; arrow points the reading way ------------------ */
html[dir="rtl"] #contactus .contactLeft p.cl-eyebrow,
html[dir="rtl"] #contactus .cf-label {
  letter-spacing: 0;
  text-transform: none;
  font-size: 12.5px;
}

html[dir="rtl"] #contactus .contactFormBtn {
  letter-spacing: 0;
  font-size: 15px;
}

/* Affiliate names are Latin (dir="ltr"), so their arrow stays as in English */
html[dir="rtl"] #contactus .cl-affiliates .cl-arrow {
  transform: rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
  #contactus .cl-affiliates a,
  #contactus .cl-arrow,
  #contactus .cf-label,
  #contactus .cf .field,
  #contactus .contactFormBtn,
  #contactus .cf-alt a {
    transition: none;
  }
}
