/* ============================================
   FILE: assets/css/style.css
   PURPOSE: Custom CSS for both frontend & admin
   ============================================ */

/* ============================================
   FONT IMPORTS (supplemental)
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --color-primary:       #B91C1C;
    --color-primary-dark:  #991B1B;
    --color-primary-light: #FEE2E2;
    --color-text:          #1f2937;
    --color-muted:         #6b7280;
    --color-border:        #e5e7eb;
    --font-hindi:          'Noto Sans Devanagari', 'Segoe UI', sans-serif;
}

/* ============================================
   BASE STYLES
   ============================================ */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

/* Hindi font class */
.font-hindi {
    font-family: var(--font-hindi);
}

/* Line clamp utilities */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================
   TICKER ANIMATION (news ticker in header)
   ============================================ */
@keyframes ticker-scroll {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.ticker-wrap {
    overflow: hidden;
    white-space: nowrap;
}
.ticker-move {
    display: inline-block;
    animation: ticker-scroll 30s linear infinite;
    padding-left: 100%;
}
.ticker-move:hover {
    animation-play-state: paused;
}

/* ============================================
   POST / ARTICLE STYLES
   ============================================ */
.article-content {
    font-family: var(--font-hindi);
    line-height: 1.9;
    color: var(--color-text);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.article-content h1 { font-size: 1.6rem; border-bottom: 2px solid var(--color-primary-light); padding-bottom: 0.4rem; }
.article-content h2 { font-size: 1.3rem; }
.article-content h3 { font-size: 1.1rem; }

.article-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.article-content ul,
.article-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 0.35rem; }

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.875rem;
    overflow-x: auto;
    display: block;
}

.article-content th,
.article-content td {
    border: 1px solid var(--color-border);
    padding: 0.6rem 0.9rem;
    text-align: left;
}

.article-content th {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.article-content tr:nth-child(even) td { background: #fef2f2; }
.article-content tr:hover td { background: #fee2e2; }

.article-content strong, .article-content b { color: var(--color-primary-dark); }

.article-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.article-content blockquote {
    border-left: 4px solid var(--color-primary);
    background: #fef2f2;
    padding: 0.75rem 1.25rem;
    margin: 1rem 0;
    font-style: italic;
    color: #7f1d1d;
    border-radius: 0 8px 8px 0;
}

/* Important info box */
.article-content .important-box {
    background: #fef9c3;
    border: 1px solid #fde047;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* ============================================
   ADMIN PAGE TRANSITIONS
   ============================================ */
#adminMain {
    transition: opacity 0.15s ease;
}

/* ============================================
   FLOATING WA BUTTON PULSE
   ============================================ */
.whatsapp-float-btn {
    animation: wa-pulse 2s infinite;
}
@keyframes wa-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); }
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
    transition: all 0.15s;
}

.pagination a:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.pagination span.current {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.pagination span.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   POST CARD HOVER EFFECTS
   ============================================ */
.post-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.post-card:hover {
    transform: translateY(-1px);
}

/* ============================================
   ADMIN FLASH MESSAGES AUTO-DISMISS
   ============================================ */
#flashSuccess,
#flashError {
    animation: fadeInDown 0.3s ease;
}
@keyframes fadeInDown {
    from { transform: translateY(-10px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ============================================
   SCROLLBAR (webkit)
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f3f4f6; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }
