/*
  community.css
  - Styles for the community page content.
  - Uses variables from style.css for consistency.
*/

body {
    background-color: #F5F5F5; /* A neutral background */
    padding: 2rem;
    box-sizing: border-box;
}

/* The main layout is now handled by global styles via the .subpage-wrap and .page-item classes. */

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--accent-color, #FFFFFF);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    position: relative; /* For animation */
}

/* Wavy/Honey-drip Animation */
.container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 20px;
    background-color: var(--accent-color, #FFFFFF);
    border-radius: 0 0 50% 50% / 0 0 10px 10px;
    animation: wavy-animation 3s ease-in-out infinite;
}

@keyframes wavy-animation {
    0%, 100% {
        transform: scaleY(1);
        border-radius: 0 0 50% 50% / 0 0 10px 10px;
    }
    50% {
        transform: scaleY(1.2);
        border-radius: 0 0 45% 55% / 0 0 12px 8px;
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
    position: relative; /* To appear above the animation */
    z-index: 1;
}

header h1 {
    margin: 0;
    font-size: 28px;
    color: var(--text-color, #3D3D3D);
}

#write-post-btn {
    background-color: var(--primary-color, #FFD233);
    color: var(--secondary-color, #3D3D3D);
    font-weight: 500;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: filter 0.3s;
}

#write-post-btn:hover {
    filter: brightness(0.95);
}

main {
    position: relative; /* To appear above the animation */
    z-index: 1;
}

#post-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.post-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 15px;
    background-color: #fdfdfd;
    transition: box-shadow 0.3s;
}

.post-item:hover {
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.post-item h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: var(--text-color, #3D3D3D);
}

.post-meta {
    font-size: 12px;
    color: var(--subtext-color, #8E8E8E);
}

.post-meta .author {
    font-weight: 500;
    color: var(--secondary-color, #3D3D3D);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
}

#post-form input,
#post-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#post-form button {
    width: 100%;
    background-color: var(--primary-color, #FFD233);
    color: var(--secondary-color, #3D3D3D);
    font-weight: 500;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: filter 0.3s;
}

#post-form button:hover {
    filter: brightness(0.95);
}