/* ========================================
   投稿ダイアログ共通スタイル
   ポートフォリオ・ストーリー新規登録用
   ======================================== */

/* ========================================
   ダイアログ本体
   ======================================== */
.post-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 720px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    padding: 0;
    border: none;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    font-family: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
}

.post-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.68);
}

.post-dialog__inner {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 64px);
    background-color: #fff;
}

/* ========================================
   ヘッダー
   ======================================== */
.post-dialog__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px 10px;
    /* background-color: #fff; */
    flex-shrink: 0;
    position: relative;
}

.post-dialog__title {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

.post-dialog__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    top: 8px;
    right: 8px;
}

.post-dialog__close:hover .post-dialog__close-icon::before,
.post-dialog__close:hover .post-dialog__close-icon::after {
    background-color: #333;
}

.post-dialog__close-icon {
    width: 16px;
    height: 16px;
    position: relative;
}

.post-dialog__close-icon::before,
.post-dialog__close-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #707070;
    border-radius: 1px;
}

.post-dialog__close-icon::before {
    transform: rotate(45deg);
}

.post-dialog__close-icon::after {
    transform: rotate(-45deg);
}

/* ========================================
   ボディ
   ======================================== */
.post-dialog__body {
    padding: 0 35px 35px;
    overflow-y: auto;
    flex: 1;
    background-color: #fff;
}

.post-dialog__form {
    display: flex;
    flex-direction: column;
}

/* ========================================
   画像ドロップエリア
   ======================================== */
.post-dialog__drop-area {
    position: relative;
    width: 100%;
    border: 3px dashed #efefef;
    border-radius: 4px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.post-dialog__drop-area:hover {
    border-color: #ccc;
}

.post-dialog__drop-area.is-dragover {
    border-color: #888;
    background-color: #fafafa;
}

.post-dialog__file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.post-dialog__drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    pointer-events: none;
}

.post-dialog__drop-content svg {
    color: #888;
}

.post-dialog__drop-title {
    font-size: 16px;
    font-weight: bold;
    color: #888;
}

.post-dialog__drop-hint {
    font-size: 13px;
    color: #888;
}

.post-dialog__upload-note {
    margin: 6px 0 0;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

/* プレビュー */
.post-dialog__preview {
    position: relative;
    width: 100%;
    height: 100%;
}

.post-dialog__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-dialog__preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s, background-color 0.2s;
}

.post-dialog__preview-remove:hover {
    background-color: #fff;
    color: #e74c3c;
}

/* ========================================
   フォームフィールド
   ======================================== */
.post-dialog__field {
    margin-bottom: 12px;
}

.post-dialog__label {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #888;
    margin-bottom: 8px;
}

.post-dialog__required {
    font-size: 13px;
    font-weight: bold;
    color: #888;
}

.post-dialog__hint {
    font-size: 13px;
    font-weight: normal;
    color: #888;
}

.post-dialog__textarea--medium {
    height: 129px;
    resize: vertical;
}

/* ========================================
   アクションボタン
   ======================================== */
.post-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ========================================
   レスポンシブ対応
   ======================================== */
@media (max-width: 768px) {
    .post-dialog {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        border-radius: 0;
    }

    .post-dialog__inner {
        height: 100%;
        max-height: none;
    }

    .post-dialog__header {
        padding: 20px;
    }

    .post-dialog__body {
        padding: 0 20px 20px;
    }

    .post-dialog__drop-area {
        height: 160px;
    }
}
