/* Reset & Basic Setup */
:root {
    --primary: #2E7D32;
    --secondary: #81C784;
    --background: #F1F8E9;
    --bg-white: #ffffff;
    --text-main: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --hover-bg: #f9f9f9;
    --container-max-width: 1000px;
    --box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

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

header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

nav ul {
    display: flex;
    gap: 24px;
}

nav a {
    font-weight: 600;
    font-size: 1rem;
}

main {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

/* Footer */
footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 40px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(to bottom, var(--bg-white), var(--background));
    border-radius: 16px;
    margin-bottom: 40px;
    box-shadow: var(--box-shadow);
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--primary);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
}

/* Sections */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.section-wrapper {
    margin-bottom: 60px;
}

/* Grid Layouts */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.1);
}

.card-category {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.card-excerpt {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 16px;
    flex-grow: 1;
}

.card-meta {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* Post Detail */
.post-header {
    text-align: center;
    margin-bottom: 40px;
}

.post-header h1 {
    font-size: 2.2rem;
    margin: 16px 0;
    line-height: 1.3;
}

.post-meta {
    color: var(--text-light);
    font-size: 0.95rem;
    display: flex;
    justify-content: center;
    gap: 16px;
}

.post-content {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h2 {
    font-size: 1.6rem;
    margin: 40px 0 20px;
    color: var(--primary);
}

.post-content h3 {
    font-size: 1.3rem;
    margin: 30px 0 16px;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content ul, .post-content ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 8px;
}

.summary-box {
    background-color: var(--background);
    border-left: 4px solid var(--primary);
    padding: 20px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
}

.summary-box h4 {
    margin-bottom: 8px;
    color: var(--primary);
}

.summary-box p:last-child {
    margin-bottom: 0;
}

/* Author Box */
.author-box {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.author-info h4 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.author-info p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Category List */
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 40px;
}

.category-chip {
    padding: 8px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.category-chip:hover, .category-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary);
}

/* Admin floating button for authorized users */
#admin-fab {
    display: none;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: bold;
    margin-top: 16px;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(46, 125, 50, 0.3);
}

#admin-fab:hover {
    background: #1b5e20;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 16px 0;
        gap: 12px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .post-content {
        padding: 24px;
    }
}
