<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>{{.Data.Name}} {{if not .Data.First_air_date.IsZero}}({{.Data.GetYears}}){{end}} — a·muse</title>
		<link rel="stylesheet" href="/static/style/style.css" />
		<link rel="icon" type="image/svg+xml" href="/static/img/logo.svg">
		<link rel="apple-touch-icon" type="image/svg+xml" href="/static/img/logo.svg">
	</head>
	<body>
		<header class="w12 padding-bottom-_25 flex flex-row flex-justify-space flex-align-centre bg-primary">
			<a href="/" class="decoration-none">
				<h1 class="inline valign-mid text-white sans margin-lr-1">a·muse</h1>
			</a>
			<form action="/items/" method="get" class="flex inline margin-lr-1 border-bottom-white">
				<input type="search" name="q" class="phone-max-width-8 border-none bg-none sans text-white" placeholder="{{.Strings.Global.search}}" />
			</form>
			<div class="margin-lr-1 text-white">
				{{ if .State.User.IsEmpty }}
				<a href="/login" class="decoration-none sans">{{.Strings.Global.log_in}}</a>
				—
				<a href="/signup" class="decoration-none sans">{{.Strings.Global.sign_up}}</a>
				{{ else }}
				<nav class="text">
					<label for="hamburger" class="cursor-hand">
						<img src="/users/{{.State.User.Username}}/avatar?size=small" class="border-radius-25 width-1_5"/>
					</label>
					<input type="checkbox" id="hamburger" class="display-none" />
					<ul class="absolute right top-1 padding-lr-1 padding-tb-_5 bg align-right list-style-none sans">
						<!--<li><a href="/users/{{.State.User.Username}}" class="decoration-none text-accent">{{.Strings.Global.account}}</a><span class="material-icon padding-lr-_5">&#xe851;</span></li>-->
						<li><a href="/users/{{.State.User.Username}}/watchlist" class="decoration-none text-accent">{{.Strings.Global.watchlist}}</a><span class="material-icon padding-lr-_5">&#xe04a;</span></li>
						<li><a href="/users/{{.State.User.Username}}/tvqueue" class="decoration-none text-accent">{{.Strings.Global.tv_queue}}</a><span class="material-icon padding-lr-_5">&#xe1b2;</span></li>
						<li><a href="/users/{{.State.User.Username}}/readlist" class="decoration-none text-accent">{{.Strings.Global.readlist}}</a><span class="material-icon padding-lr-_5">&#xe431;</span></li>
						<li><a href="/users/{{.State.User.Username}}/experiences" class="decoration-none text-accent">{{.Strings.Global.experiences}}</a><span class="material-icon padding-lr-_5">&#xe042;</span></li>
						<li class="bg-error">
							<form action="/users/{{.State.User.Username}}/sessions/{{.State.User.Session}}" method="POST" class="inline">
								<input type="hidden" value="DELETE" name="method" />
								<input type="submit" value="{{.Strings.Global.log_out}}" class="border-none bg-none font-normal text-accent padding-lr-0 cursor-hand font-1" />
							</form><span class="material-icon padding-lr-_5 text-white">&#xe7ff;</span>
						</li>
					</ul>
				</nav>
				{{ end }}
			</div>
		</header>
		<div class="absolute top behind w12">
			{{if .Data.Backdrop_path}}
			<img src="https://image.tmdb.org/t/p/original{{.Data.Backdrop_path}}" class="w12 cover height-30" />
			{{else}}
			<img src="/static/img/serie_backdrop.webp" class="w12 cover height-30" /><!-- Photo by [Image Catalog](https://www.flickr.com/photos/image-catalog/) from [Flickr](https://www.flickr.com/photos/132795455@N08/21741652275/) -->
			{{end}}
			<div class="on-desktop relative bottom-4 sans inline-block w12 padding-l-16 font-3 bg-gradient border-box">
				<span class="text-white">{{.Data.Name}}</span>
				{{if not .Data.First_air_date.IsZero}}
				<span class="text-unimportant font-thin font-2">({{.Data.GetYears}})</span>
				{{end}}
			</div>
			{{if and .State.User .Data.IsOnWantList}}
			<div style="width: {{.Data.Progress}}%;" class="relative bottom-4 phone-bottom-_4 height-_25 bg-accent">
			{{end}}
			</div>
		</div>
		<main class="margin-top-20 margin-lr-5 flex flex-row flex-wrap flex-justify-space flex-align-start">
			<div class="desktop-w3 phone-w12 margin-bottom-2">
				{{if .Data.Poster_path}}
				<img src="https://image.tmdb.org/t/p/w154{{.Data.Poster_path}}" class="block min-height-231px width-154px">
				{{else}}
				<img src="/static/img/tv_empty.webp" class="block min-height-231px width-154px" />
				{{end}}
				<div class="on-phone">
					<span class="sans font-3">{{.Data.Name}}</span>
					{{if not .Data.First_air_date.IsZero}}
					<span class="sans text-unimportant font-thin font-2">({{.Data.GetYears}})</span>
					{{end}}
				</div>
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe8d0;</span> {{$.Strings.Serie.rating}}</p>
				{{if eq .Data.Vote_count 0}}
				<p class="margin-lr-1 sans margin-tb-_5">{{$.Strings.Serie.no_rating}}</p>
				{{else}}
				<p class="margin-lr-1 sans margin-tb-_5">{{.Data.Vote_average}}/10 ({{$.Strings.Serie.votes}}: {{.Data.Vote_count}})</p>
				{{end}}
				{{if .Data.Genres}}
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe43a;</span> {{$.Strings.Serie.genre}}</p>
				<p class="margin-lr-1 sans margin-tb-_5">{{range .Data.Genres}} {{.Name}}<br/> {{end}}</span></p>
				{{end}}
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe923;</span> {{$.Strings.Serie.status}}</p>
				<p class="margin-lr-1 sans margin-tb-_5">{{.Data.Status}}</p>
				{{ if .Data.BasedOn.Title }}
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe865;</span> {{.Strings.Serie.based_on}}</p>
				<p class="margin-lr-1 sans margin-tb-_5"><a href="{{.Data.BasedOn.Uri}}">{{.Data.BasedOn.Title}}</a></p>
				{{ end }}
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe157;</span> {{$.Strings.Serie.source}}</p>
				<p class="margin-lr-1 sans margin-tb-_5"><a href="{{.Data.Source}}">TheMovieDB</a></p>
				{{if and .State.User .Data.IsOnWantList}}
				<p class="sans text-grey margin-top-1 margin-bottom-_5"><span class="material-icon">&#xe04a;</span> {{$.Strings.Serie.watched}}</p>
				<p class="margin-lr-1 sans margin-tb-_5">{{.Strings.Serie.episodes}}: {{.Data.WatchedEpisodes}}/{{.Data.AllEpisodes}}</p>
				<p class="margin-lr-1 sans margin-tb-_5">({{.Strings.Serie.skipped}}: {{.Data.SkippedEpisodes}})</p>
				<form action="/users/{{.State.User.Username}}/watchlist/tvserie:{{.Data.Id}}" method="POST">
					<input type="hidden" name="method" value="DELETE" />
					<button type="submit" class="border-text sans margin-lr-1 hover-bg-grey padding-tb-_25 cursor-hand text"><span class="padding-lr-_5 material-icon">&#xe16c;</span><span class="sans padding-lr-_5">{{.Strings.Serie.remove_want}}</span></button>
				</form>
				{{end}}
			</div>
			<div class="desktop-w6 phone-w12 margin-top-10 padding-lr-2 margin-bottom-2">
				<div class="flex flex-row flex-wrap flex-justify-space flex-align-start">
					<div class="flex-force-50">
						{{if .Data.Last_episode_to_air.Name}}
						<span class="sans font-1_5">{{.Strings.Serie.latest_episode}}</span>
						<div class="flex margin-tb-1">
							<div class="margin-lr-1">
								{{if .Data.Last_episode_to_air.Still_path}}
								<img src="https://image.tmdb.org/t/p/w185{{.Data.Last_episode_to_air.Still_path}}" decoding="async" loading="lazy" class="min-height-104px width-185px {{if .Data.Last_episode_to_air.ContainsSpoilers}}spoiler{{end}}"/>
								{{else}}
								<img src="/static/img/still_empty.webp" decoding="async" loading="lazy" class="min-height-104px width-185px"/> <!-- Photo by [Mahdi Leader](https://www.pexels.com/@mahdi-leader-415984) from [Pexels](https://www.pexels.com/photo/walpaper-firewatch-1090640) -->
								{{end}}
							</div>
							<div>
								<p class="sans text-grey margin-tb-0">{{.Data.Last_episode_to_air.Episode_code}}</p>
								<p class="sans margin-bottom-_5 margin-top-0 {{if .Data.Last_episode_to_air.ContainsSpoilers}}spoiler{{end}}">{{.Data.Last_episode_to_air.Name}}</p>
								<p class="sans margin-tb-_5 text-grey">{{.Data.Last_episode_to_air.Air_date_str}}</p>
								<p class="font-_875 clamp {{if .Data.Last_episode_to_air.ContainsSpoilers}}spoiler{{end}}">{{.Data.Last_episode_to_air.Overview}}</p>
							</div>
						</div>
						{{end}}
					</div>
					<div class="flex-force-50">
						{{if and (not .State.User.IsEmpty) .Data.IsOnWantList}}
						{{if .Data.Next_episode_to_watch.Episode_code}}
						<span class="sans font-1_5">{{.Strings.Serie.next_episode}}</span>
						<div class="flex margin-tb-1">
							<div class="margin-lr-1">
								{{if .Data.Next_episode_to_watch.Still_path}}
								<img src="https://image.tmdb.org/t/p/w185{{.Data.Next_episode_to_watch.Still_path}}" decoding="async" loading="lazy" class="min-height-104px width-185px"/>
								{{else}}
								<img src="/static/img/still_empty.webp" decoding="async" loading="lazy" class="min-height-104px width-185px"/> <!-- Photo by [Mahdi Leader](https://www.pexels.com/@mahdi-leader-415984) from [Pexels](https://www.pexels.com/photo/walpaper-firewatch-1090640) -->
								{{end}}
							</div>
							<div>
								<div class="flex flex-row flex-justify-space flex-align-start">
									<div>
										<p class="sans text-grey margin-tb-0">{{.Data.Next_episode_to_watch.Episode_code}}</p>
										<p class="sans margin-bottom-_5 margin-top-0">{{.Data.Next_episode_to_watch.Name}}</p>
										<p class="sans margin-tb-_5 text-grey">{{.Data.Next_episode_to_watch.Air_date_str}}</p>
									</div>
									<div class="flex flex-row">
										{{if and (not $.State.User.IsEmpty) $.Data.IsOnWantList}}
										<form action="/users/{{$.State.User.Username}}/experiences/" method="POST">
											<input type="hidden" name="itemId" value="{{$.Data.Id}}/{{.Data.Next_episode_to_watch.Episode_code}}" />
											<input type="hidden" name="itemType" value="tvserie" />
											<input type="hidden" name="experiencedDate" value="0001-01-01"/>
											<input type="hidden" name="experiencedTime" value="00:00"/>
											<input type="checkbox" class="display-none" name="isOtherTime" value="true" checked />
											<button type="submit" class="border-text hover-bg-grey cursor-hand text font-1_5"><span class="material-icon">&#xe044;</span></button>
										</form>
										<form action="/users/{{$.State.User.Username}}/experiences/" method="POST">
											<input type="hidden" name="itemId" value="{{$.Data.Id}}/{{.Data.Next_episode_to_watch.Episode_code}}" />
											<input type="hidden" name="itemType" value="tvserie" />
											<button type="submit" class="border-text hover-bg-dark-accent cursor-hand text-black font-1_5"><span class="material-icon">&#xe037;</span></button>
										</form>
										{{end}}
									</div>
								</div>
								<p class="font-_875 clamp">{{.Data.Next_episode_to_watch.Overview}}</p>
							</div>
						</div>
						{{end}}
						{{end}}
						{{if and (not .State.User.IsEmpty) (not .Data.IsOnWantList)}}
						<form action="/users/{{.State.User.Username}}/tvqueue/" method="POST" class="margin-tb-_5 margin-lr-1">
							<input type="hidden" name="itemId" value="{{.Data.Id}}" />
							<input type="hidden" name="itemType" value="tvserie" />
							<button type="submit" class="border-text hover-bg-grey padding-tb-_25 cursor-hand text font-2"><span class="padding-lr-_5 material-icon font-2">&#xe03b;</span><span class="sans padding-lr-_5">{{.Strings.Serie.want_watch}}</span></button>
						</form>
						{{end}}
					</div>
				</div>
				<p class="serif justify hyphenate">{{.Data.Overview}}</p>
				<hr class="material-icon text-grey hr-tv" />
				{{range .Data.Seasons}}
				<details>
					<summary class="cursor-hand sans">{{$.Strings.Serie.season}} {{.Season_number}}</summary>
					{{if not .Episodes}}
					<p class="sans indent-2 margin-top-1">{{$.Strings.Serie.no_episodes}}</p>
					{{end}}
					{{if and (not $.State.User.IsEmpty) $.Data.IsOnWantList}}
					{{if eq .Season_number 0}}
					<form action="/users/{{$.State.User.Username}}/experiences/" method="POST" class="flex flex-centre">
						<input type="hidden" name="itemId" value="{{$.Data.Id}}/S00A{{len .Episodes}}" />
						<input type="hidden" name="itemType" value="tvserie" />
						<input type="hidden" name="experiencedDate" value="0001-01-01"/>
						<input type="hidden" name="experiencedTime" value="00:00"/>
						<input type="checkbox" class="display-none" name="isOtherTime" value="true" checked />
						<button type="submit" class="border-text hover-bg-grey padding-tb-_25 cursor-hand text font-1_5"><span class="padding-lr-_5 material-icon font-1_5">&#xe044;</span><span class="sans padding-lr-_5">{{$.Strings.Serie.skip_specials}}</span></button>
					</form>
					{{else}}
					<form action="/users/{{$.State.User.Username}}/experiences/" method="POST" class="flex flex-centre">
						<input type="hidden" name="itemId" value="{{$.Data.Id}}/S{{.Season_number_string}}A{{len .Episodes}}" />
						<input type="hidden" name="itemType" value="tvserie" />
						<input type="hidden" name="experiencedDate" value="0001-01-01"/>
						<input type="hidden" name="experiencedTime" value="00:00"/>
						<input type="checkbox" class="display-none" name="isOtherTime" value="true"/>
						<button type="submit" class="border-text hover-bg-dark-accent cursor-hand text-black font-1_5"><span class="padding-lr-_5 material-icon font-1_5">&#xe01f;</span><span class="sans padding-lr-_5">{{$.Strings.Serie.watched_whole_season}}</span></button>
					</form>
					{{end}}
					{{end}}
					{{range .Episodes}}
					<div class="flex margin-tb-1">
						<div class="margin-lr-1">
							{{if .Still_path}}
							<img src="https://image.tmdb.org/t/p/w185{{.Still_path}}" decoding="async" loading="lazy" class="min-height-104px width-185px {{if .ContainsSpoilers}}spoiler{{end}}"/>
							{{else}}
							<img src="/static/img/still_empty.webp" decoding="async" loading="lazy" class="min-height-104px width-185px"/> <!-- Photo by [Mahdi Leader](https://www.pexels.com/@mahdi-leader-415984) from [Pexels](https://www.pexels.com/photo/walpaper-firewatch-1090640) -->
							{{end}}
						</div>
						<div class="w12">
							<div class="flex flex-row flex-justify-space flex-align-start">
								<div>
									<p class="sans text-grey margin-tb-0">{{.Episode_code}}</p>
									<p class="sans margin-bottom-_5 margin-top-0 {{if .ContainsSpoilers}}spoiler{{end}}">{{.Name}}</p>
									<p class="sans margin-tb-_5 text-grey">{{.Air_date_str}}</p>
									{{if .IsWatched}}
									<p class="sans margin-tb-_5 text-grey">{{$.Strings.Serie.watched}} {{.GetLastExperience $.Strings $.State.User.Timezone}}</p>
									{{end}}
								</div>
								<div class="flex flex-row">
									{{if and (not $.State.User.IsEmpty) $.Data.IsOnWantList}}
									{{if eq (len .Experiences) 0}}
									<form action="/users/{{$.State.User.Username}}/experiences/" method="POST">
										<input type="hidden" name="itemId" value="{{$.Data.Id}}/{{.Episode_code}}" />
										<input type="hidden" name="itemType" value="tvserie" />
										<input type="hidden" name="experiencedDate" value="0001-01-01"/>
										<input type="hidden" name="experiencedTime" value="00:00"/>
										<input type="checkbox" class="display-none" name="isOtherTime" value="true" checked />
										<button type="submit" class="border-text hover-bg-grey cursor-hand text font-2"><span class="material-icon font-2">&#xe044;</span></button>
									</form>
									{{end}}
									<form action="/users/{{$.State.User.Username}}/experiences/" method="POST">
										<input type="hidden" name="itemId" value="{{$.Data.Id}}/{{.Episode_code}}" />
										<input type="hidden" name="itemType" value="tvserie" />
										<button type="submit" class="border-text hover-bg-dark-accent cursor-hand text-black font-2">
											{{if .IsWatched}}
											<span class="material-icon font-2">&#xe042;</span>
											{{else}}
											<span class="material-icon font-2">&#xe037;</span>
											{{end}}
										</button><label for="experienced-datetime-check-{{.Episode_code}}" class="cursor-hand bg-accent inline-block font-2 relative top-m_05 height-2_8 text-black">
											<span class="material-icon">&#xe5cf;</span>
										</label>
										<input type="checkbox" id="experienced-datetime-check-{{.Episode_code}}" class="display-none experienced-datetime-check" name="isOtherTime" value="true"/>
										<div class="experienced-box-flex absolute moveX-m50" id="experienced-box-{{.Episode_code}}">
											<input type="date" name="experiencedDate" class="margin-lr-_5 margin-tb-_5 text bg border-text" placeholder="YYYY-mm-dd"/>
											<input type="time" name="experiencedTime" class="margin-lr-_5 margin-tb-_5 text bg border-text" placeholder="HH:MM" />
										</div>
									</form>
									{{end}}
								</div>
							</div>
							<p class="font-_875 {{if .ContainsSpoilers}}spoiler{{end}}">{{.Overview}}</p>
						</div>
					</div>
					{{end}}
				</details>
				{{end}}
			</div>
			<div class="desktop-w3 phone-w12 margin-top-10 flex phone-flex-flow margin-bottom-2">
				<details class="min-width-13_5 margin-lr-1 flex-force-40">
					<summary class="cursor-hand">
						<span class="material-icon font-1_5">&#xe7fb;</span> <span class="sans font-1_5">{{.Strings.Serie.cast}}</span>
					</summary>
					<div>
						{{if not .Data.Credits.Cast}}
						<p class="sans indent-2 margin-top-1">{{.Strings.Serie.empty_payroll}}</p>
						{{end}}
						{{range .Data.Credits.Cast}}
						<a href="/persons/{{.Id}}" class="decoration-none no-outline inline-block margin-tb-1">
							<div class="flex">
								<div>
									{{if .Profile_path}}
									<img src="https://image.tmdb.org/t/p/w92{{.Profile_path}}" class="min-height-139px width-92px" decoding="async" loading="lazy" />
									{{else}}
									<img src="/static/img/person_empty.webp" class="min-height-139px width-92px" decoding="async" loading="lazy" />
									{{end}}
								</div>
								<div class="margin-lr-1">
									<p class="sans text">{{.Character}}</p>
									<p class="sans font-_875">{{.Name}}</p>
								</div>
							</div>
						</a>
						{{end}}
					</div>
				</details>
				<details class="min-width-13_5 margin-lr-1 flex-force-40">
					<summary class="cursor-hand">
						<span class="material-icon font-1_5">&#xe7fc;</span> <span class="sans font-1_5">{{.Strings.Serie.crew}}</span>
					</summary>
					<div>
						{{if not .Data.Credits.Crew}}
						<p class="sans indent-2 margin-top-1">{{.Strings.Serie.empty_payroll}}</p>
						{{end}}
						{{range .Data.Credits.Crew}}
						<a href="/persons/{{.Id}}" class="decoration-none no-outline inline-block margin-tb-1">
							<div class="flex">
								<div>
									{{if .Profile_path}}
									<img src="https://image.tmdb.org/t/p/w92{{.Profile_path}}" class="min-height-139px width-92px" decoding="async" loading="lazy" />
									{{else}}
									<img src="/static/img/person_empty.webp" class="min-height-139px width-92px" decoding="async" loading="lazy" />
									{{end}}
								</div>
								<div class="margin-lr-1">
									<p class="sans text">{{.Job}}</p>
									<p class="sans font-_875">{{.Name}}</p>
								</div>
							</div>
						</a>
						{{end}}
					</div>
				</details>
			</div>
		</main>
	</body>
</html>
