@charset "utf-8";
/* =====================================================================
   yip-course-search.css
   產業新尖兵「開班資料查詢條件」專用樣式（元件前綴：.yipq）

   為什麼獨立一支：
   這個查詢區原本沿用共用的 .organizer-search-* 版型，但日期欄位是
   Turbo.Lib 的 DatePickerTWFor 產生的 bootstrap 3 .input-group，
   bootstrap 給 .input-group-btn 的 width:1%（配合 display:table 用的）
   在共用版型裡沒有被還原，flex 化之後那個 span 只剩約 4px，
   裡面 37px 的日曆鈕就整個溢出欄位、壓在右邊欄位的輸入框上。
   共用版型要同時服務十幾個頁面，動它風險高，因此本頁改用這支
   自足的樣式：版面、欄位外觀、日期元件全部在這裡從頭寫，
   不依賴 .organizer-search-* 的任何規則。

   視覺沿用全站既有的色票與尺寸（標籤 #5e3927、框線 #b9a89c、
   圓角 9px、欄高 2.75rem、主色 #aa4b8f），所以外觀與其他計畫一致。
   字級一律用相對單位（無障礙 CS2140401C）。
   ===================================================================== */

/* ---------- 查詢卡 ---------- */
.yipq {
    /* 日曆彈窗由 datetimepicker 以最近的定位祖先計算位置，
       這裡當基準，且不可裁切，否則彈窗會被切掉或跑到頁面下方。 */
    position: relative;
    overflow: visible;
    margin: 0 0 1.5rem;
    padding: 1.5rem;
    border: 1px solid #ead8c8;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 5px 14px rgba(115, 77, 0, .1);
}

/* ---------- 欄位網格：固定 3 欄，每欄等寬 ---------- */
.yipq__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    align-items: start;
}

/* minmax(0,…) + min-width:0 讓欄位可以縮到比內容還窄，
   內容才不會把格線撐開去擠壓隔壁欄位。 */
.yipq__field {
    min-width: 0;
    overflow: visible;
}

.yipq__label {
    display: block;
    margin-bottom: .35rem;
    color: #5e3927;
    font-weight: 700;
    line-height: 1.5;
}

/* ---------- 控制項外觀（一般輸入框、下拉、日期顯示框共用） ---------- */
.yipq__field input[type="text"],
.yipq__field select {
    display: block;
    float: none;            /* 蓋掉 bootstrap .input-group .form-control 的 float:left */
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 2.75rem;
    margin: 0;
    padding: .55rem .75rem;
    border: 1px solid #b9a89c;
    border-radius: 9px;
    background: #fff;
    box-shadow: none;
    color: #33261e;
    font: inherit;
    line-height: 1.5;
}

.yipq__field input[type="text"]:focus,
.yipq__field select:focus {
    border-color: #b9472c;
    outline: 3px solid rgba(26, 115, 232, .25);
    outline-offset: 1px;
}

.yipq__field input[type="text"]::placeholder { color: #9b8b80; }

/* ---------- 日期欄位 ----------
   helper 產生的結構固定為：
     div.date.datepicker-outline.input-group
       ├ input[type=text].form-control   顯示用（民國年）
       ├ input[type=hidden].datepickerinput  西元年，外掛靠這個 class 辨識
       └ span.input-group-btn > a.open-datepicker
   class 名稱由 Turbo.Lib 與 datetimepicker 綁定，不能改，
   所以這裡把它們的寬度規則整組重寫。 */
.yipq__field .input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
}

/* 輸入框吃剩餘寬度；width:auto 是關鍵 ——
   bootstrap 給它 width:100%，在 flex 容器裡會先撐到整欄寬，
   日曆鈕就只能被擠到欄位外面。 */
.yipq__field .input-group > input[type="text"] {
    flex: 1 1 auto;
    width: auto;
    border-right: 0;
    border-radius: 9px 0 0 9px;
}

/* 西元值只是傳給後端用，不佔版面 */
.yipq__field .input-group > .datepickerinput { display: none; }

/* ★ 本頁跑版的真正原因：bootstrap 的 .input-group-btn { width: 1% }。
   一欄 370px 時 1% ≒ 3.7px，而裡面的日曆鈕是 37px，
   於是溢出 33px 壓到右邊欄位上。改回 auto，讓它由按鈕撐開。 */
.yipq__field .input-group > .input-group-btn {
    flex: 0 0 auto;
    display: flex;
    width: auto;
    font-size: inherit;
    white-space: nowrap;
}

.yipq__field .open-datepicker {
    display: flex;
    align-items: center;
    height: auto;
    min-height: 2.75rem;
    padding: 0 .85rem;
    border: 1px solid #aa4b8f;
    border-radius: 0 9px 9px 0;
    background: #aa4b8f;
    color: #fff;
    text-decoration: none;
    line-height: 1.5;
    cursor: pointer;
}

.yipq__field .open-datepicker:hover,
.yipq__field .open-datepicker:focus {
    border-color: #8f3c78;
    background: #8f3c78;
    color: #fff;
}

.yipq__field .open-datepicker:focus {
    outline: 3px solid rgba(26, 115, 232, .25);
    outline-offset: 1px;
}

/* 日曆彈窗要疊在下方的查詢結果表格之上 */
.yipq .bootstrap-datetimepicker-widget { z-index: 100; }

/* ---------- 課程狀態（複選勾選框） ----------
   用 fieldset + legend 讓三個勾選框有群組名稱（無障礙），
   把瀏覽器給 fieldset 的預設框線／內距拿掉，外觀與其他欄位一致。 */
.yipq__checks {
    margin: 0;
    padding: 0;
    border: 0;
}

.yipq__checks > legend {
    float: none;
    width: auto;
    margin-bottom: .35rem;
    padding: 0;
    border: 0;
    font-size: inherit;
}

.yipq__check-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.1rem;
    min-height: 2.75rem;
    align-items: center;
}

.yipq__check {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    color: #33261e;
    font-weight: 400;
    line-height: 1.5;
    cursor: pointer;
}

.yipq__check input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    accent-color: #aa4b8f;
    cursor: pointer;
}

.yipq__check input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(26, 115, 232, .35);
    outline-offset: 2px;
}

/* ---------- 送出 ---------- */
.yipq__actions {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

/* 沿用全站 .btn.btn-primary 的顏色，只補尺寸，避免與其他計畫的查詢鈕不一致 */
.yipq__submit { min-width: 10rem; }

/* ---------- 窄螢幕 ---------- */
@media (max-width: 991px) {
    .yipq__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575px) {
    .yipq { padding: 1.1rem; }
    .yipq__grid { grid-template-columns: minmax(0, 1fr); }
}
