/*
Urban Boulder Race CMS
Based on WordPress theme "First" by Takao Utsumi
Adapted for Django/Wagtail
*/

/* TABLE OF CONTENTS
------------------------------------------------------------
* Global
* Typography
* Layout
* Navigation
* Content
* Blog
* Gallery
* Footer
------------------------------------------------------------ */

/* Global - Root
------------------------------------------------------------ */
html {
	font-size: 90%;
	height: 100%;
}
@media screen and (min-width: 783px) {
	html {
		font-size: 100%;
	}
}

/* Base */
body {
	color: #333;
	font-family: 'Source Sans Pro', sans-serif;
	font-size: 17px;
	line-height: 1.5;
	word-wrap: break-word;
	background-color: #f8f8f8;
	min-height: 100%;
	display: flex;
	flex-direction: column;
}

::selection {
	background-color: #fffad3;
	color: #333;
}

::-moz-selection {
	background-color: #fffad3;
	color: #333;
}

@media screen and (min-width: 783px) {
	body {
		font-size: 18px;
	}
}

/* Typography - Headings
------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
	clear: both;
	color: #111;
	font-family: 'Source Sans Pro', sans-serif;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.4;
}

h1 {
	font-size: 36px;
	font-size: 2.25rem;
	margin-bottom: 1em;
	margin-top: 2em;
}

h2 {
	font-size: 28px;
	font-size: 1.75rem;
	margin-bottom: 1em;
	margin-top: 2em;
}

h3 {
	font-size: 24px;
	font-size: 1.5rem;
	margin-bottom: 1em;
	margin-top: 1.5em;
}

h4 {
	font-size: 20px;
	font-size: 1.25rem;
	margin-bottom: 1em;
	margin-top: 1.5em;
}

h5 {
	font-size: 18px;
	font-size: 1.125rem;
	margin-bottom: 0.5em;
	margin-top: 1em;
}

h6 {
	font-size: 17px;
	font-size: 1.063rem;
	margin-bottom: 0.5em;
	margin-top: 1em;
}

/* Links */
a {
	color: inherit;
	text-decoration: none;
	transition: background-color .2s ease-in-out, border-color .2s ease-in-out, color .2s ease-in-out, opacity .2s ease-in-out;
}

.entry-content a,
.page-content a,
.comment-content a {
	color: #3872b8;
	text-decoration: underline;
}

a:hover {
	color: #5687c3;
}

/* Text Elements */
p {
	margin: 0 0 1.5em;
}

b, strong {
	font-weight: 700;
}

dfn, q, cite, em, i {
	font-style: italic;
}

del {
	color: #6c757d;
	text-decoration: line-through;
}

code, kbd, tt, var {
	color: #666;
	border-bottom: solid 1px #ccc;
	font-family: Consolas, 'Courier New', monospace;
	font-size: 87.5%;
}

mark, ins {
	background-color: #fffad3;
	color: #333;
	text-decoration: none;
}

/* Blockquotes */
blockquote {
	color: #888;
	font-style: italic;
	margin: 0 0 2.4em;
	padding: 12px 0 0 44px;
	position: relative;
}

blockquote:before {
	color: #ddd;
	content: "\201C";
	font-family: Georgia, serif;
	font-size: 84px;
	left: -5px;
	line-height: 1;
	position: absolute;
	top: -5px;
}

/* Lists */
ul, ol {
	margin: 0 0 1.5em 2em;
	padding: 0;
}

li > ul,
li > ol {
	margin-bottom: 0;
	margin-left: 1.5em;
}

/* Tables */
table {
	border-top: solid 1px #e6e6e6;
	font-size: 93.8%;
	margin: 0 0 1.6em;
	width: 100%;
}

table th, table td {
	border-bottom: solid 1px #e6e6e6;
	padding: 0.8em 1.2em 0.8em 0;
}

th {
	font-weight: 600;
	text-align: left;
}

/* Images */
img {
	height: auto;
	max-width: 100%;
	vertical-align: middle;
}

figure {
	margin: 0;
}

/* Header Cover Image
------------------------------------------------------------ */
.site-header {
	background-color: #f8f8f8;
	border-bottom: none;
	padding: 0;
}

.header-cover {
	text-align: center;
	padding: 0;
	max-width: 720px;
	margin: 0 auto;
	background-color: #fff;
}

@media screen and (min-width: 783px) {
	.header-cover {
		max-width: 820px;
	}
}

.cover-image {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto;
}

/* Navigation
------------------------------------------------------------ */
.navbar {
	background-color: #f8f8f8 !important;
	box-shadow: none;
	padding: 0;
}

.navbar .container {
	max-width: 720px;
	background-color: #222;
	margin-left: auto;
	margin-right: auto;
	padding: 0;
}

@media screen and (min-width: 783px) {
	.navbar .container {
		max-width: 820px;
	}
}

.navbar-nav {
	flex-direction: row !important;
	padding: 0;
	margin: 0;
}

.navbar-nav .nav-item {
	margin: 0;
}

.navbar-nav .nav-link {
	color: rgba(255,255,255,0.85) !important;
	padding: 1rem 1.5rem;
	transition: color .2s ease-in-out, background-color .2s ease-in-out;
	display: block;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
	color: #fff !important;
	background-color: rgba(255,255,255,0.1);
}

/* Dropdown menu styling */
.navbar-nav .dropdown-menu {
	background-color: #333;
	border: none;
	border-radius: 0;
	margin-top: 0;
	padding: 0;
	min-width: 200px;
	display: none;
}

/* Show dropdown on hover */
.navbar-nav .dropdown:hover .dropdown-menu {
	display: block;
}

.navbar-nav .dropdown-item {
	color: rgba(255,255,255,0.85);
	padding: 0.75rem 1.5rem;
	transition: color .2s ease-in-out, background-color .2s ease-in-out;
}

.navbar-nav .dropdown-item:hover,
.navbar-nav .dropdown-item:focus {
	color: #fff;
	background-color: rgba(255,255,255,0.1);
}

.navbar-nav .dropdown-toggle::after {
	margin-left: 0.5rem;
}

/* Content and Footer Wrapper
------------------------------------------------------------ */
.content-footer-wrapper {
	background-color: #f8f8f8;
	flex: 1;
	display: flex;
	flex-direction: column;
	position: relative;
}

.content-footer-wrapper::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 100%;
	max-width: 720px;
	background-color: #fff;
	z-index: 0;
}

@media screen and (min-width: 783px) {
	.content-footer-wrapper::before {
		max-width: 820px;
	}
}

/* Content Layout
------------------------------------------------------------ */
main {
	background-color: transparent;
	padding: 0;
	flex: 1;
	position: relative;
	z-index: 1;
}

main .container {
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
	background-color: transparent;
	padding: 2rem 1rem;
	min-height: 100%;
}

@media screen and (min-width: 783px) {
	main .container {
		max-width: 820px;
	}
}

.entry-content,
.page-content {
	margin-top: 2em;
}

/* Blog Posts
------------------------------------------------------------ */
article {
	margin-bottom: 3em;
	padding-bottom: 2em;
	border-bottom: solid 1px #e6e6e6;
}

article:last-child {
	border-bottom: none;
}

.entry-header h1,
.page-header h1 {
	margin-top: 0.5em;
	margin-bottom: 0.5em;
}

.entry-meta,
.post-meta {
	color: #777;
	font-size: 87.5%;
	margin-bottom: 1.5em;
}

.entry-meta a,
.post-meta a {
	color: #777;
	text-decoration: none;
}

.entry-meta a:hover,
.post-meta a:hover {
	color: #3872b8;
}

/* Blog Cards */
.card {
	border: solid 1px #e6e6e6;
	border-radius: 0;
	margin-bottom: 2em;
	transition: box-shadow .2s ease-in-out;
}

.card:hover {
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-title {
	font-size: 1.5rem;
	margin-bottom: 0.5em;
}

.card-title a {
	color: #111;
	text-decoration: none;
}

.card-title a:hover {
	color: #3872b8;
}

.btn-primary {
	background-color: #222;
	border: none;
	border-radius: 4px;
	color: #eee;
	font-size: 87.5%;
	line-height: 1;
	padding: 1em 1.5em;
	text-transform: uppercase;
	transition: .3s ease-in-out;
}

.btn-primary:hover {
	background-color: #555;
	color: #fff;
}

/* Image Blocks - Dva obrázky vedle sebe
------------------------------------------------------------ */
.image-pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5em;
	margin: 2em 0;
}

.image-pair img {
	width: 100%;
	height: auto;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-pair-caption {
	color: #777;
	font-size: 93.8%;
	font-style: italic;
	margin-top: 0.8em;
	text-align: center;
}

@media (max-width: 768px) {
	.image-pair {
		grid-template-columns: 1fr;
	}
}

/* Advanced Image Block
------------------------------------------------------------ */
.advanced-image-block {
	margin: 2em 0;
}

.advanced-image-block.text-center {
	text-align: center;
}

.advanced-image-block.text-left {
	text-align: left;
}

.advanced-image-block.text-right {
	text-align: right;
}

.advanced-image-block img {
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-caption {
	color: #777;
	font-size: 93.8%;
	font-style: italic;
	margin-top: 0.8em;
}

/* Image Link Block
------------------------------------------------------------ */
.image-link-block {
	margin: 2em 0;
}

.image-link {
	display: inline-block;
	position: relative;
	transition: opacity .2s ease-in-out;
}

.image-link:hover {
	opacity: 0.9;
}

.image-link::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0);
	transition: background 0.3s ease;
	pointer-events: none;
}

.image-link:hover::after {
	background: rgba(0,0,0,0.1);
}

.image-link::before {
	content: '🔗';
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(0,0,0,0.7);
	color: white;
	padding: 5px 8px;
	border-radius: 15px;
	font-size: 12px;
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: 1;
}

.image-link:hover::before {
	opacity: 1;
}

/* Video Block
------------------------------------------------------------ */
.video-block {
	margin: 2em 0;
}

.video-alignment-left {
	text-align: left;
}

.video-alignment-center {
	text-align: center;
}

.video-alignment-right {
	text-align: right;
}

.video-wrapper {
	position: relative;
	display: inline-block;
	max-width: 100%;
}

.video-wrapper iframe,
.video-wrapper embed,
.video-wrapper object {
	max-width: 100%;
	height: auto;
}

.video-caption {
	color: #777;
	font-size: 93.8%;
	font-style: italic;
	margin-top: 0.8em;
}

/* Gallery - Galerie obrázků
------------------------------------------------------------ */
.image-gallery {
	margin: 2em 0;
}

.gallery-title {
	font-weight: 600;
	color: #111;
	border-bottom: 2px solid #e6e6e6;
	padding-bottom: 0.5rem;
	margin-bottom: 1.5rem;
}

/* Zarovnání galerie */
.gallery-alignment-left {
	text-align: left;
}

.gallery-alignment-center {
	text-align: center;
	display: flex;
	justify-content: center;
	width: 100%;
}

.gallery-alignment-center .gallery-container {
	display: inline-block;
	text-align: center;
	max-width: 100%;
}

.gallery-alignment-center .gallery-row {
	justify-content: center !important;
	text-align: center;
}

.gallery-alignment-right {
	text-align: right;
	display: flex;
	justify-content: flex-end;
	width: 100%;
}

.gallery-alignment-right .gallery-container {
	display: inline-block;
	text-align: right;
}

.gallery-alignment-right .gallery-row {
	justify-content: flex-end !important;
}

/* Gallery items */
.gallery-item {
	display: flex;
	flex-direction: column;
	height: 100%;
	align-items: center;
	justify-content: flex-start;
	transition: transform 0.3s ease;
}

.gallery-image-container {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 200px;
}

.gallery-item img {
	object-fit: cover;
	height: auto;
	max-height: 300px;
	width: 100%;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-gallery .row {
	display: flex;
	flex-wrap: wrap;
}

.image-gallery .row > [class*="col-"] {
	display: flex;
	flex-direction: column;
}

.gallery-image-link {
	display: block;
	text-decoration: none;
	position: relative;
	overflow: hidden;
	width: 100%;
}

.gallery-hover-zoom {
	transition: transform 0.3s ease;
}

.gallery-image-link:hover .gallery-hover-zoom {
	transform: scale(1.05);
}

.gallery-link-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.3s ease;
}

.gallery-image-link:hover .gallery-link-overlay {
	background: rgba(0,0,0,0.3);
}

.gallery-link-icon {
	font-size: 24px;
	color: white;
	opacity: 0;
	transition: opacity 0.3s ease;
	text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.gallery-image-link:hover .gallery-link-icon {
	opacity: 1;
}

.gallery-caption {
	color: #777;
	font-size: 93.8%;
	font-style: italic;
	margin-top: 0.8em;
	text-align: center;
}

.gallery-image-container:hover {
	transform: translateY(-2px);
	transition: transform 0.3s ease;
}

.gallery-image-container:hover img {
	box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

/* Gallery Full-Width Mode
------------------------------------------------------------ */
.gallery-row-full-width {
	display: flex !important;
	flex-wrap: wrap !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	margin-bottom: 0 !important;
	width: 100% !important;
}

.gallery-col-full {
	padding-left: 0 !important;
	padding-right: 2px !important;
	padding-bottom: 2px !important;
	flex: 0 0 auto !important;
	margin: 0 !important;
	max-width: none !important;
	display: block !important;
}

.gallery-col-full .gallery-item {
	width: 100% !important;
	display: block !important;
}

.gallery-col-full .gallery-image-container {
	width: 100% !important;
	display: block !important;
}

.gallery-col-2 {
	width: calc(50% - 1px) !important;
}

.gallery-col-3 {
	width: calc(33.333% - 1.33px) !important;
}

.gallery-col-4 {
	width: calc(25% - 1.5px) !important;
}

.gallery-col-5 {
	width: calc(20% - 1.6px) !important;
}

/* Poslední obrázek v řádku nemá pravý padding */
.gallery-col-2:nth-child(2n) {
	padding-right: 0 !important;
}

.gallery-col-3:nth-child(3n) {
	padding-right: 0 !important;
}

.gallery-col-4:nth-child(4n) {
	padding-right: 0 !important;
}

.gallery-col-5:nth-child(5n) {
	padding-right: 0 !important;
}

.gallery-full-width-img {
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Responsive úpravy pro full-width */
@media (max-width: 768px) {
	.gallery-col-full {
		width: calc(50% - 0.25rem) !important;
	}
}

@media (max-width: 480px) {
	.gallery-col-full {
		width: 100% !important;
	}
}

/* Footer
------------------------------------------------------------ */
footer {
	background-color: transparent;
	color: #999;
	margin-top: 0;
	padding: 0;
	position: relative;
	z-index: 1;
}

footer .container {
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
	background-color: #222;
	padding: 1em 1rem;
}

@media screen and (min-width: 783px) {
	footer .container {
		max-width: 820px;
	}
}

footer h5 {
	color: #ccc;
	margin-top: 0;
	margin-bottom: 0.5em;
}

footer a {
	color: #ccc;
}

footer a:hover {
	color: #fff;
}

/* Responsive
------------------------------------------------------------ */
@media (max-width: 768px) {
	.advanced-image-block,
	.image-link-block,
	.video-block {
		text-align: center !important;
		justify-content: center !important;
	}
	
	.video-wrapper {
		max-width: 100% !important;
	}
	
	.image-gallery .col-lg-3,
	.image-gallery .col-lg-4 {
		-webkit-flex: 0 0 50%;
		-ms-flex: 0 0 50%;
		flex: 0 0 50%;
		max-width: 50%;
	}
	
	.gallery-link-icon {
		font-size: 20px;
	}
}

@media (max-width: 576px) {
	.image-gallery .col-lg-3,
	.image-gallery .col-lg-4,
	.image-gallery .col-md-6 {
		-webkit-flex: 0 0 100%;
		-ms-flex: 0 0 100%;
		flex: 0 0 100%;
		max-width: 100%;
	}
}


/* Styly pro obrázky vedle sebe */
.image-gallery {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.image-gallery img {
    flex: 1;
    max-width: 48%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.image-pair img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .image-gallery img {
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .image-pair {
        grid-template-columns: 1fr;
    }
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link.active {
    font-weight: 600;
}

/* Hero sekce */
.hero-section {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    min-height: 400px;
    display: flex;
    align-items: center;
}

/* Content styly */
.content {
    font-size: 1.1rem;
}

.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.content h1 {
    border-bottom: 3px solid #007bff;
    padding-bottom: 0.5rem;
}

.content p {
    margin-bottom: 1.5rem;
}

.content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #666;
}

/* Blog styly */
.blog-posts .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-posts .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-title a {
    color: #333;
    text-decoration: none;
}

.card-title a:hover {
    color: #007bff;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Utility classes */
.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

/* Responsive úpravy */
@media (max-width: 768px) {
    .hero-section {
        min-height: 300px;
        text-align: center;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Wagtail RichText specifické styly */
.rich-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.rich-text ul, .rich-text ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.rich-text li {
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Image Link styly */
.image-link {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.image-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.hover-zoom {
    transition: transform 0.3s ease;
}

.image-link:hover .hover-zoom {
    transform: scale(1.05);
}

.image-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.image-link:hover::after {
    background: rgba(0,0,0,0.1);
}

/* Indikátor odkazu na obrázku */
.image-link::before {
    content: '🔗';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 8px;
    border-radius: 15px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.image-link:hover::before {
    opacity: 1;
}

/* Advanced Image Block styly */
.advanced-image-block .image-container {
    max-width: 100%;
}

.image-caption, .video-caption {
    margin-top: 0.5rem;
    font-style: italic;
}

/* Video Block styly */
.video-block {
    display: block;
    width: 100%;
}

.video-alignment {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.video-alignment-left {
    align-items: flex-start;
}

.video-alignment-center {
    align-items: center;
}

.video-alignment-right {
    align-items: flex-end;
}

.video-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: inline-block;
}

.video-size-small {
    max-width: 400px;
    width: 100%;
}

.video-size-medium {
    max-width: 640px;
    width: 100%;
}

.video-size-large {
    max-width: 854px;
    width: 100%;
}

.video-size-full {
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
}

.video-size-full .embed-responsive {
    width: 100% !important;
    position: relative !important;
    padding-bottom: 56.25% !important; /* 16:9 poměr */
    height: 0 !important;
    overflow: hidden !important;
}

.video-size-full .embed-responsive iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.video-size-full iframe {
    width: 100% !important;
}

.video-wrapper iframe {
    border-radius: 8px;
    display: block;
}

/* Vylepšené vertikální zarovnání pro obrázky */
.advanced-image-block,
.image-link-block {
    display: block;
    width: 100%;
}

.advanced-image-block .image-container,
.image-link-block .image-container {
    display: inline-block;
    vertical-align: middle;
}

/* Zarovnání kontejnerů */
.advanced-image-block.text-center,
.image-link-block.text-center {
    text-align: center;
}

.advanced-image-block.text-left,
.image-link-block.text-left {
    text-align: left;
}

.advanced-image-block.text-right,
.image-link-block.text-right {
    text-align: right;
}

/* Pro kombinování s textem na stejném řádku */
.inline-media {
    display: inline-block;
    vertical-align: middle;
    margin: 0 10px;
}

.inline-media img,
.inline-media .video-wrapper {
    vertical-align: middle;
}

/* Gallery Link styly - sloučeno s novým flexbox layout */
.gallery-image-link {
    display: block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    width: 100%;
}

.gallery-hover-zoom {
    transition: transform 0.3s ease;
}

.gallery-image-link:hover .gallery-hover-zoom {
    transform: scale(1.05);
}

.gallery-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    border-radius: 8px;
}

.gallery-image-link:hover .gallery-link-overlay {
    background: rgba(0,0,0,0.3);
}

.gallery-link-icon {
    font-size: 24px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.gallery-image-link:hover .gallery-link-icon {
    opacity: 1;
}

.gallery-caption {
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-style: italic;
}

.gallery-title {
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Zarovnání galerie */
.gallery-alignment-left {
    text-align: left;
}

.gallery-alignment-center {
    text-align: center;
    display: flex;
    justify-content: center;
    width: 100%;
}

.gallery-alignment-center .gallery-container {
    display: inline-block;
    text-align: center;
    max-width: 100%;
}

.gallery-alignment-center .gallery-row {
    justify-content: center !important;
    text-align: center;
}

.gallery-alignment-right {
    text-align: right;
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.gallery-alignment-right .gallery-container {
    display: inline-block;
    text-align: right;
}

.gallery-alignment-right .gallery-row {
    justify-content: flex-end !important;
}

/* Vertikální centrování obrázků v galerii */
.gallery-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    align-items: center;
    justify-content: flex-start;
}

.gallery-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 200px;
}

.gallery-item img {
    object-fit: cover;
    height: auto;
    max-height: 300px;
    width: 100%;
    border-radius: 8px;
}

/* Flexbox pro stejnou výšku sloupců */
.image-gallery .row {
    display: flex;
    flex-wrap: wrap;
}

.image-gallery .row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

/* Gallery hover efekty */
.gallery-image-container:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

.gallery-image-container:hover .shadow-sm {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.gallery-item {
    position: relative;
    transition: transform 0.3s ease;
}

/* Responzivní úpravy pro mobilní zařízení */
@media (max-width: 768px) {
    .advanced-image-block,
    .image-link-block,
    .video-block {
        text-align: center !important;
        justify-content: center !important;
    }
    
    .video-wrapper {
        max-width: 100% !important;
    }
    
    /* Gallery responzivní úpravy */
    .image-gallery .col-lg-3,
    .image-gallery .col-lg-4 {
        -webkit-flex: 0 0 50%;
        -ms-flex: 0 0 50%;
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .gallery-link-icon {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .image-gallery .col-lg-3,
    .image-gallery .col-lg-4,
    .image-gallery .col-md-6 {
        -webkit-flex: 0 0 100%;
        -ms-flex: 0 0 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
}
