/* Font Face Declaration */
@font-face {
    font-family: 'Gidolinya';
    src: url('Fonts/Gidole-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables - Dark Mode (Default) */
:root {
    --bg-primary: #1E1615;
    --bg-secondary: #342a29;
    --text-primary: #E8E4D0;
    --text-secondary: #b8b396;
    --text-tertiary: #95917a;
    --accent: #FFF7D4;
    --border: #3d3432;
    --transition: all 0.3s ease;
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #FCF2D9;
    --bg-secondary: #f0f0ed;
    --text-primary: #1a1918;
    --text-secondary: #4a4948;
    --text-tertiary: #7a7978;
    --accent: #4a7ba7;
    --border: #e0e0dd;
}

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

html {
    font-size: 90%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Proxima Nova', 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    letter-spacing: 0.005em;
    font-weight: 300;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.theme-toggle:hover {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }
}

.theme-toggle svg {
    color: var(--text-primary);
}

.sun-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: block;
}

[data-theme="light"] .moon-icon {
    display: none;
}

.moon-icon {
    display: block;
}

/* Layout */
main {
    max-width: 700px;
    width: 90%;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
}

@media (min-width: 768px) {
    main {
        width: 85%;
        padding: 3rem 2rem;
    }
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    padding: 3rem 0 1rem;
    margin: 0;
}

.hero-name {
    font-size: clamp(2rem, 5.33vw, 3.33rem);
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-tagline {
    font-size: 1.125rem;
    color: var(--text-primary);
    max-width: 600px;
    line-height: 1.8;
}

/* Bio Section */
.bio {
    max-width: 600px;
    margin: 0 auto 5rem;
    text-align: center;
}

.bio p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 0;
    color: var(--text-primary);
}

.bio-secondary {
    color: var(--text-secondary) !important;
}

/* Writing Section */
.writing {
    margin-bottom: 2rem;
}

/* Currently Reading Section */
.currently-reading {
    margin-bottom: 3rem;
}

/* Contact Section */
.contact-section {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.reach-out {
    font-size: 1.125rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.section-header {
    font-size: 1.75rem;
    font-weight: 300;
    margin-bottom: 1rem;
    text-align: left;
    color: var(--text-primary);
}

/* Posts List */
.posts-list {
    max-width: 600px;
    margin: 0;
}

.loading {
    text-align: center;
    color: var(--text-primary);
    padding: 2rem;
}

.post-item {
    margin-bottom: 0.25rem;
}

.post-link {
    font-size: 1.125rem;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-block;
    padding: 0.25rem 0;
    transition: var(--transition);
    cursor: pointer;
}

.post-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Reading List (matching Posts List styling) */
.reading-list {
    max-width: 600px;
    margin: 0;
}

.reading-item {
    margin-bottom: 0.25rem;
}

.reading-link {
    font-size: 1.125rem;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-block;
    padding: 0.25rem 0;
    transition: var(--transition);
    cursor: pointer;
}

.reading-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}


/* Post View */
.post-view {
    max-width: 700px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in;
}

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

.back-button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-bottom: 2rem;
    transition: var(--transition);
    text-decoration: none;
}

.back-button:hover {
    opacity: 0.8;
}

/* Post Content Styles */
.post-content {
    color: var(--text-primary);
}

.post-content h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.post-content h2 {
    font-size: 1.75rem;
    font-weight: 300;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-content h3 {
    font-size: 1.4rem;
    font-weight: 300;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.post-content a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--text-primary);
    text-underline-offset: 2px;
    transition: var(--transition);
}

.post-content a:hover {
    opacity: 0.8;
}

.post-content strong,
.post-content b {
    font-weight: 600;
    color: var(--text-primary);
}

.post-content em,
.post-content i {
    font-style: italic;
}

.post-content code {
    background: var(--bg-secondary);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content blockquote {
    border-left: 3px solid var(--border);
    padding-left: 1.5rem;
    margin: 2rem 0;
    color: var(--text-primary);
    font-style: italic;
}

.post-content ul,
.post-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 2rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 1rem;
    table-layout: auto;
}

.post-content .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2rem 0;
}

.post-content table th,
.post-content table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--text-primary);
}

.post-content table th {
    font-weight: 600;
    color: var(--text-primary);
}

.post-content table td {
    color: var(--text-primary);
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--text-primary);
    margin: 3rem 0;
}

/* Published Date */
.published-date {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Footer */
footer {
    padding: 3rem 0;
    text-align: center;
    margin-top: auto;
}

.contact {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.copy-email-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 4px;
}

.copy-email-btn:hover {
    opacity: 0.8;
    background: var(--bg-secondary);
}

.copy-email-btn svg {
    display: block;
}

.email {
    font-size: 1.125rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.email:hover {
    opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero {
        padding: 2rem 0 1.5rem;
    }

}

/* Image Lightbox */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.image-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.image-lightbox img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 6px;
    cursor: zoom-out;
}

.image-lightbox-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.post-content img {
    cursor: zoom-in;
}

/* Smooth transitions for theme switching */
body,
.theme-toggle,
.post-link,
.email,
.copy-email-btn,
.back-button {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
