/* Custom styles for FastAPI Blog CMS */

/* Light & Upbeat Theme Customization */
:root {
    --primary: #5865F2;
    --primary-hover: #4752C4;
    --primary-focus: rgba(88, 101, 242, 0.125);
    --primary-inverse: #FFF;
}

body {
    background-color: #F8F9FA;
}

nav {
    background-color: #FFFFFF;
    border-bottom: 1px solid #E9ECEF;
}

/* Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 0 0 2rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay h1 {
    color: #FFFFFF;
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .hero-section {
        height: 250px;
    }

    .hero-overlay h1 {
        font-size: 2rem;
    }
}

/* Post preview spacing */
.post-preview {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.post-preview:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.post-preview h2 {
    margin-bottom: 0.5rem;
}

.post-preview h2 a {
    color: var(--primary);
    text-decoration: none;
}

.post-preview h2 a:hover {
    text-decoration: underline;
}

.post-meta {
    color: var(--muted-color);
    margin-bottom: 1rem;
}

.post-excerpt {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Post content styling */
.post-content {
    line-height: 1.8;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.post-content pre {
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
}

.post-content code {
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.post-content pre code {
    padding: 0;
}

.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin-left: 0;
    font-style: italic;
    color: var(--muted-color);
}

.post-content table {
    width: 100%;
    margin: 1rem 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content h1:first-child,
.post-content h2:first-child,
.post-content h3:first-child {
    margin-top: 0;
}

/* Admin table adjustments */
table button,
table a[role="button"] {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    nav ul li {
        padding: 0 0.5rem;
    }

    table button,
    table a[role="button"] {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Form textarea */
#content {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Character counter (if added) */
.char-counter {
    text-align: right;
    color: var(--muted-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}
