/*
 Theme Name: In-You
 Template:   kadence
*/
/* --- 1. 基礎表單容器 --- */
.iy-form {
    margin: 20px auto;
    padding: 30px;
    background: #fcfcfc;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

/* --- 2. ACF 欄位佈局與間距 --- */
.iy-form .acf-field, 
.iy-form p {
    margin-bottom: 20px !important;
}

.iy-form .acf-fields {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px 25px !important;
    border: none !important;
}

/* 預設全寬 */
.iy-form .acf-field {
    grid-column: span 2 !important;
}

/* 標籤 (Label) */
.iy-form label,
.iy-form .acf-label label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--global-palette-text, #333);
}

/* --- 3. 統一輸入框樣式 --- */
.iy-form input[type="text"],
.iy-form input[type="password"],
.iy-form input[type="email"],
.iy-form input[type="tel"],
.iy-form input[type="number"],
.iy-form input[type="date"],
.iy-form textarea,
.iy-form select {
    width: 100% !important;
    padding: 12px 15px !important;
    font-size: 16px !important;
    border: 1px solid var(--global-palette-border, #ccc);
    border-radius: 4px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Focus 狀態 (品牌色) */
.iy-form input:focus {
    outline: none;
    border-color: var(--global-palette-highlight, #202020);
    box-shadow: 0 0 0 1px var(--global-palette-highlight, #202020);
}

/* --- 4. 唯讀與禁用狀態 (ReadOnly / Disabled) --- */
/* 這裡處理你故意 disabled 的欄位樣式 */
.iy-form input[readonly],
.iy-form input[disabled],
.iy-form .acf-field[data-readonly="1"] input {
    background-color: #f5f5f5 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    border-color: #eee !important;
    box-shadow: none !important;
}

/* --- 5. 特殊 ACF 欄位美化 --- */
/* Checkbox 與 Radio */
.acf-field .acf-input label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px;
    margin: 0 !important;
    padding: 8px 0 !important;
    cursor: pointer;
}

.acf-field .acf-input input[type="checkbox"],
.acf-field .acf-input input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: var(--global-palette-highlight, #202020);
}

/* 監護人區塊裝飾 (註冊頁面) */
.iy-register .acf-field[data-name^="gardian_"] {
    background-color: rgba(0, 0, 0, 0.02);
    border-left: 4px solid var(--global-palette-highlight, #202020);
    padding-left: 15px !important;
}

/* 檔案上傳區域 (作品上傳) */
.acf-field-image .acf-basic-uploader, 
.acf-field-file .acf-basic-uploader {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    background: #fff;
}

/* --- 6. 桌面版半寬佈局 (Responsive) --- */
@media (min-width: 768px) {
    /* 註冊頁面半寬 */
    .iy-register .acf-field[data-name="gardian_signature"],
    .iy-register .acf-field[data-name="gardian_signature_date"] {
        grid-column: span 1 !important;
    }

    /* 作品上傳頁面半寬 */
    .iy-upload-artwork .acf-field[data-name="artist_name"],
    .iy-upload-artwork .acf-field[data-name="artwork_name"],
    .iy-upload-artwork .acf-field[data-name="submit_by"],
    .iy-upload-artwork .acf-field[data-name="submit_date"],
    .iy-upload-artwork .acf-field[data-name="artwork_number"] {
        grid-column: span 1 !important;
    }
}

/* --- 7. 提交按鈕 --- */
.iy-form .acf-form-submit {
    margin-top: 25px;
}

.iy-form .acf-form-submit .button,
.iy-form input[type="submit"] {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--global-palette-highlight, #202020) !important;
    color: #fff !important;
}

.iy-form .acf-form-submit .button:hover,
.iy-form input[type="submit"]:hover {
    opacity: 0.9;
}

/* 按鈕禁用狀態 (如 ToS 未勾選) */
.iy-form .acf-form-submit .button:disabled,
.iy-form input[type="submit"]:disabled {
    background-color: #ccc !important;
    color: #888 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* --- 8. 我的作品列表表格 (iy_my_artworks) --- */
.iy-my-artworks {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #fff;
}

.iy-my-artworks th, 
.iy-my-artworks td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.iy-my-artworks th {
    background-color: #f8f8f8;
    color: var(--global-palette-text, #333);
    font-weight: bold;
}

/* 狀態標籤顏色 (完整版) */
.iy-form .status-pending { color: #d68910; font-weight: bold; } /* 審核中 - 橘色 */
.iy-form .status-publish { color: #27ae60; font-weight: bold; } /* 已發佈 - 綠色 */
.iy-form .status-private { color: #c0392b; font-weight: bold; } /* 私人 - 紅色 */
.iy-form .status-draft   { color: #7f8c8d; font-weight: normal; } /* 草稿 - 灰色 */
.iy-form .status-future  { color: #2980b9; font-weight: normal; } /* 排程 - 藍色 */

/* 成功提示訊息 */
.submission-success {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}
/* 表格內縮圖樣式 */
.iy-table-preview {
    object-fit: cover; /* 自動裁切填滿，不會變形 */
    border-radius: 4px;
    border: 1px solid #eee;
    display: block;
}

/* 沒圖片時的文字樣式 */
.no-image {
    color: #ccc;
    text-transform: uppercase;
}

/* 調整表格對齊，讓圖片跟文字垂直置中 */
.iy-my-artworks td {
    vertical-align: middle !important;
}