/* Font imports */
@font-face {
    font-family: 'PP Neue Machina';
    src: url('/fonts/PP Neue Machina/PPNeueMachina-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'PP Neue Machina';
    src: url('/fonts/PP Neue Machina/PPNeueMachina-Ultrabold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Sligoil';
    src: url('/fonts/sligoil-main/fonts/web/Sligoil-Micro.woff2') format('woff2'),
         url('/fonts/sligoil-main/fonts/web/Sligoil-Micro.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Sligoil';
    src: url('/fonts/sligoil-main/fonts/web/Sligoil-MicroMedium.woff2') format('woff2'),
         url('/fonts/sligoil-main/fonts/web/Sligoil-MicroMedium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Sligoil';
    src: url('/fonts/sligoil-main/fonts/web/Sligoil-MicroBold.woff2') format('woff2'),
         url('/fonts/sligoil-main/fonts/web/Sligoil-MicroBold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

/* CSS Variables for theming */
:root[data-theme="light"] {
    --bg-color: #F5F5F5;
    --text-color: #2C3444;
    --accent-color: #00CC99;
    --footer-bg: #1E2432;
    --footer-text: #FFFFFF;
    --card-bg: #FFFFFF;
    --border-color: #E0E0E0;
    --drawer-bg: #F5F5F5;
    --drawer-text: #2C3444;
}

:root[data-theme="dark"] {
    --bg-color: #2C3444;
    --text-color: #E8E8E8;
    --accent-color: #00CC99;
    --footer-bg: #1E2432;
    --footer-text: #FFFFFF;
    --card-bg: #3A4252;
    --border-color: #4A5262;
    --drawer-bg: #2C3444;
    --drawer-text: #E8E8E8;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sligoil', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.75;
    font-size: 1.0625rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'PP Neue Machina', sans-serif;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

a {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

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

/* Buttons and interactive elements */
button {
    text-decoration: none !important;
}

button:hover {
    text-decoration: none !important;
}

/* Header */
.site-header {
    padding: 3rem 1rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.crescent-icon {
    color: var(--accent-color);
    width: 2.5rem;
    height: 2.5rem;
}

.site-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.site-name {
    font-family: 'PP Neue Machina', sans-serif;
    font-weight: bold;
    font-size: 2.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

/* Main content */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

/* Home page */
.home-container {
    padding: 0 1rem 2rem;
}

.about-section {
    margin-bottom: 3rem;
}

.about-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* Tabs */
.tabs-container {
    margin-top: 2rem;
}

.tabs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

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

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: 'PP Neue Machina', sans-serif;
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: background-color 0.3s ease, color 0.3s ease, border-radius 0.3s ease;
    margin-bottom: -2px;
    position: relative;
    text-decoration: none;
}

.tab-button::before {
    content: attr(data-text);
    content: attr(data-text) / "";
    height: 0;
    visibility: hidden;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
    font-weight: bold;
    display: block;
}

.tab-button.active {
    background-color: var(--accent-color);
    color: var(--text-color);
    font-weight: bold;
    border-radius: 4px 4px 0 0;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
}

.theme-icon {
    color: var(--text-color);
}

/* Show lightbulb in dark mode (to switch to light) */
:root[data-theme="dark"] .sunglasses-icon {
    display: none;
}

/* Show sunglasses in light mode (to switch to dark) */
:root[data-theme="light"] .lightbulb-icon {
    display: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Post list */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.post-item {
    padding-bottom: 1.5rem;
}

.post-link {
    display: block;
    text-decoration: none;
}

.post-link:hover .post-item-title {
    color: var(--accent-color);
}

.post-link:hover .post-item-excerpt {
    opacity: 0.5;
}

.post-item-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
    transition: color 0.3s ease;
}

.post-item-date {
    display: block;
    font-size: 0.9375rem;
    color: var(--text-color);
    opacity: 0.65;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.post-item-excerpt {
    line-height: 1.75;
    opacity: 0.85;
    font-size: 1.0625rem;
}

/* Bookshelf */
.bookshelf h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 2rem 0 1rem 0;
}

.bookshelf ul {
    list-style: disc;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

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

/* Post page */
.post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* Hide TOC in post body */
.table-of-contents,
#table-of-contents {
    display: none;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
}

.menu-icon {
    transition: opacity 0.2s ease;
    color: var(--text-color);
}

.post-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.post-title {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.post-meta {
    color: var(--text-color);
    opacity: 0.65;
    margin-bottom: 3rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.post-content {
    line-height: 1.8;
    font-size: 1.25rem;
}

.post-content h2 {
    font-size: 3rem;
    font-weight: bold;
    margin: 3rem 0 1.5rem 0;
    letter-spacing: -0.03em;
}

.post-content h3 {
    font-size: 2.25rem;
    font-weight: bold;
    margin: 2.5rem 0 1.25rem 0;
    letter-spacing: -0.03em;
}

.post-content p {
    margin-bottom: 1.75rem;
}

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

.post-content a {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

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

/* TOC Drawer */
.toc-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

.toc-drawer.open {
    pointer-events: auto;
}

.toc-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toc-drawer.open .toc-overlay {
    opacity: 1;
}

.toc-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 90%;
    max-width: 600px;
    height: 100%;
    background: var(--drawer-bg);
    color: var(--drawer-text);
    padding: 2rem;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.toc-drawer.open .toc-content {
    transform: translateX(0);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.toc-title {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.2;
    flex: 1;
    padding-right: 1rem;
}

.toc-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-shrink: 0;
    color: var(--drawer-text);
}


.toc-nav {
    margin-top: 2rem;
}

.toc-nav ul {
    list-style: disc;
    padding-left: 2rem;
}

.toc-nav li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.toc-nav a {
    color: var(--drawer-text);
    opacity: 0.8;
    text-decoration: none;
}

.toc-nav a:hover {
    color: var(--accent-color);
    opacity: 1;
    text-decoration: underline;
}

/* Footer */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 1rem 2rem;
    margin-top: 4rem;
    border-radius: 24px 24px 0 0;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-logo-link {
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-logo-link:hover {
    opacity: 0.8;
}

.footer-logo {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--footer-text);
}

.newsletter-form {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.newsletter-form input {
    width: 100%;
    padding: 1rem 140px 1rem 1.25rem;
    border: none;
    border-radius: 12px;
    font-family: 'Sligoil', monospace;
    font-size: 1rem;
    background: white;
    color: #1E2432;
    transition: box-shadow 0.3s ease;
}

.newsletter-form input:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-color);
}

.newsletter-form button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.75rem 1.75rem;
    background-color: var(--accent-color);
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    font-family: 'PP Neue Machina', sans-serif;
    font-weight: bold;
    font-size: 1.0625rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.newsletter-form button:hover {
    background-color: #00a88f;
    transform: translateY(-50%) translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 191, 165, 0.3);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--footer-text);
    opacity: 0.8;
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Mobile responsive */
@media (max-width: 768px) {
    body {
        font-size: 1rem;
    }

    .site-header {
        padding: 2rem 1rem 1.5rem;
    }

    .crescent-icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .site-title {
        font-size: 1.75rem;
    }

    .site-name {
        font-size: 1.75rem;
    }

    .tabs-header {
        flex-wrap: wrap;
    }

    .tab-button {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }

    .post-container {
        padding: 1rem;
    }

    .post-header {
        padding: 0.5rem 0 1rem;
        margin-bottom: 1rem;
    }

    .post-title {
        font-size: 2.5rem;
    }

    .post-meta {
        margin-bottom: 2rem;
    }

    .post-content {
        font-size: 1.0625rem;
    }

    .post-content h2 {
        font-size: 2rem;
    }

    .post-content h3 {
        font-size: 1.5rem;
    }

    .post-content img {
        margin: 2rem 0;
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
        max-width: calc(100% + 2rem);
        border-radius: 0;
    }

    .post-item-title {
        font-size: 1.75rem;
    }

    .newsletter-form {
        max-width: 100%;
    }

    .newsletter-form input {
        font-size: 0.9375rem;
        padding: 0.875rem 120px 0.875rem 1rem;
    }

    .newsletter-form button {
        font-size: 0.9375rem;
        padding: 0.625rem 1.25rem;
    }

    .footer-logo {
        font-size: 1.5rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .social-links {
        justify-content: center;
    }

    .toc-content {
        width: 100%;
    }

    .about-section p {
        font-size: 1rem;
    }
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .site-title {
        font-size: 2rem;
    }

    .site-name {
        font-size: 2rem;
    }

    .crescent-icon {
        width: 2rem;
        height: 2rem;
    }

    .post-title {
        font-size: 3.5rem;
    }

    .post-item-title {
        font-size: 2.25rem;
    }

    .post-content h2 {
        font-size: 2.75rem;
    }

    .post-content h3 {
        font-size: 2rem;
    }

    .post-content img {
        margin: 2.5rem 0;
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
        max-width: calc(100% + 2rem);
        border-radius: 0;
    }

    .tab-button {
        font-size: 0.9375rem;
    }

    .newsletter-form input {
        font-size: 0.9375rem;
    }

    .newsletter-form button {
        font-size: 1rem;
    }
}

/* Large screens - optimize for readability */
@media (min-width: 1400px) {
    .site-header,
    .main-content,
    .post-container,
    .footer-content {
        max-width: 900px;
    }
}
