@charset "utf-8";
/* CSS Document */

/* リセット・基本設定 */
* {
    box-sizing: border-box;
}

html {
    font-family: 'Hiragino Kaku Gothic Pro', Meiryo, Osaka, 'MS PGothic', arial, sans-serif;
    font-size: 62.5%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 1.6rem;
    line-height: 1.4;
    color: #101010;
    background: #f2f5f8;
}

a:hover {
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ヘッダー */
.header {
    background: #ffffff;
    border-bottom: 2px solid #b2dcf0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1000px;
    padding: 15px 20px;
    margin: 0 auto;
    line-height: 1;
}

.logo img {
    width: 66px;
    height: 30px;
}

.nav-links {
    display: flex;
    justify-content: flex-end;
}

.post-link {
    padding-right: 20px;
}

.post-link a {
    padding: 10px 25px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    background: #2ea1d7;
    border-radius: 6px;
    transition: all 0.5s 0s ease;
}

.post-link a:hover {
    background: #1e729a;
}

.home-link a {
    padding: 10px 15px;
    color: black;
    text-decoration: none;
    background: #f1f2f3;
    border-radius: 6px;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    margin: 0 auto;
}

/* 検索フォーム */
.search-container {
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    font-size: 1.6rem;
    border: 1px solid #dddddd;
    border-radius: 4px;
}

.search-button {
    padding: 8px 20px;
    font-size: 1.6rem;
    color: white;
    cursor: pointer;
    background: #00B4CC;
    border: none;
    border-radius: 4px;
}

.search-button:hover {
    background: #0056b3;
}

.search-clear {
    padding: 8px 15px;
    color: white;
    text-align: center;
    text-decoration: none;
    background: #6c757d;
    border-radius: 4px;
}

.search-clear:hover {
    text-decoration: none;
    background: #545b62;
}

.search-result-info {
    padding: 10px 20px;
    margin-bottom: 20px;
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    border-radius: 0 4px 4px 0;
}

/* 投稿一覧 */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.no-posts {
    padding: 40px;
    font-size: 1.8rem;
    color: #666666;
    text-align: center;
    background: white;
    border-radius: 8px;
}

/* 投稿アイテム */
.post {
    padding: 10px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-header {
    padding: 10px 12px;
    margin: 8px 8px 20px 8px;
    background: #f2efe7;
    border-bottom: 1px solid #e7e7e7;
    border-radius: 8px;
}

.post-header h2 {
    overflow-wrap: anywhere;
}

.post-title {
    margin-bottom: 2px;
    font-size: 2rem;
    line-height: 1.4;
    color: #333333;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.post-author-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.post-name a {
    font-size: 1.8rem;
    text-shadow: 0 1px 0 rgba(16, 16, 16, 0.1);
}

.post-url a {
    padding: 2px 6px;
    color: #28a745;
    text-decoration: none;
    background: #f8f9fa;
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(16, 16, 16, 0.2);
}

.post-date {
    font-size: 1.4rem;
    color: #878787;
}

/* 投稿本文 */
.post-body {
    display: flex;
    gap: 25px;
    padding: 0 2px;
    margin: 0 10px 20px 10px;
}

.post-images {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    gap: 10px;
    width: 300px;
}

.image-container {
    width: fit-content;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.image-link {
    display: block;
}

.post-image {
    display: block;
    max-height: 380px;
    border-radius: 4px;
    transition: opacity 0.2s;
}

.post-image:hover {
    opacity: 0.9;
}

.post-content {
    flex: 1;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* 投稿フッター */
.post-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #eeeeee;
}

.delete-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.delete-password {
    width: 120px;
    padding: 5px 8px;
    font-size: 1.4rem;
    border: 1px solid #dddddd;
    border-radius: 3px;
}

.delete-button {
    padding: 4px 12px;
    font-size: 1.4rem;
    color: white;
    cursor: pointer;
    background: #dc3545;
    border: none;
    border-radius: 3px;
}

.delete-button:hover {
    background: #c82333;
}

/* 投稿フォーム */
.post-form-container {
    max-width: 700px;
    padding: 30px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-form-header {
    padding: 12px 0;
    margin-bottom: 10px;
    background: #f2efe7;
    border-radius: 8px;
}

.post-form-container h1 {
    font-size: 2rem;
    color: #333333;
    text-align: center;
}

.form-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    margin-bottom: 30px;
    background: #f1f2f3;
    border-radius: 8px;
}

.form-notice p:nth-child(2) {
    margin-top: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333333;
}

.required {
    font-size: 1.5rem;
    color: #dc3545;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    font-family: inherit;
    font-size: 1.6rem;
    border: 1px solid #dddddd;
    border-radius: 4px;
}

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

.form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    font-size: 1.4rem;
    background: #f8f9fa;
    border: 1px solid #dddddd;
    border-radius: 4px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 1.4rem;
    color: #666666;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    text-align: center;
}

.submit-button {
    padding: 12px 50px;
    font-size: 1.6rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    background: #2ea1d7;
    border: none;
    border-radius: 4px;
    transition: all 0.5s 0s ease;
}

.submit-button:hover {
    background: #1e729a;
}

.cancel-link {
    box-sizing: border-box;
    display: inline-block;
    padding: 12px 30px;
    color: black;
    text-decoration: none;
    border: 3px solid #cccccc;
    border-radius: 4px;
    transition: all 0.5s 0s ease;
}

.cancel-link:hover {
    background: #cccccc;
}

.form-attention {
    margin-top: 15px;
    font-size: 1.4rem;
    text-align: center;
}

/* メッセージ */
.success-message {
    padding: 15px;
    margin-bottom: 20px;
    color: #155724;
    text-align: center;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

.error-message,
.error-messages {
    padding: 15px;
    margin-bottom: 20px;
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.error-messages {
    max-width: 700px;
    margin: 0 auto 20px;
}

.error-messages li:nth-child(even) {
    margin-top: 5px;
}

.back-link {
    margin-left: 10px;
    color: #007bff;
}

/* 管理画面 */
.admin-login-container {
    max-width: 400px;
    padding: 40px;
    margin: 50px auto;
    text-align: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-login-container h1 {
    margin-bottom: 30px;
    color: #333333;
}

.login-form .form-group {
    text-align: left;
}

.login-button {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    font-size: 1.6rem;
    color: white;
    cursor: pointer;
    background: #007bff;
    border: none;
    border-radius: 4px;
}

.login-button:hover {
    background: #0056b3;
}

.admin-container {
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    margin-bottom: 30px;
    border-bottom: 2px solid #007bff;
}

.admin-header h1 {
    color: #333333;
}

.logout-link {
    padding: 8px 16px;
    color: white;
    text-decoration: none;
    background: #dc3545;
    border-radius: 4px;
}

.logout-link:hover {
    text-decoration: none;
    background: #c82333;
}

/* 統計情報 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.stat-label {
    display: block;
    margin-bottom: 5px;
    font-size: 1.5rem;
    color: #666666;
}

.stat-value {
    display: block;
    font-size: 3.2rem;
    font-weight: bold;
    color: #007bff;
}

/* 管理画面投稿テーブル */
.admin-posts h2 {
    margin-bottom: 20px;
    color: #333333;
}

.posts-table-container {
    overflow-x: auto;
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.posts-table th,
.posts-table td {
    padding: 12px;
    vertical-align: top;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.posts-table th {
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
}

.posts-table tr:hover {
    background: #f8f9fa;
}

.title-cell {
    max-width: 250px;
}

.title {
    margin-bottom: 5px;
    font-weight: 500;
}

.content-preview {
    font-size: 1.4rem;
    color: #666666;
}

.ip-cell {
    font-family: monospace;
    font-size: 1.4rem;
}

.date-cell {
    font-size: 1.4rem;
    white-space: nowrap;
}

.image-cell {
    text-align: center;
}

.image-count {
    padding: 2px 6px;
    font-size: 1.3rem;
    color: white;
    background: #28a745;
    border-radius: 3px;
}

.no-image {
    font-size: 1.4rem;
    color: #878787;
}

.action-cell {
    text-align: center;
}

.admin-delete-button {
    padding: 5px 10px;
    font-size: 1.3rem;
    color: white;
    cursor: pointer;
    background: #dc3545;
    border: none;
    border-radius: 3px;
}

.admin-delete-button:hover {
    background: #c82333;
}

/* ページネーション・フッター */
.footer {
    padding: 20px;
    margin-top: 30px;
    background: white;
    border-top: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.page-link {
    padding: 8px 12px;
    color: #1696d4;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s;
}

.page-link:hover {
    text-decoration: none;
    background: #e9ecef;
}

.page-link.current {
    color: white;
    background: #19a7ec;
    border-color: #1696d4;
}

.page-link.prev,
.page-link.next {
    font-weight: 500;
}

.page-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.page-ellipsis {
    padding: 8px 4px;
    color: #6c757d;
}

/* フッターコンテンツ */
.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    max-width: 1000px;
    padding-top: 15px;
    margin: 0 auto;
    border-top: 1px solid #e9ecef;
}

.footer-links .admin-link {
    padding: 6px 10px;
    font-size: 1.4rem;
    color: #6c757d;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s;
}

.footer-links .admin-link:hover {
    color: #495057;
    text-decoration: none;
    background: #f8f9fa;
}

.copyright {
    padding: 6px 10px;
    font-size: 1.4rem;
    color: #6c757d;
}

.copyright p {
    margin: 0;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header-container {
        padding: 15px;
    }

    .main-content {
        padding: 15px;
    }

    .header-top {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .nav-links {
        justify-content: center;
    }

    .search-input {
        min-width: auto;
    }

    .post-body {
        flex-direction: column;
        gap: 15px;
        margin: 0 5px 20px 5px;
    }

    .post-header {
        margin: 0 0 20px 0;
    }

    .post-images {
        flex-wrap: wrap;
        align-items: center;
        width: 100%;
    }

    .post-image {
        width: 320px;
        max-width: 100%;
        max-height: 200px;
        object-fit: cover;
        object-position: 25% 13%;
    }

    .post-meta {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
    }

    .post-time-info {
        width: 100%;
        text-align: right;
    }

    .form-actions {
        flex-direction: column;
    }

    .submit-button,
    .cancel-link {
        width: 100%;
        text-align: center;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .posts-table-container {
        font-size: 1.4rem;
    }

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

    .pagination {
        gap: 5px;
        margin-bottom: 15px;
    }

    .page-link {
        padding: 6px 8px;
        font-size: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
        align-items: normal;
    }

    .footer-links {
        text-align: right;
    }

    .copyright {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .post-form-container {
        padding: 20px;
        margin: 10px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input,
    .search-button,
    .search-clear {
        width: 100%;
    }

    .admin-login-container {
        padding: 30px 20px;
        margin: 20px;
    }

    .admin-container {
        padding: 20px;
        margin: 10px;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 359px) {

    .search-form {
        flex-direction: column;
    }
}