/*
 * Zelda Cavern modern layer
 * Built by Kyle Bargman
 * Loaded AFTER the theme stylesheet (main/blue/green/purple.css) and only adds polish:
 * typography, rounded panels, shadows, transitions and a responsive layout.
 * Colors come from the active theme, so all four themes keep working.
 */

:root{
	--zc-radius: 14px;
	--zc-radius-sm: 7px;
	--zc-shadow: 0 10px 30px rgba(0,0,0,.45), 0 1px 0 rgba(255,255,255,.04) inset;
	--zc-line: rgba(0,0,0,.55);
	--zc-glass: rgba(255,255,255,.04);
}

html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }

body{
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, Geneva, sans-serif;
	font-size: 14px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img{ max-width:100%; height:auto; }
a{ transition: color .15s, background-color .15s, opacity .15s; }
a:hover{ text-decoration:none; opacity:.9; }

/* ---------- Header ---------- */
#top{ width:950px; }
[id^="logo"]{ filter: drop-shadow(0 8px 24px rgba(0,0,0,.5)); }

#topNavLeft, #topNavRight{
	border-radius: 10px;
	overflow: visible;
	box-shadow: 0 6px 18px rgba(0,0,0,.45);
}
/* No transform/filter on the icon <li>s: either one would become the positioning
   context for the dropdowns and shift the ones that use fixed left offsets (BotW/TotK). */
#topNavLeft li > a.dropbtn, #topNavRight li > a.dropbtn{ transition: background-color .15s; }
#topNavLeft li:hover > a.dropbtn, #topNavRight li:hover > a.dropbtn{ background-color: rgba(255,255,255,.12) !important; }

[class^="dropdown-content"]{
	border-radius: var(--zc-radius-sm);
	box-shadow: 0 14px 34px rgba(0,0,0,.6);
	overflow: hidden;
	z-index: 50;
	animation: zcFade .14s ease-out;   /* opacity-only so it can't shift position */
}
[class^="dropdown-content"] a{ padding:7px 12px !important; font-size:13px; }
@keyframes zcFade{ from{ opacity:0; } to{ opacity:1; } }

/* ---------- Sidebar ---------- */
#left{
	border-radius: var(--zc-radius);
	box-shadow: var(--zc-shadow);
	overflow: hidden;
	position: sticky;
	top: 12px;
}
#leftHead2{ border-radius: var(--zc-radius) var(--zc-radius) 0 0; }
#leftHead3{ border-radius: 0 0 var(--zc-radius) var(--zc-radius); }
#leftContent{ padding:8px 7px; }
.navSection{ letter-spacing:.06em; font-size:11px; }
ul.navButtons{ margin:6px 0 12px; }
.navButtons li{ border:0 !important; margin:2px 0; }
.navButtons a:link, .navButtons a:visited{
	border-radius: 6px;
	line-height: 1.35 !important;
	padding: 6px 8px !important;
	font-size: 12px;
	box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 1px 2px rgba(0,0,0,.4);
	transition: background-color .15s, transform .15s, padding .15s;
}
.navButtons a:hover{ transform: translateX(3px); }

/* ---------- Main content ---------- */
#newsflash img{ border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.5); }

#mainContent{
	border-radius: var(--zc-radius) !important;
	box-shadow: var(--zc-shadow);
	padding: 0 12px 18px !important;
	box-sizing: border-box;
	width: 785px !important;   /* same outer width as the original 771px + padding + border */
	font-size: 14px;
	line-height: 1.65;
}
#mainContent p{ margin: 0 0 .25em; }
#mainContent br + br{ line-height: .6; }

#bc1, #bcg, #bcs, #bc2, #breadcrumb, .newsMain{
	width: auto !important;
	margin-left: -12px !important;
	margin-right: -12px !important;
}
/* Built by Kyle Bargman: the title/breadcrumb/section bars are tiny repeating theme images
   (32px, 20px, 18px tall). Stretch them vertically to a fixed bar height and set the line-height
   to match, so text is centred in the bar in every color theme. */
#bc1{
	height: 42px !important;
	background-size: auto 100% !important;
	border-radius: var(--zc-radius) var(--zc-radius) 0 0;
}
#bct, #bc1 #bc-text{
	width: auto !important; margin-left: 0 !important;
	height: 42px !important; line-height: 42px !important;
	padding: 0 !important;
	font-size: 22px; font-weight: 600; letter-spacing: .01em;
	text-shadow: 0 2px 6px rgba(0,0,0,.5);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#bct #bc-text{ height:auto !important; line-height: inherit !important; padding: 0 !important; }
#bcg, #bc2{
	height: 28px !important;
	line-height: 28px !important;
	background-size: auto 100% !important;
	font-size: 13px;
	padding: 0 0 0 10px !important;
	margin-bottom: 12px !important;
	box-sizing: border-box;
}
#bcg #bc-text, #bc2 #bc-text{ height: auto !important; padding: 0 !important; line-height: inherit !important; }
#bcg img{ vertical-align: middle; }
#bcg + br{ display: none; }   /* the <br> after the breadcrumb showed up as an empty bar */
#bcg + br + #bcs, #bcg + #bcs{ margin-top: -12px !important; }   /* section bar right under the breadcrumb: no sliver */
#bcs{
	height: 30px !important;
	line-height: 26px !important;
	padding: 0 !important;
	background-size: auto 100% !important;
	box-sizing: border-box;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	font-size: 12px;
}
#bcs #bc-text{ height: auto !important; padding: 0 !important; line-height: inherit !important; }

/* News */
.newsMain:first-child{ border-radius: var(--zc-radius) var(--zc-radius) 0 0; }
.newsMeta{ width:auto !important; opacity:.8; }
.newsTitle{ font-family: inherit; font-size: 24px; letter-spacing: -.01em; }
.newsAvatar{ border-radius: 0 0 8px 0; overflow:hidden; }
.newsBody{ padding: 10px 6px 8px; }
.newsBody iframe, .newsBody video{ max-width:100%; border-radius:10px; }
.messageVideoContainer{ width:auto !important; }
.newsComments a{ padding:3px 10px; border-radius:999px; background: var(--zc-glass); }

/* Inline fixed widths used by older guide pages */
#mainContent [style*="width"]{ max-width:100%; }
#mainContent table{ max-width:100%; }
#mainContent pre{ white-space:pre-wrap; }

/* "Coming soon" placeholder */
.comingsoon h2{ font-size:26px; margin-bottom:6px; }
.comingsoon a{ text-decoration:underline; }

/* ---------- Staff page ---------- */
/* Built by Kyle Bargman: the original boxes are a fixed 125px tall for 11px text;
   let them grow with their content and lay them out as cards. */
#staff{
	text-align: left;
	height: auto !important;
	width: auto !important;
	max-width: 560px;
	display: grid;
	grid-template-columns: 110px 1fr;
	grid-template-areas: "avatar badge" "avatar info";
	column-gap: 18px;
	row-gap: 4px;
	padding: 14px 16px;
	border-radius: 12px;
	border-width: 1px !important;
	background: rgba(0,0,0,.18);
	box-shadow: 0 6px 18px rgba(0,0,0,.35);
	margin: 0 auto 4px !important;
}
#staff .pos, #staff .pos2{ grid-area: badge; justify-self: start; line-height: 0; }
#staff .pos img, #staff .pos2 img{ position: static !important; }
#staffavatar{
	grid-area: avatar;
	float: none !important;
	width: 110px !important; height: auto !important;
	padding: 0 !important;
	margin: 0 !important;
}
#staffavatar img{ width: 110px !important; height: 110px; object-fit: cover; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
#staffinfo{
	grid-area: info;
	float: none !important;
	width: auto !important; height: auto !important;
	top: 0 !important;
	font-size: 13px !important;
	line-height: 1.6;
	text-align: left !important;
	justify-self: start;
	margin: 0 !important;   /* main.css centers it with margin:0 auto */
}
@media (max-width: 520px){
	#staff{ grid-template-columns: 1fr; grid-template-areas: "badge" "avatar" "info"; }
	#staffavatar img{ width: 96px !important; height: 96px; }
}

/* ---------- Bottom spacing ---------- */
/* The old sticky-footer trick (negative wrapper margin + #push) lets the sidebar run into the footer. */
#wrapper{ margin-bottom: 0 !important; padding-bottom: 28px; }
#wrapper::after{ content: ""; display: table; clear: both; }
#push{ display: none !important; }
#footer{ margin-top: 0; }

/* ---------- Footer ---------- */
#footer{ border-top-width:1px; }
.footerText{ letter-spacing:.06em; }
#zcwidgets a img{ width:14px !important; height:14px !important; border-radius:50%; border:1px solid rgba(255,255,255,.5) !important; transition: transform .15s; vertical-align:middle; }
#zcwidgets a:hover img{ transform: scale(1.25); }

/* ---------- Responsive ---------- */
@media (max-width: 980px){
	#wrapper{ width:auto !important; padding: 10px 10px 0 !important; }
	#top{ width:auto !important; height:auto !important; }
	[id^="logo"]{
		width: 100% !important;
		max-width: 535px;
		height: auto !important;
		aspect-ratio: 535 / 378;
		background-size: contain;
		background-repeat: no-repeat;
		background-position: center;
	}
	#topNav{ position: static !important; margin: 6px 0 10px; }
	#topNavLeft, #topNavRight{
		position: static !important;
		width: auto !important;
		margin: 0 0 6px !important;
		float: none !important;
		display: block !important;
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch;
	}
	#topNavLeft ul, #topNavRight ul{ display:flex; width:max-content; margin:0 auto; }
	[class^="dropdown-content"]{ display:none !important; }   /* tapping an icon opens the game page */

	#left{ float:none !important; width:auto !important; margin:0 0 12px !important; position:static; }
	#leftContent ul.navButtons{ display:grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap:4px; }
	#leftContent ul.navButtons li{ margin:0; }

	#mainwrapper, [id="mainwrapper right"], #right{ width:auto !important; float:none !important; margin:0 !important; }
	#newsflash, #mainContent{ width:auto !important; float:none !important; }
	.newsTitle{ font-size:20px; height:auto; }
	.footerText{ padding: 6px 14px 0; display:inline-block; }
	#copyright{ height:auto; padding:4px 8px; line-height:1.5; }
	span#zcwidgets{ margin-right:0; display:block; }
	#mainContent [style*="float"]{ float:none !important; padding-left:0 !important; }
}
