/* Language visibility controlled by JS (plays nicely with responsive CSS) */
		.lang-hidden { display: none !important; }

	
        /* Jazykový přepínač vpravo nahoře */
        #lang-switcher {
            position: fixed;
            top: 10px;
            right: 10px;
            z-index: 2000;
            background: rgba(0, 0, 0, 0.6);
            padding: 6px 10px;
            border-radius: 8px;
        }

		/* Make language buttons shrink-wrap exactly around the flag */
		#lang-switcher .lang-flag {
			cursor: pointer;
			margin: 0 6px;

			/* kill the global button styling */
			background: transparent;
			border: 0;
			padding: 0;
			height: auto !important;
			min-height: 0 !important;
			line-height: 0 !important;
			font: inherit;

			display: inline-flex;
			align-items: center;
			justify-content: center;
		}

		/* size of the flag itself */
		#lang-switcher .lang-flag img {
			display: block;
			width: 22px;      /* adjust to taste */
			height: 14px;     /* or "auto" if your PNG already has correct ratio */
		}

		
	
        #lang-switcher .lang-flag.active {
            outline: 2px solid #ffffff;
            border-radius: 4px;
        }

        /* Zvýraznění social ikon */
        .contact .icons .icon {
            font-size: 2.2rem;
            margin-right: 0.4em;
        }

        /* Dlaždice pro projekty – 2x2+ grid */
        .project-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            grid-gap: 2rem;
        }

        .project-tile {
            background: rgba(255, 255, 255, 0.03);
            border-radius: 10px;
            padding: 1.5rem;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .project-tile h3 {
            margin-top: 0;
        }

        .language-note {
            font-style: italic;
            margin-top: 0.5rem;
        }

        /* Ikony v publikacích trochu větší / u sebe */
        .pub-social-icons .icon {
            font-size: 2rem;
            margin-right: 0.6rem;
        }
		
		/* Keep language switcher always visible above HTML5UP overlays */
		#lang-switcher{
		  display: flex !important;
		  align-items: center;
		  gap: 6px;
		  z-index: 100000 !important;      /* above sidebar/titlebar/overlays */
		  visibility: visible !important;
		  opacity: 1 !important;
		}

		/* In the “tablet” range the template’s title bar often occupies the top */
		@media screen and (max-width: 1280px) and (min-width: 737px){
		  #lang-switcher{
			top: 3.25em; /* move below title bar; tweak (3em–4em) if needed */
			backdrop-filter: blur(5px); /* Adds a modern frosted glass effect */
			-webkit-backdrop-filter: blur(5px);
		  }
		}

		/* 1280px: top menu mode — don’t wrap words like "O mně" / "Co mě baví" */
		@media screen and (max-width: 1280px){
		  #sidebar ul{
			display: flex !important;
			flex-wrap: wrap !important;     /* wrap whole tabs to next row if needed */
			gap: 0.5rem !important;
		  }

		  #sidebar ul li{
			flex: 0 0 auto !important;      /* tabs size to their text (not equal-width) */
		  }

		}

        @media screen and (max-width: 1280px){
		  #sidebar ul li a{
			display: inline-flex !important;
			align-items: center !important;
			line-height: 1.2 !important;
			padding: 0.6em 0.9em !important;   /* gives room for diacritics */
			text-indent: 0 !important;        /* some HTML5UP menus use indent tricks */
			white-space: nowrap !important;
			overflow: visible !important;
			height: auto !important;
		  }
		}

		/* Desktop sidebar: keep translated labels compact enough to match the Czech layout */
		@media screen and (min-width: 1281px) {
		  #sidebar {
			overflow-y: auto;
			-ms-overflow-style: none;
			scrollbar-width: none;
		  }

		  #sidebar::-webkit-scrollbar {
			width: 0;
			height: 0;
		  }

		  #sidebar nav > ul > li {
			margin-top: 1rem;
		  }

		  #sidebar nav a {
			font-size: 0.56em;
			letter-spacing: 0.18em;
			line-height: 1.35;
			padding: 0.95em 0;
		  }
		}

		/* 1280px: zafixuj i MENU vytvořené šablonou (často #navPanel / #titleBar) */
		@media screen and (max-width: 1280px) {
		  /* pokud šablona vytváří nav panel */
		  #navPanel nav ul {
			display: flex !important;
			flex-wrap: wrap !important;
			gap: 0.5rem !important;
		  }
		  #navPanel nav ul li { flex: 0 0 auto !important; }

		  #navPanel nav ul li a {
			display: inline-flex !important;
			align-items: center !important;
			white-space: nowrap !important;
			text-indent: 0 !important;
			padding: 0.6em 0.9em !important;
			height: auto !important;
			overflow: visible !important;
			line-height: 1.2 !important;
		  }

		/* pokud je nahoře title bar, nenech ho ořezávat text (NE na všechny potomky) */
		#titleBar {
		  overflow: visible !important;
		}

		#titleBar .toggle,
		#titleBar nav a {
		  white-space: nowrap !important;
		  text-overflow: clip !important;
		}

		}

		/* Narrow screens: stack action buttons vertically (no horizontal scrolling) */
		/*
		@media screen and (max-width: 736px) {
		  ul.actions {
			display: flex !important;
			flex-direction: column !important;
			align-items: stretch !important;
			gap: 0.6rem !important;
		  }

		  ul.actions li {
			width: 100% !important;
		  }

		  ul.actions li a.button,
		  ul.actions li span.button,
		  ul.actions li button.button {
			width: 100% !important;
			white-space: normal !important;   
			text-align: center !important;
		  }
		}
		*/

		/* Enable container queries on the main content area */
		#wrapper {
		  container-type: inline-size;
		}

		/* Default: actions are horizontal */
		ul.actions {
		  display: flex;
		  flex-direction: row;
		  flex-wrap: wrap;   /* allow wrapping instead of horizontal scroll */
		  gap: 0.6rem;
		}

		.pub-actions {
		  margin-top: 1rem;
		}

		/* When the container gets narrow, stack vertically */
		@container (max-width: 520px) {
		  ul.actions {
			flex-direction: column;
			align-items: stretch;
		  }
		  ul.actions li { width: 100%; }
		  ul.actions li a.button,
		  ul.actions li span.button,
		  ul.actions li button.button {
			width: 100%;
			white-space: normal;
			text-align: center;
		  }
		}


		/* Language switcher buttons: make <button> behave like the old <span> */
		#lang-switcher .lang-flag{
		  appearance: none;
		  -webkit-appearance: none;
		  background: transparent;
		  border: 0;
		  padding: 0;
		  margin: 0 6px;
		  line-height: 0;
		  font: inherit;
		  cursor: pointer;
		  display: inline-flex;
		  align-items: center;
		  justify-content: center;
		}

		/*
		#lang-switcher .lang-flag img{
		  display: block;
		  width: 22px;   // adjust if you want 
		  height: 14px;  // keep flag ratio 
		}
		*/

		@media print {
			/* Reset background to white for saving ink/toner */
			body, #wrapper, #sidebar, #footer, .project-tile { 
				background: #ffffff !important; 
				color: #000000 !important;
				box-shadow: none !important;
				border: none !important;
			}
			
			/* Hide navigation and interactive elements */
			#sidebar, #lang-switcher, .actions, #footer, .email-button { 
				display: none !important; 
			}
			
			/* Ensure text is dark and readable */
			h1, h2, h3, h4, h5, h6, strong, b {
				color: #000000 !important;
			}
			
			/* Show real links so printed paper is useful */
			a { 
				text-decoration: underline; 
				color: #000000 !important; 
			}
			a[href^="http"]:after {
				content: " (" attr(href) ")";
				font-size: 0.8em;
			}
			
			/* Adjust grid for paper width */
			.project-grid {
				display: block !important;
			}
			.project-tile {
				margin-bottom: 20px;
				border: 1px solid #ccc !important;
			}
		}

