/* Styles for the pages in the /videos/ folder. The colors come from the site's journal.css. */

.videoGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px 20px;
    margin-bottom: 28px;
}

/* The newest videos on the site's home page: three to a row, fewer on small screens. */
.homeVideos .videoGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; margin-bottom: 16px; }
@media (max-width: 640px) { .homeVideos .videoGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px) { .homeVideos .videoGrid { grid-template-columns: minmax(0, 1fr); } }

/* Manage Videos: keep the table inside the page, with Edit above Delete. */
.manageVideosTable img { width: 96px; max-width: none; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.manageVideosTable td { vertical-align: top; }
.manageVideosTable .manageAdded small { white-space: nowrap; }
.manageVideosTable .rowActions { text-align: center; }
.manageVideosTable .rowActions form { display: block; margin: 8px 0 0; }

.videoCard { min-width: 0; }

.videoThumb { display: block; }

.videoThumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
    background: var(--paper-deep);
}

.videoThumb:hover img,
.videoThumb:focus img { outline: 2px solid var(--accent); outline-offset: 2px; }

.videoCard h3 {
    margin: 10px 0 4px;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.videoCard h3 a { color: var(--ink); text-decoration: none; }
.videoCard h3 a:hover,
.videoCard h3 a:focus { color: var(--accent); text-decoration: underline; }

.videoMeta {
    margin: 0;
    color: var(--ink-soft);
    font-family: var(--sans);
    font-size: 14px;
    overflow-wrap: anywhere;
}

/* The player keeps a 16:9 shape at any width. */
.videoPlayer {
    aspect-ratio: 16 / 9;
    margin-bottom: 18px;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.videoPlayer iframe { display: block; width: 100%; height: 100%; border: 0; }

.videoTitle { margin: 0 0 6px; overflow-wrap: anywhere; }

.videoDescription {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--paper-deep);
    overflow-wrap: anywhere;
}

article > .videoDescription + .pageButtons { margin-top: 18px; }

/* The category links on the Videos page. */
.videoCategories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 24px;
    font-family: var(--sans);
    font-size: 14px;
}

.videoCategories a,
.videoCategories strong {
    padding: 4px 12px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    font-weight: 400;
    text-decoration: none;
}

.videoCategories a { color: var(--ink); }
.videoCategories a:hover,
.videoCategories a:focus { border-color: var(--accent); color: var(--accent); }
.videoCategories strong { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* The like and subscribe buttons. */
.videoActions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 14px 0 20px;
}
.videoLike, .videoSubscribe { font-family: var(--sans); font-size: 15px; }
.videoLike form, form.videoSubscribe { margin: 0; }
.videoLike button, .videoSubscribe button { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.videoLike button[aria-pressed="true"], .videoSubscribe button[aria-pressed="true"] { background: var(--accent); color: var(--paper); }
.videoLike button:disabled, .videoSubscribe button:disabled { opacity: .7; }

.videoReportLink { font-family: var(--sans); font-size: 14px; }

/* A video in the main site search's results. */
.videoSearchResult { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.videoSearchResult > .videoThumb { flex: 0 0 200px; max-width: 100%; }
.videoSearchResult > div { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.videoSearchResult h3 { margin: 0 0 4px; }

/* The agreement tick box on Add a Video. */
.videoAgree { display: flex; align-items: flex-start; gap: 8px; }
.videoAgree input { flex: none; width: auto; margin-top: 4px; }
.videoAgree label { margin: 0; font-weight: 400; }

/* Save to Playlist on the watch page. */
.videoSavePlaylist {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 20px;
    font-family: var(--sans);
    font-size: 15px;
}
.playlistForm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.playlistForm label { margin: 0; }
.playlistForm select { max-width: 220px; }
.playlistStatus { color: var(--ink-soft); }

/* The Remove buttons under videos on My Playlists and Watch History. */
.videoCardAction { margin: 8px 0 0; }
.videoCardAction button { padding: 4px 12px; font-size: 14px; background: transparent; color: var(--accent); border: 1px solid var(--accent); }

/* The list of channels on My Subscriptions. */
.channelList { list-style: none; margin: 0 0 28px; padding: 0; }
.channelList li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    padding: 10px 0;
    border-top: 1px solid var(--rule);
    overflow-wrap: anywhere;
}

/* Comments. */
.videoComments { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--rule); }
.videoComment { padding: 14px 0; border-top: 1px solid var(--rule); }
.videoCommentText { margin-top: 6px; overflow-wrap: anywhere; }
.videoTrap { position: absolute; left: -10000px; }

/* The "More Videos" list in the sidebar. */
.moreVideos .videoCard + .videoCard { margin-top: 16px; }
.moreVideos .videoCard h3 { font-size: 15px; }
