/* Shared styles for blog articles and static pages */
:root {
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-brand: 'Tiro Devanagari Hindi', serif;
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background-color: var(--bg-color);
    margin: 0;
    line-height: 1.6;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    display: block !important;
}

.app-container {
    padding-top: 0 !important;
    height: auto !important;
}

.glass-header {
    margin-top: 0 !important;
}

.logo .highlight {
    font-family: var(--font-brand);
    transform: translateY(4px);
    display: inline-block;
}

.theme-toggle-standalone {
    background: var(--key-base);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
}

.theme-toggle-standalone:hover {
    transform: rotate(15deg) scale(1.1);
    border-color: var(--primary);
    background: var(--highlight);
}

/* Hero Section */
.hero {
    padding: 8rem 2rem 5rem;
    text-align: center;
    background-size: cover;
    background-position: center;
    background: linear-gradient(120deg, var(--surface) 0%, var(--bg-color) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, var(--primary-glow), transparent 60%);
    opacity: 0.6;
    pointer-events: none;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary) !important;
    /* User request: Black/Text color for visibility */
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary) !important;
    max-width: 700px;
    margin: 0 auto 2rem;
    font-weight: 500;
}

/* For articles that HAVE background images, we keep the white text & overlay */
.hero.has-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6));
    color: white;
}

.hero.has-bg h1,
.hero.has-bg p {
    color: white !important;
}

.meta {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

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

.article-layout {
    display: grid;
    grid-template-columns: 800px 1fr;
    gap: 4rem;
    margin: 4rem 0 6rem;
}

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

.article-layout .widget.primary {
    background: var(--primary);
    color: var(--on-primary);
    border: none;
}

.article-layout .widget.primary h4,
.article-layout .widget.primary p {
    color: inherit;
}

.article-body {
    background: var(--surface);
    padding: 4rem;
    border-radius: 32px;
    border: 1px solid var(--border);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .article-body {
        padding: 2rem;
    }
}

.article-body h2 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 2rem;
    margin: 3.5rem 0 1.5rem;
}

.article-body p {
    margin-bottom: 2rem;
}

.article-body strong {
    color: var(--text-primary);
}

.tip-box {
    background: var(--highlight);
    border-left: 6px solid var(--primary);
    padding: 2rem;
    border-radius: 20px;
    margin: 3.5rem 0;
    font-style: italic;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
}

.widget h4 {
    font-family: var(--font-heading);
    margin: 0 0 1.5rem;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 12px;
    margin: 0 -12px;
    border-radius: 12px;
    transition: all 0.2s;
}

.resource-link:hover {
    background: var(--highlight);
    color: var(--primary);
    transform: translateX(5px);
}

/* Listing Feed Styles */
.content-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    margin-bottom: 6rem;
}

@media (max-width: 968px) {
    .content-section {
        grid-template-columns: 1fr;
    }
}

.section-heading {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.article-feed {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.article-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    text-decoration: none;
    padding: 1.5rem;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 640px) {
    .article-card {
        grid-template-columns: 1fr;
    }
}

.article-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.article-image {
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--highlight);
    border-radius: 16px;
    background-size: cover;
    background-position: center;
}

.article-info h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin: 0.5rem 0 0.75rem;
    color: var(--text-primary);
}

/* Feature Cards & Grid Styles */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* Symbol Grid Specifics for Guide */
.table-wrapper tbody {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px;
    justify-content: flex-start;
    background: var(--bg-color) !important;
}

.table-wrapper tr {
    display: flex !important;
    width: 48px;
    height: 48px;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.table-wrapper tr:hover {
    background: var(--highlight) !important;
    border-color: var(--primary) !important;
    transform: scale(1.1);
    z-index: 10;
}

.table-wrapper tr.active {
    background: var(--primary) !important;
    color: var(--on-primary) !important;
    border-color: var(--primary) !important;
}

.table-wrapper td {
    padding: 0 !important;
    border: none !important;
}

/* Hide extra columns in grid mode if they are still there */
.table-wrapper tr td:not(.preeti-font) {
    display: none;
}

.table-wrapper tr td.preeti-font {
    display: block;
    font-size: 1.4rem;
}

.article-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--highlight);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
}

.article-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Feature Cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

.feature-card h3 {
    margin-top: 0;
    color: var(--primary);
}

/* Character & Alt Code Tables */
.table-wrapper {
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid var(--border);
    margin-bottom: 4rem;
    background: var(--surface);
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrapper th {
    background: var(--highlight);
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--border);
}

.table-wrapper td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

/* Symbol Grid Mode for Preeti Alt Codes */
.symbol-grid-body {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
    background: var(--bg-color);
    justify-content: center;
}

.symbol-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 70px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.symbol-item:hover {
    background: var(--highlight);
    border-color: var(--primary);
    transform: scale(1.1);
    z-index: 2;
}

.symbol-char {
    font-size: 1.5rem;
    font-family: 'Preeti', sans-serif;
    color: var(--text-primary);
}

.symbol-code {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
}