/* Reset & Base */
:root {
    --bg-color: #fdfbf7;
    --text-color: #4a4a4a;
    --accent-pink: #f4dcd6;
    --accent-blue: #d6e4f4;
    --accent-yellow: #f4f0d6;
    --link-color: #d46b6b;
    --border-radius: 12px;
}

body {
    font-family: 'Zen Maru Gothic', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.8;
    background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Nav */
header {
    background: #fff;
    border-bottom: 2px dashed #ddd;
    padding: 20px 0;
    margin-bottom: 40px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    margin: 0;
    font-size: 1.8em;
}

.logo p {
    margin: 0;
    color: #888;
    font-size: 0.8em;
}

/* Dropdown Menu */
.top-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: #555;
    font-weight: bold;
    font-size: 16px;
    padding: 10px 15px;
    border-radius: 20px;
    transition: background 0.2s;
}

.nav-link:hover {
    background-color: var(--accent-yellow);
    text-decoration: none;
    opacity: 1;
}

/* Search Container */
.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#search-input {
    padding: 8px 35px 8px 15px;
    border-radius: 20px;
    border: 2px solid #eee;
    font-family: inherit;
    font-size: 0.9em;
    width: 200px;
    transition: all 0.2s;
    background: #fff;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(214, 228, 244, 0.5);
    width: 250px;
}

#search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #999;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: none;
}

#search-clear:hover {
    color: #666;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.hidden {
    display: none !important;
}

#no-results {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: var(--border-radius);
    border: 2px dashed #ddd;
    margin-bottom: 20px;
}

.dropbtn {
    background-color: var(--accent-blue);
    color: #555;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 20px;
    font-family: inherit;
    font-weight: bold;
    transition: background 0.2s;
}

.dropbtn:hover {
    background-color: #c4d9f0;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 1;
    border-radius: 12px;
    padding: 10px;
    border: 2px solid #eee;
    max-height: 400px;
    overflow-y: auto;
}

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

.dropdown-content li {
    list-style: none;
}

.dropdown-content a {
    color: #4a4a4a;
    padding: 8px 12px;
    text-decoration: none;
    display: block;
    border-radius: 8px;
}

.dropdown-content a:hover {
    background-color: var(--accent-yellow);
}

/* Main Layout - Single Column */
.main-layout {
    display: block; /* Removed grid */
}

/* Main Content */
.card {
    background: #fff;
    padding: 50px;
    border-radius: var(--border-radius);
    box-shadow: 8px 8px 0 rgba(0,0,0,0.05);
    border: 1px solid #eee;
    margin-bottom: 30px;
    position: relative;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--accent-pink);
    color: #555;
    border: none;
    padding: 6px 15px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    visibility: visible;
}

.back-btn:hover {
    background: #eecbc3;
    transform: translateX(-3px);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.05);
}

.back-btn:disabled {
    background: #eee;
    color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.back-btn .icon {
    font-size: 1.1em;
}

@media (max-width: 600px) {
    .back-btn {
        position: static;
        margin-bottom: 20px;
        display: inline-flex;
    }
}

.category-tag {
    display: inline-block;
    background: var(--accent-yellow);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    color: #666;
    margin-bottom: 10px;
}

/* Post List (Index) */
.post-list {
    display: grid;
    gap: 20px;
}

.post-preview {
    background: #fff;
    padding: 25px;
    border: 2px solid #f0f0f0;
    border-radius: var(--border-radius);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.post-preview:hover {
    transform: translateY(-3px);
    border-color: var(--accent-pink);
}

.post-preview h2 {
    margin: 10px 0 0;
    font-size: 1.4em;
}

.cat-label {
    background: var(--accent-blue);
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    color: #555;
}

/* Article Content Typography */
.content h1, .content h2, .content h3 {
    color: #333;
    margin-top: 1.5em;
}

.content p {
    margin-bottom: 1.5em;
    font-size: 1.1em; /* Slightly larger for readability */
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: block;
    margin: 20px auto;
}

.content blockquote {
    border-left: 4px solid var(--accent-pink);
    margin: 20px 0;
    padding-left: 20px;
    color: #666;
    background: #fffcfc;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
}

.content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #d63384;
}

.content pre {
    background: #2d2d2d;
    color: #ccc;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 60px;
    padding: 40px 0;
    color: #999;
    border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 850px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .top-nav {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .search-container {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    #search-input, #search-input:focus {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .card {
        padding: 20px;
    }
}
