:root {
    --font: 'Asap Condensed', Arial, sans-serif;
    --font-headings: 'DynaPuff', Arial, sans-serif;
    --font-size: 24px;
    --surface: #f4f4f4;
    --on-surface: #333;
    --primary: #009fcf;
    --on-primary: #fff;
    --secondary: #95b589;
    --on-secondary: #fff;
    --tertiary: #fff;
    --on-tertiary: var(--on-surface);
}

* {
    box-sizing: border-box;
}

html,
body,
header,
main,
footer {
    padding: 0;
    margin: 0;
}

body {
    font-family: var(--font);
    font-size: var(--font-size, 16px);
    line-height: 1.5;
    background-color: var(--surface);
    color: var(--on-surface);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: 2.5em;
    font-weight: bold;
    margin: 1rem 0;
    color: var(--secondary);
}

h1,
h2,
h3 {
    color: var(--secondary);
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 2rem;
}

h4,
h5,
h6 {
    color: var(--primary);
}

h4 {
    font-size: 2.5rem;
}

h5 {
    font-size: 2rem;
}

h6 {
    font-size: 1.5rem;
}

header {
    background-color: var(--primary);
    color: var(--on-primary);
    padding: 3rem 1rem 1rem 1rem;
    text-align: center;
}

header > * {
    color: inherit;
}

main {
    padding: 0;
    max-width: 1024px;
    margin: 0 auto;
    background-color: #fff;
}

main > article {
    padding: 2rem 2rem 6rem 2rem;
    padding-bottom: 10rem;
}

main > article.with-cars {
    background-image: url('../img/rpnp-cars.png');
    background-position-x: center;
    background-position-y: bottom;
    background-size: contain;
    background-repeat: no-repeat;
    padding-bottom: 40rem;
}

footer {
    background-color: var(--secondary);
    color: var(--on-secondary);
    text-align: center;
    padding: 1rem;
}

nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

nav > ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav > ul > li {
    display: inline;
}

nav > ul > li > a {
    text-decoration: none;
    color: var(--on-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease;
}

nav > ul > li > a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

nav > ul > li > a.active {
    background-color: var(--on-primary);
    color: var(--primary);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 1rem;
}

table th,
table td {
    padding: 0.5rem;
    text-align: left;
    border-top: 1px solid var(--on-surface);
    border-bottom: 1px solid var(--on-surface);
    text-align: center;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.small {
    font-size: 1rem;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.funny {
    font-family: var(--font-headings);
}

.priary-container {
    background-color: var(--primary);
    color: var(--on-primary);
}

.secondary-container {
    background-color: var(--secondary);
    color: var(--on-secondary);
}

.tertiary-container {
    background-color: var(--tertiary);
    color: var(--on-tertiary);
}

.surface-container {
    background-color: var(--surface);
    color: var(--on-surface);
}

.primary {
    color: var(--primary);
}

.secondary {
    color: var(--secondary);
}

.tertiary {
    color: var(--tertiary);
}

.surface {
    color: var(--surface);
}

.bold {
    font-weight: bold;
}

.italic {
    font-style: italic;
}

.uppercase {
    text-transform: uppercase;
}

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

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

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

.hero,
.hero-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hero {
    font-size: 5rem;
}

.hero-hero {
    font-size: 10rem;
}

.intro-cars {
    width: 100%;
    height: auto;
}

.logo {
    height: 7.5rem;
    width: auto;
    max-width: 100%;
}

.logo-large {
    height: 10rem;
    width: auto;
    max-width: 100%;
}

.header-logo {
    width: 25rem;
    max-width: 100%;
    height: auto;
}

.footer-logo {
    height: 5rem;
    width: auto;
    max-width: 100%;
}

.footer-logo-large {
    height: 7.5rem;
    width: auto;
    max-width: 100%;
}

.strip {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    flex-direction: row;
}

.slice {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.small-padding {
    padding: 0.5rem;
}

.medium-padding {
    padding: 1rem;
}

.large-padding {
    padding: 1.5rem;
}

.row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.col-1 {
    grid-column: span 1;
}

.col-2 {
    grid-column: span 2;
}

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

.col-4 {
    grid-column: span 4;
}

.col-5 {
    grid-column: span 5;
}

.col-6 {
    grid-column: span 6;
}

.col-7 {
    grid-column: span 7;
}

.col-8 {
    grid-column: span 8;
}

.col-9 {
    grid-column: span 9;
}

.col-10 {
    grid-column: span 10;
}

.col-11 {
    grid-column: span 11;
}

.col-12 {
    grid-column: span 12;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    max-width: 100%;
}

.gallery-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: transform 0.2s ease-in-out;
}

.gallery-item:hover {
    transform: scale(1.03);
    /* Lehký zoom efekt při najetí myší */
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Důležité: Ořízne obrázek, aby se vešel do čtverce */
    display: block;
    border-radius: 0.25rem;
}

.overlay {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.overlay-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.overlay-image {
    max-width: 80%;
    max-height: 80%;
    display: block;
    object-fit: contain;
    border-radius: 0.5rem;
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
    transform: translateX(0);
    opacity: 1;
}

.overlay-image.slide-left {
    transform: translateX(-100%);
    opacity: 0;
}

.overlay-image.slide-right {
    transform: translateX(100%);
    opacity: 0;
}

.overlay-image.slide-out-left {
    transform: translateX(-100%);
    opacity: 0;
}

.overlay-image.slide-out-right {
    transform: translateX(100%);
    opacity: 0;
}

.overlay-image.slide-in-right {
    transform: translateX(100%);
    opacity: 0;
}

.overlay-image.slide-in-left {
    transform: translateX(-100%);
    opacity: 0;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.25);
    color: white;
    border: none;
    width: 4rem;
    height: 4rem;
    font-size: 2rem;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
    user-select: none;
}

.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.close-btn {
    top: 3rem;
    right: 1rem;
}

.prev-btn {
    left: 1rem;
}

.next-btn {
    right: 1rem;
}

@media screen and (max-width: 600px) {

    h1 {
        font-size: 2em;
    }

    .logo {
        width: 15rem;
    }

    .hero {
        font-size: 2.5rem;
    }

    .hero-hero {
        font-size: 4rem;
    }

    main > article {
        padding-bottom: 15rem;
    }

    .table-container {
        overflow-x: visible;
    }

    .hidden-sm {
        display: none;
    }

    .col-1-sm {
        grid-column: span 12 !important;
    }

}