/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&family=Roboto:wght@400;700&display=swap');

/* === CSS VARIABLES === */
:root {
  /* Light Mode Palette */
  --color-bg: #F8F9FA;
  --color-fg: #FFFFFF;
  --color-text: #212529;
  --color-primary: #6F42C1;
  --color-accent: #FFC107;
  --color-border: #E9ECEF;
  --color-shadow: rgba(0, 0, 0, 0.08);
  --base-font-size: 16px;
}

.dark-mode {
  /* Dark Mode Palette */
  --color-bg: #1A1A1A;
  --color-fg: #2C2C2C;
  --color-text: #E9ECEF;
  --color-primary: #8A63D2;
  --color-accent: #FFC107;
  --color-border: #3a3a3a;
  --color-shadow: rgba(0, 0, 0, 0.3);
}

/* Font Size Adjustments */
body.font-size-large { --base-font-size: 18px; }
body.font-size-xl { --base-font-size: 20px; }


/* === GENERAL STYLES === */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'Roboto', sans-serif;
  font-size: var(--base-font-size); /* Use variable for base font size */
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s, font-size 0.3s;
  line-height: 1.6;
  /* Animated neural background will be handled by JavaScript */
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5em; } /* Use em for relative sizing */
h2 { font-size: 2em; }
h3 { font-size: 1.75em; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease-in-out;
}

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 2rem; /* Adjusted padding */
}

/* === HEADER & NAVIGATION === */
.header {
  background-color: var(--color-fg);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 2rem;
  transition: background-color 0.3s, border-bottom 0.3s;
}

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

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-controls {
    display: flex;
    align-items: center;
}

.site-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease-in-out;
  display: flex;
  align-items: center;
}

.site-title:hover {
  color: var(--color-accent);
}

.logo {
  height: 60px;
  width: auto;
  margin-right: 0.5rem;
}

.nav a {
  margin-left: 1.5rem;
  font-weight: 700;
  padding: 0.5rem 0; /* Add padding for better click area */
}

/* Hamburger Menu Styles */
.hamburger-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 3px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--color-text);
    transition: all 0.3s ease;
}

.hamburger-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  border-radius: 5px;
  margin-left: 1.5rem;
  font-size: 1.2em;
  min-width: 2.5em;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.theme-toggle:hover {
    background-color: var(--color-primary);
    color: #FFFFFF;
    border-color: var(--color-primary);
}

/* === MAIN CONTENT === */
/* Removed .hero styles as the section was removed from index.html */

/* New Main Content Grid */
.main-content-grid {
    display: grid;
    grid-template-columns: 3fr 1fr; /* Main content 3 parts, Sidebar 1 part */
    gap: 2rem;
    margin-top: 2rem;
}

.main-content-left {
    /* Main content area on the left */
    min-height: 200px;
}

.main-sidebar-right {
    background-color: var(--color-fg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 8px var(--color-shadow);
}

.main-sidebar-right h3 {
    margin-top: 0;
    font-size: 1.5em;
    margin-bottom: 1rem;
}

/* Legacy sidebar styles for backward compatibility */
.main-sidebar {
    background-color: var(--color-fg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 8px var(--color-shadow);
}

.main-sidebar h3 {
    margin-top: 0;
    font-size: 1.5em;
}

.main-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-sidebar a {
    display: block;
    padding: 0.5rem 0;
    font-weight: normal;
}

.main-content-right {
    /* Main content area - inherits grid layout styles */
    min-height: 200px; /* Ensure minimum height for content */
}

/* === CARDS === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background-color: var(--color-fg);
    border: 1px solid var(--color-border);
    border-radius: 12px; /* More rounded */
    padding: 1.5rem;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 8px var(--color-shadow); /* Add shadow */
}

.card:hover {
    box-shadow: 0 6px 12px var(--color-shadow);
    transform: translateY(-2px);
}

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

/* Smaller cards for Recent Posts */
.small-cards .card {
    padding: 1rem; /* Smaller padding */
}

.small-cards .card h3 {
    font-size: 1.2em; /* Smaller heading */
    margin-bottom: 0.5rem;
}

.small-cards .card p {
    font-size: 0.9em; /* Smaller paragraph font */
    margin-bottom: 0;
}

.read-more-link {
    text-align: center;
    margin-top: 1.5rem;
}

.read-more-link a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 2px solid var(--color-primary);
    border-radius: 5px;
    transition: all 0.3s ease;
    display: inline-block;
}

.read-more-link a:hover {
    background-color: var(--color-primary);
    color: white;
}


/* === FOOTER === */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 1rem 2rem;
  color: #6c757d;
  font-size: 0.9em;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer p {
  margin: 0;
}

.footer-social {
  position: absolute;
  right: 2rem;
}

.footer-social img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transition: transform 0.2s ease-in-out;
  opacity: 0.7;
}

.footer-social img:hover {
  transform: scale(1.2);
  opacity: 1;
}

/* Add bottom padding to body to prevent content from hiding behind fixed footer */
body {
  padding-bottom: 80px;
}

/* === BLOG LAYOUT SPECIFIC STYLES === */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 2rem;
    margin-top: 2rem;
}
.blog-nav {
    border-right: 1px solid var(--color-border);
    padding-right: 2rem;
}

.blog-nav h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.posts-list {
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--color-fg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem;
}

.posts-list::-webkit-scrollbar {
    width: 6px;
}

.posts-list::-webkit-scrollbar-track {
    background: var(--color-bg);
    border-radius: 3px;
}

.posts-list::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.posts-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.blog-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-nav a {
    display: block;
    padding: 0.7rem 0.5rem;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}
.blog-nav a:hover, .blog-nav a.active {
    background-color: var(--color-primary);
    color: #FFFFFF;
}
#article-content {
    background-color: var(--color-fg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 8px var(--color-shadow);
}

/* === RESPONSIVENESS === */
@media (max-width: 768px) {
    .hamburger-toggle {
        display: flex;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-fg);
        border-top: 1px solid var(--color-border);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 2rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .nav-links.nav-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links a {
        margin: 0;
        padding: 0.75rem 0;
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .nav-controls {
        gap: 0.5rem;
    }
    
    .nav-controls .theme-toggle {
        margin-left: 0;
    }
    
    .header {
        position: relative;
    }
    .footer-social {
        position: static;
        text-align: center;
        margin-top: 1rem;
    }
    /* Removed .hero styles as the section was removed from index.html */
    .main-content-grid {
        grid-template-columns: 1fr; /* Stack columns on small screens */
    }
    .main-sidebar, .main-sidebar-right {
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--color-border);
        border-radius: 0; /* Remove border radius when stacked */
    }
    .main-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .main-sidebar a {
        flex: 1 1 auto;
        text-align: center;
    }
    .blog-layout {
        grid-template-columns: 1fr; /* Stack columns on small screens */
    }
    .blog-nav {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding-right: 0;
        padding-bottom: 1rem;
    }
    .blog-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .blog-nav a {
        flex: 1 1 auto; /* Allow links to grow */
        text-align: center;
    }
    .about-content {
        flex-direction: column;
    }
    .about-hero {
        width: 100%;
        max-width: 300px;
        align-self: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    .footer-social {
        right: 1rem;
        bottom: 0.5rem;
    }
}

/* === DOJO DIVIDERS === */
.dojo-divider {
    text-align: center;
    margin: 2rem 0;
    font-size: 1.5rem;
    opacity: 0.7;
    letter-spacing: 0.5rem;
    transition: opacity 0.3s ease;
}

.dojo-divider:hover {
    opacity: 1;
}

/* === ARTICLE IMAGES === */
.article-image {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    background-color: var(--color-fg);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--color-shadow);
    border: 1px solid var(--color-border);
}

.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.image-caption {
    font-style: italic;
    color: var(--color-text);
    opacity: 0.8;
    margin: 0;
    font-size: 0.9rem;
}

/* === ABOUT PAGE STYLES === */
.about-content {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.about-hero {
    width: 250px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--color-shadow);
}

.about-text {
    flex: 1;
}
.hero-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('/src/assets/neuralpattern.png');
    background-size: cover;
    background-position: center;
    opacity: 0.12;
    pointer-events: none;
}
.hero-banner .hero-inner { position: relative; z-index: 1; }
.hero-banner h1 {
    color: #fff;
    margin: 0 0 0.5rem 0;
}
.date-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.9rem;
}

/* cleaned: removed unused hero-aside and minimal-accent rules */
