/*
Theme Name: Fireball Style
Theme URI:
Author: Joe
Author URI:
Description: A minimal, typography-focused blog theme inspired by Daring Fireball. Features linked asides and original posts with distinct styling. Two-column layout with sidebar navigation.
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fireball-style
*/

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    background-color: #faf9f7;
    color: #333;
    font-family: "work-sans", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: "adriane", Georgia, serif;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.5em;
    color: #222;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    margin: 0 0 1.25em;
}

a {
    color: #4271ae;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

blockquote {
    margin: 1.5em 0;
    padding-left: 1.25em;
    border-left: 3px solid #ccc;
    color: #555;
    font-style: italic;
}

code, pre {
    font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
    background: #f0efed;
    border-radius: 3px;
}

code {
    padding: 0.15em 0.4em;
}

pre {
    padding: 1em;
    overflow-x: auto;
    margin: 1.5em 0;
}

pre code {
    padding: 0;
    background: none;
}

/* ==========================================================================
   Two-Column Layout
   ========================================================================== */

.site-wrapper {
    display: flex;
    min-height: 100vh;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    gap: 3rem;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.site-sidebar {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.site-logo {
    margin-bottom: 0.5rem;
}

.site-logo .custom-logo-link {
    display: block;
}

.site-logo .custom-logo {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    width: auto;
}

.site-title {
    font-family: "adriane", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.site-title a {
    color: #222;
    text-decoration: none;
}

.site-title a:hover {
    color: #4271ae;
}

/* Sidebar Text Widget */
.sidebar-text {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
}

.sidebar-text p:last-child {
    margin-bottom: 0;
}

/* Sidebar Navigation */
.sidebar-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-navigation li {
    margin-bottom: 0.5rem;
}

.sidebar-navigation a {
    font-size: 0.9rem;
    color: #555;
    text-decoration: none;
}

.sidebar-navigation a:hover {
    color: #4271ae;
}

.sidebar-navigation .current-menu-item a,
.sidebar-navigation .current_page_item a {
    color: #222;
    font-weight: 500;
}

/* Sidebar Ad Widget */
.sidebar-ad {
    padding-top: 1rem;
}

.sidebar-ad .widget-title {
    font-family: "work-sans", sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 0.75rem;
}

.ad-placeholder {
    background: #e8e7e5;
    border-radius: 4px;
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #888;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.site-main {
    flex: 1;
    min-width: 0;
    max-width: 640px;
}

/* ==========================================================================
   Posts
   ========================================================================== */

.post {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid #e0dfdc;
}

.post:last-child {
    border-bottom: none;
}

/* Original Posts */
.post-original .post-title {
    font-family: "adriane", Georgia, serif;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.post-original .post-title a {
    color: #222;
}

.post-original .post-title a:hover {
    color: #4271ae;
}

/* Aside / Linked Posts */
.post-aside .post-title {
    font-family: "work-sans", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: baseline;
    gap: 0.4em;
}

.post-aside .post-title a {
    color: #222;
}

.post-aside .post-title a:hover {
    color: #4271ae;
}

.aside-indicator {
    color: #888;
    font-size: 0.85em;
}

/* Post Meta */
.post-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 1rem;
}

.post-meta a {
    color: #888;
}

.post-meta a:hover {
    color: #4271ae;
}

.meta-sep {
    margin: 0 0.4em;
    color: #ccc;
}

/* Post Footer / Tags */
.post-footer {
    margin-top: 1.25rem;
}

.post-tags a {
    display: inline-block;
    font-size: 0.75rem;
    color: #666;
    background: #f0efed;
    padding: 0.25em 0.6em;
    border-radius: 3px;
    margin-right: 0.4em;
    margin-bottom: 0.4em;
    text-decoration: none;
}

.post-tags a:hover {
    background: #e0dfdc;
    color: #333;
}

/* Post Content */
.post-content {
    line-height: 1.7;
}

.post-content img {
    max-width: 100%;
    height: auto;
}

/* Read More / Permalink */
.post-permalink {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #888;
}

.post-permalink:hover {
    color: #4271ae;
}

/* ==========================================================================
   Single Post
   ========================================================================== */

.single-post .post {
    border-bottom: none;
    margin-bottom: 2rem;
    padding-bottom: 0;
}

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

/* ==========================================================================
   Archive / Search Headers
   ========================================================================== */

.archive-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0dfdc;
}

.archive-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin: 0 0 0.25rem;
}

.archive-title {
    font-family: "adriane", Georgia, serif;
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.archive-title span {
    color: #4271ae;
}

.archive-description {
    font-size: 0.9rem;
    color: #888;
    margin: 0;
}

.no-results {
    padding: 2rem 0;
    color: #666;
}

.external-link-note {
    background: #f0efed;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #555;
}

.external-link-note a {
    font-weight: 500;
}

/* ==========================================================================
   Pages
   ========================================================================== */

.page .page-title {
    font-family: "adriane", Georgia, serif;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.page-content {
    line-height: 1.7;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0dfdc;
    font-size: 0.85rem;
    color: #888;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
}

.footer-copyright {
    margin: 0;
}

.footer-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
}

.footer-navigation li {
    margin: 0;
}

.site-footer a {
    color: #888;
}

.site-footer a:hover {
    color: #4271ae;
}

@media (max-width: 500px) {
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.pagination a {
    color: #555;
}

.pagination a:hover {
    color: #4271ae;
}

/* ==========================================================================
   Mobile Header
   ========================================================================== */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #faf9f7;
    border-bottom: 1px solid #e0dfdc;
    padding: 0.75rem 1rem;
    align-items: center;
    gap: 1rem;
}

.mobile-logo {
    flex: 1;
}

.mobile-logo .custom-logo-link {
    display: block;
}

.mobile-logo .custom-logo {
    max-height: 28px;
    width: auto;
}

.mobile-logo .site-title-link {
    font-family: "adriane", Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    text-decoration: none;
}

.mobile-logo .site-title-link:hover {
    color: #4271ae;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.menu-toggle:hover {
    background: #f0efed;
    border-radius: 4px;
}

.hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    position: absolute;
    left: 0;
    transition: transform 0.2s ease;
}

.hamburger-icon::before {
    top: -7px;
}

.hamburger-icon::after {
    bottom: -7px;
}

/* Hamburger animation when open */
.menu-toggle.is-active .hamburger-icon {
    background: transparent;
}

.menu-toggle.is-active .hamburger-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.is-active .hamburger-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
}

.sidebar-overlay.is-active {
    display: block;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 800px) {
    .mobile-header {
        display: flex;
        padding-top: 1rem;
        padding-bottom: 0.75rem;
    }

    .site-wrapper {
        flex-direction: column;
        padding: 1rem;
        padding-top: 5rem;
    }

    /* Hide sidebar logo on mobile - it's in the mobile header */
    .site-sidebar .site-logo {
        display: none;
    }

    .site-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        background: #faf9f7;
        padding: 2rem 1.5rem;
        z-index: 999;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .site-sidebar.is-open {
        left: 0;
    }

    .site-main {
        max-width: 100%;
    }
}

@media (max-width: 500px) {
    html {
        font-size: 16px;
    }

    .post-original .post-title {
        font-size: 1.3rem;
    }
}

/* ==========================================================================
   Widget Styles
   ========================================================================== */

.widget {
    margin-bottom: 1.5rem;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-family: "work-sans", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 0.75rem;
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget li {
    margin-bottom: 0.4rem;
}

.widget a {
    color: #555;
    font-size: 0.9rem;
}

.widget a:hover {
    color: #4271ae;
}
