/* YTLink: the few looks Tabler does not have. Colors come from Tabler's custom properties. */

.yt-logo {
	display: inline-flex; align-items: center; justify-content: center;
	width: 1.75rem; height: 1.75rem; border-radius: .5rem;
	background: var(--tblr-primary); color: #fff; flex: none;
}

/* Video cards */
.yt-card { overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.yt-card:hover { transform: translateY(-2px); box-shadow: var(--tblr-shadow-card-hover, 0 .5rem 1rem rgba(0,0,0,.1)); }
.yt-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--tblr-bg-surface-secondary); overflow: hidden; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.yt-card:hover .yt-thumb img { transform: scale(1.04); }
.yt-play {
	position: absolute; inset: 0; margin: auto; width: 3.25rem; height: 2.25rem; border-radius: .6rem;
	display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
	background: rgba(0, 0, 0, .65); color: #fff; opacity: 0; transition: opacity .15s ease, background .15s ease;
}
.yt-card:hover .yt-play, .yt-thumb:focus-visible .yt-play { opacity: 1; background: #e11d48; }
.yt-badge-watched {
	position: absolute; left: .5rem; bottom: .5rem; padding: .1rem .4rem; border-radius: .3rem;
	font-size: .75rem; background: rgba(0, 0, 0, .7); color: #fff;
}
.yt-watched .yt-thumb img { filter: saturate(.35) brightness(.85); }
.yt-title {
	font-weight: 600; line-height: 1.3; text-decoration: none;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em;
}
.yt-title:hover { color: var(--tblr-primary) !important; }
.yt-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.yt-prewrap { white-space: pre-wrap; }

/* Toggles: watched in green, favourite in yellow */
.yt-toggle-watched.yt-on, .yt-toggle-watched.yt-on:hover { color: var(--tblr-green); }
.yt-toggle-favorite.yt-on, .yt-toggle-favorite.yt-on:hover { color: var(--tblr-yellow); }
.js-toggle button[aria-busy="true"] { opacity: .5; pointer-events: none; }

/* Category cards: a mosaic of the newest thumbnails */
.yt-mosaic { display: grid; grid-template-columns: repeat(2, 1fr); aspect-ratio: 16 / 9; overflow: hidden; background: var(--tblr-bg-surface-secondary); }
.yt-mosaic img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.yt-mosaic img:only-child { grid-column: span 2; grid-row: span 2; }
.yt-mosaic img:first-child:nth-last-child(2), .yt-mosaic img:first-child:nth-last-child(2) ~ img { grid-row: span 2; aspect-ratio: auto; }
.yt-mosaic img:first-child:nth-last-child(3) { grid-row: span 2; aspect-ratio: auto; }
.yt-mosaic-empty { grid-column: span 2; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--tblr-secondary); }
.yt-newcat { border-style: dashed; background: transparent; min-height: 12rem; }
.yt-newcat:hover { border-color: var(--tblr-primary); color: var(--tblr-primary); }

/* Category colors in the sidebar */
.yt-cat .ti { color: var(--yt-c, inherit); }
.yt-cat-red { --yt-c: var(--tblr-red); } .yt-cat-orange { --yt-c: var(--tblr-orange); } .yt-cat-yellow { --yt-c: var(--tblr-yellow); }
.yt-cat-lime { --yt-c: var(--tblr-lime); } .yt-cat-green { --yt-c: var(--tblr-green); } .yt-cat-teal { --yt-c: var(--tblr-teal); }
.yt-cat-cyan { --yt-c: var(--tblr-cyan); } .yt-cat-blue { --yt-c: var(--tblr-blue); } .yt-cat-indigo { --yt-c: var(--tblr-indigo); }
.yt-cat-purple { --yt-c: var(--tblr-purple); } .yt-cat-pink { --yt-c: var(--tblr-pink); } .yt-cat-azure { --yt-c: var(--tblr-azure); }

.yt-player iframe { border: 0; border-radius: var(--tblr-card-border-radius) var(--tblr-card-border-radius) 0 0; }
.yt-quickadd { border-style: dashed; }

/* A link just added is picked out for a moment */
.yt-card:target { animation: yt-flash 2s ease; }
@keyframes yt-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--tblr-primary); } 100% { box-shadow: none; } }

@media (max-width: 575.98px) {
	.form-control, .form-select { font-size: 16px; } /* iPhones do not zoom in */
}

/* A favourite is a filled star: the outline icon, filled with color (no extra icon font needed). */
.yt-toggle-favorite.yt-on .ti-star::before { color: var(--tblr-yellow); text-shadow: 0 0 0 var(--tblr-yellow); }
.yt-toggle-favorite.yt-on { background: var(--tblr-yellow-lt); }

/* The welcome page has its heading in the card. */
.yt-no-page-header .page-header { display: none; }
.yt-no-page-header .page-body { margin-top: 2rem; }

/* The sidebar toggle sits close to the sidebar's edge, not 2rem away. */
@media (min-width: 992px) {
	.kit-shell-header { padding-left: .5rem; }
}
