/* ===== Public Site Styles - White Minimalist ===== */

:root {
    --sp-bg: #ffffff;
    --sp-text: #1a1a1a;
    --sp-text-light: #6b7280;
    --sp-border: #e5e7eb;
    --sp-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --sp-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --sp-radius: 8px;
    --sp-transition: 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--sp-text);
    background-color: #f9fafb;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--sp-text);
    text-decoration: none;
    transition: color var(--sp-transition);
}

a:hover {
    color: var(--sp-text-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Header / Navbar ===== */
.site-header {
    background: var(--sp-bg);
    border-bottom: 1px solid var(--sp-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--sp-text);
}

.site-logo:hover {
    color: var(--sp-text);
}

/* Category nav */
.nav-categories {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    overflow-x: auto;
    white-space: nowrap;
}

.nav-categories li a {
    display: block;
    padding: 6px 14px;
    font-size: 0.875rem;
    color: var(--sp-text-light);
    border: 1px solid transparent;
    border-radius: 20px;
    transition: all var(--sp-transition);
}

.nav-categories li a:hover,
.nav-categories li a.active {
    color: var(--sp-text);
    background: var(--sp-bg);
    border-color: var(--sp-border);
    box-shadow: var(--sp-shadow);
}

.nav-categories-link {
    display: block;
    padding: 6px 14px;
    font-size: 0.875rem;
    color: var(--sp-text-light);
    transition: color var(--sp-transition);
}

.nav-categories-link:hover {
    color: var(--sp-text);
}

/* ===== Main Content ===== */
.site-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--sp-text);
}

.page-header p {
    margin-top: 8px;
    color: var(--sp-text-light);
    font-size: 0.95rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--sp-text-light);
    margin-bottom: 16px;
    list-style: none;
}

.breadcrumb a {
    color: var(--sp-text-light);
}

.breadcrumb a:hover {
    color: var(--sp-text);
}

.breadcrumb-sep {
    color: #d1d5db;
}

/* ===== Post Cards Grid ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.post-card {
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    overflow: hidden;
    transition: box-shadow var(--sp-transition), transform var(--sp-transition);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--sp-shadow-hover);
    transform: translateY(-2px);
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--sp-border);
}

.post-card-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-bottom: 1px solid var(--sp-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    font-size: 2rem;
}

.post-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sp-text-light);
    margin-bottom: 8px;
}

.post-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--sp-text);
}

.post-card-title a {
    color: inherit;
}

.post-card-title a:hover {
    color: var(--sp-text-light);
}

.post-card-excerpt {
    font-size: 0.875rem;
    color: var(--sp-text-light);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--sp-border);
    font-size: 0.8rem;
    color: #9ca3af;
}

/* ===== Individual Post ===== */
.post-single {
    max-width: 760px;
    margin: 0 auto;
}

.post-single-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--sp-radius);
    border: 1px solid var(--sp-border);
    box-shadow: var(--sp-shadow);
    margin-bottom: 32px;
}

.post-single h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.3;
    margin-bottom: 16px;
}

.post-single-description {
    font-size: 1.1rem;
    color: var(--sp-text-light);
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-single-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--sp-border);
    font-size: 0.875rem;
    color: var(--sp-text-light);
}

.post-single-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--sp-text-light);
    box-shadow: var(--sp-shadow);
}

.post-single-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #374151;
}

.post-single-content p {
    margin-bottom: 1.25em;
}

/* ===== Comments Section ===== */
.comments-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--sp-border);
}

.comments-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.comment-item {
    padding: 16px 20px;
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    margin-bottom: 12px;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.comment-content {
    font-size: 0.875rem;
    color: var(--sp-text-light);
    line-height: 1.6;
}

/* ===== Comment Form ===== */
.comments-list {
    margin-bottom: 32px;
}

.comment-form-section {
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 24px;
    box-shadow: var(--sp-shadow);
}

.comment-form-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--sp-text);
}

.comment-form .form-group {
    margin-bottom: 16px;
}

.comment-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--sp-text);
}

.comment-form .required {
    color: #ef4444;
}

.comment-form .form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid var(--sp-border);
    border-radius: 6px;
    background: #fafafa;
    color: var(--sp-text);
    transition: border-color var(--sp-transition), box-shadow var(--sp-transition);
}

.comment-form .form-control:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.15);
    background: var(--sp-bg);
}

.comment-form textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.comment-form .captcha-input {
    max-width: 120px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.comment-form .btn-submit {
    display: inline-block;
    padding: 10px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sp-bg);
    background: var(--sp-text);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--sp-transition), transform var(--sp-transition);
}

.comment-form .btn-submit:hover {
    background: #374151;
    transform: translateY(-1px);
}

.comment-form .btn-submit:active {
    transform: translateY(0);
}

.field-validation-error {
    display: block;
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ===== Categories Grid ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    padding: 24px;
    transition: box-shadow var(--sp-transition), transform var(--sp-transition);
    display: flex;
    align-items: center;
    gap: 16px;
}

.category-card:hover {
    box-shadow: var(--sp-shadow-hover);
    transform: translateY(-2px);
}

.category-card-image {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--sp-border);
    flex-shrink: 0;
}

.category-card-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1px solid var(--sp-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    font-size: 1.25rem;
}

.category-card-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.category-card-info span {
    font-size: 0.8rem;
    color: var(--sp-text-light);
}

/* ===== Category Detail with Posts ===== */
.category-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 24px;
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
}

.category-detail-image {
    width: 80px;
    height: 80px;
    border-radius: var(--sp-radius);
    object-fit: cover;
    border: 1px solid var(--sp-border);
}

.category-detail-placeholder {
    width: 80px;
    height: 80px;
    border-radius: var(--sp-radius);
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1px solid var(--sp-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    font-size: 2rem;
    flex-shrink: 0;
}

.category-detail-info h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.category-detail-info p {
    color: var(--sp-text-light);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--sp-text-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1rem;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--sp-border);
    padding: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
    background: var(--sp-bg);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 12px 16px;
        gap: 8px;
    }

    .nav-categories {
        width: 100%;
        justify-content: flex-start;
        padding-bottom: 4px;
    }

    .site-main {
        padding: 24px 16px 60px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .post-single h1 {
        font-size: 1.5rem;
    }

    .category-detail-header {
        flex-direction: column;
        text-align: center;
    }
}