/* style.css — જ્ઞાનપથ ગુજરાતી
   ડિઝાઇન: ઊંડો ઇન્ડિગો (જ્ઞાનની ગંભીરતા) + કેસરી (ગુજરાતી ઉત્સવ) ના ટોન પર,
   "પથ" (માર્ગ) ને દર્શાવતી ટપકાંવાળી લીટીની થીમ સાથે. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color tokens */
    --ink: #182449;          /* deep indigo — primary */
    --ink-soft: #2c3a6e;
    --ink-deep: #0f1830;
    --saffron: #e6862a;      /* marigold/saffron accent */
    --saffron-deep: #c66c14;
    --paper: #f5f6fb;        /* cool pale background */
    --surface: #ffffff;
    --text: #1c2333;
    --muted: #5b6478;
    --border: #e4e7f0;

    /* backward-compatible aliases used elsewhere */
    --primary-color: var(--ink);
    --secondary-color: var(--ink-soft);
    --text-color: var(--text);
    --bg-color: var(--paper);
    --white: var(--surface);
    --gray: var(--muted);

    /* type scale */
    --font-display: 'Noto Serif Gujarati', 'Noto Sans Gujarati', Georgia, serif;
    --font-body: 'Noto Sans Gujarati', system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--text);
    background-color: var(--paper);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a { color: inherit; }

::selection {
    background: var(--saffron);
    color: var(--surface);
}

:focus-visible {
    outline: 3px solid var(--saffron);
    outline-offset: 2px;
}

/* Header & Navigation */
header {
    background: var(--surface);
    box-shadow: 0 1px 0 var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

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

.logo h1 {
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.logo h1::before {
    content: '॥';
    color: var(--saffron);
    margin-inline-end: 0.35rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.25s;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--saffron);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s ease;
}

.nav-menu a:hover {
    color: var(--saffron-deep);
}

.nav-menu a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    border-radius: 2px;
    background: var(--ink);
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Hero Section — the "path" motif */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--ink) 0%, var(--ink-deep) 100%);
    color: var(--surface);
    padding: 5rem 0 6rem;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 8% 30%, rgba(230,134,42,0.18), transparent 40%),
        radial-gradient(circle at 92% 75%, rgba(230,134,42,0.14), transparent 45%);
    pointer-events: none;
}

.hero .path-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.35;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero .eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--saffron);
    border: 1px solid rgba(230,134,42,0.5);
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.hero h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.82);
    max-width: 560px;
    margin: 0 auto;
}

/* Search bar */
.search-bar {
    max-width: 480px;
    margin: 2rem auto 0;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: 999px;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    background: rgba(255,255,255,0.95);
    color: var(--text);
}

.search-bar input:focus {
    outline: 3px solid var(--saffron);
}

.search-bar input::placeholder {
    color: var(--muted);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
}

.hero-stats span {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    padding: 0.4rem 1rem;
    border-radius: 999px;
}

/* Path divider — signature element between sections */
.path-divider {
    height: 1px;
    background-image: repeating-linear-gradient(90deg, var(--border) 0 8px, transparent 8px 16px);
    margin: 0;
}

/* Posts Section */
.posts-section {
    padding: 3.5rem 0;
}

.posts-section h2 {
    font-family: var(--font-display);
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--ink);
    font-size: 2rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--surface);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15,24,48,0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(18px);
}

.post-card.in-view {
    animation: cardRise 0.6s ease forwards;
}

@keyframes cardRise {
    to { opacity: 1; transform: translateY(0); }
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(15,24,48,0.12);
}

.post-image-wrap {
    overflow: hidden;
    height: 200px;
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--paper);
    transition: transform 0.5s ease;
    display: block;
}

.post-card:hover .post-image {
    transform: scale(1.08);
}

.post-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-category {
    display: inline-block;
    align-self: flex-start;
    background: var(--ink);
    color: var(--surface);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
}

/* rotate category-chip colors for visual variety */
.posts-grid .post-card:nth-of-type(5n+2) .post-category { background: var(--saffron-deep); }
.posts-grid .post-card:nth-of-type(5n+3) .post-category { background: #2f6b5e; }
.posts-grid .post-card:nth-of-type(5n+4) .post-category { background: #6b3f8f; }
.posts-grid .post-card:nth-of-type(5n+5) .post-category { background: #a24444; }

.post-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 0.6rem;
    color: var(--text);
    line-height: 1.4;
}

.post-title a {
    text-decoration: none;
    color: inherit;
}

.post-title a:hover {
    color: var(--saffron-deep);
}

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

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--muted);
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

/* Loading & empty states */
.state-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.state-message .state-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--border);
    border-top-color: var(--saffron);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Ad Section */
.ad-section {
    padding: 1rem 0 3rem;
    text-align: center;
}

#ad-banner {
    min-height: 90px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Footer */
footer {
    background: var(--ink-deep);
    color: rgba(255,255,255,0.85);
    padding: 3.5rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-family: var(--font-display);
    color: var(--surface);
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section h4 {
    color: var(--saffron);
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

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

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

.footer-section a {
    color: var(--surface);
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px dashed rgba(255,255,255,0.15);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

/* Single Post Page */
.single-post {
    padding: 3rem 0;
}

.single-post .container {
    max-width: 820px;
}

.post-header {
    text-align: center;
    margin-bottom: 2rem;
}

.post-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--ink);
}

.featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 2rem;
}

.post-body {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.post-body h2 {
    font-family: var(--font-display);
    margin: 2rem 0 1rem;
    color: var(--ink);
}

.post-body h3 {
    margin: 1.5rem 0 0.8rem;
}

.post-body p {
    margin-bottom: 1rem;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Admin Panel */
.admin-panel {
    padding: 2.5rem 0 4rem;
}

.admin-header {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 14px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h1 {
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 1.5rem;
}

.admin-form,
.login-box {
    background: var(--surface);
    padding: 2rem;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.login-box {
    max-width: 420px;
    margin: 3rem auto;
}

.login-box h1 {
    font-family: var(--font-display);
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--ink);
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 2rem;
    align-items: start;
}

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

.admin-form h2,
.admin-list h2 {
    font-family: var(--font-display);
    color: var(--ink);
    margin-bottom: 1.25rem;
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--paper);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--saffron);
    background: var(--surface);
}

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

.form-hint {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.btn {
    background: linear-gradient(135deg, var(--ink) 0%, var(--ink-soft) 100%);
    color: var(--surface);
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s;
    box-shadow: 0 2px 8px rgba(24,36,73,0.18);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(24,36,73,0.28);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-accent {
    background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-deep) 100%);
    box-shadow: 0 2px 8px rgba(198,108,20,0.25);
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-deep) 100%);
    box-shadow: 0 8px 20px rgba(198,108,20,0.35);
}

.btn-outline {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
}

.btn-outline:hover {
    background: var(--ink);
    color: var(--surface);
}

.btn-danger {
    background: #a24444;
}

.btn-danger:hover {
    background: #832f2f;
}

.admin-post-item {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-post-item h3 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.admin-post-item p {
    color: var(--muted);
    font-size: 0.85rem;
}

.status-msg {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
}

.status-msg.error {
    background: #fbe9e7;
    color: #a24444;
}

.status-msg.success {
    background: #e6f4ee;
    color: #256a4f;
}

/* Contact Form */
.contact-form {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto;
}

/* Generic page intro (about/privacy/terms/contact/categories) */
.page-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.page-intro h2 {
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 1.9rem;
}

.page-intro p {
    color: var(--muted);
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--surface);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.08);
        padding: 2rem 0;
        gap: 1.25rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero { padding: 3.5rem 0 4rem; }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-body { padding: 1.5rem; }
}
