/* Final polished styles with fixed duplication and sidebar */

/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@700&display=swap');

/* Variables for consistent colors and measurements */
:root {
    --primary-color: #8B6D3F;
    --secondary-color: #B89E6B;
    --accent-color: #D6BA8A;
    --light-accent: #F5ECD9;
    --text-color: #333333;
    --light-text: #757575;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --border-radius: 6px;
    --content-width: 1140px;
    --header-height: 70px;
    --transition: all 0.3s ease;
}

/* Base styles - clean and simple */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background: var(--background-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Content container with maximum width for readability */
.container, main {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Modern navigation with sophisticated golden brown gradient */
nav, .navbar {
    background: linear-gradient(to right, #8B6D3F, #B89E6B);
    height: var(--header-height);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap; /* Allow elements to move if needed */
    align-items: center;
    justify-content: space-between;
    padding: 0 20px; /* Reduce padding for better spacing */
    transition: var(--transition);
}

/* Navigation links - clean and precise */
nav a, .nav-link {
    color: white;
    font-weight: 500;
    text-decoration: none;
    margin: 0 15px;
    position: relative;
    transition: var(--transition);
    border-bottom: none;
}

nav a::after, .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: white;
    transition: var(--transition);
}

nav a:hover::after, .nav-link:hover::after {
    width: 100%;
    transition: width 0.3s ease-in-out;
}

/* Header with subtitle for data visualization and analysis */
header {
    background: linear-gradient(135deg, #8B6D3F, #B89E6B);
    color: white;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    margin-bottom: 40px;
}

/* Hide the duplicate name in header */
header h1.title {
    display: none;
}

/* Main page title styling */
.navbar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5em;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2.8em;
    color: var(--primary-color);
}

p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #444; /* Darker for readability */
    font-size: 1.1em; /* Increase size slightly */
}

/* Hide the duplicate "Data Visualization & Analysis" text */
.quarto-title .title {
    display: none;
}

/* Hide default Quarto title block (prevents duplication) */
.quarto-title-block {
    display: none !important;
}

/* Content sections with clean layout */
section, .section, article {
    margin: 30px auto;
    padding: 30px;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

section:hover, .section:hover, article:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Subtle accent for sections */
section::before, .section::before, article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0.8;
}

/* Headings with refined typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary-color);
    margin-top: 1.2em;
    margin-bottom: 0.8em;
}

h2 { 
    font-size: 1.8em; 
    padding-bottom: 0.5em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
h3 { font-size: 1.4em; }
h4 { font-size: 1.2em; }

/* Paragraph styles optimized for readability */
p {
    margin-bottom: 1.5em;
    line-height: 1.8;
}

/* Link styling */
a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 1px dotted var(--primary-color);
    padding-bottom: 1px;
}

a:hover {
    color: #634D2C;
    border-color: #634D2C;
}

/* Button styles with professional feel */
button, .button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-weight: 500;
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

button:hover, .button:hover {
    background: #634D2C;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Improve sidebar spacing */
#quarto-margin-sidebar {
    background-color: var(--card-background);
    padding: 25px 20px; /* Increase padding for better spacing */
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.05); /* Light border for separation */
}

#quarto-margin-sidebar {
    max-width: 280px; /* Keep sidebar width consistent */
}

#quarto-margin-sidebar a {
    display: block; /* Allow links to wrap correctly */
    width: auto; /* Let links fit naturally */
}

/* Main sidebar container */
.sidebar-navigation-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    width: 100%;
}

/* Style all sidebar sections */
.sidebar-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px; /* More padding for better spacing */
    margin-bottom: 25px; /* Increase margin for spacing */
    box-shadow: var(--shadow-md); /* Stronger shadow for visibility */
    width: 100%;
}

/* Titles for sidebar sections */
.sidebar-title,  
#toc-title,  
.quarto-sidebar-section-title,  
.sidebar-section-title,  
.sidebar h2,  
.sidebar h3 {  
    font-weight: 600;  
    color: var(--primary-color);  
    margin-top: 0;  
    margin-bottom: 15px;  
    font-size: 1.1em;  
    border-bottom: 1px solid rgba(139, 109, 63, 0.1);  
    padding-bottom: 10px;  
    background: transparent; /* Fix the brown rectangle issue */
}

/* Fix "On this page" title */
.sidebar nav[role="doc-toc"] > h2 {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 1px solid rgba(139, 109, 63, 0.1);
    padding-bottom: 10px;
}

/* Style each section in the sidebar */
#quarto-sidebar > div,
#quarto-margin-sidebar > div {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    width: 100%;
}

/* Fix for the "What You'll Find Here" and "Connect with Me" sections */
div.toc-actions,
div.quarto-sidebar nav ul,
div.quarto-sidebar div ul {
    padding-left: 0;
    margin-left: 0;
    list-style-type: none;
}

div.quarto-sidebar div:not(.toc-actions) {
    width: 100%;
}

/* Navigation list styling */
.sidebar nav ul, 
.sidebar div ul,
#TOC ul {
    padding-left: 0;
    margin-left: 0;
    list-style-type: none;
    width: 100%;
}

.sidebar nav li,
.sidebar div li,
#TOC li {
    margin-bottom: 10px;
    list-style-type: none;
}

.sidebar nav a,  
.sidebar div a,  
#TOC a {  
    color: var(--text-color);  
    text-decoration: none;  
    border-bottom: none;  
    display: block;  
    padding: 8px 12px; /* Add left padding for better alignment */
    transition: var(--transition);  
    font-weight: 400;  
}

.sidebar nav a:hover,
.sidebar div a:hover,
#TOC a:hover {
    color: #6A4C28;
    font-weight: 600;
    border-bottom: 2px solid #6A4C28;
}

/* "On this page" section styling */
.sidebar-item {
    margin-bottom: 8px;
    padding: 0;
    display: flex;
    align-items: flex-start;
}

.sidebar-item-container {
    padding-left: 0;
}

/* Add this to your styles.css file */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.skills-grid ul {
  margin-top: 10px;
}

/* Specific fixes for "What You'll Find Here" and "Connect with Me" */
div#quarto-margin-sidebar > div > div > ul > li,
div#quarto-margin-sidebar > div > ul > li {
    list-style-type: none;
    margin-bottom: 10px;
    padding-left: 0;
}

/* Make sure the white background extends fully */
div#quarto-margin-sidebar > div {
    width: 100%;
    box-sizing: border-box;
}

/* Specific fixes for nested elements */
.quarto-sidebar-section ul li a,
div#quarto-margin-sidebar > div > div > ul > li a,
div#quarto-margin-sidebar > div > ul > li a {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: none;
    padding: 5px 0;
    transition: var(--transition);
    font-weight: 400;
}

.quarto-sidebar-section ul li a:hover,
div#quarto-margin-sidebar > div > div > ul > li a:hover,
div#quarto-margin-sidebar > div > ul > li a:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

/* Project card grid for portfolio items */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.project-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.project-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-card h3 {
    margin-top: 0;
    font-size: 1.3em;
    margin-bottom: 10px;
}

.project-card p {
    margin-bottom: 20px;
    color: var(--light-text);
    flex-grow: 1;
}

.button-cta {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 1.2em;
    padding: 12px 24px;
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    transition: 0.3s;
}

.button-cta:hover {
    background: #6A4C28;
    transform: scale(1.05);
}

/* Responsive design adjustments */
@media (max-width: 991px) {
    :root {
        --content-width: 95%;
    }
    
    header {
        padding: 40px 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    section, .section, article {
        padding: 25px;
    }
    
    header:after {
        font-size: 1.5em;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.5em; }
    
    nav, .navbar {
        padding: 0 15px;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    header:after {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    header {
        padding: 30px 15px;
    }
    
    h1 {
        font-size: 1.7em;
    }
    
    section, .section, article {
        padding: 20px;
        margin: 25px auto;
    }
    
    h2 { font-size: 1.4em; }
    
    header:after {
        font-size: 1.2em;
    }
}

/* Print styles for better document printing */
@media print {
    body {
        background: linear-gradient(to bottom, #FAF8F3, #F2E7D5);
    }
    
    nav, .navbar, footer {
        display: none;
    }
    
    header {
        background: none;
        color: black;
        padding: 0;
        margin-bottom: 20px;
    }
    
    h1 {
        color: black;
        font-size: 24pt;
    }
    
    section, .section, article {
        break-inside: avoid;
        box-shadow: none;
        margin: 20px 0;
        padding: 0;
        border: none;
    }
    
    a {
        color: black;
        text-decoration: underline;
        border-bottom: none;
    }
}