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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 40px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 20px;
}

nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

nav a:hover {
    color: #1a365d;
}

/* Main content */
main {
    min-height: calc(100vh - 120px);
}

.hero h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #1a365d;
}

.about, .posts, .contact {
    margin-bottom: 40px;
}

.about h2, .posts h2, .contact h1 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #1a365d;
}

.about-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.profile-photo {
    width: 160px;
    height: 160px;
    border-radius: 24px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.profile-img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    position: absolute;
    top: -5px;
    left: -25px;
}

.about p {
    font-size: 1.1em;
    color: #666;
    margin: 0;
}

.about p a {
    color: #2c5282;
    text-decoration: none;
    border-bottom: 1px solid rgba(44, 82, 130, 0.3);
    transition: border-bottom-color 0.2s ease;
}

.about p a:hover {
    border-bottom-color: #2c5282;
}

.about p img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 0.1em;
    vertical-align: -0.1em;
}

/* Post list */
.post-list {
    list-style: none;
}

.post-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

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

.post-item a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: block;
    margin-bottom: 8px;
}

.post-item a:hover {
    color: #1a365d;
}

.post-date {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
    margin-left: 20px;
}

.post-description {
    color: #666;
    font-size: 0.95em;
    line-height: 1.4;
    margin: 0;
}

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

.post-header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    color: #1a365d;
}

.post-header .post-date {
    color: #666;
    font-size: 1em;
    margin-left: 0;
}

.post-content {
    font-size: 1.1em;
    line-height: 1.7;
}

.post-content h2 {
    margin: 30px 0 15px 0;
    color: #1a365d;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content ul,
.post-content ol {
    margin: 20px 0;
    padding-left: 20px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content a {
    color: #2c5282;
    text-decoration: none;
    border-bottom: 1px solid rgba(44, 82, 130, 0.3);
    transition: border-bottom-color 0.2s ease;
}

.post-content a:hover {
    border-bottom-color: #2c5282;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content img.no-border {
    border-radius: 0;
    box-shadow: none;
}

.post-content code {
    background-color: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.post-content pre {
    background-color: #f5f5f5;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.post-content pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    white-space: pre;
}

.post-content blockquote {
    background-color: #f8f9fa;
    border-left: 4px solid #e9ecef;
    margin: 20px 0;
    padding: 15px 20px;
    font-style: italic;
    color: #666;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
}

.post-content th,
.post-content td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.post-content th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #1a365d;
    border-bottom: 2px solid #d0d0d0;
}

.post-content tr:hover {
    background-color: #f9f9f9;
}

.post-content td:last-child,
.post-content th:last-child {
    text-align: right;
}

.post-nav {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.post-nav a {
    color: #2c5282;
    text-decoration: none;
    border-bottom: 1px solid rgba(44, 82, 130, 0.3);
    transition: border-bottom-color 0.2s ease;
}

.post-nav a:hover {
    border-bottom-color: #2c5282;
}

/* Contact page */
.contact-info {
    margin-top: 20px;
}

.contact-info p {
    margin-bottom: 15px;
}

.contact-info ul {
    list-style: none;
    margin-top: 10px;
}

.contact-info li {
    margin-bottom: 8px;
}

.contact-info a {
    color: #2c5282;
    text-decoration: none;
    border-bottom: 1px solid rgba(44, 82, 130, 0.3);
    transition: border-bottom-color 0.2s ease;
}

.contact-info a:hover {
    border-bottom-color: #2c5282;
}

/* Newsletter CTA */
.newsletter-cta {
    margin: 40px 0 0 0;
}

.newsletter-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.newsletter-box h3 {
    margin: 0 0 10px 0;
    color: #1a365d;
    font-size: 1.4em;
}

.newsletter-box p {
    margin: 0 0 20px 0;
    color: #495057;
    line-height: 1.5;
}

.newsletter-box form {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: stretch;
    max-width: 500px;
    margin: 0 auto 15px auto;
}

.newsletter-box input[type="email"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.newsletter-box input[type="email"]:focus {
    outline: none;
    border-color: #1a365d;
}

.newsletter-box button {
    padding: 12px 24px;
    background-color: #1a365d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.newsletter-box button:hover:not(:disabled) {
    background-color: #2c5282;
}

.newsletter-box button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#newsletter-status {
    margin: 10px 0 0 0;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.95em;
}

#newsletter-status:empty {
    display: none;
}

.newsletter-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.newsletter-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
footer {
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #eee;
    color: #666;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .about-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-photo {
        align-self: flex-start;
    }

    .post-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-date {
        margin-left: 0;
        margin-top: 5px;
    }

    .hero h1 {
        font-size: 2em;
    }

    .newsletter-box form {
        flex-direction: column;
    }

    .newsletter-box button {
        width: 100%;
    }
}

/* Newsletter page */
.newsletter-page {
    max-width: 100%;
}

.newsletter-page h1 {
    font-size: 2.2em;
    margin-bottom: 20px;
    color: #1a365d;
}

.newsletter-page p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.newsletter-page .newsletter-box {
    margin-top: 30px;
    text-align: center;
}

/* Sticky subscribe hint - Clean/Minimal */
.subscribe-hint {
    position: fixed;
    z-index: 1000;
}

.subscribe-hint-title {
    margin: 0 0 12px 0;
    font-weight: 700;
    color: #1a365d;
    font-size: 1.1em;
}

.subscribe-hint-form {
    display: flex;
    margin-bottom: 8px;
}

.subscribe-hint-form input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 0.9em;
    font-family: inherit;
    min-width: 0;
}

.subscribe-hint-form input:focus {
    outline: none;
    border-color: #1a365d;
}

.subscribe-hint-form button {
    padding: 10px 16px;
    background-color: #1a365d;
    color: white;
    border: none;
    border-radius: 0 6px 6px 0;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.subscribe-hint-form button:hover {
    background-color: #2c5282;
}

.subscribe-hint-desc {
    margin: 0;
    color: #666;
    font-size: 0.8em;
    line-height: 1.4;
}

/* Desktop: right sidebar box */
@media (min-width: 1100px) {
    .subscribe-hint {
        position: fixed;
        left: calc(50% + 420px);
        top: 50%;
        transform: translateY(-50%);
        width: 260px;
    }

    .subscribe-hint-title {
        font-size: 1.2em;
        margin-bottom: 14px;
    }
}

/* Hide on medium screens where it would overlap content */
@media (min-width: 601px) and (max-width: 1099px) {
    .subscribe-hint {
        display: none;
    }
}

/* Mobile: bottom bar */
@media (max-width: 600px) {
    .subscribe-hint {
        bottom: 0;
        left: 0;
        right: 0;
        background-color: white;
        border-top: 1px solid #eee;
        padding: 12px 16px;
    }

    .subscribe-hint-title {
        margin: 0 0 10px 0;
        font-size: 1em;
        text-align: center;
    }

    .subscribe-hint-form {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 0;
    }

    .subscribe-hint-form input {
        border-right: 1px solid #d0d0d0;
        border-radius: 6px;
    }

    .subscribe-hint-form button {
        border-radius: 6px;
        width: 100%;
    }

    .subscribe-hint-desc {
        display: none;
    }
}