/* ========================================================================== */
/* Base.css variables                                                         */
/* ========================================================================== */
:root {
    --font-base: system-ui, -apple-system, Helvetica, Arial, sans-serif, "Apple Color Emoji";
    --font-size-base: clamp(1.1rem, 2vw, 1.35rem);
    --font-size-heading: clamp(2rem, 5vw, 3rem);
    --font-size-small: clamp(1rem, 1.5vw, 1.2rem);
    --font-size-smaller: clamp(0.85rem, 1.2vw, 1rem);
    --border-radius: 0.25em;
    --bg: #D2B2D8;
    --fg: #392467;
    --accent: #865691;
}

:root[data-theme=dark] {
    --bg: #392467;
    --fg: #FFD1E3;
    --accent: #A367B1;
}

/* ========================================================================== */
/* Generic styling                                                            */
/* ========================================================================== */
#isso-thread * {
    /* Reset */
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    font-family: var(--font-base);
}

/* ========================================================================== */
/* Thread heading area                                                        */
/* ========================================================================== */
#isso-thread {
    padding: 0;
    margin: 0;
}
h4.isso-thread-heading {
    color: var(--fg);
    font-weight: bold;
}
.isso-feedlink {
    float: right;
    padding-left: 1em;
}
.isso-feedlink a {
    font-size: 0.8em;
    vertical-align: bottom;
}

/* ========================================================================== */
/* Comments                                                                   */
/* ========================================================================== */

.isso-comment {
    max-width: 68em;
    margin: 0 auto;
}
.isso-preview .isso-comment {
    padding-top: 0;
    margin: 0;
}
.isso-comment:not(:first-of-type),
.isso-follow-up .isso-comment {
    border-top: 1px solid var(--accent);
    margin-bottom: 0.5em;
}
.isso-avatar {
    display: block;
    float: left;
    margin: 0.95em 0.95em 0;
    border-radius: var(--border-radius);
}
.isso-avatar svg {
    max-width: 48px;
    max-height: 48px;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    border: 2px solid var(--accent);
}
.isso-text-wrapper {
    display: block;
    padding: 0.95em;
}
.isso-follow-up {
    padding-left: calc(7% + 20px);
}
.isso-comment-footer {
    font-size: 0.95em;
}
.isso-comment-header {
    font-size: 0.85em;
}
.isso-comment-header a {
    text-decoration: none;
}
/* Only for comment header, spacer between up-/downvote should have no padding */
.isso-comment-header .isso-spacer {
    padding: 0 6px;
}
.isso-spacer {
    color: var(--fg);
}
.isso-permalink,
.isso-note,
.isso-parent {
    color: var(--accent);
    font-weight: normal;
    text-shadow: none;
}
.isso-permalink:hover,
.isso-note:hover,
.isso-parent:hover {
    color: var(--fg);
}
.isso-note {
    float: right;
}
.isso-author {
    font-weight: bold;
    color: var(--accent);
}
.isso-author:hover {
    color: var(--fg);
}
.isso-page-author-suffix {
    font-weight: bold;
    color: var(--accent);
}
.isso-textarea,
.isso-preview {
    color: var(--bg);
    margin-top: 0.2em;
    width: 100%;
    border: 2px solid var(--accent);
    border-radius: var(--border-radius);
    opacity: 0.8;
}
.isso-text p {
    margin-top: 0.2em;
}
.isso-text p:last-child {
    margin-bottom: 0.2em;
}
.isso-text h1,
.isso-text h2,
.isso-text h3,
.isso-text h4,
.isso-text h5,
.isso-text h6 {
    font-size: 130%;
    font-weight: bold;
}
.isso-comment-footer {
    font-size: 0.80em;
    color: var(--fg);
    clear: left;
}
.isso-feedlink,
.isso-comment-footer a {
    font-weight: bold;
    text-decoration: none;
}
.isso-feedlink:hover,
.isso-comment-footer a:hover {
    color: var(--fg);
}
.isso-reply:hover,
.isso-edit:hover {
    text-decoration: underline wavy var(--accent);
}
.isso-comment-footer > a {
    position: relative;
    top: .2em;
}
.isso-comment-footer > a + a {
    padding-left: 1em;
}
.isso-comment-footer .isso-votes {
    color: var(--accent);
}
.isso-upvote svg,
.isso-downvote svg {
    position: relative;
    top: .2em;
    fill: var(--fg);
}
.isso-upvote svg:hover,
.isso-downvote svg:hover {
    fill: var(--accent);
}
/* Reply postbox under existing comment */
.isso-comment .isso-postbox {
    margin-top: 0.8em;
}
.isso-comment.isso-no-votes > * > .isso-comment-footer .isso-votes {
    display: none;
}

/* ========================================================================== */
/* Postbox                                                                    */
/* ========================================================================== */
.isso-postbox {
    max-width: 68em;
    margin: 0 auto 2em;
    clear: right;
}
.isso-form-wrapper {
    display: block;
    padding: 0;
}
.isso-textarea,
.isso-preview {
    margin: 0 0 .3em;
    padding: .4em .8em;
    border-radius: 3px;
    background-color: var(--fg);
    color: var(--bg);
    border: 1px solid var(--accent);
    box-shadow: 0 1px 2px var(--accent);
}
.isso-textarea {
    outline: 0;
    width: 100%;
    resize: none;
}
.isso-form-wrapper input[type=checkbox] {
    vertical-align: middle;
    position: relative;
    bottom: 1px;
    margin-left: 0;
    accent-color: var(--accent);
    color: var(--fg);
    background-color: var(--fg);
}
.isso-notification-section {
    font-size: 0.90em;
    padding-top: .3em;
    display: none;
    padding-bottom: 10px;
}
.isso-auth-section {
    display: block;
}
.isso-textarea:focus,
.isso-auth-section input:focus {
    border-color: var(--accent);
    opacity: 1;
    color: var(--bg);
    outline: 2px solid var(--accent);
}
.isso-input-wrapper {
    display: inline-block;
    position: relative;
    max-width: 25%;
    margin: 0;
}
.isso-input-wrapper input {
    padding: .3em 10px;
    max-width: 100%;
    border-radius: 3px;
    background-color: var(--fg);
    color: var(--bg);
    line-height: 1.4em;
    border: 1px solid var(--accent);
    opacity: 0.8;
}
.isso-input-wrapper input::placeholder {
    color: var(--bg);
    opacity: 0.9;
}
.isso-input-wrapper label {
    display: inline-block;
    line-height: 1.4em;
    height: 1.4em;
    font-size: var(--font-size-smaller)
}
.isso-post-action {
    display: block;
    float: right;
    margin: 1.4em 0 0 5px;
}
.isso-post-action > input {
    border: 2px solid var(--accent);
    padding: 0.2em 0.5em;
    background: var(--fg);
    color: var(--bg);
    font-weight: 700;
    border-radius: var(--border-radius);
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    opacity: 0.8;
}
.isso-post-action > input:hover {
    cursor: pointer;
    opacity: 1;
    transition: background 0.2s, color 0.2s;
}
.isso-post-action > input:active {
    opacity: 1;
    transition: background 0.2s, color 0.2s;
}

/* ========================================================================== */
/* Postbox (preview mode)                                                     */
/* ========================================================================== */
.isso-preview,
.isso-post-action input[name="edit"],
.isso-postbox.isso-preview-mode > .isso-form-wrapper input[name="preview"],
.isso-postbox.isso-preview-mode > .isso-form-wrapper .isso-textarea {
    display: none;
}
.isso-postbox.isso-preview-mode > .isso-form-wrapper .isso-preview {
    display: block;
}
.isso-postbox.isso-preview-mode > .isso-form-wrapper input[name="edit"] {
    display: inline;
}
.isso-preview {
    color: var(--fg);
    background: repeating-linear-gradient(
        -45deg,
        var(--accent),
        var(--accent) 10px,
        var(--bg) 10px,
        var(--bg) 20px
    );
}

/* ========================================================================== */
/* Animations                                                                 */
/* ========================================================================== */

/* "target" means the comment that's being linked to, for example:
 * https://example.com/blog/example/#isso-15
 */
.isso-target {
    animation: isso-target-fade 5s ease-out;
}
@keyframes isso-target-fade {
    0% { background-color: var(--accent); }
    /* This color should be changed when used on a dark background,
     * maybe #3f3c1c for example
     */
}

/* ========================================================================== */
/* Media queries                                                              */
/* ========================================================================== */
@media screen and (max-width:600px) {
    .isso-input-wrapper {
        display: block;
        max-width: 100%;
        margin: 0 0 .3em;
    }
    .isso-input-wrapper input {
        width: 100%;
    }
    .isso-post-action {
        margin-top: 0;
    }
}
