/* ==========================================================================
   VIJAY'S JOURNAL - FINAL STYLESHEET
   Clean design with subtle magazine-style visual accents
   ========================================================================== */

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */

:root {
    --accent: #d63447;
    --dark: #1a1a1a;
    --light: #ffffff;
    --gray: #666;
    --border: #ddd;
    --gradient-start: #d63447;
    --gradient-end: #9b59b6;
}

body.dark-mode {
    --light: #0a0a0a;
    --dark: #e8e8e8;
    --border: #333;
    --gray: #999;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

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

body {
    font-family: 'Crimson Pro', Georgia, serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    font-size: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ==========================================================================
   AMBIENT GRADIENT BACKGROUND
   ========================================================================== */

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end), var(--gradient-start));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ==========================================================================
   THEME TOGGLE
   ========================================================================== */

.theme-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    background: var(--dark);
    color: var(--light);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

body.dark-mode .theme-toggle {
    background: var(--light);
    color: var(--dark);
}

/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--gradient-end));
    z-index: 9999;
    width: 0;
    transition: width 0.1s ease;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

header {
    max-width: 100%;
    padding: 60px 40px 35px 40px;
    margin: 0 0 20px 0;
    text-align: center;
    border-bottom: 2px solid var(--dark);
    animation: fadeInDown 0.8s ease;
}

body.dark-mode header {
    border-bottom-color: #333;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -2px;
}

.site-title a {
    color: var(--dark);
    text-decoration: none;
}

.site-tagline {
    font-family: 'Crimson Pro', serif;
    font-size: 17px;
    color: var(--gray);
    margin-bottom: 25px;
    font-style: italic;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

nav {
    display: flex;
    gap: 25px;
    justify-content: center;
    padding-top: 22px;
    flex-wrap: wrap;
}

nav a {
    color: var(--dark);
    text-decoration: none;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--accent);
}

nav a:hover::after {
    width: 100%;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
    background: var(--dark);
    color: var(--light);
    padding: 35px 0;
    margin-top: 80px;
}

body.dark-mode footer {
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-family: 'Work Sans', sans-serif;
    color: var(--light);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

/* ==========================================================================
   HOME PAGE - HERO SECTION (Subtle Enhancement)
   ========================================================================== */

.home-intro {
    margin-bottom: 70px;
    animation: fadeIn 1s ease;
    position: relative;
    padding: 35px 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Subtle background tint */
.home-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(214, 52, 71, 0.02) 0%, 
        rgba(155, 89, 182, 0.015) 100%
    );
    z-index: -1;
    border-top: 1px solid rgba(214, 52, 71, 0.06);
    border-bottom: 1px solid rgba(214, 52, 71, 0.06);
}

.home-intro h2 {
    font-family: 'Work Sans', sans-serif;
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: -1px;
    text-align: center;
    line-height: 1.3;
}

.home-intro h3 {
    font-family: 'Crimson Pro', serif;
    font-size: 22px;
    font-weight: 400;
    font-style: italic;
    color: var(--gray);
    margin-bottom: 35px;
    text-align: center;
    line-height: 1.4;
}

.home-intro p {
    font-size: 19px;
    line-height: 1.55;
    margin-bottom: 0.85em;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.home-intro p:last-of-type {
    margin-bottom: 0;
}

/* ==========================================================================
   SECTION TITLES (With Accent Underline)
   ========================================================================== */

.section-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 35px;
    letter-spacing: -1px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 1px;
}

/* ==========================================================================
   FEATURED SECTION
   ========================================================================== */

.featured-section {
    margin-bottom: 60px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

/* ==========================================================================
   ARTICLES GRID
   ========================================================================== */

.articles-section {
    margin-bottom: 70px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* ==========================================================================
   ARTICLE CARD
   ========================================================================== */

.article-card {
    background: var(--light);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
}

body.dark-mode .article-card {
    background: #1a1a1a;
    border-color: #333;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

body.dark-mode .article-card:hover {
    box-shadow: 0 10px 30px rgba(255,255,255,0.1);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%;
    overflow: hidden;
    background: var(--border);
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .card-image {
    transform: scale(1.05);
}

.card-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--gradient-end) 100%);
    opacity: 0.1;
}

/* Category Badge - Small and Subtle */
.card-category {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent);
    color: white;
    padding: 3px 7px;
    font-family: 'Work Sans', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    z-index: 10;
    opacity: 0.9;
}

.card-content {
    padding: 18px;
}

.card-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.card-excerpt {
    font-size: 15px;
    line-height: 1.5;
    color: var(--gray);
    margin-bottom: 10px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.article-card:hover .card-excerpt {
    opacity: 1;
    max-height: 100px;
}

.card-meta {
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-divider {
    color: var(--border);
}

/* ==========================================================================
   VIEW ALL BUTTON
   ========================================================================== */

.view-all {
    text-align: center;
    margin-top: 50px;
}

.btn-primary {
    display: inline-block;
    font-family: 'Work Sans', sans-serif;
    background: var(--accent);
    color: white;
    padding: 14px 32px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(214, 52, 71, 0.3);
}

.btn-primary:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 52, 71, 0.4);
}

/* ==========================================================================
   SINGLE POST PAGE
   ========================================================================== */

.post {
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.article-header {
    margin-bottom: 45px;
}

.category-badge {
    display: inline-block;
    font-family: 'Work Sans', sans-serif;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 25px;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(214, 52, 71, 0.3);
}

.article-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 22px;
    animation: slideIn 0.8s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-subtitle {
    font-size: 23px;
    color: var(--gray);
    line-height: 1.45;
    margin-bottom: 32px;
    font-weight: 400;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 22px 0;
    border-top: 2px solid var(--dark);
    border-bottom: 2px solid var(--dark);
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    color: var(--gray);
    flex-wrap: wrap;
}

body.dark-mode .article-meta {
    border-top-color: #333;
    border-bottom-color: #333;
}

.author-info {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    margin-right: 12px;
    box-shadow: 0 2px 10px rgba(214, 52, 71, 0.3);
}

.author-name {
    font-weight: 600;
    color: var(--dark);
}

.meta-item {
    padding-left: 15px;
    border-left: 1px solid var(--border);
}

.meta-item:first-of-type {
    padding-left: 0;
    border-left: none;
}

/* ==========================================================================
   ARTICLE CONTENT
   ========================================================================== */

.article-content {
    margin: 45px 0 70px 0;
}

.article-content p {
    margin-bottom: 1.1em;
    line-height: 1.65;
    transition: transform 0.2s ease;
}

.article-content p:hover {
    transform: translateX(3px);
}

.article-content h2 {
    font-family: 'Work Sans', sans-serif;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
    margin: 50px 0 22px 0;
    line-height: 1.2;
}

.article-content h3 {
    font-family: 'Work Sans', sans-serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin: 40px 0 18px 0;
}

.article-content h4 {
    font-family: 'Work Sans', sans-serif;
    font-size: 21px;
    font-weight: 600;
    margin: 32px 0 14px 0;
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: #c0392b;
}

.article-content ul,
.article-content ol {
    margin: 1.3em 0 1.3em 2em;
}

.article-content li {
    margin-bottom: 0.4em;
    line-height: 1.6;
}

.article-content blockquote {
    font-size: 23px;
    line-height: 1.55;
    font-style: italic;
    margin: 35px 0;
    padding: 28px 0 28px 28px;
    border-left: 4px solid var(--accent);
    color: var(--gray);
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 28px 0;
    border-radius: 8px;
}

.article-content code {
    background: var(--border);
    padding: 3px 8px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

body.dark-mode .article-content code {
    background: #333;
}

.article-content pre {
    background: var(--dark);
    color: #00ff88;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 28px 0;
}

body.dark-mode .article-content pre {
    background: #1a1a1a;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: #00ff88;
}

/* ==========================================================================
   ARTICLE FOOTER
   ========================================================================== */

.article-footer {
    margin-top: 55px;
    padding-top: 35px;
    border-top: 2px solid var(--dark);
}

body.dark-mode .article-footer {
    border-top-color: #333;
}

.share-label {
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 18px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 35px;
}

.tag {
    font-family: 'Work Sans', sans-serif;
    background: transparent;
    border: 2px solid var(--border);
    color: var(--dark);
    padding: 9px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 52, 71, 0.3);
}

.back-link {
    font-family: 'Work Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
    transform: translateX(-5px);
}

/* ==========================================================================
   STATIC PAGES
   ========================================================================== */

.page {
    animation: fadeIn 1s ease;
    margin-top: 0;
    padding-top: 0;
}

.page-header {
    text-align: center;
    margin-bottom: 28px;
    margin-top: 0;
    padding-top: 0;
}

.page-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 14px;
    margin-top: 0;
}

.page-subtitle {
    font-size: 20px;
    color: var(--gray);
    line-height: 1.4;
}

.page-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-content p {
    margin-bottom: 0.9em;
    line-height: 1.6;
}

.page-content h2 {
    font-family: 'Work Sans', sans-serif;
    font-size: 30px;
    font-weight: 700;
    margin: 40px 0 18px 0;
    letter-spacing: -1px;
}

.page-content h3 {
    font-family: 'Work Sans', sans-serif;
    font-size: 23px;
    font-weight: 600;
    margin: 30px 0 14px 0;
}

.page-content ul {
    margin: 1.1em 0 1.1em 2em;
}

.page-content li {
    margin-bottom: 0.4em;
    line-height: 1.6;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .container {
        padding: 0 30px;
    }
    
    header {
        padding: 50px 30px 28px 30px;
        margin-bottom: 18px;
    }
    
    .site-title {
        font-size: 38px;
        letter-spacing: -1.5px;
    }
    
    .site-tagline {
        font-size: 16px;
    }
    
    .articles-grid,
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }
    
    .article-title {
        font-size: 40px;
        letter-spacing: -1.5px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 18px;
    }
    
    .container {
        padding: 0 20px;
    }
    
    header {
        padding: 45px 20px 22px 20px;
        margin-bottom: 15px;
    }
    
    .site-title {
        font-size: 30px;
        letter-spacing: -1px;
    }
    
    .site-tagline {
        font-size: 15px;
    }
    
    nav {
        gap: 14px;
    }
    
    nav a {
        font-size: 11px;
    }
    
    .theme-toggle {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .articles-grid,
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .article-title {
        font-size: 34px;
        letter-spacing: -1px;
    }
    
    .article-subtitle {
        font-size: 19px;
    }
    
    .article-content h2 {
        font-size: 26px;
    }
    
    .article-content h3 {
        font-size: 22px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .section-title {
        font-size: 26px;
    }
    
    .home-intro {
        padding: 30px 0;
    }
    
    .home-intro h2 {
        font-size: 28px;
    }
    
    .home-intro h3 {
        font-size: 20px;
    }
    
    .home-intro p {
        font-size: 17px;
    }
    
    .page-header {
        margin-bottom: 25px;
    }
    
    .page-title {
        font-size: 34px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 17px;
    }
    
    .site-title {
        font-size: 26px;
    }
    
    .article-title {
        font-size: 30px;
    }
    
    .card-title {
        font-size: 17px;
    }
}