:root {
    --brand: #c1121f;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --heading-font: "Noto Serif Devanagari", serif;
    --body-font: "Noto Sans Devanagari", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: var(--body-font);
    background: #f8fafc;
    line-height: 1.8;
    font-size: 18px;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--heading-font);
}

a {
    color: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.site-loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    transition: opacity .3s ease;
}

.site-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
}

.topbar-line {
    background: #0f172a;
    color: #f8fafc;
}

.topbar-links a {
    color: #e2e8f0;
}

.topbar-links a:hover {
    color: #fff;
}

.logo {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.logo img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: .5rem;
}

.logo span {
    color: var(--brand);
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    font-weight: 700;
    line-height: 1.1;
}

.site-tagline {
    color: var(--muted);
    font-size: .92rem;
}

.navbar .nav-link {
    font-weight: 600;
    font-size: .95rem;
}

.navbar .nav-link:hover {
    color: var(--brand);
}

.breaking-marquee {
    width: 100%;
    overflow: hidden;
}

.breaking-marquee-inner {
    display: inline-flex;
    gap: 2rem;
    min-width: 100%;
    animation: ticker 28s linear infinite;
    white-space: nowrap;
}

.breaking-marquee-inner a {
    font-weight: 600;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: .75rem;
    margin: 2rem 0 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid #fecaca;
}

.section-title h2,
.section-title h3 {
    margin: 0;
}

.hero-carousel .carousel-item img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 1rem;
}

.hero-carousel .carousel-caption {
    text-align: left;
    left: 5%;
    right: 5%;
    bottom: 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    border-radius: .75rem;
    padding: 1rem;
}

.stories-strip {
    display: flex;
    gap: .65rem;
    overflow-x: auto;
    padding-bottom: .3rem;
}

.story-pill {
    border: 1px solid #fca5a5;
    background: #fff;
    border-radius: 999px;
    padding: .45rem .85rem;
    font-size: .95rem;
    white-space: nowrap;
}

.story-pill:hover {
    background: #fee2e2;
}

.news-card {
    height: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.news-card .card-title {
    font-size: 1.16rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .card-img-top {
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.meta {
    color: var(--muted);
    font-size: .98rem;
}

.article-wrap {
    max-width: 900px;
    margin: 0 auto;
}

.article-body {
    font-size: 1.18rem;
}

.article-body iframe {
    width: 100%;
    min-height: 260px;
    border: 0;
    border-radius: .8rem;
    margin: .8rem 0;
}

.weather-strip {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem 1.15rem;
}

.weather-metrics {
    font-size: .98rem;
}

.utility-card {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}

.fuel-table-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
}

.fuel-table-wrap .table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.fuel-table-wrap th {
    white-space: nowrap;
}

.video-card img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.social-card .social-title {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.article-body h2,
.article-body h3 {
    margin-top: 1.5rem;
}

.profile-strip {
    border-left: 4px solid var(--profile-color, #1d4ed8);
    background: #fff;
}

.share-strip {
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: .8rem;
    padding: .85rem;
}

.ad-block {
    margin: .85rem 0;
    border: 1px solid var(--line);
    border-radius: .75rem;
    overflow: hidden;
    background: #fff;
}

.ad-label {
    display: block;
    font-size: .75rem;
    color: #64748b;
    padding: .3rem .6rem;
    border-bottom: 1px solid var(--line);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.site-footer a {
    color: #334155;
}

.customer-care a {
    color: #0f172a;
}

.wa-floating-btn {
    position: fixed;
    right: .8rem;
    bottom: .8rem;
    z-index: 1030;
    background: #25d366;
    color: #fff;
    border-radius: 999px;
    padding: .6rem .9rem;
    box-shadow: 0 8px 20px rgba(37, 211, 102, .3);
    font-weight: 600;
}

.wa-floating-btn:hover {
    color: #fff;
    filter: brightness(.95);
}

/* SEO assistant enhancements */
.seo-assistant-live .badge {
    font-size: .85rem;
}
.seo-checklist li {
    padding: .25rem .4rem;
    border-radius: .35rem;
    margin-bottom: .2rem;
    font-size: .92rem;
    color: #334155;
    background: #f1f5f9;
}
.seo-checklist li.seo-ok {
    background: #dcfce7;
    color: #166534;
}
.seo-checklist li.seo-fail {
    background: #fee2e2;
    color: #991b1b;
}
.keyword-strong {
    border: 1px solid #16a34a !important;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, .2);
}

.seo-score-good {
    background-color: #16a34a !important;
    color: white !important;
}

.seo-score-medium {
    background-color: #f59e0b !important;
    color: white !important;
}

.seo-score-poor {
    background-color: #dc2626 !important;
    color: white !important;
}

.related-posts {
    border: 1px solid #16a34a !important;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, .2);
}
.related-posts {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 1rem;
    padding: 1rem;
    margin-top: 1.5rem;
}
.related-posts ul {
    list-style: none;
    padding: 0;
    margin: .4rem 0 0;
}
.related-posts li {
    margin-bottom: .55rem;
}
.related-posts a {
    color: var(--brand);
    font-weight: 600;
}


.auth-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.auth-panel,
.auth-help,
.admin-panel,
.install-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem;
}

.alert {
    padding: .75rem .9rem;
    border-radius: .65rem;
    margin-bottom: .9rem;
}

.alert-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #7f1d1d;
}

.alert-success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #14532d;
}

.helper {
    color: #475569;
    font-size: .92rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem 1rem;
}

input,
select,
textarea,
button {
    width: 100%;
    font: inherit;
}

input,
select,
textarea {
    border: 1px solid #cbd5e1;
    border-radius: .6rem;
    padding: .6rem .7rem;
    background: #fff;
}

button,
.btn {
    border-radius: .6rem;
}

label {
    display: block;
    margin-bottom: .3rem;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    border: 1px solid #e2e8f0;
    padding: .55rem;
    vertical-align: top;
}

th {
    background: #f8fafc;
    text-align: left;
}

.inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-right: .3rem;
    max-width: 100%;
}

.inline-form input,
.inline-form select,
.inline-form button {
    width: auto;
    max-width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}

.stat-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .85rem;
    padding: .85rem;
}

.stat-box h3 {
    margin: 0 0 .2rem;
    font-size: .95rem;
    color: #334155;
}

.stat-box p {
    margin: 0;
    font-weight: 700;
    font-size: 1.4rem;
}

.admin-wrap {
    width: min(100% - 1rem, 1380px);
    margin-inline: auto;
    padding: 1rem 0 2rem;
}

.admin-ui-large {
    font-size: 17px;
}

.admin-header {
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .9rem;
    padding: 1rem;
}

.admin-user-pill {
    background: color-mix(in srgb, var(--user-color, #c1121f) 14%, white);
    border: 1px solid color-mix(in srgb, var(--user-color, #c1121f) 60%, white);
    padding: .35rem .75rem;
    border-radius: 999px;
    display: inline-flex;
    gap: .45rem;
    align-items: center;
    font-size: .85rem;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .8rem;
}

.admin-nav a {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 999px;
    padding: .28rem .72rem;
    font-size: .86rem;
}

.role-admin { background: #fee2e2; color: #991b1b; }
.role-writer { background: #dbeafe; color: #1d4ed8; }
.role-editor { background: #ccfbf1; color: #0f766e; }
.role-publisher { background: #ede9fe; color: #6d28d9; }
.role-ad-manager { background: #fef3c7; color: #92400e; }

.install-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.install-box {
    width: min(980px, 100%);
}

@media (min-width: 768px) {
    .auth-grid,
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    body {
        font-size: 17px;
    }

    .logo {
        gap: .45rem;
    }

    .logo img {
        width: 34px;
        height: 34px;
        border-radius: .35rem;
    }

    .logo span {
        font-size: 1.2rem;
    }

    .header-actions .btn {
        padding: .35rem .55rem;
        font-size: .8rem;
    }

    .section-title {
        align-items: center;
    }

    .section-title .meta {
        font-size: .86rem;
    }

    .hero-carousel .carousel-caption {
        padding: .75rem;
    }

    .hero-carousel .carousel-caption p {
        display: none;
    }
}

@media (min-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Filter Panel Styles */
.filter-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0 !important;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 3;
}

.table-responsive {
    border-radius: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-panel .form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.filter-panel .form-control,
.filter-panel .form-select {
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

.filter-panel .form-control:focus,
.filter-panel .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(193, 18, 31, 0.25);
}

.filter-panel .btn-primary {
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 0.5rem;
    font-weight: 500;
}

.filter-panel .btn-primary:hover {
    background: #a00f24;
    border-color: #a00f24;
}

.filter-panel .btn-secondary {
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    color: #334155;
    border-radius: 0.5rem;
    font-weight: 500;
}

.filter-panel .btn-secondary:hover {
    background: #cbd5e1;
}

/* Table Styles */
.table-responsive {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-header {
    background: #f1f5f9;
    font-weight: 600;
    color: #334155;
}

.table-header th {
    padding: 1rem 0.75rem;
    border-bottom: 2px solid #cbd5e1;
}

.posts-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.posts-table tbody tr:hover {
    background: #f8fafc;
}

.posts-table td {
    padding: 0.85rem 0.75rem;
    vertical-align: middle;
}

.posts-table td.fw-600 {
    font-weight: 600;
    color: #334155;
}

/* Sort Link Styles */
.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #334155;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.sort-link:hover {
    color: var(--brand);
}

.sort-icon {
    font-size: 0.9rem;
    color: #94a3b8;
    display: inline-block;
}

.sort-icon.active {
    color: var(--brand);
    font-weight: bold;
}

/* Badge Styles */
.badge {
    padding: 0.35rem 0.55rem;
    font-size: 0.85rem;
    border-radius: 0.35rem;
    font-weight: 500;
}

.badge.status-draft {
    background: #f3f4f6;
    color: #6b7280;
}

.badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge.status-approved {
    background: #ccfbf1;
    color: #0f766e;
}

.badge.status-published {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.4rem;
}

.inline-delete {
    display: inline;
}

.inline-delete button {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
}