/* skeleton Mastodon client
   Copyright (C) 2026  CarePackage17
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

:root {
    color-scheme: dark light;
}

@media (prefers-color-scheme: dark) {
    :root {
        background-color: #1c1b22;
        --accent-color: rgb(61, 94, 156);
        --cw-color: orangered;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        background-color: seashell;
        --accent-color: rgb(61, 94, 156);
        --cw-color: red;
    }
}

/* https://github.com/system-fonts/modern-font-stacks */
body {
    font-family: system-ui, sans-serif;
    overflow-wrap: break-word;
}

article {
    animation-name: fade-in;
    animation-duration: 0.75s;
    border-bottom: 2q solid var(--accent-color);
    padding-top: 24px;
    padding-bottom: 24px;
}

article:hover {
    /* this will do nothing in light mode, we'll need something else to fix that */
    backdrop-filter: brightness(1.2);
    -webkit-backdrop-filter: brightness(1.2);
}

nav {
    border-bottom: 2q solid var(--accent-color);
    padding-bottom: 24px;
}

summary {
    border: solid var(--cw-color);
}

@keyframes fade-in {
    from {
        opacity: 0%;
    }

    to {
        opacity: 100%;
    }
}

@keyframes fade-out-in {
    0% {
        opacity: 100%;
    }

    50% {
        opacity: 0%;
    }

    100% {
        opacity: 100%;
    }
}

#popover {
    width: 95vw;
    height: 95vh;
}

#popoverCurrentImage {
    display: block;
    object-fit: contain;
    /* play with this until it looks right */
    width: 100%;
    height: 100%;
}

#post-tags-container {
    display: flex;
    column-gap: .5em;
    overflow: scroll;
}

/* mastodon API wraps some content like https in links: https://github.com/mastodon/mastodon/issues/34319 
   might also apply to some hashtags. */
.invisible {
    display: none;
}

.post-tag {
    border-style: solid;
    border-width: 2px;
}

.post-img {
    animation-name: fade-in;
    animation-duration: 0.75s;

    object-fit: scale-down;
    max-width: 95vw;
    max-height: 85vh;

    /* These center the image, looking nice on mobile but somewhat meh on desktop */
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.post-video {
    animation-name: fade-in;
    animation-duration: 0.75s;

    object-fit: scale-down;
    max-width: 95vw;
    max-height: 85vh;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.friendly-name {
    margin-left: 8px;
    font-size: large;
    font-weight: bold;
    overflow: hidden;
}

.full-account-name {
    margin-left: 8px;
    font-weight: lighter;
    grid-column: 2;
    overflow: hidden;
}

.post-header {
    display: grid;
    grid-template-columns: 50px 1fr;
}

.post-avatar {
    grid-row-start: 1;
    grid-row-end: 3;
}

.post-creation-time {
    font-weight: lighter;
}

.load-next-batch {
    display: block;
    margin-top: 24px;
    margin-bottom: 24px;
}

.loading-anim {
    animation-name: fade-out-in;
    animation-duration: 1s;
    animation-iteration-count: infinite;
}