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

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
    font-weight: inherit;
    font-size: inherit;
    line-height: inherit;
}

p, blockquote, ul, ol, li {
    margin: 0;
    padding: 0;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 0;
}

a {
    text-decoration: none;
    color: inherit;
    background-color: transparent;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
}

blockquote {
    quotes: none;
}

blockquote::before,
blockquote::after {
    content: '';
    content: none;
}

/* Header */
.header {
    background-color: #ffffff;
    padding: 1rem 0;
}

.header__container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header__title-link {
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header__title-link:hover {
    color: #374151;
}

.header__logo {
    font-size: 1.25rem;
    line-height: 1;
}

.header__text {
    line-height: 1;
}

.header__nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.header__link {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.header__link:hover {
    color: #111827;
}

.header__link--github {
    background-color: #111827;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
}

.header__link--github:hover {
    background-color: #374151;
    color: #ffffff;
}

/* Main */
.main {
    padding: 3rem 0;
}

.main__container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero__title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
    margin-bottom: 2rem;
}

.hero__topics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* Topics */
.topic {
    color: #6b7280;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
    cursor: pointer;
}

.topic:hover {
    color: #2563eb;
}

/* Posts grid */
.posts__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-items: start;
}

/* Post card */
.post-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.post-card__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #f3f4f6;
}

.post-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card__img {
    transform: scale(1.05);
}

.post-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 200px;
}

.post-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.post-card__author {
    font-weight: 500;
}

.post-card__date {
    font-weight: 400;
}

.post-card__title {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.post-card__link {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: #111827;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 3.25rem;
}

.post-card__link:hover {
    color: #4f46e5;
}

.post-card__excerpt {
    color: #6b7280;
    line-height: 1.6;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Individual post page */
.post {
    max-width: 900px;
    margin: 0 auto;
}

.post__header {
    margin-bottom: 2rem;
    text-align: center;
}

.post__meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.post__author {
    font-weight: 600;
}

.post__date {
    font-weight: 400;
}

.post__title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
    margin-bottom: 1rem;
}

.post__lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.post__topics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.post__image {
    margin-bottom: 3rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.post__img {
    width: 100%;
    height: auto;
}

.post__content {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
    width: 80%;
    margin: 0 auto;
}

.post__content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 2.5rem 0 1rem 0;
    line-height: 1.3;
}

.post__content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 2rem 0 0.75rem 0;
    line-height: 1.3;
}

.post__content p {
    margin-bottom: 1.5rem;
}

.post__content ul,
.post__content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post__content li {
    margin-bottom: 0.5rem;
}

.post__list {
    list-style-type: disc;
    list-style-position: outside;
    margin-left: 0;
    padding-left: 2rem;
}

.post__list li {
    margin-bottom: 0.5rem;
    padding-left: 0;
}

/* Code block styles */
.post__content pre,
.post__content code {
    max-width: 100%;
    overflow-x: auto;
}

.post__content pre {
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1.5rem 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre;
    overflow-x: auto;
}

.post__content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
}

.post__content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.post__quote {
    background-color: #f8fafc;
    border-left: 4px solid #4f46e5;
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.25rem;
    color: #475569;
    border-radius: 0 0.375rem 0.375rem 0;
}

.post__inline-image {
    margin: 2rem 0;
    text-align: center;
}

.post__inline-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin: 0 auto 1rem auto;
}

.post__image-caption {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

.post__embed {
    margin: 2.5rem 0;
    display: flex;
    justify-content: center;
}

.post__embed .twitter-tweet {
    max-width: 550px !important;
    margin: 0 auto !important;
}

.post__footer {
    margin-top: 3rem;
    padding-top: 2rem;
}

.post__authors {
    margin-bottom: 2rem;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.post__authors-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
}

.author {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.author__avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f3f4f6;
}

.author__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author__info {
    flex: 1;
}

.author__name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.author__bio {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.author__social {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.author__link {
    color: #4f46e5;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.author__link:hover {
    color: #3730a3;
}


/* Responsive design */
@media (max-width: 768px) {
    .header__container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .header__nav {
        gap: 1rem;
    }

    .main__container {
        padding: 0 1rem;
    }

    .hero__title {
        font-size: 2rem;
    }

    .posts__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .post-card__content {
        padding: 1rem;
    }

    .post__title {
        font-size: 2rem;
    }

    .post__lead {
        font-size: 1.125rem;
    }

    .post__content {
        font-size: 0.95rem;
        width: 100%;
    }

    .post__content h2 {
        font-size: 1.375rem;
    }

    .post__content h3 {
        font-size: 1.125rem;
    }

    .post__meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .hero__topics {
        justify-content: center;
    }

    .post__topics {
        justify-content: center;
    }

    .author {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .author__avatar {
        width: 80px;
        height: 80px;
    }

    .author__social {
        justify-content: center;
    }

    .post__authors {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero__title {
        font-size: 1.75rem;
    }

    .post__title {
        font-size: 1.75rem;
    }

    .topic {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Footer */
.footer {
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer__container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    width: 80%;
    margin: 0 auto;
}

.footer__section {
    display: flex;
    align-items: center;
}

.footer__copyright {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 400;
}

.footer__nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.footer__link {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer__link:hover {
    color: #111827;
}

/* Footer responsive */
@media (max-width: 768px) {
    .footer__container {
        padding: 0 1rem;
    }

    .footer__content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        width: 100%;
    }

    .footer__nav {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .footer__nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}
