@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Outfit:wght@400;700&display=swap');

:root {
    --accent-color: #0056b3; /* Darker Blue */
    --primary-text-color: #212529; /* Dark Charcoal */
    --secondary-text-color: #6c757d; /* Lighter Gray for less important text */
    --light-bg-color: #f9f9f9;
    --header-bg-color: #ffffff;
    --section-bg-color: #ffffff;
    --border-color: #dee2e6; /* Light gray for borders */
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    font-size: 16px;
    color: var(--primary-text-color);
    background-color: var(--light-bg-color); /* Light gray background */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* Header */
header {
    background-color: var(--header-bg-color); /* White background for header */
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color); /* Subtle border */
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-top: 0; /* Remove default top margin */
    margin-bottom: 0.25rem;
    color: var(--primary-text-color); /* Dark blue-gray for title */
}
header h1 a {
    text-decoration: none;
    color: inherit;
}



header nav {
    margin-top: 5px;
}

header nav a {
    margin: 0 15px;
    font-size: 1.1rem;
    font-weight: 700;
}

header nav a:hover {
    color: color-mix(in srgb, var(--accent-color) 80%, black); /* Darker blue on hover */
}
header nav a:focus-visible {
    color: color-mix(in srgb, var(--accent-color) 80%, black); /* Darker blue on focus */
    outline: 2px solid var(--accent-color); /* Enhanced focus outline */
    outline-offset: 2px;
}

/* Main Content */
main {
    flex-grow: 1; /* Ensures main content takes available space, pushing footer down */
    padding: 1rem 0;
    width: 90%;
    max-width: 900px; /* Max width for readability */
    margin: 1.5rem auto 2rem; /* Centering and spacing (top, horizontal, bottom) */
}

main section {
    background-color: var(--section-bg-color); /* White background for content sections */
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Subtle shadow */
}

main h2 {
    color: var(--accent-color); /* Changed from primary-text-color */
    margin-top: 0; /* Override general h2 margin-top */
    margin-bottom: 0.75rem; /* Closer to its content */
    /* border-bottom: 2px solid var(--accent-color); Removed */
    /* padding-bottom: 8px; Removed */
    border-top: 1px solid var(--border-color); /* Added */
    padding-top: 0.5rem; /* Space from top border. Will inherit margin-top from general h rule */
    letter-spacing: 0.25px; /* Subtle letter spacing for definition */
    text-align: center;
}

p {
    margin-bottom: 1rem;
}

/* Specific line height for homepage sections */
#who-i-am p,
#purpose p {
    line-height: 1.7;
}

.disclaimer {
    font-size: 0.8rem; /* Changed from 0.9em */
    color: var(--secondary-text-color); /* Gray for disclaimer text */
    font-style: italic;
    border-left: 3px solid var(--border-color); /* Subtle left border */
    padding-left: 10px;
    margin-top: 15px;
}

/* Posts Page Specifics */
/* Styles for the new clickable post summary link container */
.post-summary-link {
    display: block;
    text-decoration: none;
    color: inherit; /* Inherit text color from parent */
    margin-bottom: 0; /* Existing margin from .post-summary */
    padding-bottom: 0; /* Existing padding from .post-summary */
    border-bottom: 1px solid var(--border-color); /* Changed from dashed to solid */
    transition: background-color 0.2s ease-in-out; /* Subtle hover effect */
}

.post-summary-link:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.post-summary-link:hover, .post-summary-link:focus {
    background-color: #f8f9fa; /* Very light background on hover */
    text-decoration: none; /* Ensure no underline from browser default on hover */
}

/* h3 within the link container */
.post-summary-link h3 {
    margin-top: 10px; /* Decrease top margin */
    margin-bottom: 0.25rem; /* Existing margin */
}

/* Title link style within the clickable card */
.post-summary-link h3 a {
    text-decoration: none; 
    color: var(--accent-color);
    font-size: 1.4rem; /* Existing font size */
}
.post-summary-link h3 a:hover, .post-summary-link h3 a:focus {
    text-decoration: underline;
    color: color-mix(in srgb, var(--accent-color) 80%, black);
}

/* Ensure paragraphs within the link don't change color unexpectedly */
.post-summary-link p {
    color: var(--primary-text-color); /* Or var(--secondary-text-color) if more appropriate for excerpt */
}
/* Specifically for post-meta if it needs to be different */
.post-summary-link .post-meta {
    color: var(--secondary-text-color); /* Ensure post-meta keeps its muted color */
    font-size: 0.875rem; /* Ensure post-meta keeps its font-size */
    margin-bottom: 0.5rem; /* Ensure post-meta keeps its margin */
}


.post-meta, .caption-text {
    font-size: 0.875rem; /* This rule is now more general or can be combined */
    color: var(--secondary-text-color); 
    margin-bottom: 0.5rem;
}

/* Single Post View */
#single-post-section #back-to-list {
    display: inline-block;
    margin-bottom: 2rem;
    font-weight: bold;
    transition: color 0.2s ease-in-out, outline-offset 0.1s ease-in-out, outline 0.1s ease-in-out; /* Added specific transitions */
}
#single-post-section #back-to-list:hover {
    color: color-mix(in srgb, var(--accent-color) 80%, black);
}
#single-post-section #back-to-list:focus-visible {
    color: color-mix(in srgb, var(--accent-color) 80%, black);
    outline: 2px solid var(--accent-color); /* Enhanced focus outline */
    outline-offset: 2px;
}

/* Markdown Rendered Content Styling */
#post-content {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

#post-content h1, #post-content h2, #post-content h3, #post-content h4, #post-content h5, #post-content h6 {
    color: var(--primary-text-color);
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}
#post-content h1 {
    text-align: center;
}
#post-content h2 {
    margin-top: 0; /* Set h2 top margin to 0 */
}
#post-content h1 { font-size: 3rem; } /* Updated from 2em */
#post-content h2 { font-size: 2.25rem; } /* Updated from 1.75em */
#post-content h3 { font-size: 1.75rem; } /* Updated from 1.5em */
#post-content h4 { font-size: 1.5rem; }   /* Added */
#post-content h5 { font-size: 1.25rem; }  /* Added */
#post-content h6 { font-size: 1rem; }     /* Added */

#post-content p {
    margin-bottom: 1em;
    line-height: 1.7; /* Improved readability for paragraphs */
}

#post-content ul, #post-content ol {
    margin-left: 20px;
    margin-bottom: 1em;
}

#post-content li {
    margin-bottom: 0.5em;
}

#post-content blockquote {
    border-left: 4px solid var(--accent-color); /* Changed to accent color */
    padding-left: 15px;
    margin: 1.5rem 0;
    color: var(--secondary-text-color);
    font-style: italic;
}

#post-content code { /* Inline code */
    background-color: #ecf0f1; /* Light gray background for inline code */
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.9em;
}

#post-content pre { /* Code blocks */
    background-color: #2d2d2d; /* Dark background for code blocks */
    color: #f8f8f2; /* Light text for contrast */
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto; /* Horizontal scroll for long code lines */
    margin-bottom: 1.5rem;
}

#post-content pre code { /* Reset for code inside pre */
    background-color: transparent;
    padding: 0;
    font-size: 0.9em;
}

#post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1em 0;
}

/* Global link styles */
a {
    color: var(--accent-color); /* Default link color */
    text-decoration: none;
    transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

/* Link styles within post content */
#post-content a {
    /* color is inherited from global 'a' */
    border-bottom: 1px solid transparent;
    /* transition is inherited from global 'a' */
}

#post-content a:hover {
    text-decoration: none; /* Ensure no default underline from browser on hover */
    border-bottom-color: var(--accent-color); /* Change border color */
    color: color-mix(in srgb, var(--accent-color) 80%, black);
}

#post-content a:focus-visible {
    text-decoration: none; /* Ensure no default underline from browser on focus */
    border-bottom-color: var(--accent-color); /* Change border color */
    color: color-mix(in srgb, var(--accent-color) 80%, black);
    outline: 2px solid var(--accent-color); /* Optional: Add outline for very clear focus if border is subtle */
    outline-offset: 2px;
}

/* Ensure header links get the global transition if not overridden */
header nav a {
    /* color: var(--accent-color); Already set */
    /* font-weight: 700; Already set */
    /* margin: 0 15px; Already set -- from previous turn */
    /* font-size: 1.1rem; Already set */
    /* text-decoration: none; Already set via global 'a' */
    transition: color 0.2s ease-in-out, outline-offset 0.1s ease-in-out, outline 0.1s ease-in-out; /* Added outline transitions */
}

.post-end-cue {
    text-align: center;
    font-size: 1.5rem;
    color: var(--border-color); /* Light gray, subtle */
    margin-top: 3rem;   /* Space above the cue */
    margin-bottom: 1rem; /* Space below the cue, before footer (main already has margin-bottom) */
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem 0;
    background-color: var(--light-bg-color); /* Light footer */
    color: var(--primary-text-color); /* Dark text for footer */
    margin-top: auto; /* Pushes footer to the bottom */
}

footer p {
    margin: 0;
}

.contact-links a:first-of-type {
    margin-right: 15px; /* Adjust as needed for desired spacing */
}

/* Footnote specific styles */
.footnotes {
    margin-top: 2em;
    border-top: 1px solid var(--border-color);
    padding-top: 1em;
    font-size: 0.9em;
    color: var(--secondary-text-color);
}

.footnotes ol {
    list-style-type: decimal;
    margin-left: 20px;
    padding-left: 0;
}

.footnotes li {
    margin-bottom: 0.5em;
}

.footnotes li p {
    display: inline; /* Keep paragraph content inline with list number */
}

.footnotes li a.footnote-backref {
    text-decoration: none;
    margin-left: 0.5em;
    color: var(--accent-color);
}

.footnotes li a.footnote-backref:hover {
    text-decoration: underline;
}


/* Utility Classes */
/* Callout Boxes */
.callout {
    padding: 1.25rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-left-width: 5px;
    border-radius: 5px;
}

.callout h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    color: var(--primary-text-color);
}

.callout.info {
    border-left-color: var(--accent-color);
    background-color: #f0f7ff;
}

.callout ul {
    margin-left: 20px;
    margin-bottom: 0;
}

/* Checklist */
.checklist {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 0.75rem;
}

.checklist li::before {
    content: '\2713'; /* Checkmark character */
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Timeline */
.timeline {
    list-style: none;
    padding-left: 40px; /* Space for the line and circles */
    position: relative;
}

.timeline li {
    position: relative;
    margin-bottom: 1.5rem; /* This is the gap between list items */
    padding-left: 20px; /* Space for the text after the circle */
}

.timeline li::before {
    content: '';
    position: absolute;
    left: -6px; /* Relative to li's padding-left */
    top: 14px; /* Half of .t-num height */
    bottom: -1.5rem; /* Extend to the bottom of the li, accounting for margin-bottom */
    width: 2px;
    background-color: var(--accent-color);
}

.timeline li:last-child::before {
    display: none; /* Hide the line for the last item */
}

.timeline li .t-num {
    position: absolute;
    left: -20px; /* (0px (line start) - 14px (half circle width)) - 20px (li padding) = -34px */
    top: -2px;
    width: 28px;
    height: 28px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-weight: bold;
}

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    list-style: none;
    padding-left: 0;
}

.resource-grid li a {
    display: block;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    color: var(--primary-text-color);
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.resource-grid li a:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 { /* General header h1 for this breakpoint */
        font-size: 1.8rem;
    }
    

    #post-content h1 { font-size: 2.5rem; } 
    #post-content h2 { font-size: 2rem; }   
    #post-content h3 { font-size: 1.6rem; }

    header nav a {
        margin: 0 10px;
        font-size: 1rem;
    }
    main {
        width: 95%; /* More width on smaller screens */
    }
    .post-summary-link h3 a { /* Adjusted for new class */
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 0;
    }
    header h1 {
        font-size: 1.5rem;
    }
    header nav { /* Center nav links on very small screens */
        display: flex;
        justify-content: center;
    }
    header nav a {
        margin: 0 5px; /* Adjust horizontal margin */
    }
    main section {
        padding: 20px;
    }
    #post-content h1 { font-size: 1.75rem; }
    #post-content h2 { font-size: 1.5rem; }
    #post-content h3 { font-size: 1.25rem; }

    

    main h2 { /* Affects "Who I Am", "Purpose", "Published Posts" */
        font-size: 1.75rem;
    }

    #post-content pre {
        padding: 0.75em; 
    }
    .post-end-cue {
        font-size: 1.2rem; 
        margin-top: 2rem;
    }
}

.share {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.share span {
    font-weight: bold;
    margin-right: 5px;
}


.share .btn {
    background-color: var(--accent-color);
    color: white;
    padding: 4px 8px; /* Reduced padding */
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    font-size: 0.9rem; /* Slightly smaller font for text/icons */
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.share .btn:hover {
    background-color: color-mix(in srgb, var(--accent-color) 80%, black);
}

.share .btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.share .share-x {
    background-color: #000;
}

.share .share-x:hover {
    background-color: #333;
}

.share .share-li {
    background-color: #0077B5;
}


.share .share-li:hover {
    background-color: #005582;
}

