/* ==========================================================================
   หน้าติดต่อเรา (frontend/contact_us)
   โครงตาม mockup: breadcrumb แถบกรมท่า → banner → แถบข้อมูลติดต่อ (ซ้อนขอบล่าง banner)
   → การ์ดสองคอลัมน์ → แถบชวนไป FAQ
   ขนาดตัวอักษร/ระยะใช้สเกลเดียวกับหน้าอื่นของเว็บ, กรอบเนื้อหาเท่ากับ breadcrumb และหน้าถาม-ตอบ
   ========================================================================== */

.ct-page {
    --ct-ink: var(--bs-primary-500, #002777);   /* หัวข้อ / ปุ่ม / ไอคอน */
    --ct-blue: #2d66cc;
    --ct-text: #3a4668;
    --ct-muted: #8b93a7;
    --ct-panel: #f3f6fc;
    --ct-line: #e3e9f3;
    --ct-input-line: #cfd8e6;
    --ct-radius: 10px;
    --ct-shadow: 0 14px 44px rgba(33, 48, 105, 0.08);

    color: var(--ct-text);
    text-align: left;
    padding-bottom: 3rem;
}

.ct-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4.5vw, 5.5rem);
}

/* ---------- banner (ภาพ 1920x450) ----------
   ตำแหน่ง/ขนาดชุดเดียวกับ hero ของ mrta-news (.nw-hero) - แก้ที่ใดให้แก้ทุกระบบให้ตรงกัน:
   กรอบกว้างสุด 1920 / ข้อความเยื้องซ้าย 8.5vw / หัวเรื่อง 3.7vw / คำโปรย 1.1vw / จัดกลางแนวตั้ง
   ระยะล่างของ .ct-hero-inner (อย่างน้อย 4.5rem) เผื่อแถบข้อมูลติดต่อที่ซ้อนขึ้นมา 3rem */
.ct-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: clamp(220px, 23.4vw, 450px);
    overflow: hidden;
    background: #d9e8fb;   /* ฟ้าอ่อนตามฝั่งซ้ายของรูป banner-contact-us.png */
    color: #002777;
}

/* รูป hero เป็นชั้นตกแต่ง ::after (ไม่ใช่ background ของ section) - ตัวตรวจ WCAG วัดคอนทราสต์ของหัวข้อได้
   (กรมท่าบนพื้น #d9e8fb = 10.9:1 / แดง #c8102e = 4.7:1 ผ่านเกณฑ์ตัวอักษรใหญ่) แทนที่จะขึ้นข้อควรระวัง "ข้อความอยู่บนรูปภาพพื้นหลัง" */
.ct-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: var(--ct-hero-image) right center / cover no-repeat;
}
.ct-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 8.5vw, 10.25rem) 4.5rem;
    /* หัวเรื่องเยื้องเข้ามาจากตัวหนังสือของ breadcrumb ("หน้าหลัก" = หมุด 15px + ช่อง 8px = 23px) อีก 2vw */
    padding-left: calc(clamp(1rem, 8.5vw, 10.25rem) + 23px + 2vw);
}
.ct-hero-title {
    color: #002777;
    font-family: var(--bs-font-primary);
    font-weight: 700;
    font-size: clamp(2rem, 3.7vw, 4.5rem);
    line-height: 1.2;
    margin: 0 0 clamp(.6rem, 1.2vw, 1.4rem);
}
/* "เรา" สีแดงตามแบบ - หัวเรื่องเป็นตัวอักษรใหญ่ (2rem ขึ้นไป ตัวหนา) เกณฑ์ AAA 4.5:1 */
.ct-hero-accent { color: #c8102e; }
.ct-hero-desc {
    color: #002777;
    font-family: var(--bs-font-primary);
    font-size: clamp(.9rem, 1.1vw, 1.35rem);
    line-height: 1.95;
    margin: 0;
    max-width: 36em;
}

/* ---------- แถบข้อมูลติดต่อ 4 ช่อง ---------- */
.ct-body {
    position: relative;
    z-index: 1;
}
.ct-info-bar {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.5fr 0.9fr;
    margin-top: -3rem;
    background: #fff;
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
    padding: 1.4rem 0.5rem;
}
.ct-info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    min-width: 0;
    padding: 0.25rem 1.5rem;
}
.ct-info-item + .ct-info-item {
    border-left: 1px solid var(--ct-line);
}
.ct-info-icon {
    flex-shrink: 0;
    color: var(--ct-ink);
    font-size: 1.9rem;
    line-height: 1;
    margin-top: 0.2rem;
}
.ct-info-detail {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.ct-info-detail .l {
    color: var(--ct-ink);
    font-size: 0.92rem;
    font-weight: 700;
}
.ct-info-detail .v {
    color: var(--ct-ink);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
    text-decoration: none;
    overflow-wrap: anywhere;
}
a.v:hover {
    color: var(--ct-blue);
}
.ct-info-item.is-address .v {
    color: var(--ct-text);
    font-size: 0.88rem;
    font-weight: 400;
    line-height: 1.6;
}
.ct-info-detail .n {
    color: var(--ct-text);
    font-size: 0.85rem;
}

/* ---------- การ์ดสองคอลัมน์ ---------- */
.ct-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
    align-items: start;
    margin-top: 1.75rem;
}
.ct-card {
    background: #fff;
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
    padding: 1.75rem 2rem 2rem;
    min-width: 0;
}
.ct-card-title {
    color: var(--ct-ink);
    font-weight: 800;
    font-size: 1.3rem;
    line-height: 1.4;
    margin: 0 0 1.1rem;
}
.ct-sub-title {
    color: var(--ct-ink);
    font-weight: 700;
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem;
}
.ct-card-title + .ct-sub-title {
    margin-top: 0;
}

/* แผนที่ */
.ct-map {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--ct-line);
    background: var(--ct-panel);
}
.ct-map iframe {
    display: block;
    width: 100%;
    height: 300px;
    border: 0;
}
/* อยู่ใต้แผนที่ใน flow ปกติ (absolute ทับแผนที่ = ข้อควรระวังเรื่องคอนทราสต์ของตัวตรวจ WCAG) */
.ct-map-open {
    position: static;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    color: var(--ct-ink);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 50rem;
    padding: 0.4rem 0.85rem;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(33, 48, 105, 0.18);
    transition: background 0.2s, color 0.2s;
}
.ct-map-open:hover {
    background: var(--ct-ink);
    color: #fff;
}

/* การเดินทาง */
.ct-travel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.ct-travel-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--ct-panel);
    border-radius: 8px;
    padding: 0.75rem 1.1rem;
}
.ct-travel-icon {
    flex: 0 0 28px;
    text-align: center;
    color: var(--ct-ink);
    font-size: 1.3rem;
}
.ct-travel-info {
    color: var(--ct-text);
    font-size: 0.88rem;
    line-height: 1.55;
    min-width: 0;
}
.ct-travel-info strong {
    display: block;
    color: var(--ct-ink);
    font-size: 0.95rem;
}

/* ช่องทางโซเชียล - 4 ช่องคั่นด้วยเส้นตั้ง */
.ct-social-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ct-social-list li + li {
    border-left: 1px solid var(--ct-line);
}
.ct-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0.5rem;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s;
}
.ct-social img {
    width: 40px;
    height: 40px;
    margin-bottom: 0.3rem;
}
a.ct-social:hover {
    transform: translateY(-2px);
}
.ct-social-name {
    color: var(--ct-ink);
    font-weight: 700;
    font-size: 0.92rem;
}
.ct-social-detail {
    color: var(--ct-text);
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}
/* ยังไม่ได้ตั้ง URL ใน user_orgs */
/* จางเฉพาะไอคอน - ตัวหนังสือใช้เทาเข้มพอให้คอนทราสต์ผ่าน 4.5:1 (WCAG 1.4.3) */
.ct-social.is-off {
    filter: grayscale(1);
}
.ct-social.is-off img {
    opacity: 0.45;
}
.ct-social.is-off .ct-social-name,
.ct-social.is-off .ct-social-detail {
    color: #454f69; /* 7:1 ขึ้นไป (AAA) - เดิม #6b758c 4.62:1 */
}

/* ---------- แบบฟอร์ม ---------- */
.ct-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.ct-field {
    margin-bottom: 1rem;
    min-width: 0;
}
.ct-field label {
    display: block;
    color: var(--ct-ink);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}
.req {
    color: #8f1218; /* 7:1 ขึ้นไปทั้งบนพื้นขาวและพื้นเทาอ่อน (AAA) - เดิม #d82028 5.05:1 */
    margin-left: 0.1rem;
}
/* ช่องกรอก = x-field-input (.field-input ใน main.css) + .ct-input ปรับขนาด/สีให้ตรง mockup
   ดรอปดาวน์ = x-select-dropdown (.app-dd) + .ct-select ปรับปุ่มเปิดให้สูง/ขอบเท่าช่องกรอก */
.ct-input {
    min-height: 44px;
    border-color: var(--ct-input-line);
    padding: 0.55rem 0.9rem;
    font-size: 0.92rem;
    color: var(--ct-ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ct-input::placeholder {
    color: #9aa4bd;
}
.ct-input:focus,
.ct-select .app-dd-toggle:focus,
.ct-select .app-dd-toggle[aria-expanded="true"] {
    border-color: var(--ct-blue);
    box-shadow: 0 0 0 3px rgba(45, 102, 204, 0.15);
}
textarea.ct-input {
    min-height: 130px;
    resize: vertical;
}
.ct-select .app-dd-toggle {
    height: 44px;
    border-color: var(--ct-input-line);
    border-radius: 4px;
    padding: 0 2.5rem 0 0.9rem;
    font-size: 0.92rem;
    color: var(--ct-ink);
    background-position: right 0.95rem center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
/* แผงตัวเลือกกว้างเท่าช่อง - หัวข้อมีหลายตัว จำกัดความสูงแล้วเลื่อนในแผงแทน */
.ct-select .app-dd-menu {
    width: 100%;
    max-height: 320px;
    overflow-y: auto;
}
.ct-select .app-dd-menu .dropdown-item {
    font-size: 0.92rem;
    white-space: normal;
}
.ct-input.is-invalid,
.ct-select.is-invalid .app-dd-toggle {
    border-color: var(--bs-secondary, #d82028);
}
.ct-err {
    color: var(--bs-secondary, #d82028);
    font-size: 0.8rem;
    margin: 0.35rem 0 0;
}
.ct-err[hidden] {
    display: none;
}

/* PDPA */
.ct-pdpa {
    background: var(--ct-panel);
    border: 1px solid var(--ct-input-line);
    border-radius: 4px;
    padding: 0.9rem 1.1rem;
    margin: 0.5rem 0 1.25rem;
}
.ct-pdpa-head {
    color: var(--ct-ink);
    font-weight: 700;
    font-size: 0.92rem;
    margin: 0 0 0.4rem;
}
.ct-pdpa-check {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    color: var(--ct-text);
    font-size: 0.85rem;
    line-height: 1.7;
    cursor: pointer;
}
.ct-pdpa-check input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 0.3rem;
    accent-color: var(--ct-ink);
}
.ct-pdpa-check a {
    color: var(--ct-ink);
    font-weight: 600;
    text-decoration: underline;
}
.ct-pdpa-check a:hover {
    color: var(--ct-blue);
}

.ct-captcha {
    margin-bottom: 1.25rem;
    min-height: 78px; /* ขนาดของ widget reCAPTCHA - กันฟอร์มกระโดดตอนโหลดเสร็จ */
}

.ct-submit,
.ct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 46px;
    border: 0;
    border-radius: 4px;
    background: var(--ct-ink);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.ct-submit {
    width: 100%;
}
.ct-btn {
    padding: 0.5rem 1.75rem;
}
.ct-submit i,
.ct-btn i {
    font-size: 0.85em;
}
.ct-submit:hover,
.ct-btn:hover {
    background: var(--bs-primary-300, #202eab);
    color: #fff;
}
.ct-submit:disabled {
    opacity: 0.65;
}
/* ปุ่ม FAQ ในโหมดสาธิต (ถาม-ตอบปิดอยู่) - หน้าตาเหมือนปุ่มปกติ (ไม่ทำจาง) แต่กดไม่ได้และไม่เปลี่ยนสีตอน hover */
.ct-btn.is-disabled,
.ct-btn.is-disabled:hover {
    background: var(--ct-ink);
    cursor: default;
}
.ct-form-note {
    text-align: center;
    color: var(--ct-text);
    font-size: 0.85rem;
    margin: 0.75rem 0 0;
}

/* ---------- แถบชวนไป FAQ ---------- */
.ct-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    margin-top: 2.5rem;
    background: #dfe7f5;
    border-radius: var(--ct-radius);
    padding: 2rem 2.5rem;
}
/* ภาพหูฟัง 590x458 มีวงกลมพื้นหลังในตัวแล้ว - กำหนดแค่ความกว้าง */
.ct-help-art {
    flex: 0 0 auto;
    width: 170px;
    height: auto;
}
.ct-help-text h2 {
    color: var(--ct-ink);
    font-weight: 800;
    font-size: 1.4rem;
    margin: 0 0 0.35rem;
}
.ct-help-text p {
    color: var(--ct-text);
    font-size: 0.92rem;
    line-height: 1.7;
    margin: 0 0 1rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199.98px) {
    .ct-info-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem 0;
    }
    .ct-info-item:nth-child(3) {
        border-left: 0;
    }
    .ct-two-col {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 991.98px) {
    /* ภาพรถไฟ/อาคารอยู่ใต้ข้อความ - ไล่สีฟ้าอ่อนทับฝั่งซ้ายให้อ่านตัวหนังสือกรมท่าออก */
    .ct-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        background: linear-gradient(90deg, rgba(217, 232, 251, 0.92) 0%, rgba(217, 232, 251, 0.7) 60%, rgba(217, 232, 251, 0) 100%);
    }
}

@media (max-width: 767.98px) {
    .ct-hero::after { background-position: 72% center; }
    .ct-hero-inner { padding-inline: clamp(1rem, 4.7vw, 5.75rem); padding-left: calc(clamp(1rem, 4.7vw, 5.75rem) + 23px); }

    .ct-info-bar {
        grid-template-columns: minmax(0, 1fr);
        padding: 1rem 0.25rem;
    }
    .ct-info-item {
        padding: 0.75rem 1rem;
    }
    .ct-info-item + .ct-info-item {
        border-left: 0;
        border-top: 1px solid var(--ct-line);
    }
    .ct-card {
        padding: 1.5rem 1.25rem;
    }
    .ct-help {
        flex-direction: column;
        text-align: center;
        padding: 1.75rem 1.25rem;
    }
    .ct-help-text p br {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .ct-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
    .ct-social-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 1rem;
    }
    .ct-social-list li:nth-child(3) {
        border-left: 0;
    }
}
