/**
 * mls_blog.css — ブログ公開ページ + 管理画面スタイル
 *
 * /var/www/mallink/ml_style/mls_blog.css
 * 2026-02-19 created
 *
 * CSS Variables (root_css_style.css から継承):
 *   --primary-color: #dd3333
 *   --text-color: #333
 *   --light-gray: #f5f5f5
 *   --text-light: #666
 */

/* ========================================
   A. 公開ページ共通（blog/index.php, blog/detail.php）
   ======================================== */

.blog-page {
    font-family: 'Noto Sans JP', sans-serif;
    color: #333;
    min-height: 100vh;
    background: #f7f8fa;
}

.blog-page *,
.blog-page *::before,
.blog-page *::after {
    box-sizing: border-box;
}

/* ---- ヘッダーバー ---- */
.blog-header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.blog-header-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.blog-header-logo {
    flex-shrink: 0;
}

.blog-header-logo img {
    height: 36px;
    width: auto;
    display: block;
}

.blog-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    letter-spacing: 0.15em;
    flex: 1;
    text-align: center;
}

.blog-header-title:hover {
    color: #dd3333;
}

.blog-header-home {
    font-size: 0.875rem;
    color: #dd3333;
    text-decoration: none;
    font-weight: 500;
}

.blog-header-home:hover {
    text-decoration: underline;
}

/* ---- メインコンテンツ ---- */
.blog-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ---- タブUI（index.php news-tabs と同デザイン） ---- */
.blog-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 8px;
}

.blog-tabs::-webkit-scrollbar {
    display: none;
}

.blog-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    color: #666;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-radius: 6px;
    text-decoration: none;
}

.blog-tab:hover {
    color: #dd3333;
    background: rgba(221, 51, 51, 0.1);
}

.blog-tab.active {
    color: #fff;
    background: #dd3333;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(221, 51, 51, 0.3);
}

/* ---- 記事リスト ---- */
.blog-list {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    border: 1px solid #e8e8e8;
}

.blog-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.blog-list-item:last-child {
    border-bottom: none;
}

.blog-list-item:hover {
    background: #f8f5f5;
}

.blog-list-date {
    color: #dd3333;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

.blog-list-category {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

.blog-list-category.cat-notice { background: #fff3cd; color: #856404; }
.blog-list-category.cat-event  { background: #d1ecf1; color: #0c5460; }
.blog-list-category.cat-info   { background: #d4edda; color: #155724; }

.blog-list-title {
    color: #333;
    font-size: 0.875rem;
    flex: 1;
}

.blog-list-icon {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.blog-list-icon i {
    color: #666;
    font-size: 0.875rem;
}

.blog-list-icon .fa-file-pdf { color: #dc3545; }
.blog-list-icon .fa-external-link-alt { color: #0066cc; }
.blog-list-icon .fa-arrow-right { color: #dd3333; }

/* ---- ページネーション ---- */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.blog-pagination a,
.blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.875rem;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.blog-pagination a:hover {
    border-color: #dd3333;
    color: #dd3333;
}

.blog-pagination .current {
    background: #dd3333;
    color: #fff;
    border-color: #dd3333;
}

.blog-no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 0.9rem;
}

/* ---- 記事詳細（detail.php） ---- */
.blog-detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.blog-detail-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.blog-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1.5;
}

.blog-detail-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.blog-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.blog-detail-body p {
    margin-bottom: 1rem;
}

.blog-detail-thumbnail {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.blog-back-link {
    display: inline-block;
    margin-top: 2rem;
    color: #dd3333;
    text-decoration: none;
    font-weight: 500;
}

.blog-back-link:hover {
    text-decoration: underline;
}

/* ---- モバイル対応 ---- */
@media (max-width: 768px) {
    .blog-main {
        padding: 1.5rem 1rem;
    }

    .blog-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .blog-list-icon {
        margin-left: 0;
    }

    .blog-detail-title {
        font-size: 1.25rem;
    }

    .blog-tab {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

/* ========================================
   B. 管理画面（blog/kanri.php）
   ======================================== */

.kanri-page {
    font-family: 'Noto Sans JP', sans-serif;
    color: #333;
    min-height: 100vh;
    background: #eef1f5;
}

.kanri-page *,
.kanri-page *::before,
.kanri-page *::after {
    box-sizing: border-box;
}

/* ---- ヘッダー ---- */
.kanri-header {
    background: #2c3e50;
    color: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.kanri-header h1 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.kanri-header-links {
    display: flex;
    gap: 1rem;
}

.kanri-header-links a {
    color: #ccc;
    font-size: 0.8rem;
    text-decoration: none;
}

.kanri-header-links a:hover {
    color: #fff;
}

/* ---- コンテンツ ---- */
.kanri-main {
    max-width: 960px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ---- ツールバー ---- */
.kanri-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.kanri-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kanri-filter {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.8rem;
    background: #fff;
}

.kanri-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.kanri-btn-primary {
    background: #dd3333;
    color: #fff;
}

.kanri-btn-primary:hover {
    background: #c22;
}

.kanri-btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
}

.kanri-btn-secondary:hover {
    background: #f0f0f0;
}

.kanri-btn-danger {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.kanri-btn-danger:hover {
    background: #dc3545;
    color: #fff;
}

.kanri-btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* ---- 記事テーブル ---- */
.kanri-table-wrap {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.kanri-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.kanri-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}

.kanri-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.kanri-table tr:hover td {
    background: #fafafa;
}

.kanri-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.kanri-status-draft { background: #e9ecef; color: #495057; }
.kanri-status-published { background: #d4edda; color: #155724; }
.kanri-status-scheduled { background: #fff3cd; color: #856404; }

.kanri-actions {
    display: flex;
    gap: 0.5rem;
}

/* ---- 編集フォーム（モーダル） ---- */
.kanri-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    overflow-y: auto;
}

.kanri-modal-overlay.is-open {
    display: flex;
}

.kanri-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.kanri-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.kanri-modal-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.kanri-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.kanri-modal-close:hover {
    color: #333;
}

.kanri-modal-body {
    padding: 1.5rem;
}

.kanri-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ---- フォーム ---- */
.kanri-form-group {
    margin-bottom: 1.25rem;
}

.kanri-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #555;
}

.kanri-form-group input[type="text"],
.kanri-form-group input[type="url"],
.kanri-form-group input[type="datetime-local"],
.kanri-form-group select,
.kanri-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
}

.kanri-form-group textarea {
    min-height: 200px;
    resize: vertical;
}

.kanri-form-group input:focus,
.kanri-form-group select:focus,
.kanri-form-group textarea:focus {
    outline: none;
    border-color: #dd3333;
    box-shadow: 0 0 0 2px rgba(221,51,51,0.15);
}

.kanri-form-row {
    display: flex;
    gap: 1rem;
}

.kanri-form-row .kanri-form-group {
    flex: 1;
}

/* ---- 権限不足画面 ---- */
.kanri-denied {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.kanri-denied-card {
    background: #fff;
    border-radius: 15px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.kanri-denied-levels {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanri-denied-level {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85rem;
}

.kanri-denied-badge {
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    width: 150px;
    flex-shrink: 0;
    text-align: center;
    white-space: nowrap;
}

.kanri-denied-login {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #dd3333;
    color: #fff;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(221,51,51,0.35);
    transition: all 0.2s;
}

.kanri-denied-login:hover {
    background: #c22;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(221,51,51,0.45);
}

.kanri-denied-login-icon {
    background: rgba(255,255,255,0.25);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* ---- モバイル ---- */
@media (max-width: 768px) {
    .kanri-main {
        padding: 1rem;
    }

    .kanri-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .kanri-form-row {
        flex-direction: column;
        gap: 0;
    }

    .kanri-table {
        font-size: 0.75rem;
    }

    .kanri-table th,
    .kanri-table td {
        padding: 8px;
    }
}
