/* 
 * Retro Game Blog with Editorial Typography
 * Inspired by The New Yorker's elegant typography and retro pixel aesthetics
 */

/* =====================
   CSS Variables
   ===================== */
:root {
    /* Typography - New Yorker inspired */
    --font-display: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
    --font-body: 'Lyon Text', 'Charter', 'Iowan Old Style', 'Georgia', serif;
    --font-mono: 'Berkeley Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
    
    /* Colors - Classic with pixel accents */
    --color-text: #1a1a1a;
    --color-text-light: #666;
    --color-bg: #fffef9;
    --color-accent: #d32f2f;
    --color-pixel: #00ff00;
    --color-border: #e0e0e0;
    --color-link: #1a73e8;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 4rem;
    
    /* Layout */
    --content-width: 600px;
    --content-width-wide: 700px;
}

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

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

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
    position: relative;
    min-height: 100vh;
    padding: 0 1.5rem;
}

/* =====================
   Retro Game Elements
   ===================== */

/* Corner decorations - pixel art style */
.corner-decoration {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--color-accent);
    z-index: 1000;
    animation: pulse 2s ease-in-out infinite;
}

.corner-decoration.top-left {
    top: 10px;
    left: 10px;
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.3);
}

.corner-decoration.top-right {
    top: 10px;
    right: 10px;
    animation-delay: 0.5s;
}

.corner-decoration.bottom-left {
    bottom: 10px;
    left: 10px;
    animation-delay: 1s;
}

.corner-decoration.bottom-right {
    bottom: 10px;
    right: 10px;
    animation-delay: 1.5s;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* Blinking cursor/indicator */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.blink {
    animation: blink 1s step-end infinite;
}

/* Pixel borders and boxes */
.pixel-border {
    border: 2px solid var(--color-text);
    padding: var(--space-xs) var(--space-sm);
    display: inline-block;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

.pixel-box {
    border: 2px solid var(--color-border);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    position: relative;
    background: white;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.pixel-box:hover {
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.06);
    transform: translate(-2px, -2px);
}

.pixel-icon {
    font-family: var(--font-mono);
    color: var(--color-accent);
    font-weight: bold;
    margin-right: 0.5rem;
}

.footer-pixel-line {
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        var(--color-accent) 0px,
        var(--color-accent) 10px,
        transparent 10px,
        transparent 20px
    );
    margin-bottom: var(--space-md);
}

/* =====================
   Navigation
   ===================== */
.main-nav {
    max-width: var(--content-width-wide);
    margin: 0 auto;
    padding: var(--space-md) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-container {
    display: flex;
    gap: var(--space-md);
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    color: var(--color-accent);
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--color-accent);
    font-weight: bold;
}

.nav-pixel {
    font-size: 0.7rem;
}

.score-display {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-light);
    letter-spacing: 0.1em;
}

/* =====================
   Layout
   ===================== */
.content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--space-lg) 0 var(--space-xl) 0;
}

/* =====================
   Typography - Editorial Style
   ===================== */
.title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.subtitle {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: var(--space-lg);
}

.page-subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--color-text-light);
    margin-bottom: var(--space-lg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.3;
}

h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin: 1.5rem 0 0.8rem 0;
}

.section-heading {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
}

/* Drop cap for first paragraph */
.drop-cap::first-letter {
    font-family: var(--font-display);
    font-size: 4.5rem;
    line-height: 0.85;
    float: left;
    margin: 0.1em 0.1em 0 0;
    font-weight: 400;
}

p {
    margin-bottom: 1em;
    max-width: 65ch;
}

.intro {
    margin-bottom: 1.5rem;
}

.intro p {
    font-size: 1.1rem;
    line-height: 1.5;
}

/* =====================
   Links
   ===================== */
a {
    color: var(--color-link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

a:hover {
    border-bottom-color: var(--color-link);
}

.arrow-link {
    display: inline-block;
    font-weight: 500;
}

.arrow-link:hover {
    transform: translateX(4px);
}

.email-link {
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

/* =====================
   Content Grid
   ===================== */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.grid-item p {
    margin-bottom: 0.8rem;
}

/* =====================
   Search
   ===================== */
.search-container {
    margin-bottom: var(--space-lg);
}

.search-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
}

.search-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: 1rem;
    border: 2px solid var(--color-border);
    background: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.search-results-count {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: var(--space-sm);
}

/* =====================
   Newsletter Section
   ===================== */
.newsletter-section {
    margin: 2rem auto;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: 65ch;
    width: 100%;
}

.newsletter-description {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--color-text-light);
}

.newsletter-form {
    max-width: 300px;
}

.form-group {
    margin-bottom: 0.8rem;
}

.form-label {
    display: block;
    margin-bottom: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pixel-input {
    width: 100%;
    padding: 1rem;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.pixel-input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
    transform: scale(1.02);
}

.pixel-input::placeholder {
    color: var(--color-text-light);
    opacity: 0.6;
}

.pixel-button {
    background: var(--color-accent);
    color: white;
    border: 2px solid var(--color-accent);
    padding: 0.9rem 2.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
}

.pixel-button:hover {
    background: #b71c1c;
    border-color: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.3);
}

.pixel-button:active {
    transform: translateY(0);
}

/* =====================
   Blog Posts
   ===================== */
.blog-posts-container {
    margin-top: var(--space-lg);
}

.blog-entry {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.blog-entry:last-child {
    border-bottom: none;
}

.blog-entry:hover {
    transform: translateX(8px);
}

.blog-entry h2 {
    margin: 0 0 var(--space-sm) 0;
}

.blog-entry h2 a {
    color: var(--color-text);
    border-bottom: none;
    transition: color 0.2s ease;
}

.blog-entry h2 a:hover {
    color: var(--color-accent);
}

.blog-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.blog-excerpt {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text-light);
}

/* =====================
   Post Content
   ===================== */
.post {
    margin-bottom: var(--space-xl);
}

.post-header {
    margin-bottom: var(--space-lg);
}

.post-title {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: var(--space-md);
    line-height: 1.1;
}

.post-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.meta-separator {
    color: var(--color-accent);
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.5;
}

.post-content p {
    margin-bottom: 1em;
}

.post-content h2 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 4px solid var(--color-accent);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--color-text-light);
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    display: block;
}

.post-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
}

.back-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* =====================
   Footer
   ===================== */
.site-footer {
    max-width: var(--content-width-wide);
    margin: 0 auto;
    padding: var(--space-xl) 0 var(--space-md) 0;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-align: center;
}

.contact-note {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--color-text-light);
}

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

/* Tablet */
@media (min-width: 768px) {
    html {
        font-size: 19px;
    }
    
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-section {
        grid-column: 1 / -1;
    }
    
    .corner-decoration {
        width: 24px;
        height: 24px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    html {
        font-size: 20px;
    }
    
    body {
        padding: 0 2rem;
    }
    
    .content {
        max-width: var(--content-width);
    }
    
    .corner-decoration {
        width: 28px;
        height: 28px;
    }
    
    /* Ensure narrow reading column on desktop */
    p {
        max-width: 65ch;
    }
    
    .post-content {
        max-width: 65ch;
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    html {
        font-size: 17px;
    }
    
    body {
        padding: 0 1.25rem;
    }
    
    .main-nav {
        padding: var(--space-sm) 0;
    }
    
    .nav-container {
        gap: var(--space-sm);
    }
    
    .content {
        padding: var(--space-md) 0 var(--space-lg) 0;
        max-width: 100%;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .drop-cap::first-letter {
        font-size: 3.5rem;
    }
    
    .pixel-box {
        padding: var(--space-sm);
    }
    
    .corner-decoration {
        width: 16px;
        height: 16px;
    }
    
    .corner-decoration.top-left,
    .corner-decoration.top-right {
        top: 8px;
    }
    
    .corner-decoration.bottom-left,
    .corner-decoration.bottom-right {
        bottom: 8px;
    }
    
    .corner-decoration.top-left,
    .corner-decoration.bottom-left {
        left: 8px;
    }
    
    .corner-decoration.top-right,
    .corner-decoration.bottom-right {
        right: 8px;
    }
    
    /* Force full width paragraphs on mobile */
    p {
        max-width: 100%;
    }
    
    .post-content p {
        max-width: 100%;
    }
}

/* Print styles */
@media print {
    .corner-decoration,
    .main-nav,
    .search-container,
    .site-footer,
    .back-link {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
