/*
Theme Name: 8th Pay Commission
Theme URI: https://example.com
Author: 8th Pay Team
Author URI: https://example.com
Description: Custom theme for the 8th Pay Commission News Portal, matching the static site design.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: 8thpay
*/

/* Global Styles */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #3b82f6;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --light-text: #64748b;
    --white: #ffffff;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
    --result-item-bg: #f1f5f9;
    --total-bg: #dbeafe;
    --total-border: #bfdbfe;
    --total-text: #1d4ed8;
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #60a5fa;
    --secondary-color: #60a5fa;
    --background-color: #0f172a;
    --text-color: #f1f5f9;
    --light-text: #94a3b8;
    --white: #1e293b;
    /* Reusing var name for semantic flip, or better: component bg */
    --card-bg: #1e293b;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5);
    --input-bg: #334155;
    --input-border: #475569;
    --result-item-bg: #334155;
    --total-bg: #1e3a8a;
    --total-border: #1e40af;
    --total-text: #bfdbfe;
    --success-color: #34d399;
    --warning-color: #fbbf24;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.main-header {
    background-color: var(--card-bg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    color: var(--text-color);
}

.highlight {
    color: var(--primary-color);
}

nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

nav a {
    font-weight: 500;
    color: var(--light-text);
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--primary-color);
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}

.theme-btn:hover {
    background-color: var(--input-bg);
}

/* Hero Section & Calculator */
.hero-section {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--background-color) 100%);
    padding: 4rem 0 2rem;
    text-align: center;
}

.page-hero {
    background: var(--card-bg);
    padding: 3rem 0;
    text-align: center;
    border-bottom: 1px solid var(--input-border);
}

.page-hero h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.hero-content {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--light-text);
    max-width: 600px;
    margin: 0 auto;
}

/* Content Section */
.content-section {
    padding: 4rem 0;
    background-color: var(--background-color);
    transition: background-color 0.3s;
}


/* ----------------------------------------------------
   News Page Redesign (2-Column Layout)
---------------------------------------------------- */
.news-wrapper {
    background-color: var(--background-color);
    padding: 3rem 0;
    min-height: 80vh;
}

.news-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 900px) {
    .news-layout {
        grid-template-columns: 1fr;
    }

    .news-sidebar {
        order: -1;
    }
}

/* News Feed */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--input-border);
    padding-bottom: 0.5rem;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-card.list-view {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--input-border);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
}

.news-card.list-view:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.news-list-thumb {
    width: 240px;
    height: 160px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .news-list-item-wrapper {
        flex-direction: column;
    }

    .news-list-thumb {
        width: 100%;
        height: 200px;
    }
}

.news-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--light-text);
}

.news-cat {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--input-bg);
    padding: 2px 8px;
    border-radius: 4px;
}

.news-date {
    color: var(--light-text);
}

.news-card.list-view h3 {
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
    color: var(--text-color);
    line-height: 1.3;
}

.news-card.list-view p {
    color: var(--light-text);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.read-more:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Sidebar Widgets */
.news-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 6rem;
}

.widget {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.widget h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--input-bg);
}

/* Quick Tools */
.widget-links {
    list-style: none;
    padding: 0;
}

.widget-links li {
    margin-bottom: 0.5rem;
}

.widget-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--input-bg);
    border: 1px solid transparent;
}

.widget-links a:hover {
    background: var(--white);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateX(2px);
}

/* Recent Posts Widget */
.small-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.small-post-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    text-decoration: none;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--input-bg);
    transition: transform 0.2s;
}

.small-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.small-post-item:hover {
    transform: translateX(2px);
}

.small-post-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: var(--input-bg);
    flex-shrink: 0;
}

.small-post-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.small-post-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.small-post-item:hover .small-post-title {
    color: var(--primary-color);
}

.small-post-date {
    font-size: 0.8rem;
    color: var(--light-text);
}

/* Categories Widget */
.widget-categories {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.widget-categories li a {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--input-bg);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.2s;
}

.widget-categories li a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Newsletter Widget */
.newsletter-widget p {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.newsletter-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
}

.newsletter-form .btn-subscribe {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-form .btn-subscribe:hover {
    background: var(--primary-dark);
}

.small-note {
    font-size: 0.75rem !important;
    color: var(--light-text);
    margin-top: 0.5rem;
    text-align: center;
}

/* Footer */
footer {
    background-color: var(--card-bg);
    padding: 3rem 0;
    margin-top: 0;
    border-top: 1px solid var(--input-border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-col p {
    font-size: 0.9rem;
    color: var(--light-text);
    line-height: 1.6;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: var(--light-text);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--input-border);
    padding-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--light-text);
}

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

.post-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin: 10px 0 15px;
}

.post-meta-row {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
    color: var(--light-text);
}

.post-hero-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 30px;
    object-fit: cover;
    max-height: 500px;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.post-content h2 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
}

.post-content ul,
.post-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.post-content li {
    margin-bottom: 10px;
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .news-layout {
        grid-template-columns: 1fr;
    }

    .news-card {
        flex-direction: column;
    }

    .news-list-thumb {
        width: 100%;
        height: 200px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .main-header .container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }

    nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 10px;
    }
}