/* ==========================================================================
   Contact Section Block
   ========================================================================== */

/* --- Section --- */
.ctct-section {
  padding: 2.5rem 0;
}

/* --- Header row: title pill + subtitle --- */
.ctct-header {
  display: flex;
  flex-direction: row;
  gap: 40px;
  align-items: flex-start;
  justify-content: flex-start;
  margin-bottom: 24px;
}

/* --- Title pill (green highlight) --- */
.ctct-title-wrap {
  background-color: var(--color-green);
  border-radius: 7px;
  padding: 0 7px;
  flex-shrink: 0;
}

.ctct-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  color: #000000;
  margin: 0;
}

/* --- Subtitle --- */
.ctct-subtitle {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: #000000;
  margin: 0;
  max-width: 323px;
}

/* --- Inner grey container ---
   Two-column grid: form on the left, image on the right (50/50).
   ========================================================================== */
.ctct-inner {
  background-color: var(--color-grey);
  border-radius: 45px;
  padding: 60px 100px 80px 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
}

/* --- Left: form area --- */
.ctct-form {
  min-width: 0;
  width: 100%;
}

/* --- Right: image column --- */
.ctct-image {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image — preserves aspect ratio in both modes via object-fit: contain. */
.ctct-image img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* Fit by WIDTH: image fills its column width; height grows naturally. */
.ctct-image--fit-width img {
  width: 100%;
  height: auto;
}

/* Fit by HEIGHT: image fills the row height (matched to the form's height);
   width auto, capped at column width. */
.ctct-inner--fit-height .ctct-image {
  align-self: stretch;
  position: relative;
}

.ctct-image--fit-height img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Hide image on mobile when "Show Image on Mobile" is off */
@media (max-width: 767px) {
  .ctct-image--hide-mobile {
    display: none;
  }
}

/* ==========================================================================
   Plugin Form Styling
   Targets the HTML Forms plugin <p><label><input></p> structure
   ========================================================================== */

/* Form element itself */
.ctct-form form {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin: 0;
  width: 100%;
}

/* Each <p> wrapper = one field row */
.ctct-form p {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
  width: 100%;
}

/* Labels */
.ctct-form label {
  display: block;
  color: #000000;
  font-family: 'SpaceGrotesk-Regular', sans-serif;
  font-size: 1rem;
  line-height: 1.75rem;
  font-weight: 400;
  margin: 0;
}

/* Text, email, tel, url, number inputs */
.ctct-form input[type="text"],
.ctct-form input[type="email"],
.ctct-form input[type="tel"],
.ctct-form input[type="url"],
.ctct-form input[type="number"],
.ctct-form input[type="search"] {
  background-color: #ffffff;
  border-radius: 14px;
  border: 1px solid #000000;
  padding: 18px 30px;
  width: 100%;
  color: #000000;
  font-family: 'SpaceGrotesk-Regular', sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.5;
  outline: none;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

/* Textarea */
.ctct-form textarea {
  background-color: #ffffff;
  border-radius: 14px;
  border: 1px solid #000000;
  padding: 18px 30px;
  width: 100%;
  min-height: 190px;
  color: #000000;
  font-family: 'SpaceGrotesk-Regular', sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.5;
  outline: none;
  resize: none;
  box-sizing: border-box;
}

/* Placeholder text */
.ctct-form input::placeholder,
.ctct-form textarea::placeholder {
  color: #898989;
}

/* Focus states */
.ctct-form input[type="text"]:focus,
.ctct-form input[type="email"]:focus,
.ctct-form input[type="tel"]:focus,
.ctct-form input[type="url"]:focus,
.ctct-form input[type="number"]:focus,
.ctct-form textarea:focus {
  outline: none;
  border-color: #000000;
  box-shadow: none;
}

/* Submit button (input type="submit" or button) */
.ctct-form input[type="submit"],
.ctct-form button[type="submit"] {
  display: block;
  width: 100%;
  background-color: var(--color-dark);
  color: #ffffff;
  border-radius: 14px;
  border: none;
  padding: 20px 35px;
  font-family: 'SpaceGrotesk-Regular', sans-serif;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 400;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: opacity 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.ctct-form input[type="submit"]:hover,
.ctct-form button[type="submit"]:hover {
  opacity: 0.88;
}

/* --- Custom Radio Buttons ---
   Styles plugin-rendered radios to match the circular dot design
   ========================================================================== */

/* Row of radio buttons — plugin wraps them in a <p> */
.ctct-form p:has(input[type="radio"]) {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 35px;
}

/* Each radio + label pair */
.ctct-form p:has(input[type="radio"]) label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  line-height: 1;
}

/* Hide browser default radio */
.ctct-form input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: 1px solid #000000;
  background-color: #ffffff;
  position: relative;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

/* Green dot when selected */
.ctct-form input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--color-green);
}

/* --- Success / Error messages from the plugin --- */
.ctct-form .hf-message,
.ctct-form .success,
.ctct-form .error {
  font-family: 'SpaceGrotesk-Regular', sans-serif;
  font-size: 0.9rem;
  border-radius: 8px;
  padding: 12px 20px;
}

.ctct-form .hf-message-success,
.ctct-form .success {
  background-color: var(--color-green);
  color: #000000;
}

.ctct-form .hf-message-error,
.ctct-form .error {
  background-color: #fff0f0;
  color: #cc0000;
}

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

@media (max-width: 1279px) {
  .ctct-inner {
    padding: 60px;
    gap: 30px;
  }
}

@media (max-width: 1023px) {
  .ctct-inner {
    padding: 50px;
    gap: 24px;
  }

  .ctct-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 767px) {
  /* Header: centered pill + centered subtitle */
  .ctct-header {
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
  }

  .ctct-subtitle {
    max-width: 100%;
    text-align: center;
  }

  /* Stack on mobile */
  .ctct-inner {
    grid-template-columns: 1fr;
    padding: 40px 30px;
    border-radius: 45px;
    gap: 36px;
  }

  .ctct-form {
    max-width: 100%;
    width: 100%;
  }

  /* Tighter field spacing on mobile */
  .ctct-form form {
    gap: 20px;
  }

  .ctct-form p {
    gap: 10px;
  }

  .ctct-form label {
    font-size: 0.875rem;
    line-height: 1.4;
  }

  .ctct-form input[type="text"],
  .ctct-form input[type="email"],
  .ctct-form input[type="tel"],
  .ctct-form input[type="url"],
  .ctct-form input[type="number"],
  .ctct-form input[type="search"],
  .ctct-form textarea {
    padding: 18px 20px;
    font-size: 1rem;
  }

  .ctct-form textarea {
    min-height: 132px;
  }

  .ctct-form input[type="submit"],
  .ctct-form button[type="submit"] {
    padding: 20px 35px;
    font-size: 1.125rem;
  }

  /* Radio row tighter on mobile */
  .ctct-form p:has(input[type="radio"]) {
    gap: 25px;
    justify-content: space-between;
  }

  /* On mobile, image always fits by width (no absolute positioning) */
  .ctct-inner--fit-height .ctct-image {
    position: static;
    align-self: auto;
  }
  .ctct-image--fit-height img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

@media (max-width: 575px) {
  .ctct-inner {
    padding: 32px 20px;
    border-radius: 35px;
  }

  .ctct-title {
    font-size: 1.5rem;
  }

  .ctct-form p:has(input[type="radio"]) {
    gap: 20px;
  }
}
