/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本スタイル */
body {
    font-family: 'Klee One', 'UD Digi Kyokasho NK-R', 'Comic Sans MS', 'Segoe Print', cursive, sans-serif;
    line-height: 1.8;
    color: #2a2a2a;
    background-color: #fafafa;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 29px,
            #f0f0f0 29px,
            #f0f0f0 30px
        );
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ナビゲーション */
.navbar {
    background: #2a2a2a;
    color: white;
    padding: 1.2rem 0;
    box-shadow: 3px 3px 0px rgba(0,0,0,0.2);
    border-bottom: 3px solid #000;
    transform: rotate(-0.5deg);
    margin-bottom: 2rem;
    position: relative;
    z-index: 10000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: rotate(0.5deg);
}

.logo {
    font-size: 1.6rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    letter-spacing: 1px;
    transform: rotate(-2deg);
    display: inline-block;
    text-shadow: 
        2px 2px 0px rgba(0,0,0,0.3),
        3px 3px 0px rgba(0,0,0,0.2),
        4px 4px 0px rgba(0,0,0,0.1),
        5px 5px 0px rgba(0,0,0,0.05);
    transition: transform 0.3s, text-shadow 0.3s;
}

.logo:hover {
    transform: rotate(-2deg) translateY(-2px);
    text-shadow: 
        3px 3px 0px rgba(0,0,0,0.3),
        4px 4px 0px rgba(0,0,0,0.2),
        5px 5px 0px rgba(0,0,0,0.1),
        6px 6px 0px rgba(0,0,0,0.05),
        7px 7px 0px rgba(0,0,0,0.03);
}

.logo-tech {
    font-style: normal;
    display: inline-block;
    color: #ffeb3b;
    text-shadow: 
        2px 2px 0px rgba(0,0,0,0.4),
        3px 3px 0px rgba(0,0,0,0.3),
        4px 4px 0px rgba(0,0,0,0.2);
    font-size: 1.1em;
    margin: 0 0.2rem;
    font-weight: bold;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 2rem;
    transition: transform 0.2s;
    display: inline-block;
    border-bottom: 2px dotted transparent;
}

.nav-links a:hover {
    transform: scale(1.1) rotate(-2deg);
    border-bottom-color: #ccc;
}

/* ドロップダウンメニュー */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.3rem);
    left: 0;
    background: white;
    border: 3px solid #2a2a2a;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.2);
    min-width: 250px;
    z-index: 9999;
    transform: rotate(-0.5deg);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* ドロップダウンと親要素の間の隙間を埋める */
.dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: -10px;
    right: -10px;
    height: 1rem;
    display: none;
    z-index: 9998;
}

.dropdown:hover::before {
    display: block;
}

.dropdown-menu a {
    display: block;
    color: #2a2a2a;
    padding: 0.8rem 1.2rem;
    text-decoration: none;
    border-bottom: 2px dotted #ccc;
    margin: 0;
    transition: background 0.2s, transform 0.2s;
    transform: none;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    transform: translateX(5px);
    border-bottom-color: #2a2a2a;
}

/* メインコンテンツ */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* ヒーローセクション */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: #2a2a2a;
    transform: rotate(-1deg);
    text-shadow: 3px 3px 0px #e0e0e0;
    letter-spacing: 2px;
}

.hero p {
    font-size: 1.3rem;
    color: #666;
    transform: rotate(0.5deg);
    font-style: italic;
}

/* カテゴリーグリッド */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.category-card {
    background: white;
    border: 3px solid #2a2a2a;
    border-radius: 0;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: #2a2a2a;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    transform: rotate(-1deg);
    position: relative;
}

.category-card:nth-child(even) {
    transform: rotate(1deg);
}

.category-card:hover {
    transform: rotate(0deg) translateY(-5px);
    box-shadow: 8px 8px 0px rgba(0,0,0,0.2);
}

.category-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: grayscale(30%);
}

.category-card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #2a2a2a;
    border-bottom: 2px dashed #999;
    padding-bottom: 0.5rem;
}

.category-card p {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* ページヘッダー */
.page-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    color: #2a2a2a;
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    transition: transform 0.2s;
    border-bottom: 2px dotted #666;
}

.back-link:hover {
    transform: translateX(-5px);
    border-bottom-style: solid;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    transform: rotate(-0.5deg);
    text-shadow: 2px 2px 0px #e0e0e0;
}

/* 検索ボックス */
.search-box {
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border: 2px solid #2a2a2a;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.1);
    transform: rotate(-0.3deg);
    position: relative;
    z-index: 1;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 3px solid #2a2a2a;
    background: white;
    font-family: inherit;
    transition: all 0.2s;
    color: #2a2a2a;
}

.search-input::placeholder {
    color: #999;
}

.search-input:focus {
    outline: none;
    background: #fffef0;
    border-color: #000;
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.15), 0 0 0 3px rgba(255,235,59,0.3);
    transform: scale(1.02);
    caret-color: #2a2a2a;
}

.search-input:focus::placeholder {
    opacity: 0.5;
}

.search-button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    background: #2a2a2a;
    color: white;
    border: 2px solid #2a2a2a;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 3px 3px 0px rgba(0,0,0,0.2);
}

.search-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px rgba(0,0,0,0.3);
}

.search-button:active {
    transform: translate(0, 0);
    box-shadow: 1px 1px 0px rgba(0,0,0,0.2);
}

.clear-button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    background: #f5f5f5;
    color: #2a2a2a;
    border: 2px solid #666;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
    transition: background 0.2s;
}

.clear-button:hover {
    background: #e0e0e0;
}

.search-result {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #f5f5f5;
    border-left: 4px solid #2a2a2a;
    font-size: 0.95rem;
    transform: rotate(0.2deg);
}

.search-result strong {
    background: none;
    color: #2a2a2a;
    font-weight: bold;
}

/* 投稿リスト */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-card {
    background: white;
    border: 2px solid #2a2a2a;
    border-radius: 0;
    padding: 2rem;
    text-decoration: none;
    color: #2a2a2a;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    transform: rotate(-0.3deg);
    position: relative;
}

.post-card:nth-child(even) {
    transform: rotate(0.3deg);
}

.post-card:hover {
    transform: rotate(0deg) translateX(5px);
    box-shadow: 6px 6px 0px rgba(0,0,0,0.15);
}

.post-date {
    color: #666;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.post-card h2 {
    font-size: 1.7rem;
    margin-bottom: 0.5rem;
    color: #2a2a2a;
    border-bottom: 2px dashed #ccc;
    padding-bottom: 0.3rem;
}

.post-summary {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #f5f5f5;
    color: #2a2a2a;
    padding: 0.3rem 0.8rem;
    border: 2px solid #2a2a2a;
    border-radius: 0;
    font-size: 0.85rem;
    transform: skew(-5deg);
    box-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

/* 投稿メタ情報 */
.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed #ccc;
}

/* 投稿コンテンツ */
.post-content {
    background: white;
    border: 3px solid #2a2a2a;
    border-radius: 0;
    padding: 2.5rem;
    box-shadow: 6px 6px 0px rgba(0,0,0,0.1);
    line-height: 2;
    transform: rotate(-0.2deg);
    font-size: 1.1rem;
}

.post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2a2a2a;
    border-bottom: 3px solid #2a2a2a;
    padding-bottom: 0.5rem;
    transform: rotate(-0.5deg);
    font-size: 1.8rem;
}

.post-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: #444;
    border-left: 4px solid #2a2a2a;
    padding-left: 0.8rem;
    font-size: 1.4rem;
}

.post-content h4 {
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    color: #555;
    font-size: 1.2rem;
}

.post-content p {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}

.post-content code {
    background: #f5f5f5;
    padding: 0.3rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 0;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.post-content pre {
    background: #2a2a2a;
    color: #f0f0f0;
    padding: 1.5rem;
    border: 3px solid #000;
    border-radius: 0;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.3);
    font-size: 1rem;
    position: relative;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    border: none;
}

/* コピーボタンのスタイル */
.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: bold;
    background: #f5f5f5;
    color: #2a2a2a;
    border: 2px solid #2a2a2a;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.3);
    z-index: 10;
}

.copy-button:hover {
    background: #ffeb3b;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px rgba(0,0,0,0.4);
}

.copy-button:active {
    transform: translate(0, 0);
    box-shadow: 1px 1px 0px rgba(0,0,0,0.3);
}

.copy-button.copied {
    background: #4caf50;
    color: white;
    border-color: #2e7d32;
}

.post-content ul,
.post-content ol {
    margin-left: 2rem;
    margin-bottom: 1.2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

/* マーカー・強調スタイル */
.post-content strong {
    background: linear-gradient(transparent 60%, #ffeb3b 60%, #ffeb3b 90%, transparent 90%);
    font-weight: bold;
    padding: 0 0.2rem;
    color: #2a2a2a;
}

.post-content em {
    font-style: italic;
    color: #444;
    border-bottom: 2px dotted #666;
    padding-bottom: 2px;
}

.post-content mark {
    background: #ffeb3b;
    padding: 0.2rem 0.4rem;
    color: #2a2a2a;
    font-weight: bold;
    border: 2px dashed #2a2a2a;
    border-radius: 0;
    transform: skew(-3deg);
    display: inline-block;
}

.post-content del {
    text-decoration: line-through;
    text-decoration-color: #ff5252;
    text-decoration-thickness: 3px;
    color: #888;
}

.post-content ins {
    text-decoration: none;
    background: #e0e0e0;
    padding: 0.2rem 0.4rem;
    border-left: 4px solid #2a2a2a;
    font-weight: bold;
}

/* 投稿なし */
.no-posts {
    text-align: center;
    padding: 3rem;
    background: white;
    border: 3px dashed #999;
    border-radius: 0;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.05);
    transform: rotate(-0.5deg);
}

.no-posts p {
    color: #666;
    font-size: 1.1rem;
    font-style: italic;
}

/* フッター */
footer {
    background: #2a2a2a;
    color: #ccc;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    border-top: 4px solid #000;
    box-shadow: 0 -3px 0px rgba(0,0,0,0.2);
}

footer p {
    font-style: italic;
    letter-spacing: 1px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .post-card h2 {
        font-size: 1.3rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
