/* News Web App - Mobile First CSS */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    max-width: 530px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Container */
.container {
    padding: 0 16px;
    max-width: 100%;
}

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* Navigation */
.nav {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: none;
}

.nav.active {
    display: block;
    position: fixed;
    z-index: 100;
    width: 100%;
}

.nav-list {
    list-style: none;
    padding: 0;
}

.nav-item {
    border-bottom: 1px solid #f8f9fa;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: #f8f9fa;
    color: #007bff;
}

/* Main Content */
.main {
    padding: 20px 0;
    min-height: calc(100vh - 120px);
}

/* Articles Grid */
.articles-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f8f9fa;
}

.article-content {
    padding: 16px;
}

.article-category {
    color: #007bff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-decoration: none;
}

.article-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.4;
}

.article-title a {
    color: #333;
    text-decoration: none;
}

.article-excerpt {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

/* Single Post */
.post-header {
    margin-bottom: 24px;
}

.post-title {
    font-size: 28px;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 12px;
}

.post-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
}

.post-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 24px;
}

.post-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
}

.post-content * {
    max-width: 100% !important;
}

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

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 24px 0 16px 0;
    font-weight: bold;
}

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

.post-content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    color: #666;
}

/* Related Posts */
.related-posts {
    margin-top: 32px;
}

.section-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 20px;
    padding: 8px 16px;
    border: 1px solid #007bff;
    border-radius: 4px;
    transition: all 0.2s;
}

.back-button:hover {
    background: #007bff;
    color: #fff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #007bff;
    text-decoration: none;
    background: #fff;
    font-weight: 500;
}

.pagination a:hover {
    background: #007bff;
    color: #fff;
}

.pagination .current {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Footer */
.footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #333;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 16px;
    background: #fff;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px 0;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top: 2px solid #007bff;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 404 Page */
.error-page {
    text-align: center;
    padding: 60px 0;
}

.error-code {
    font-size: 72px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 16px;
}

.error-message {
    font-size: 18px;
    color: #666;
    margin-bottom: 24px;
}

/* Responsive for larger screens */
@media (min-width: 531px) {
    body {
        max-width: 530px;
        border-left: 1px solid #e9ecef;
        border-right: 1px solid #e9ecef;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }

    .nav.active {
        max-width: 530px;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.hidden {
    display: none;
}


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


.footer-links a {
    color: tomato;
    text-decoration: none;
    margin: 0 10px;
}

.footer-ads {
    padding: 15px;
}