/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0a0a0a;
    --secondary-color: #525252;
    --text-color: #171717;
    --background-color: #ffffff;
    --border-color: #e5e5e5;
    --accent-color: #000000;
    --spacing-unit: 1rem;
    --max-width: 720px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 1.25rem;
    }
    
    body {
        font-size: 17px;
    }
}

/* Header */
header {
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 100;
}

header nav {
    padding: 1rem 0;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--primary-color);
    margin: 0;
}

header h1 a {
    text-decoration: none;
    color: inherit;
}

.search-bar-container {
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 0;
    background-color: #fafafa;
}

.search-bar-container .container {
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .search-bar-container .container {
        padding: 0 1.25rem;
    }
}

#site-search {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9375rem;
    font-family: inherit;
    background-color: #ffffff;
    color: var(--text-color);
    transition: all 0.15s ease;
    position: relative;
}

.search-results-container {
    position: relative;
    width: 100%;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
    background-color: #f5f5f5;
}

.search-result-title {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.search-result-path {
    font-size: 0.8125rem;
    color: var(--secondary-color);
    font-family: monospace;
}

.search-result-snippet {
    font-size: 0.8125rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
    line-height: 1.4;
}

.search-highlight {
    background-color: #fff3cd;
    font-weight: 500;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9375rem;
}

#site-search:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

#site-search::placeholder {
    color: #737373;
}

/* Content Wrapper */
.content-wrapper {
    padding: 1.5rem 0;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem 0;
    }
}

.content-layout {
    display: block;
}

.content {
    width: 100%;
}

article {
    max-width: 100%;
}

/* Hero Section */
.hero {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.author-intro {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.profile-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: #525252;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.author-text {
    flex: 1;
}

.hero h2 {
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    line-height: 1.2;
}

.lead {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--secondary-color);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.author-signature {
    font-size: 1rem;
    font-style: italic;
    color: var(--secondary-color);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.personal-disclaimer {
    font-size: 0.9375rem;
    color: var(--secondary-color);
    background-color: #f9f9f9;
    padding: 1rem;
    border-left: 3px solid var(--accent-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.personal-disclaimer .profile-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.personal-disclaimer .profile-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #525252;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.personal-disclaimer-content {
    flex: 1;
}

.personal-disclaimer strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Personal Intro */
.personal-intro {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.personal-intro h3 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 1rem;
    color: var(--primary-color);
    line-height: 1.3;
}

.personal-intro p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.75;
}

.personal-intro p:last-child {
    margin-bottom: 0;
}

/* Article Content */
article h3 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 1rem;
    margin-top: 2.5rem;
    color: var(--primary-color);
    line-height: 1.3;
}

article h3:first-child {
    margin-top: 0;
}

article p {
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
    color: var(--text-color);
}

article p:first-of-type {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--secondary-color);
}

article p a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid #d4d4d4;
    transition: border-color 0.15s ease;
    font-weight: 500;
}

article p a:hover {
    border-bottom-color: var(--accent-color);
}

/* AI Conversation Styles */
article p strong:first-child {
    display: block;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

article p:has(strong:first-child) {
    margin-top: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
    font-style: italic;
    color: var(--secondary-color);
}

article p:has(strong:first-child) strong {
    font-style: normal;
    display: block;
    margin-bottom: 0.5rem;
}

/* AdSense Containers */
.ad-container {
    margin: 0;
    text-align: center;
    width: 100%;
    min-height: 0;
}

/* Hide empty ad containers to avoid spacing issues */
.ad-container:empty,
.ad-container:not(:has(ins[data-adsbygoogle-status])),
.ad-container ins:empty {
    display: none;
}

.ad-sidebar {
    display: none;
}

.ad-in-article {
    margin: 2rem 0;
}

.ad-in-article:empty,
.ad-in-article:not(:has(ins[data-adsbygoogle-status])),
.ad-in-article ins:empty {
    display: none;
    margin: 0;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer p {
    font-size: 0.875rem;
    color: #737373;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 0.75rem 0;
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs span {
    margin: 0 0.5rem;
    color: var(--border-color);
}

.breadcrumbs .current {
    color: var(--primary-color);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .search-bar-container {
        padding: 0.75rem 0;
    }
    
    .content-wrapper {
        padding: 1.5rem 0;
    }
    
    .hero {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .author-intro {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .profile-image {
        width: 70px;
        height: 70px;
    }
    
    .author-text {
        width: 100%;
    }
    
    .hero h2 {
        font-size: 1.875rem;
        line-height: 1.25;
    }
    
    .lead {
        font-size: 1.0625rem;
    }
    
    .personal-intro {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .personal-intro h3 {
        font-size: 1.375rem;
    }
    
    article h3 {
        font-size: 1.375rem;
        margin-top: 2rem;
        line-height: 1.3;
    }
    
    article p {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    article p:first-of-type {
        font-size: 1.0625rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0;
    }
    
    header nav {
        padding: 1rem 0;
    }
    
    header h1 {
        font-size: 1.125rem;
    }
    
    .search-bar-container {
        padding: 0.625rem 0;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .search-bar-container .container {
        padding: 0 1rem;
    }
    
    .content-wrapper {
        padding: 1.25rem 0;
    }
    
    .hero h2 {
        font-size: 1.625rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    article h3 {
        font-size: 1.25rem;
        margin-top: 1.75rem;
    }
    
    article p {
        font-size: 0.9375rem;
    }
    
    .personal-intro h3 {
        font-size: 1.25rem;
    }
}
