/* Header */
.site-header {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.logo__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text)
}

.logo__img {
    width: 28px;
    height: 28px;
    border-radius: 6px
}

.logo__text {
    font-weight: 700
}

.site-header .right {
    display: flex;
    align-items: center;
    gap: 20px
}

/* User menu */
.user-menu {
    position: relative
}

.user-menu__summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px
}

.user-menu__summary::-webkit-details-marker {
    display: none
}

.user-menu__name {
    color: var(--text)
}

.user-menu__chev {
    opacity: .7
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    object-fit: cover
}

.user-menu__dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    z-index: 20
}

.user-menu[open] .user-menu__dropdown {
    display: block
}

.user-menu__item {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text) !important
}

.user-menu__item:hover {
    background: var(--elev-2);
    color: var(--brand) !important
}

.user-menu__sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 6px 4px
}

.user-menu__danger:hover {
    color: #fff !important;
    background: #a63226
}

/* Icon link */
.icon-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    color: var(--text) !important;
    border: 1px solid var(--border);
    background: transparent;
    transition: background .15s, border-color .15s, color .15s, transform .05s
}

.icon-link .icon {
    width: 18px;
    height: 18px;
    display: block
}

.icon-link:hover {
    border-color: var(--brand);
    color: var(--brand) !important;
    background: var(--brand-ghost)
}

.icon-link:active {
    transform: translateY(1px);
    background: var(--elev-2)
}

.icon-link:focus-visible {
    outline: none;
    box-shadow: var(--ring)
}

.icon-link__label {
    display: none
}

@media (min-width: 780px) {
    .icon-link__label {
        display: inline
    }
}

.icon-link--ghost {
    border-color: transparent;
    background: transparent
}

.icon-link--ghost:hover {
    background: var(--brand-ghost);
    border-color: var(--brand-ghost);
    color: var(--brand)
}

/* Like button + animation */
.like-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 8px
}

.like-btn:focus-visible {
    outline: none;
    box-shadow: var(--ring)
}

.heart {
    fill: var(--text-muted);
    width: 24px;
    height: 24px;
    transform-origin: 50% 50%
}

.like-btn .heart--filled {
    display: none
}

.like-btn.is-liked .heart--filled {
    display: block
}

.like-btn.is-liked .heart--outline {
    display: none
}

.like-btn:not(.is-liked) .heart--outline {
    display: block
}

.like-btn:hover .heart {
    transform: translateY(-1px)
}

.like-btn:active .heart {
    transform: scale(.95)
}

.like-btn.anim-like .heart--filled {
    animation: heart-pop .28s ease-out
}

@keyframes heart-pop {
    0% {
        transform: scale(.6);
        filter: drop-shadow(0 0 0 rgba(255, 102, 0, 0))
    }
    60% {
        transform: scale(1.18);
        filter: drop-shadow(0 4px 10px rgba(255, 102, 0, .35))
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(255, 102, 0, 0))
    }
}

.like-btn.anim-like::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 102, 0, .35);
    animation: like-ring .45s ease-out forwards;
    pointer-events: none
}

@keyframes like-ring {
    0% {
        transform: scale(.7);
        opacity: .7;
        box-shadow: 0 0 0 0 rgba(255, 102, 0, .35)
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
        box-shadow: 0 0 0 8px rgba(255, 102, 0, 0)
    }
}

/* Cards & post bits */
.card {
    padding: 12px 0;
    margin-bottom: 16px
}

.post-header, .card-header {
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    color: var(--text-muted)
}

.post-header a, .card-header a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px
}

.author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none
}

.author .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    object-fit: cover
}

.post-footer, .card-footer {
    padding: 15px 0;
    display: flex;
    gap: 15px;
    align-items: center
}

.post-footer .views,
.post-footer .likes,
.card-footer .views,
.card-footer .likes,
.card-footer .comments {
    display: flex;
    gap: 5px;
    align-items: center;
    color: var(--text-muted)
}

.post-footer .likes svg,
.post-footer .views svg,
.card-footer .likes svg,
.card-footer .views svg,
.card-footer .comments svg {
    width: 24px;
    height: 24px;
}

/* Comments */
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px
}

.comment-item {
    padding: 17px 0 0
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    object-fit: cover;
    display: block
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px
}

.comment-author {
    color: var(--text);
    font-weight: 600;
    text-decoration: none
}

.comment-author:hover {
    color: var(--brand)
}

.comment-dot {
    color: var(--text-muted)
}

.comment-time {
    color: var(--text-muted);
    font-size: 12px
}

.comment-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 20vw;
    font-size: 12px
}

.comment-del {
    margin-left: auto
}

.comment-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    background: var(--elev-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 8px 6px 10px
}

.comment-input-row input {
    flex: 1;
    background: transparent;
    border: 0 !important;
    outline: 0;
    color: var(--text);
    font: inherit;
    box-shadow: none;
}

.comment-input-row input::placeholder {
    color: var(--text-muted)
}

.comment-input-row .icon-btn {
    width: 32px;
    height: 32px
}

/* Small icon button */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s, background-color .15s, border-color .15s, transform .05s
}

.icon-btn .icon {
    width: 18px;
    height: 18px;
    display: block
}

.icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--ring)
}

.icon-btn:hover {
    color: #fff;
}

.icon-btn:active {
    transform: translateY(1px);
    color: var(--brand);
}

.icon-btn--ghost:hover {
    background: var(--elev-2);
    border-color: var(--border)
}

.icon-btn--danger:hover, .icon-btn--danger:focus-visible {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
    background: color-mix(in srgb, var(--danger) 12%, transparent)
}

/* Tiles & grids */
.grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px
}

.post-tile {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: block
}

.post-tile img {
    width: 100%;
    display: block;
    aspect-ratio: 1/1;
    object-fit: cover
}

/* Gallery badge */
.gallery-badge {
    position: absolute;
    right: 8px;
    top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #fffffff5;
    color: #444;
    box-shadow: 0 6px 16px #0000002e;
    pointer-events: none
}

.post-tile .gallery-badge {
    width: 22px;
    height: 22px;
    right: 6px;
    top: 6px
}

/* Universal gallery/slider */
.gallery {
    position: relative;
    width: 100%
}

.gallery-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #0c0c0e
}

.gallery-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .25s ease-out
}

.gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .95);
    color: #111;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25)
}

.gallery-nav:hover {
    background: #fff
}

.gallery-nav.prev {
    left: 10px
}

.gallery-nav.next {
    right: 10px
}

.gallery-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 4;
}

.gallery-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
}

.gallery-dots .dot.is-active {
    background: #fff;
}

.gallery-slide.is-video::after {
    content: "▶";
    position: absolute;
    left: 8px;
    top: 8px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18)
}

/* Notice */
.notice {
    margin: 0 0 12px 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--elev-2);
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 10px
}

.notice.hidden {
    display: none
}

.notice--error {
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
    background: color-mix(in srgb, var(--danger) 12%, transparent)
}

.notice--success {
    border-color: color-mix(in srgb, #3cb371 35%, var(--border));
    background: color-mix(in srgb, #3cb371 12%, transparent)
}

.notice .notice-close {
    margin-left: auto;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--text-muted)
}

.mention {
    text-decoration: none;
}

.mention:hover {
    text-decoration: underline;
}

.hashtag {
    text-decoration: none;
}

.hashtag:hover {
    text-decoration: underline;
}
