/* Generic flex row - first child left-aligned, rest right-aligned */
.flex-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.flex-row > *:first-child {
    flex-grow: 1;
}

/* Restyle links within cards */
article a {
    text-decoration: none;
    color: inherit;
}

article a:hover {
    text-decoration: none;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem;
    background: var(--pico-primary);
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
}

.tag.clickable {
    cursor: pointer;
}

/* Gallery grid - wraps, shows all items */
.flex-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* Single-row showcase - scrollable horizontal layout */
.image-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
}

.image-row > * {
    flex: 0 0 200px;
    width: 200px;
}

.image-row img {
    width: 200px;
    height: 200px;
    object-fit: cover;
}

/* Avatar sizes */
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar.small {
    width: 24px;
    height: 24px;
}

.avatar.large {
    width: 80px;
    height: 80px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-header h3 {
    margin: 0;
}

.static-progress {
    height: 8px;
    background: var(--pico-muted-border-color);
    border-radius: 4px;
}

/* htmx loading states */
.htmx-request {
    cursor: wait;
    opacity: 0.7;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Toast notification */
#toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    min-width: 250px;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-box-shadow);
    background: var(--card-background-color);
    display: none;
}

#toast.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Rating buttons (similar to Slack/Discord reactions) */
.rating-button {
    padding: 0.25rem 0.5rem;
    margin-right: 0.25rem;
    font-size: 0.9rem;
}

.rating-container {
    display: inline-flex;
    margin-top: 0.5em;
}

/* User info display */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.user-info.header {
    gap: 1.5em;
    margin-bottom: 1.5rem;
}

.user-info small,
.user-info strong {
    margin: 0;
}

.user-info > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Comments */
.comments-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.comment-item {
    margin-bottom: 1rem;
}

.comment-item .user-info {
    margin-bottom: 0.5rem;
}

.comment-item .user-info > div {
    display: flex;
    flex-direction: column;
    margin-left: 0.5rem;
}

.text-muted {
    color: var(--pico-muted-color);
}

/* Utility classes for common layouts */
.centered-content {
    max-width: 800px;
    margin: 0 auto;
}

.narrow-form {
    max-width: 400px;
    margin: 0 auto;
}

.mt-2 {
    margin-top: 2em;
}

.error-text {
    color: red;
}

/* Responsive navbar */
nav, nav ul {
  flex-direction: column;
}

@media (min-width: 1024px) {
  nav, nav ul {
    flex-direction: row;
  }
}
