import type { Dictionary } from "@/i18n/get-dictionary";
import { sectionIds } from "@/lib/routes";
import { SectionLabel } from "@/components/shared/section-heading";
import { Section } from "@/components/shared/section";
import { ContactDetails } from "./contact-details";
import { ContactForm } from "./contact-form";
import { LocationCard } from "./location-card";

/** "Let's Build Something Great": info column + request form in one dark card. */
export function ContactSection({ t, formText }: { t: Dictionary["home"]["contact"]; formText: Dictionary["forms"] }) {
  return (
    <Section id={sectionIds.contact} labelledBy="contact-title" className="max-md:py-5 md:max-lg:py-10">
      <div className="grid overflow-hidden rounded-3xl border border-white/7 bg-surface-navy lg:grid-cols-2 lg:gap-20">
        {/* Phone & tablet (Figma 390 / 744): one column, 20px padding and gaps, 203px photo; tablet: details in one row. */}
        <div className="flex flex-col gap-5 border-white/6 p-5 pb-0 lg:gap-7 lg:border-e lg:p-10 lg:pe-0">
          <div>
            <SectionLabel>{t.label}</SectionLabel>
            <h2 id="contact-title" className="pt-3 font-heading text-4xl leading-10 font-black text-default">
              {t.titleStart}
              <br />
              {t.titleEnd}
            </h2>
            <p className="pt-4 text-sm leading-[22.75px] text-soft max-lg:text-xs max-lg:leading-5">{t.description}</p>
          </div>
          <ContactDetails t={t} />
          <LocationCard imageAlt={t.imageAlt} label={t.locationBadge} />
        </div>

        {/* Phone: the full-width button sits on the card's bottom edge and the note is hidden (Figma 390). */}
        <div className="flex flex-col justify-center gap-5 p-5 max-md:pb-0 lg:gap-10 lg:p-10 lg:ps-0">
          <ContactForm t={t.form} formText={formText} />
          <p className="text-center text-xs leading-4 text-white max-md:hidden">{t.form.note}</p>
        </div>
      </div>
    </Section>
  );
}
