/* Styling for the news page only */
.news-page {
    display: grid;
    grid-template-columns: max-content minmax(300px, 100%);
    max-width: 100%;
    grid-gap: 10px;
    padding: 0.5rem;
    box-sizing: border-box;
}

.news-left, .news-right {
    background-color: #3d3d3d;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    box-shadow: none;
}

.news-article {
    background-color: #1a1a1a;
    padding: 20px;
    margin: 5px 0;
    font-size: .8em;
    line-height: 1;
    border-radius: 24px;
    border: 1px solid #8feff2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    overflow-x: auto;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

@media (width <=800px) {
    .news-article {
        padding: 10px;
    }
}

button:hover {
	background-color: transparent;
}

.articles-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.comments-thread {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* .comments-thread form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
} */

.comment-container {
    display: flex;
    position: relative;
    flex-direction: column;
    box-sizing: border-box;
    align-items: flex-start;
    padding-left: 10px;
    margin-top: 6px;
    margin-bottom: 6px;
    min-height: 80px;
    border-left: 6px solid #333;
}

@media (width <=800px) {
    .comment-container {
        min-width: 480px;
        padding: 10px;
        border-radius: 36px;
    }
}

.comment-container:hover {
    background-color: black;
}

@media (width <=800px) {
    .comment-container:hover .comment-toolbar {
        width: fit-content;
        align-items: center;
        white-space: nowrap;
    }
}

.comment-container:hover .comment-toolbar {
    display: flex;
}

h2 {
    margin-top: 10px;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
}

.formatted-description {
    text-align: left;
    line-height: 1;
    margin-top: 5px;
    margin-bottom: 0;
    font-size: 1em;
}

p {
    font-size: 1em;
    margin-bottom: 4px;
    margin-top: 0;
}

#popup-bio {
    margin-bottom: 20px;
}

.news-embed-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.news-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.article-info {
    font-size: 1.1em;
    font-weight: 550;
    margin-right: 4px;
}

.article-info-wrapper{
    line-height: 1;
    font-size: 1.1em;
    width: 100%;
}

.news-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 10px;
    border-radius: 4px;
}

.news-left input[type="url"] {
    width: 300px;
    padding: 12px 20px;
    margin-left: 0;
    background-color: #1a1a1a;
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 1em;
    box-sizing: border-box;
    outline: none;
    transition: box-shadow 0.2s ease;
}

#submit-news {
    margin-left: 0;
    padding-left: 0;
}

.submit-article-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    margin-left: 0;
    gap: 3px;
}

.submit-article {
    padding: 12px 20px;
    font-size: 1em;
    margin-left: 3px;
    margin-top: 2px;
    background-color: #1a1a1a;
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
}

.submit-article:hover {
    background-color: #444;
}

.scraper-blocked-msg {
    font-size: .7em;
    color: #bbb;
    max-width: 350px;
    margin-top: 0;
    margin-bottom: 30px;
}

#category {
    width: 300px;
    padding: 12px 20px;
    margin-left: 0;
    background-color: #1a1a1a;
    color: #bbb;
    border: 0;
    border-radius: 999px;
    font-size: 1em;
    box-sizing: border-box;
    outline: none;
    transition: box-shadow 0.2s ease;
    margin-bottom: 40px;
}

.category-links {
    display: block;
    width: fit-content;
    margin: 0;
    padding: 0;
    font-size: 1.2em;
}

.category-links a {
    display: block;
    box-sizing: border-box;
    padding: 12px;
    background-color: #1a1a1a;
    border: 1px solid #8feff2;
}

.category-links a:hover {
    color: white;
    background-color: #333;
}

.category-links ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.category-links a.active {
    background-color: #333;
    color: white;
    font-weight: bold;
}

.new-category-container {
    display: flex;
    align-items: center;
    flex-direction: row;
    margin-top: 30px;
}

#new-category {
    width: 100%;
    max-width: 300px;
    min-width: 100px;
    padding: 5px 10px;
    margin-right: 10px;
    margin-bottom: 5px;
    background-color: #1f1f1f;
    color: #bbb;
    border: none;
    font-size: 1em;
    box-sizing: border-box;
    outline: none;
    transition: box-shadow 0.2s ease;
}

.article-count {
    margin-left: 0;
    margin-bottom: 14px;
    font-size: 1.2rem;
    color: #bbb;
}

.sort-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: baseline;
}

.sort-form {
    font-size: 0.9rem;
    color: #bbb;
}

.sort-form select {
	background-color: #1a1a1a;
	color: #bbb;
	padding: 8px 10px;
	border: none;
	width: fit-content;
}

.news-right h2 a:hover {
    color: #666;
}

.toggle-edit-article {
	color: #00e3ea;
	border: 2px solid #00e3ea;
	width: fit-content;
	border-radius: 12px;
	padding: 6px;
	margin-bottom: 0;
}

.toggle-edit-article:hover {
	color: white;
	cursor: pointer;
}

.article-edit-form {
	display: none;
	flex-direction: column;
	width: 100%;
	max-width: 500px;
	gap: 8px;
	margin-top: 0;
}

.article-edit-form.visible{
    display: flex;
}

.article-edit-form input,
.article-edit-form textarea {
	background-color: #222;
	color: #fff;
	border: 1px solid #555;
	padding: 6px;
	width: 100%;
	border-radius: 6px;
}

.article-edit-form input[type="date"] {
  width: 180px;
}

.article-edit-form button {
  align-self: flex-start;
}

.news-authors,
.news-description {
    color: #ccc;
    margin-top: 5px;
}

.delete-form {
    display: inline;
    margin: 0;
}

.delete-button {
    background-color: transparent;
    border: none;
    border-radius: 0;
    color: #888;
    cursor: pointer;
    font-size: 0.9em;
    padding: 5px;
}

.delete-button:hover {
    color: #fff;
    background-color: #333;
}

.post-comment-container {
    display: flex;
    color: white;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    gap: 8px;
    position: relative;
    overflow: visible;
}

.comment-box {
    display: flex;
    position: relative;
    color: white;
    align-items: center;
    margin-bottom: 0;
    gap: 0;
    overflow: visible;
}

.comment-editor {
    width: 100%;
    min-width: 320px;
    max-height: 280px;
    min-height: 80px;
    padding: 12px 20px;
    resize: vertical;
    overflow: auto;
    margin-bottom: 20px;
    background-color: #1f1f1f;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.news-right textarea[name="description"] {
    min-height: 100px;
}

.unicode-wrapper-reaction {
    right: 80px;
    min-width: fit-content;
    max-height: 440px;
}

@media (width <=800px) {
    .unicode-wrapper-reaction {
        right: -50px;
    }
    
}

.custom-emoji-drawer {
    position: absolute;
    max-width: 400px;
    bottom: 80px;
    right: -250px;
}

@media (width <=800px) {
    .custom-reaction-drawer,
    .custom-emoji-drawer {
        min-width: 300px;
        max-width: 300px;
        max-height: 300px;
        right: -50px;
    }
}

.unicode-emoji-wrapper {
    right: -150px;
}

.icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    margin-right: 5px;
}

.uploaded-image {
    max-width: 450px;
    max-height: 450px;
    border-radius: 24px;
    margin: 6px 0;
    display: block;
}

.upload-button {
    background: transparent;
    font-size: 1.8em;
    cursor: pointer;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

.emoji-size-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.size-option {
    padding: 2px 8px;
    border: 2px solid #00e3ea;
    border-radius: 999px;
    background-color: transparent;
    color: white;
    font-size: 0.9rem;
    max-height: 26px;
    margin-top: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.size-option.active {
    padding: 2px 8px;
    border: 2px solid limegreen;
    border-radius: 999px;
    background-color: transparent;
    color: white;
    font-size: 0.9rem;
    max-height: 26px;
    margin-top: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.inline-emoji {
    margin-right: 10px;
    image-rendering: auto;
}

.reactions-container {
    display: flex;
    flex-direction: row;
}

.article-wrapper-reactions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-toolbar-reactions {
    display: flex;
    position: relative;
    flex-direction: row;
    padding: 2px;
    width: min-content;
    border-radius: 24px;
    background-color: black;
}

.comment-toolbar {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    align-items: center;
    overflow: visible;
    gap: 0;
    margin-top: 0;
    font-size: 1em;
    color: #ccc;
    background-color: black;
    border: 1px solid teal;
    border-radius: 24px;
}

.post-comment:hover {
    background-color: #333;
    color: white;
}

.newsfeed-button {
    background-color: #1a1a1a;
    border: 3px solid #00e3ea;
    color: #00e3ea;
    padding: 2px 8px;
    max-width: 102px;
    margin-left: 0;
    font-size: 1em;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1;
    text-align: center;
    justify-content: center;
    align-items: center;
}

.newsfeed-button:hover {
    background-color: #333;
    color: white;
}

.submit-cancel {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

/* .reply strong {
    display: inline-block;
    margin-bottom: 2px;
} */

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

.reply p {
    margin-bottom: 2px;
}

.reply-drawer {
    margin-top: 5px;
    margin-left: 5px;
}

.admin-badge {
    font-size: 1.2em;
    color: #6cf;
    margin-left: 0;
    vertical-align: middle;
}

.avatar-inline {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
}

#mobile-categories {
    display: none;
    padding: 10px;
    background-color: #1a1a1a;
    color: white;
    max-width: 300px;
    z-index: 1000;
    flex-direction: column;
    gap: 10px;
}

#mobile-categories a:hover {
    background-color: #888;
}

.sharelink {
    background-color: transparent;
    color: #00e3ea;
    border: none;
    padding: 0;
    margin-left: 0;
    margin-bottom: 20px;
    margin-top: 5px;
    font-size: 1em;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.sharelink:hover {
    color: white;
}

.loading-article {
  display: flex;
  align-items: center;
  gap: 10px;
  color: gray;
  font-size: 1rem;
  padding: 1rem;
}

.spinner::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #888;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.archive-x-warning-page {
    margin-top: 20px;
}

/* Mobile layout */

@media (width <=800px) {
    .news-page {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 0 10px;
    }

    .category-links {
        display: none
    }

    .submit-article-container {
        margin-top: 20px;
        padding: 0;
    }

    #mobile-categories {
        display: flex;
        align-items: flex-start;
        padding: 10px;
        margin-top: 0;
        background-color: #1a1a1a;
        color: #bbb;
        border: 0;
        max-width: 300px;
        z-index: 1000;
        flex-direction: column;
        gap: 10px;
    }

    .comment-editor {
        width: 100%;
        max-width: 450px;
        min-width: 225px;
        min-height: 55px;
        max-height: 250px;
        resize: both;
        padding: 12px 20px;
        margin-bottom: 20px;
        background-color: #1f1f1f;
        color: white;
        border-radius: 4px;
        font-size: 16px;
        box-sizing: border-box;
    }

    .news-left,
    .news-right {
        width: 100%;
    }

    .newsfeed-button {
        background-color: #1a1a1a;
        border: 3px solid #00e3ea;
        color: #00e3ea;
        padding: 2px 12px;
        margin-left: 0;
        font-size: .9em;
        border-radius: 999px;
        cursor: pointer;
        transition: color 0.2s ease;
        text-decoration: none;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
        text-align: center;
        max-width: 100px;
        justify-content: center;
        align-items: center;
    }

    .emoji-wrapper {
        position: absolute;
        z-index: 1000;
        top: 55px;
        left: 10px;
        background-color: #1a1a1a;
        border: 1px solid #444;
        border-radius: 8px;
        padding: 8px;
        box-shadow: 0 2px 12px #1a1a1a;
        overflow-y: auto;
    }
}