/* Credits
 * PNG glow: Asif Mughal MIT license - https://codehim.com/html5-css3/css-image-glow-transparent-png/
 */

/* Info
 * All sponsor logos are converted to PNGs manually using a shellscript
 * provided
 */

:root {
	--topnav-active-color: hsla(0, 0%, 25%, 1.0);
	--color-primary: hsla(0, 0%, 12%, 1.0);
	--color-secondary: hsla(0, 0%, 15%, 1.0);
	--box-shadow-default-dark: 0px 3px 15px #111;
	--color-text-on-primary: #eee;
	--font-size-base: 1rem;
	--font-size-sidebar: 1.2rem;
	--font-clamp-max: 1.5rem;
	--text-shadow-default: 1px 1px black;
	--font-heading: Ubuntu, serif;
	--font-text: Lora, serif;
}

html {
	font-family: Lora, serif;
}

h1, h2, h3, h4, h5, h6 {
	font-family: Ubuntu, serif;
}

a:link {
	color: lightblue;
	background-color: transparent;
	text-decoration: none;
}

a:visited {
	color: mediumpurple;
	background-color: transparent;
	text-decoration: none;
}

a:active {
	color: red;
	background-color: transparent;
	text-decoration: underline;
}

.pop{
	text-shadow: var(--text-shadow-default);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	color: var(--color-text-on-primary);
}

body {
	position: relative;
	background-color: var(--color-primary);
	display: grid;
	min-height: 100vh;
	grid-auto-rows: max-content;
	grid-template-areas: 
	'topnav' 
	'header'
	'main';
}

#topnav {
	top: 0;
	position: relative;
	align-self: start;
	background-color: var(--color-primary);
	min-height: 100%;
	max-height: 50px;
	display: flex;
	flex-direction: row;
	justify-content: center;
}

#topnav img {
	width: 50px;
	height: auto;
	object-fit: contain;
}

#topnav a {
	font-family: var(--font-heading);
	color: var(--color-text-on-primary);
	font-size: var(--topnav-font-size);
	text-align: center;
	text-decoration: none;
	padding: 16px;
	flex: 1;
}

#topnav a.active {
	background-color: var(--topnav-active-color);
	color: white;
}

#topnav a:hover:not(.active) {
	background-color: var(--topnav-active-color);
	color: white;
}

header { /* logo */
  position: relative;
}

.carousel {
  position: relative;
  overflow: hidden;
  block-size: 80vh;
}

.carousel h1 {
  position: absolute;
  inset: 0;
  width: fit-content;
  height: fit-content;
  margin: auto;
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 3.5rem);
	text-shadow: 1.2px 1.2px black;
	color: white;
}

.carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-sizing: border-box;

  /* 27s (currently) shared timeline; visible in 0–33% window */
  animation-name: slideCycle;
  animation-duration: 27s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  opacity: 0;
}

/* Divide animation-duration of '.carousel img' by the total number of pictures in the carousel */
/* which gives you the step size for each image time slot */
.carousel img:nth-of-type(1) { animation-delay: 0s; }
.carousel img:nth-of-type(2) { animation-delay: 9s; }
.carousel img:nth-of-type(3) { animation-delay: 18s; }

/* Fast */

/* @keyframes slideCycle { */
/*   0%   { opacity: 0; } */
/*   5%   { opacity: 1; }   */
/*   33%  { opacity: 1; }   */
/*   38%  { opacity: 0; }   */
/*   100% { opacity: 0; } */
/* } */

/* slower */

@keyframes slideCycle {
  0%   { opacity: 0; }
  12%  { opacity: 1; }   
  33%  { opacity: 1; }   
  45%  { opacity: 0; }   
  100% { opacity: 0; }
}

/* even slower */

/* @keyframes slideCycle { */
/*   0%   { opacity: 0; } */
/*   20%  { opacity: 1; }    */
/*   33%  { opacity: 1; }    */
/*   55%  { opacity: 0; }    */
/*   100% { opacity: 0; } */
/* } */

.main-sponsor{
	position: absolute;
	width: 200px;
	inset: auto 7% 10% auto; /* top */ /* right */ /* bottom */ /* left */
}

/* subgrid */
main{
	grid-area: main;
	display: grid;
	grid-auto-columns: 1fr;
	padding: 35px;
	gap: 35px;
	grid-template-areas:
	'oppettider priser'
	'om-oss kontakta'
	'karta karta'
	'sponsorer sponsorer';
}

main > *{
	border-radius: 20px;
	background-color: var(--color-secondary);
	box-shadow: var(--box-shadow-default-dark);
}

.flex-container{
	display: flex;
	flex-wrap: wrap;
	place-content: space-evenly;
	min-height: 200px;
}

.flex-container > * {
	white-space: pre-line;
	min-width: min-content;
	text-align: center;
}

.flex-container p {
	text-align: initial;
	margin-inline: 50px;
}

.flex-container > .exclude {
	flex: 0 0 100%; /* {flex-grow} {flex-shrink} {flex-basis} */  /* force full row, not influenced by flex distribution */
}

.flex-container > .heading {
	text-align: center;
}

.span-across{
	grid-column: 1 / -1;
}

.span-three{
	grid-column: span 3;
}

.grid-container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Asif Mughal (accessed: 2025-08-18) MIT license - https://codehim.com/html5-css3/css-image-glow-transparent-png/ */

/* mainly for logo in the topnav */
.softshadowfilter {
	filter:
	/* drop-shadow(offset-x offset-y blur-radius color) */

	/* --- Sharp outline for readability --- */
	drop-shadow(-0.1px  0px 0px rgba(255, 255, 255, 0.75)) /* left   */
	drop-shadow( 0.1px  0px 0px rgba(255, 255, 255, 0.75)) /* right  */
	drop-shadow( 0px -0.1px 0px rgba(255, 255, 255, 0.75)) /* top    */
	drop-shadow( 0px  0.1px 0px rgba(255, 255, 255, 0.75)) /* bottom */

	/* --- Soft blur glow around the element --- */
	drop-shadow(0px 0px 9px rgba(100, 100, 100, 0.4))
	drop-shadow(0px 0px 9px rgba(100, 100, 100, 0.4));
}

/* .shadowfilter, #sponsorer figure img { */
.shadowfilter {
	filter:
	/* drop-shadow(offset-x offset-y blur-radius color) */

	/* --- Sharp outline for readability --- */
	drop-shadow(-0.1px  0px 0px rgba(255, 255, 255, 0.55)) /* left   */
	drop-shadow( 0.1px  0px 0px rgba(255, 255, 255, 0.55)) /* right  */
	drop-shadow( 0px -0.1px 0px rgba(255, 255, 255, 0.55)) /* top    */
	drop-shadow( 0px  0.1px 0px rgba(255, 255, 255, 0.55)) /* bottom */

	/* --- Soft blur glow around the element --- */
	/* drop-shadow(0px 0px 9px rgba(100, 100, 100, 0.4)) */
	/* drop-shadow(0px 0px 9px rgba(100, 100, 100, 0.4)); */
}

.blackshadowfilter {
	filter:
	/* drop-shadow(offset-x offset-y blur-radius color) */

	/* --- Sharp outline for readability --- */
	drop-shadow(-0.1px  0px 0px rgba(0, 0, 0, 0.55)) /* left   */
	drop-shadow( 0.1px  0px 0px rgba(0, 0, 0, 0.55)) /* right  */
	drop-shadow( 0px -0.1px 0px rgba(0, 0, 0, 0.55)) /* top    */
	drop-shadow( 0px  0.1px 0px rgba(0, 0, 0, 0.55)) /* bottom */

	/* --- Soft blur glow around the element --- */
	drop-shadow(0px 0px 9px rgba(0, 0, 0, 0.4))
	drop-shadow(0px 0px 9px rgba(0, 0, 0, 0.4));
}

#sponsorer a {
	color: var(--color-text-on-primary);
	font-size: var(--sidebar-font-size);
	text-decoration: none;
}

#sponsorer > h1 {
	text-align: center;
	color: var(--color-text-on-primary);
	text-shadow: var(--text-shadow);
}

#sponsorer figure {
	background-color: var(--primary-color);
	text-align: center;
	column-gap: 2vw;
	display: flex;
	flex-wrap: wrap;
}

#sponsorer figure > div {
	background-color: var(--primary-color);
	text-align: center;
	column-gap: 2vw;
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	justify-content: space-between;
	align-items: center;
	padding: 0px 30px;
}

#sponsorer figure > div * {
	margin: 0px auto;
}

#sponsorer figure > div > img > a > img {
	display: block;
}

#sponsorer figure figcaption {
	background-color: var(--primary-color);
	color: var(--color-text-on-primary);
	text-shadow: var(--text-shadow);
	flex-basis: 100%;
}

@media (max-width: 600px) {
	main {
		font-size: 0.8rem;
	}
	.main-sponsor{
		inset: auto 30% 10% 30%; /* top */ /* right */ /* bottom */ /* left */
	}
}

@media (max-width: 1000px) {
	main{
		padding: 30px;
		gap: 30px;
		grid-template-areas:
		'priser'
		'oppettider'
		'om-oss'
		'kontakta'
		'karta'
		'sponsorer';
	}
}

@media (min-width: 2000px) {
	main{
		grid-template-areas:
		'oppettider priser kontakta om-oss'
		'karta karta karta karta'
		'sponsorer sponsorer sponsorer sponsorer';
	}
}

/*
@media (min-width: 2000px) {
	main{
		font-size: 1.6rem;
		grid-template-areas:
		'oppettider priser kontakta'
		'om-oss projekt projekt'
		'karta karta karta'
		'sponsorer sponsorer sponsorer';
	}
}
*/
