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

:root {
    --text-color: #1f2937;
    --bg-light: #ffffff;
    --border-color: #e5e7eb;
    --focus-color: #dc2626;
}

:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

html {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'EB Garamond', serif;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Main content */
main {
    flex: 1;
    padding-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Posts container */
#posts-container {
    display: grid;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.post-card {
    position: relative;
    background-color: transparent;
    border-radius: 8px;
    padding: 0.5rem 0.25rem;
    box-shadow: none;
    transition: transform 0.2s;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    color: inherit;
    display: block;
    text-align: center;
}

.post-card:hover {
    transform: translateY(-2px);
    text-decoration-thickness: 2px;
}

.post-card:hover::before,
.post-card:hover::after,
.post-card:focus-visible::before,
.post-card:focus-visible::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-image: url('../assets/heart.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.post-card:hover::before,
.post-card:focus-visible::before {
    left: -1.5rem;
}

.post-card:hover::after,
.post-card:focus-visible::after {
    right: -1.5rem;
    left: auto;
}

.post-card:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
    border-radius: 8px;
}

.post-placeholder {
    display: block;
    padding: 0.5rem 0.5rem;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1.25rem;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.post-header .post-date {
    display: block;
    color: #818894;
    font-size: 1rem;
}

.post-content {
    font-size: 1.5rem;
    line-height: 1.8;
    color: var(--text-color);
    text-align: center;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.post-content h1 {
    font-size: 2rem;
}

.post-content h2 {
    font-size: 1.75rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

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

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content code {
    background-color: var(--border-color);
    color: var(--text-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-content pre {
    background-color: var(--border-color);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

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

.post-content blockquote {
    border-left: 4px solid var(--border-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-color);
    opacity: 0.9;
    font-style: italic;
}

.post-content a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.post-content a:hover {
    text-decoration-thickness: 2px;
}

.back-link {
    margin-top: 0;
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-link a {
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.5rem 1rem;
}

.back-link a:hover {
    text-decoration-thickness: 2px;
}

.back-link a:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Landing page styles */
.landing-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-content {
    text-align: center;
    max-width: 600px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.landing-enter {
    display: flex;
    justify-content: center;
}

.landing-enter img {
    display: block;
    width: auto;
    height: auto;
    max-width: 300px;
}

.landing-content #posts-container {
    width: 100%;
}

/* Responsive design */
@media (max-width: 768px) {
    .post-card {
        padding: 0.5rem 0.25rem;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .container {
        padding: 0 15px;
    }

    main {
        min-height: 100vh;
        padding: 2rem 0;
    }

    #posts-container {
        gap: 1.5rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .landing-enter img {
        max-width: 225px;
    }

    html {
        height: 100%;
        height: -webkit-fill-available;
        width: 100%;
        overflow-x: hidden;
    }

    body {
        height: 100%;
        height: -webkit-fill-available;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        width: 100%;
        overflow-x: hidden;
    }
}
