html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* Prevents the whole page from scrolling instead of the div */
}

#mobile-menu,
#main-header {
    display: none;
}

#content {
    margin: 0;
}

blockquote {
    position: relative;
    margin: 1em;
    color: white;
    background-color: #666;
    border-radius: 15px;
    padding: 1em;
}

blockquote::before {
    content: "“";
    font-family: serif;
    font-size: 5em;
    position: absolute;
    left: -0.1em;
    top: -0.2em;
    color: #999;
    line-height: 1;
}

.content-inner {
    margin-top: 0;
}

.back-button {
    display: none;
    width: 30px;
    height: 30px;
    fill: white;
}

/* Inner feed */
.watch-outer {
    display: flex;
    flex-direction: row-reverse;
    position: relative;
    gap: 20px;
}

.watch-inner {
    display: block;
    /* Ensure it's not flex if not needed */
    width: 50%;
    max-width: 500px;
    height: 100vh;
    /* Or 100% if parent is html/body */
    height: 100svh;
    /* Use svh for better mobile URL bar support */
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    transition: opacity 0.3s ease-in-out;
}

.watch-inner::-webkit-scrollbar {
    display: none;
}

.watch-ui {
    position: unset;
    top: 0;
    width: 60%;
    height: 100%;
    margin: 0 auto;
    pointer-events: none;
    /* Allows clicks/scrolls to pass through to video layer below */
    z-index: 5;
}

.back-button,
.watch-modal-div,
.close-modal,
.modal-nav-btn,
.comments-preview-wrapper,
.mute-svg,
.mute-overlay,
.mute-text,
.watch-nav-btn {
    pointer-events: auto;
    /* Re-enables pointer events for these elements */
}

.watch-mute-nav {
    position: absolute;
    display: flex;
    flex-direction: column;
    top: 5px;
    left: 5px;
    width: 100%;
    z-index: 11;
}

.watch-mute-nav.scroll-down {
    flex-direction: row;
    align-items: flex-start;
}

.back-mute-div {
    display: flex;
}

.watch-nav {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.watch-nav-btn {
    padding: 2px 7px;
    color: #eee;
    background-color: transparent;
    transition: all 0.4s ease-in-out display 0.4s ease-in;
}

.watch-nav-btn.active {
    color: white;
    background-color: transparent;
    font-weight: 500;
}

.watch-nav-btn.scroll-down,
.watch-nav-btn.active.scroll-down {
    background-color: transparent;
}

.video-div::after,
.watch-ui::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(rgb(0, 0, 0, 0), rgb(0, 0, 0, .8));
    pointer-events: none;
    z-index: 3;
    /* above the video but below the overlay/ engagement buttons */
}

.watch-ui::after {
    top: 0;
    bottom: auto;
    height: 110px;
    transform-origin: top;
    transform: scaleY(1);
    transition: transform 0.25s ease;
    background: linear-gradient(rgb(0, 0, 0, .6), rgb(0, 0, 0, 0));
}

.watch-ui.scroll-down::after {
    transform: scaleY(0.36);
    /* 40 / 110 ≈ 0.36 */
}

.genre-rank-badge {
    position: absolute;
    top: 7px;
    left: auto;
    right: 10px;
    color: white;
    z-index: 10;
}

/* Each item (one full screen snap) */
.item-div {
    display: flex;
    position: relative;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100svh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    /* Forces it to stop on every card */
    flex-shrink: 0;
    transition: display 0.3s ease-in-out;
}

.engagement-outer {
    position: absolute;
    justify-content: flex-end;
    bottom: 20px;
    right: 0;
    z-index: 10;
}

.watch-inner .article-engagement {
    flex-direction: column;
    width: fit-content;
    padding-right: 3px;
}

.watch-inner .engagement-primary,
.watch-inner .engagement-btn-container {
    flex-direction: column;
}

.engagement-button {
    width: 38px;
    height: fit-content;
    padding-bottom: 2px;
}

.read-icon:hover,
.thots-icon svg:hover,
.active svg:hover {
    background-color: transparent;
}

.reading-list-container,
.favorite-container {
    display: none;
}

.tooltip,
.share-options {
    top: 0;
    left: auto;
    right: 35px;
    padding: 8px;
    z-index: 12;
}

.modal-div .tooltip {
    top: 50px;
    left: 0;
}

.modal-div .share-options {
    top: 65px;
    right: -100%;
}

/* Media containers */
.media-div {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Videos */
.video {
    width: 100%;
    max-height: unset;
    object-fit: contain;
    -webkit-filter: brightness(1) !important;
    filter: brightness(1) !important;
    z-index: 0;
}

.video-playing {
    z-index: 2;
}

/* Cover images */
.cover-image,
.thot-image {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: display 0.3s ease-in-out;
    z-index: 1;
}

.watch-body .cover-image {
    position: relative;
    top: unset;
    max-height: 50vh;
}

.title-meta {
    width: 100%;
    margin: 0;
    padding: 10px 55px 10px 10px;
    z-index: 3;
}

.title {
    margin: 5px 0;
    font-size: 1.5rem;
    font-weight: 400;
}

.title,
.author-name,
.article-meta-desc,
.read-body-btn {
    cursor: pointer;
    color: white !important;
    -webkit-filter: brightness(1) !important;
    filter: brightness(1) !important;
}

.author-and-date,
.author-container,
.genre-date-container {
    display: flex;
    align-items: center;
}

.genre-date-container {
    margin: 10px 0;
}

.author-and-date,
.author-container,
.genre,
.author-name {
    font-size: 1rem;
    line-height: .9em;
}

.author-and-date {
    margin: 10px 0;
}

.author-pp {
    width: 34px;
    height: 34px;
    margin-right: 7px;
    border: none
}

.author-name {
    margin: 0 5px;
}

.article-date,
.genre {
    font-size: .95rem;
    color: #bbb;
}

.views-container {
    display: none;
}

.truncate-title,
.truncate-body,
.truncate-two,
.truncate-four,
.comment-preview-body {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: break-word;
}

.comment-preview-body {
    max-height: 4.4em;
}

.truncate-four {
    line-clamp: 4;
    -webkit-line-clamp: 4;
    margin-top: 10px;
}

.article-meta-desc {
    position: relative;
    margin: 10px 0;
    font-size: 1rem;
}

.read-more {
    position: relative;
    display: none;
    position: absolute;
    bottom: 0;
    padding: 0;
    line-height: unset;
    background-color: transparent;
}

.reading-time-container,
.meta-details-container {
    display: none;
}

@keyframes slide-up {
    0% {
        transform: translateY(100%);
    }

    100% {
        transform: translateY(0);
    }
}

.read-body-div {
    display: flex;
    justify-content: center;
    align-items: center;
}

.read-body-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    padding: 0;
}

.video-article-div .article-body {
    display: none;
}

.video-article-div .title-meta {
    position: absolute;
    bottom: 0;
    color: white;
    pointer-events: none;
    transition:
        transform 0.3s ease,
        backdrop-filter 0.3s ease,
        background-color 0.3s ease;
}

.title-meta.visible {
    background-color: rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.back-button,
.read-more,
.video-article-div .title-meta a,
.video-article-div .title-meta .author-pp,
.video-article-div .title-meta .title,
.video-article-div .title-meta .article-engagement,
.video-article-div .title-meta .article-meta-desc,
.engagement-icon,
.engagement-button,
.engagement-btn-container {
    pointer-events: auto;
    /* This makes the link clickable again */
}

.video-article-div .title,
.video-article-div .author-and-date,
.video-article-div .article-meta-desc,
.thots-preview-heading {
    margin: 2px 5px;
}

.watch-modal-div {
    display: block;
    position: absolute;
    width: 100%;
    max-width: 50%;
    height: 100%;
    top: 0;
    margin: 0 auto;
    background-color: rgba(45, 45, 45, 0.85);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    overflow-x: hidden;
    overflow-y: auto;
    transition: transform 0.2s ease;
    z-index: 11;
}

.watch-modal-div,
.modal-content,
.watch-nav {
    animation: slide-up 0.5s ease-in-out;
}

@keyframes slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-down {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.no-scroll {
    overflow-y: hidden !important;
    touch-action: none !important;
    /* for mobile */
}

.watch-modal-header {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    padding: 0 5px;
    background: linear-gradient(rgb(0, 0, 0, .5), rgb(0, 0, 0, 0));
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 15px 15px 0 0;
    pointer-events: none;
    z-index: 11;
}

.close-modal {
    display: none;
    width: 30px;
    height: 30px;
    margin: 7px;
    background-color: transparent;
}

.close-modal-svg {
    fill: #ccc;
    margin: 0;
}

.close-modal-svg:hover {
    fill: white;
}

.modal-filters,
.watch-modal-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-nav-btn {
    background-color: transparent;
    color: #ccc;
    border-radius: 0;
    transition: border .3s ease, color .3s ease;
}

.modal-nav-btn:hover,
.modal-nav-btn.active {
    color: white;
    border-bottom: 3px solid #ccc;
}

.feed-topline {
    position: relative;
}

.spinner-div {
    display: flex;
    justify-content: center;
    align-items: center;
}

.end-of-feed {
    color: #ccc;
    text-align: center;
    font-size: 1rem;
    padding: auto;
    animation: fadein 0.5s ease-in;
}

@keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.article-body, .comments-section {
    max-width: inherit;
    animation: fadein 0.3s;
}

.watch-body {
    width: 100%;
    padding: 10px;
}

.watch-body h1 {
    color: white;
}

.watch-body blockquote {
    background-color: #555;
}

.watch-body blockquote::before {
    color: #ccc;
}

.watch-body .caption {
    color: #ccc;
}

.article-body img:not(.author-pp):not(.story-cluster-image),
.article-body iframe {
    width: 100%;
    margin: 10px auto;
}

/* Thots container/ Comments */
.feed-engagement-container {
    display: flex;
}

.modal-div .read-article-container {
    display: none;
}

.comments-section {
    margin-top: 15px;
    padding: 7px;
}

.article-thot {
    padding: 10px 0;
    border-bottom: 1px solid #555;
}

.article-post-thot,
.article-thots-container input {
    color: white;
    padding: 10px 5px;
    height: fit-content;
    border-bottom: 1px solid #ccc;
}

.article-post-thot {
    width: 100%;
}

.thot-reply-form {
    display: flex;
}

.thot-reply-btn,
.thot-reply-form input[type="submit"] {
    width: fit-content;
}

.thot-reply-form .thot-textarea {
    display: none;
}

.thot-post-btn {
    background-color: #555;
    color: #ccc;
    width: 100%;
    border-bottom: none;
    transition: background-color .3s ease;
}

.replies .thot-post-btn {
    width: fit-content;
}

.dark-mode .thot-reply-form .thot-post-btn:hover,
.dark-mode .thot-post-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: black;
}

.dark-mode .article-thot .engagement-icon {
    fill: #ccc;
    stroke: #ccc;
}

.dark-mode .article-thot .engagement-button.active .engagement-icon {
    fill: var(--engagement-active-color);
    stroke: white;
}

.comment-suggestions-div {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    max-width: fit-content;
    height: fit-content;
    min-height: 45px;
    margin: 10px 0;
}

.comment-suggest-btn {
    display: inline-block;
    height: fit-content;
    margin: 0 5px;
    padding: 5px 10px;
    border-radius: 15px;
    background-color: #eee;
    color: #333;
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .3s ease;
}

.comment-suggest-btn:hover {
    background-color: #ddd;
    color: black;
}

.dark-mode .comment-suggest-btn {
    background-color: #333;
    color: #ddd;
}

.dark-mode .thot-reply-input {
    color: white;
}

.social-counts {
    margin: 0 5px;
    font-size: .8em;
}

.article-thots .like-button,
.article-thots .love-icon {
    background-color: transparent;
}

.article-thots {
    margin-top: 10px;
}

.feed-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thot-body-div {
    margin: 5px 0 10px 0;
}

.thot-author-pp {
    margin-bottom: -5px;
}

/* Cluster items */

.cluster-items-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    touch-action: pan-x;
    margin: 10px 0;
}

.story-source {
    display: flex;
    border-radius: 15px;
    background-color: #333;
    height: fit-content;
    margin-bottom: 7px;
    touch-action: auto;
}

.story-source p,
.story-source small {
    margin: 5px 10px;
}

.story-source-title {
    font-size: .9rem;
    color: #ccc;
}

.story-cluster-image {
    width: 60px;
    border-radius: 10px;
    object-fit: cover;
    object-position: center top;
}

.story-source-details {
    display: flex;
    flex-direction: column;
    width: 160px;
    color: #888;
    fill: #888;
}

.play-pause-overlay {
    position: absolute;
    top: 50%;
    left: 250px;
    opacity: 0;
    /* This moves the element back by 50% of its own width/height */
    transform: translate(-50%, -50%);
    z-index: 10;
}

.play-pause-overlay.animate {
    animation: popFade 0.6s ease-out;
}

.play-pause-overlay.visible {
    animation: popIn 0.6s ease-in;
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(2.0);
}

@keyframes popFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6);
    }

    20% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6);
    }

    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(2.0);
    }
}

.play-pause-svg {
    width: 80px;
    height: 80px;
    fill: rgba(255, 255, 255, 0.7);
}

.mute-overlay {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
}

.mute-svg {
    width: 28px;
    height: 34px;
}

.mute-text {
    font-size: .9em;
    cursor: pointer;
    line-height: 34px;
    color: #eee;
}

.video-progress {
    position: absolute;
    bottom: 4px;
    left: 8px;
    right: 8px;
    height: 7px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    opacity: 0.9;
    overflow: hidden;
    pointer-events: none;
    z-index: 4;
}

.video-progress-bar {
    width: 0%;
    height: 100%;
    background: #ccc;
    transform-origin: left;
}

.video-processing-message {
    margin: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    z-index: 11;
}

.video-processing-message p {
    margin: 5px;
}

.comments-preview-outer,
.comment-preview,
.comment-preview-pp {
    display: flex;
    align-items: center;
}

.comments-preview-wrapper {
    margin: 10px 0;
    padding: 7px 0;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 15px;
    border-bottom: 1px solid #555;
}

.comments-preview-outer {
    position: relative;
    overflow: hidden;
    gap: 10px;
    height: 45px;
}

.comment-preview {
    position: absolute;
    width: 100%;
    min-width: 100%;
    height: 60px;
    padding: 5px;
    font-size: 0.9em;
    opacity: 0;
    transform: translateY(100%);
    transition: transform .45s ease, opacity .45s ease;
}

.comment-preview.active {
    opacity: 1;
    transform: translateY(0);
}

.comment-preview.exit {
    transform: translateY(-100%);
    opacity: 0;
}

.comment-preview .author-pp {
    width: 28px;
    height: 28px;
}

.skeleton {
    height: 100%;
    border-radius: 10px;
    background-color: #444;
    background: linear-gradient(110deg,
            #444 25%,
            #666 50%,
            #444 75%);
    background-size: 200% 100%;
    animation: shimmer 3.5s infinite linear;
}

.video.skeleton {
    opacity: .4;
}

.title.skeleton,
.article-meta-desc.skeleton,
.comment-preview-body.skeleton {
    margin: 10px 0;
    height: 2.2ch;
}

.author-name.skeleton,
.article-date.skeleton {
    height: 1.2ch;
    width: 100px;
}

.article-date.skeleton {
    width: 40px;
}

.cover-image.skeleton {
    height: 40vh;
    width: 100%;
    margin: 10px 0;
}

.body-text.skeleton {
    width: 100%;
    height: 1.7ch;
    margin: 10px 0;
}

@media screen and (max-width: 1200px) {

    .watch-outer {
        gap: 10px;
    }

    .watch-ui {
        width: 50%;
    }

    .row-article-video-icon {
        width: 80px;
        height: 80px;
        left: 40%;
        top: 40%;
    }

    .cluster-items-slider {
        overflow-x: auto;
        white-space: nowrap;
        max-width: fit-content;
        scrollbar-width: none;
        /* Hides scrollbar for Firefox */
        -ms-overflow-style: none;
        /* Hides scrollbar for IE/Edge */
    }

    .cluster-items-slider::-webkit-scrollbar {
        display: none;
    }

    .truncate-four-mobile,
    .truncate-two-mobile {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        line-clamp: 4;
        -webkit-line-clamp: 4;
        overflow: hidden;
        text-overflow: ellipsis;
        overflow-wrap: break-word;
    }

    .truncate-two-mobile {
        line-clamp: 2;
        -webkit-line-clamp: 2;
    }

    .article-meta-desc {
        margin: 5px 0;
    }

    .mute-text {
        display: none;
    }

}

@media screen and (max-width: 600px) {
    .watch-outer {
        display: block;
    }

    .watch-inner {
        width: 100%;
        max-width: unset;
    }

    .watch-ui {
        position: absolute;
        width: 100%;
    }

    .author-and-date {
        margin: 5px 0;
    }

    .genre-date-container {
        margin: 5px 0;
    }

    .comments-preview-wrapper {
        margin: 7px 0;
        padding: 4px 0;
    }

    .back-button {
        display: block;
    }

    .watch-modal-div {
        position: absolute;
        display: none;
        max-width: 100vw;
        width: 100%;
        height: 90%;
        top: auto;
        bottom: 0;
        border-top: 1px solid #777;
        border-radius: 15px 15px 0 0;
    }

    .watch-nav {
        align-self: center;
    }

    .watch-mute-nav.scroll-down .watch-nav {
        margin-left: 0;
    }

    .watch-mute-nav.scroll-down .mute-text {
        display: none;
    }

    .video-div .video {
        max-height: unset;
    }

    .play-pause-overlay {
        left: 50%;
    }

    .read-more {
        display: inline-block;
    }

    .title {
        font-size: 1.2rem;
    }

    .article-body img:not(.story-cluster-image):not(.profile-pic),
    .article-body iframe {
        margin-left: -16px;
        width: calc(100% + 16px);
    }

    .watch-body .cover-image {
        width: 100vw;
    }

    .truncate-four {
        max-height: 8.8em;
    }

    .watch-modal-header {
        flex-direction: row-reverse;
    }

    .close-modal {
        display: block;
    }

    .tooltip {
        display: none !important;
    }
}