/* Återanvändbara UI-komponenter */

/* Ikonknappar (tema-växlare, hamburgermeny, dela) */

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.icon-button:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.nav-toggle,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.nav-toggle:hover,
.theme-toggle:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* Tema-växlaren visar bara den ikon som motsvarar nästa läge man byter till */

.theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: inline-flex;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* Generella knappar */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn:hover {
    background: var(--accent-hover);
    text-decoration: none;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
}

/* Hashtag-pills för taggar */

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.8125rem;
}

.tag-pill:hover {
    background: var(--bg-surface-hover);
    text-decoration: none;
}

.tag-pill .icon {
    width: 12px;
    height: 12px;
}

/* Delaknapp med textfeedback ("Kopierat!") */

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
}

.share-button:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.share-button.is-copied {
    color: var(--accent);
}

/* Inläggsflöde ("toot"-kort) */

.post-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-feed-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
}

.post-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.post-card-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-surface-hover);
    color: var(--text-tertiary);
    padding: 6px;
}

.post-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.post-card-byline {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-card-author {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.9375rem;
}

.post-card-author:hover {
    text-decoration: none;
}

.post-card-meta {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.post-card-meta:hover {
    text-decoration: none;
}

.post-card-content-link {
    color: var(--text-primary);
    display: block;
}

.post-card-content-link:hover {
    text-decoration: none;
}

.post-card-title {
    font-size: 1.125rem;
    margin: 0 0 0.375rem;
}

.post-card-excerpt {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9375rem;
}

.post-card-media {
    display: block;
    margin-top: 0.75rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.post-card-media img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
}

.post-card-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.875rem;
}

.post-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    font-weight: 600;
}

.post-card-stat:hover {
    color: var(--text-primary);
    text-decoration: none;
}

/* Sidnumrering */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.pagination-link {
    font-weight: 700;
    color: var(--accent);
}

.pagination-status {
    color: var(--text-tertiary);
}

/* Arkivrubrik (tag.hbs) */

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

.archive-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.archive-header-title {
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
}

.archive-header-description {
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
}

.author-archive-header {
    padding-bottom: 2rem;
}

/* Profilkort (author.hbs) */

.author-card {
    text-align: center;
}

.author-card-avatar {
    width: 88px;
    height: 88px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-surface);
    color: var(--text-tertiary);
    padding: 14px;
}

.author-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.author-card-name {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.author-card-bio {
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 0.75rem;
}

.author-card-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Felsida (error.hbs) */

.error-content {
    text-align: center;
    padding: 4rem 0;
}

.error-code {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.25rem;
    margin: 0;
}

.error-message {
    font-size: 1.75rem;
    margin: 0.25rem 0 0.75rem;
}

.error-description {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
}

/* Hero (startsidan, ovanför flödet) */

.site-hero {
    text-align: center;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.site-hero-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    overflow: hidden;
}

.site-hero-logo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.site-hero-logo svg {
    width: 100%;
    height: 100%;
    padding: 24px;
    background: var(--bg-surface);
    color: var(--text-tertiary);
    border-radius: 50%;
}

.site-hero-title {
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
}

.site-hero-description {
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 1.25rem;
}

.site-hero-social {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-hero-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-hero-social a:hover {
    background-color: var(--accent);
    color: var(--accent-contrast);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Varumärkesfärger per plattform */
.site-hero-social a[aria-label="Facebook"] { color: #1877f2; }
.site-hero-social a[aria-label="Mastodon"] { color: #6364ff; }
.site-hero-social a[aria-label="Twitter"] { color: #1da1f2; }
.site-hero-social a[aria-label="RSS Feed"] { color: #ffa500; }
