@charset "UTF-8";
/**
 * Advanced Shop HP Blog - Post Editor Styles
 */

/* Baseline Reset & Typos */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
}

/* Header */
.admin-header {
    background: #2563eb;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.5rem;
}

.admin-header nav a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
}

.admin-header nav a:hover {
    text-decoration: underline;
}

/* Container */
.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.message.error {
    background: #fee;
    color: #c00;
}

.message.success {
    background: #efe;
    color: #0a0;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    min-height: 300px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group .description {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

/* ----------------------------------------
   Drop Overlay (Full Screen)
   ---------------------------------------- */
#file-drop-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 99, 235, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    pointer-events: none;
    /* 下の要素を邪魔しない */
    border: 8px dashed rgba(255, 255, 255, 0.5);
    transition: opacity 0.3s ease;
}

#file-drop-overlay.active {
    display: flex;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.status-publish {
    background: #d1fae5;
    color: #065f46;
}

.status-draft {
    background: #fef3c7;
    color: #92400e;
}

.status-future {
    background: #dbeafe;
    color: #1e40af;
}

/* Full Screen Layout (PC) - Editor Only */
@media (min-width: 1200px) {
    body.page-editor {
        height: 100vh;
        overflow: hidden;
    }

    .page-editor .admin-header {
        height: 60px;
        flex-shrink: 0;
    }

    .page-editor .admin-container {
        max-width: 100%;
        margin: 0;
        padding: 1rem;
        height: calc(100vh - 60px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .editor-layout {
        display: grid;
        grid-template-columns: 3fr 5fr 2fr;
        gap: 1rem;
        flex: 1;
        min-height: 0;
        margin-top: 1rem;
        align-items: stretch;
    }

    .editor-media,
    .editor-main,
    .editor-sidebar {
        height: 100%;
        overflow-y: auto;
        background: white;
        padding: 1.5rem;
        border-radius: 8px;
    }
}

/* Preview Modal Fit Fix */
#preview-modal>div {
    max-width: 1400px !important;
    width: 95% !important;
}


/* Tablet / Mobile */
@media (max-width: 1199px) {
    .admin-container {
        max-width: 98%;
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .editor-layout {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }

    .editor-media {
        background: white;
        padding: 1.5rem;
        border-radius: 8px;
        grid-column: 1 / -1;
        max-height: 400px;
        overflow-y: auto;
    }

    .editor-main {
        background: white;
        padding: 2rem;
        border-radius: 8px;
    }

    .editor-sidebar {
        background: white;
        padding: 1.5rem;
        border-radius: 8px;
    }
}

@media (max-width: 768px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .editor-media,
    .editor-sidebar,
    .editor-main {
        grid-column: auto;
    }
}

/* Tab UI */
.tab-menu {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1rem;
}

.tab-menu button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-menu button.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.media-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #f0f0f0;
    padding: 1rem;
    background: #fafafa;
    border-radius: 4px;
}

@media (min-width: 1200px) {
    .media-list-grid {
        max-height: none;
        overflow-y: visible;
    }
}

.media-list-item {
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.5rem;
    background: white;
    text-align: center;
}

.media-list-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 2px;
    margin-bottom: 0.5rem;
}

.media-list-name {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Utilities */
.action-link {
    margin-right: 0.5rem;
}

.delete-link {
    color: #dc2626;
}

/* ----------------------------------------
   Sidebar Sections & Chips
   ---------------------------------------- */
.editor-sidebar-section {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1.5rem;
}

.section-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #333;
}

.category-chips-wrapper,
.tag-cloud-helper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.admin-chip {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.admin-chip:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

.admin-chip.active {
    background: #2563eb;
    color: white;
    border-color: #1d4ed8;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.tag-helper-chip {
    background: #fff;
}

.btn-text-toggle {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 0.85rem;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

.btn-text-toggle:hover {
    color: #1d4ed8;
}

.add-new-category-box {
    margin-top: 0.5rem;
}