:root {
    --primary-color: #f80000; /* Oracle Red */
    --secondary-color: #333;
    --background-color: #f4f4f4;
    --card-background: #ffffff;
    --text-color: #333;
    --light-text-color: #ffffff;
    --accent-color: #007bff;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --border-color: #e0e0e0;
    --font-family-heading: 'Helvetica Neue', 'Segoe UI', sans-serif;
    --font-family-body: 'Noto Sans KR', sans-serif;
}

body {
    font-family: var(--font-family-body);
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

.page-container {
    display: flex;
    max-width: 1200px;
    margin: 2rem auto;
    gap: 2rem;
    padding: 0 1rem;
}

/* Main Content Area */
main {
    flex-grow: 1;
    width: 70%; /* Desktop primary width */
}

/* Shared View Styling */
.view {
    padding: 0; /* Views manage their own padding */
}

/* Home View */
#home-view {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.hero-section {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}
.hero-section h1 {
    font-family: var(--font-family-heading);
    font-size: 2.8rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}
.hero-section p {
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 2rem auto;
}
.cta-button {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block; /* For CTA buttons within hero */
}
.cta-button:hover { background-color: #d80000; }

.content-overview {
    margin-bottom: 2rem;
}
.content-overview h2 {
    font-family: var(--font-family-heading);
    font-size: 1.8rem;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.card-grid .card {
    background: var(--background-color);
    border-radius: 8px;
    box-shadow: 0 1px 5px var(--shadow-color);
    padding: 1.2rem;
    transition: transform 0.2s ease;
}
.card-grid .card:hover { transform: translateY(-3px); }
.card-grid .card h3 { font-size: 1.2rem; margin-top: 0; }
.card-grid .card a { text-decoration: none; color: var(--text-color); }
.card-grid .card a:hover { color: var(--primary-color); }
.card-grid .card p { font-size: 0.9rem; color: #666; line-height: 1.4; }
.card-grid .card .post-tags span {
    display: inline-block;
    background-color: #eee;
    color: #555;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-right: 0.4rem;
    margin-top: 0.5rem;
}

.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}


/* Category List View (General Board View) */
#category-list-view {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
}
#category-title {
    font-family: var(--font-family-heading);
    font-size: 2rem;
    color: var(--secondary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Post List Item */
.post-item {
    background-color: var(--background-color); /* Lighten background for list items */
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 1px 4px var(--shadow-color);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}
.post-item-title { flex-grow: 1; font-size: 1.1rem; }
.post-item-title a { text-decoration: none; color: var(--text-color); font-weight: 600; }
.post-item-title a:hover { color: var(--primary-color); }
.post-item-meta { flex-basis: 180px; text-align: center; color: #666; font-size: 0.9rem; }
.post-item-stats { flex-basis: 220px; text-align: right; color: #666; font-size: 0.9rem; }
.post-item-stats span { margin-left: 1rem; }
.post-item-stats a { text-decoration: none; color: #666; }
.post-item-stats a:hover { text-decoration: underline; }


/* Post Detail View */
#post-detail-view {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
}
#back-to-list-btn {
    background: #eee;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 2rem;
}
#back-to-list-btn:hover { background: #ddd; }

#post-content-container {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
#post-content-container h3 { font-family: var(--font-family-heading); font-size: 2.2rem; margin: 0 0 1rem 0; }
.post-meta { font-size: 0.9rem; color: #666; margin-bottom: 1.5rem; }
.post-full-content { line-height: 1.7; }
.post-full-content pre { background-color: #f5f5f5; padding: 1rem; border-radius: 5px; white-space: pre-wrap; word-wrap: break-word; }

.post-tags {
    margin: 1.5rem 0;
}
.post-tags span {
    display: inline-block;
    background-color: #eee;
    color: #555;
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.comments-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }

/* Sidebar */
.sidebar {
    flex-basis: 250px;
    flex-shrink: 0;
}

.sidebar-nav {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
    margin-bottom: 2rem;
}
.sidebar-nav h4, #tag-list-container h4 {
    font-family: var(--font-family-heading);
    color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
}
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav ul li a {
    display: block;
    padding: 0.5rem 0;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}
.sidebar-nav ul li a:hover, .sidebar-nav ul li a.active {
    color: var(--primary-color);
    font-weight: bold;
}

#tag-list-container {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
}
#tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-link { text-decoration: none; color: #555; background-color: #eee; padding: 0.3rem 0.7rem; border-radius: 15px; font-size: 0.9rem; }
.tag-link:hover { background-color: #ddd; }
.tag-link.active { background-color: var(--primary-color); color: var(--light-text-color); }

/* Google AdSense Custom Element Styling */
google-adsense {
    display: block; /* Important for ad display */
    margin-bottom: 1rem; /* Spacing between ads or content */
    background-color: #f0f0f0; /* Placeholder background */
    border: 1px dashed #ccc; /* Placeholder border */
    min-height: 100px; /* Minimum height for visibility */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
}
google-adsense::before {
    content: '광고 공간';
}
google-adsense[data-ad-slot="TOP_BANNER_AD_SLOT_ID"] {
    min-height: 90px;
    margin: 0 0 2rem 0;
    width: 100%;
}
google-adsense[data-ad-slot="SIDEBAR_AD_SLOT_ID"] {
    min-height: 250px;
    width: 100%;
    margin-bottom: 2rem;
}


/* Popup Form (Copied from before, should be fine) */
.popup-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.popup-content { background: var(--card-background); padding: 2rem; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.2); width: 90%; max-width: 600px; position: relative; }
.close-popup-btn { position: absolute; top: 10px; right: 20px; font-size: 2rem; font-weight: bold; color: #999; cursor: pointer; }
.close-popup-btn:hover { color: #333; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: bold; }
.form-group input, .form-group textarea { width: 100%; padding: 0.8rem; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.cta-button { background-color: var(--primary-color); color: var(--light-text-color); padding: 1rem 2rem; text-decoration: none; border-radius: 5px; font-weight: bold; border: none; cursor: pointer; transition: background-color 0.3s ease; }
.cta-button:hover { background-color: #d80000; }

/* Responsive */
@media (max-width: 992px) {
    .page-container { flex-direction: column-reverse; }
    main { width: 100%; }
    .sidebar { flex-basis: auto; width: 100%; display: flex; gap: 2rem; margin-top: 2rem; }
    .sidebar-nav, #tag-list-container, .ad-space { flex: 1; margin-bottom: 0; }
    google-adsense[data-ad-slot="TOP_BANNER_AD_SLOT_ID"] {
        margin-bottom: 1rem;
    }
    google-adsense[data-ad-slot="SIDEBAR_AD_SLOT_ID"] {
        min-height: 120px;
        margin-bottom: 0;
        flex: 1;
    }
}
@media (max-width: 768px) {
    .hero-section h1 { font-size: 2rem; }
    .post-item { flex-wrap: wrap; }
    .post-item-title { width: 100%; margin-bottom: 0.5rem; }
    .post-item-meta { flex-grow: 1; text-align: left; }
    .post-item-stats { flex-basis: auto; flex-grow: 1; text-align: right; }
    .sidebar { flex-direction: column; }
    google-adsense[data-ad-slot="SIDEBAR_AD_SLOT_ID"] {
        min-height: 100px;
    }
}