/* 
 * Apple II Theme for BSSG
 * Green monochrome text terminal style from the Apple II era
 */

:root {
    --color-primary: #F57908;
    --color-highlight: #F5CA89;
    --color-bg: #190F00;

    --bg-color: var(--color-bg);
    --text-color: var(--color-primary);
    --link-color: var(--color-primary);
    --link-visited: var(--color-primary);
    --header-color: var(--color-primary);
    --border-color: var(--color-primary);
    --title-color: var(--color-primary);
    --title-highlight: var(--color-highlight);
    
    /* Typography */
    --font-main: 'Courier New', monospace;
    --font-headings: 'Courier New', monospace;
    --font-mono: 'Courier New', monospace;
    
    /* Sizing */
    --content-width: 800px;
}

/* Apple II screen effect */
body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    line-height: 1.5;
    text-shadow: 0 0 5px var(--text-color);
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

/* Container with simulated terminal screen */
.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Terminal header */
header {
    border-bottom: 1px solid var(--text-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Site title with Apple II inspired gradient */
.site-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: normal;
    text-transform: uppercase;
}

.site-title a {
    text-decoration: none;
    /* Apple II green gradient */
    background: linear-gradient(to right, var(--title-color) 0%, var(--title-highlight) 50%, var(--title-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 8px var(--title-color);
    display: inline-block;
    position: relative;
}

.site-title a:hover {
    text-decoration: none;
    background: linear-gradient(to right, var(--title-highlight) 0%, var(--title-color) 50%, var(--title-highlight) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px var(--title-highlight);
}

.site-title a::after {
    content: "_";
    display: inline-block;
    opacity: 1;
    animation: blink 1s step-end infinite;
    color: var(--title-color);
    text-shadow: 0 0 8px var(--title-color);
    margin-left: 2px;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: normal;
    text-transform: uppercase;
}

/* Navigation with terminal prompt style */
nav {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 5px 15px;
    margin-right: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--text-color);
    position: relative;
    display: inline-block;
}

nav a::before {
    content: "]";
    margin-right: 5px;
}

nav a::after {
    content: "[";
    margin-left: 5px;
}

nav a:hover, nav a:focus {
    background-color: var(--text-color);
    color: var(--bg-color);
    text-shadow: none;
}

/* Selected menu item */
nav a.active {
    background-color: var(--text-color);
    color: var(--bg-color);
    text-shadow: none;
}

/* Content area */
main {
    min-height: 50vh;
}

/* Typography - Apple II style */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    color: var(--header-color);
    margin-top: 1.5rem;
    margin-bottom: -0.5rem;
    font-weight: normal;
    text-transform: uppercase;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.3rem;
}

h3 {
    font-size: 1.2rem;
}

p {
    margin-bottom: 1rem;
}

/* Terminal cursor blinking effect */
.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1em;
    background-color: var(--text-color);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
}

a:visited {
    color: var(--link-visited);
}

a:hover {
    text-decoration: underline;
}

/* Apple II style prompt for articles */
article {
    /* margin-bottom: 30px; */
    /* padding-bottom: 20px; */
    /* border-bottom: 1px dotted var(--text-color); */
    position: relative;
}

article::before {
    content: ">";
    position: absolute;
    left: -20px;
}

article:last-child {
    border-bottom: none;
}

article .meta {
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

article .page-meta {
    font-size:0.8em;
}

.reading-time {
    display: inline-block;
}

.reading-time::before {
    content: "TIME:";
    margin-right: 5px;
}

/* Featured image styles for Apple II */
.featured-image {
    display: block;
    margin: 20px 0;
    border: 1px dashed var(--text-color);
    padding: 10px;
    position: relative;
}

.featured-image::before {
    content: "***** IMAGE DATA *****";
    display: block;
    text-align: center;
    margin-bottom: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.featured-image img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    filter: sepia(100%) hue-rotate(360deg) saturate(400%) brightness(0.8);
    border: 1px solid var(--text-color);
    box-shadow: 0 0 15px rgba(216, 132, 6, 0.5);
}

.featured-image .image-caption {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    font-style: italic;
}

.featured-image::after {
    content: "***** END IMAGE *****";
    display: block;
    text-align: center;
    margin-top: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.index-image {
    display: block;
    margin: 20px 0;
    border: 1px dashed var(--text-color);
    padding: 10px;
    position: relative;
}

.index-image::before {
    content: "***** INDEX IMAGE *****";
    display: block;
    text-align: center;
    margin-bottom: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.index-image img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    filter: sepia(100%) hue-rotate(360deg) saturate(400%) brightness(0.8);
    border: 1px solid var(--text-color);
}

.index-image::after {
    content: "********************";
    display: block;
    text-align: center;
    margin-top: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.tag-image {
    display: block;
    margin: 20px 0;
    border: 1px dashed var(--text-color);
    padding: 10px;
    position: relative;
}

.tag-image::before {
    content: "***** TAG IMAGE *****";
    display: block;
    text-align: center;
    margin-bottom: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.tag-image img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    filter: sepia(100%) hue-rotate(360deg) saturate(400%) brightness(0.8);
    border: 1px solid var(--text-color);
}

.tag-image::after {
    content: "********************";
    display: block;
    text-align: center;
    margin-top: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.archive-image {
    display: block;
    margin: 20px 0;
    border: 1px dashed var(--text-color);
    padding: 10px;
    position: relative;
}

.archive-image::before {
    content: "***** ARCHIVE IMAGE *****";
    display: block;
    text-align: center;
    margin-bottom: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.archive-image img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    filter: sepia(100%) hue-rotate(360deg) saturate(400%) brightness(0.8);
    border: 1px solid var(--text-color);
}

.archive-image::after {
    content: "************************";
    display: block;
    text-align: center;
    margin-top: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags::before {
    content: "TAGS:";
    margin-right: 5px;
}

.tags a {
    color: var(--text-color);
    text-decoration: none;
}

.tags a:hover {
    text-decoration: underline;
}

code {
    font-family: var(--font-mono);
    background-color: rgba(51, 255, 51, 0.1);
    padding: 2px 4px;
}

pre {
    background-color: rgba(51, 255, 51, 0.1);
    padding: 10px;
    overflow-x: auto;
    border: 1px solid var(--text-color);
}

pre code {
    background-color: transparent;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
    filter: sepia(100%) hue-rotate(360deg) saturate(400%) brightness(0.8);
    border: 1px solid var(--text-color);
}

/* Footer with prompt style */
footer {
    border-top: 1px solid var(--text-color);
    margin-top: 40px;
    padding-top: 20px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

/* footer::before {
    content: "READY.";
    display: block;
    margin-bottom: 10px;
} */

/* Apple II command prompt pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    gap: 20px;
}

.pagination a {
    color: var(--link-color);
    text-decoration: none;
    text-transform: uppercase;
}

.pagination a::before {
    content: "CMD:";
    margin-right: 5px;
}

.pagination a:hover {
    text-decoration: underline;
}

.pagination .page-info {
    margin: 0 10px;
}

/* Media query for responsive design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        width: auto;
        padding: 15px;
    }
    
    nav {
        flex-direction: column;
        align-items: center;
    }
    
    nav a {
        margin: 5px 0;
        width: auto;
        min-width: 60%;
        text-align: center;
        box-sizing: border-box;
        padding: 5px 20px;
    }
    
    article::before {
        left: 0;
        position: relative;
        display: inline-block;
        margin-right: 10px;
    }
    
    .featured-image,
    .index-image,
    .tag-image,
    .archive-image {
        margin: 15px 0;
        padding: 8px;
    }
    
    article {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    footer {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    h2 {
        font-size: 1.1rem;
    }
    
    pre {
        padding: 5px;
    }
    
    .featured-image::before,
    .index-image::before,
    .tag-image::before,
    .archive-image::before,
    .featured-image::after,
    .index-image::after,
    .tag-image::after,
    .archive-image::after {
        font-size: 0.8rem;
    }
}

/* Apple II style hr element - replaces default grey bar with themed separator */
hr {
    border: none;
    border-top: 1px dotted var(--text-color);
    height: 1px;
    margin: 20px 0;
    background-color: transparent;
}

/* Date header styling for index page */
.date-header {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: normal;
    border-bottom: 1px dotted var(--text-color);
    padding-bottom: 0.5rem;
}