/* Base Styles */
:root {
    --rust: #E67E22;
    --yellow: #F1C40F;
    --green: #27AE60;
    --brown: #795548;
    --cream: #F5EFE0;
    --dark-brown: #5D4037;
}

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

body {
    font-family: 'Work Sans', sans-serif;
    background-color: var(--cream);
    color: var(--dark-brown);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Mono', monospace;
    color: var(--dark-brown);
    margin-bottom: 1rem;
}

a {
    color: var(--rust);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Retro Elements */
.retro-line {
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        var(--rust),
        var(--rust) 20px,
        var(--yellow) 20px,
        var(--yellow) 40px,
        var(--green) 40px,
        var(--green) 60px
    );
    margin: 10px 0;
}

.retro-pattern {
    background-image: radial-gradient(var(--brown) 10%, transparent 11%),
                     radial-gradient(var(--brown) 10%, transparent 11%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0.1;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

/* Header */
header {
    padding: 20px 0;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: 'Space Mono', monospace;
    font-size: 1.8rem;
    color: var(--rust);
    font-weight: bold;
    text-decoration: none;
}

.menu {
    display: flex;
    list-style: none;
}

.menu li {
    margin-left: 20px;
}

.menu a {
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 40px 0;
    text-align: center;
    background-color: var(--yellow);
    color: var(--dark-brown);
    margin-bottom: 40px;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* Post Cards */
.post-card {
    background: white;
    border: 2px solid var(--dark-brown);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 5px 5px 0 var(--rust);
    transition: transform 0.3s;
}

.post-card:hover {
    background: var(--cream);
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--rust);
}

.post-date {
    font-family: 'Space Mono', monospace;
    color: var(--brown);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    font-family: 'Space Mono', monospace;
}

/* Post List */
.post-list {
    margin-bottom: 40px;
}

.page-title {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.page-title:after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--rust);
}

/* Post Grid */
.posts-grid, .work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* Single Post */
.post {
    background: white;
    border: 2px solid var(--dark-brown);
    padding: 30px;
    box-shadow: 5px 5px 0 var(--green);
}

.post-header {
    margin-bottom: 30px;
}

.post-content {
    line-height: 1.8;
}

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

/* Image Constraints */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border: 2px solid var(--brown);
  box-shadow: 4px 4px 0 var(--rust);
  border-radius: 4px;
}

/* Optional: Retro polaroid-style images */
.post-content img.polaroid {
  background: white;
  padding: 10px 10px 40px 10px;
  box-shadow: 4px 8px 20px rgba(60,40,20,0.2);
  border: 2px solid var(--dark-brown);
}

/* Ensure figures (if you use them) also respect width */
.post-content figure {
  max-width: 100%;
  margin: 1.5rem auto;
}

.post-content figure img {
  margin: 0 auto;
}

.post-content figcaption {
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  color: var(--brown);
  margin-top: 0.5rem;
}

/* List Styling */
.post-content ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5rem;
}

.post-content ul li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 0.75rem;
}

.post-content ul li::before {
  content: "■";
  position: absolute;
  left: 0;
  color: var(--rust);
  font-size: 1.2em;
  line-height: 1.3;
}

/* Ordered lists */
.post-content ol {
  padding-left: 30px;
  margin-bottom: 1.5rem;
}

.post-content ol li {
  margin-bottom: 0.75rem;
  padding-left: 10px;
}

.post-content ol li::marker {
  color: var(--rust);
  font-weight: bold;
  font-family: 'Space Mono', monospace;
}

/* Nested lists */
.post-content ul ul li::before {
  content: "▸";
  color: var(--green);
}

.post-content ul ul ul li::before {
  content: "•";
  color: var(--yellow);
}

/* Footer */
footer {
    margin-top: 60px;
    padding-bottom: 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.social-links a {
    margin-left: 15px;
}

/* Media Queries */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
    }
    
    .menu {
        margin-top: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .menu li {
        margin: 5px 10px;
    }
    
    .posts-grid, .work-grid {
        grid-template-columns: 1fr;
    }
}

.retro-iframe-container {
  background: var(--cream);
  border: 4px solid var(--rust);
  box-shadow: 8px 8px 0 var(--green), 0 0 0 8px var(--yellow);
  padding: 18px 18px 24px 18px;
  display: inline-block;
  border-radius: 14px;
  margin: 32px auto;
  position: relative;
  max-width: 420px;
}

.retro-iframe-container .retro-title-bar {
  background: repeating-linear-gradient(
    90deg,
    var(--rust) 0 28px,
    var(--yellow) 28px 56px,
    var(--green) 56px 84px
  );
  color: var(--cream);
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  padding: 7px 0 7px 20px;
  border-radius: 10px 10px 0 0;
  margin: -18px -18px 14px -18px;
  letter-spacing: 1px;
  box-shadow: 0 2px 0 var(--brown);
  text-shadow: 1px 1px 0 var(--brown);
}

.retro-iframe {
  border: 2px solid var(--brown);
  border-radius: 7px;
  box-shadow: 3px 3px 0 var(--rust);
  background: var(--cream);
  display: block;
  margin: 0 auto;
}

/* Optional: CRT scanline effect for extra retro vibes */
.retro-iframe-container::after {
  content: "";
  pointer-events: none;
  display: block;
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  border-radius: 14px;
  opacity: 0.08;
  background: repeating-linear-gradient(
    to bottom,
    #000 0px, #000 1.5px,
    transparent 1.5px, transparent 6px
  );
}

/* Inline code only (single backtick) */
:not(pre) > code {
  background: var(--yellow);
  color: var(--dark-brown);
  font-family: 'Space Mono', monospace;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  border: 1px solid var(--rust);
}

/* Code blocks with syntax highlighting */
.highlight {
  background: #1e1e1e;
  border: 2px solid var(--rust);
  border-radius: 6px;
  margin: 25px 0;
  overflow: hidden;
}

.highlight pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  background: transparent;
  color: #f8f8f2;
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.highlight pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Fallback for code blocks without highlighting class */
pre {
  background: #1e1e1e;
  border: 2px solid var(--rust);
  border-radius: 6px;
  padding: 20px;
  overflow-x: auto;
  margin: 25px 0;
}

pre code {
  background: transparent;
  color: #f8f8f2;
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  border: none;
  padding: 0;
}

/* Scrollbar */
.highlight pre::-webkit-scrollbar,
pre::-webkit-scrollbar {
  height: 8px;
}

.highlight pre::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track {
  background: #2b2b2b;
}

.highlight pre::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb {
  background: var(--rust);
  border-radius: 4px;
}

/* Hide unwanted elements in post card CONTENT only */
.post-card .post-summary .highlight,
.post-card .post-summary pre,
.post-card .post-summary h1,
.post-card .post-summary h2,
.post-card .post-summary h3,
.post-card .post-summary h4,
.post-card .post-summary h5,
.post-card .post-summary h6,
.post-card .post-summary img,
.post-card .post-summary iframe,
.post-card .post-summary figure,
.post-card .post-summary table,
.post-card .post-summary blockquote {
  display: none !important;
}

/* Keep the post card title (h2) visible and styled */
.post-card > h2 {
  font-family: 'Space Mono', monospace;
  font-size: 1.5rem;
  color: var(--dark-brown);
  margin-bottom: 0.75rem;
  display: block !important;
}

.post-card > h2 a {
  color: var(--rust);
  text-decoration: none;
}

.post-card > h2 a:hover {
  color: var(--brown);
  text-decoration: underline;
}

/* Keep paragraphs in summary styled nicely */
.post-card .post-summary p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  color: var(--dark-brown);
}

/* Keep inline code but make it subtle */
.post-card .post-summary code {
  background: var(--yellow);
  color: var(--dark-brown);
  font-family: 'Space Mono', monospace;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.85em;
  border: 1px solid var(--rust);
}

/* Clean up lists in summary */
.post-card .post-summary ul,
.post-card .post-summary ol {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.post-card .post-summary ul li,
.post-card .post-summary ol li {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}
