/* ===== CSS VARIABLES ===== */
:root {
    --navy:         #1d3557;
    --navy-mid:     #2a4a73;
    --orange:       #f47920;
    --orange-dark:  #d4620e;
    --bg:           #f0f3f7;
    --white:        #ffffff;
    --text:         #1d3557;
    --text-muted:   #5a7184;
    --border:       #d8e0ea;
    --radius:       10px;
    --shadow:       0 2px 18px rgba(29,53,87,0.09);
    --shadow-hover: 0 8px 32px rgba(29,53,87,0.17);
}

/* ===== RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Barlow', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== HEADER ===== */
header {
    background: var(--white);
    border-bottom: 3px solid var(--orange);
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
    box-shadow: 0 2px 14px rgba(29,53,87,0.10);
}

header .logo img {
    height: 90px;
    width: auto;
    display: block;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 4px;
}

nav ul li a {
    text-decoration: none;
    color: var(--navy);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 1.05em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 6px;
    position: relative;
    transition: color 0.2s, background 0.2s;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--orange);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

nav ul li a:hover,
nav ul li a:focus {
    color: var(--orange);
    background: rgba(244,121,32,0.07);
}

nav ul li a:hover::after,
nav ul li a:focus::after {
    transform: scaleX(1);
}

/* ===== MAIN ===== */
main {
    flex: 1 0 auto;
    max-width: 1400px;
    width: 100%;
    margin: 48px auto;
    padding: 0 32px;
    min-height: 70vh;
}

/* ===== HEADINGS ===== */
h1, h2, h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
}

h1 { font-size: 2.4em; }
h2 { font-size: 1.9em; }
h3 { font-size: 1.35em; }

/* ===== O MNĚ ===== */
.about {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 44px 40px;

    margin-bottom: 48px;
    border-top: 4px solid var(--orange);
}

.about-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.about-header img {
    height: 150px;
    width: auto;
    flex-shrink: 0;
}

.about-header h2 {
    margin-bottom: 0;
}

.about strong {
    color: var(--orange);
}

.about p {
    font-size: 1.1em;
    margin-bottom: 14px;
    color: var(--text);
}

.about p:last-child {
    margin-bottom: 0;
}

/* ===== PROJEKTY — SEZNAM ===== */
.projects {
    margin-bottom: 60px;
}

.project-container {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
}

.project-card {
    position: relative;
    flex: 1 1 calc(50% - 16px);
    max-width: calc(50% - 16px);
    height: 420px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(29,53,87,0.85) 0%, rgba(29,53,87,0.55) 100%);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 28px;
    gap: 14px;
}

.project-card:hover .overlay {
    opacity: 1;
}

.overlay-text {
    background: transparent;
    color: white;
    padding: 0;
    max-width: 100%;
    box-shadow: none;
    border-radius: 0;
}

.overlay-text h3 {
    color: white;
    font-size: 1.65em;
    margin-bottom: 4px;
    font-style: normal;
}

.overlay-text p {
    font-size: 0.9em;
    color: rgba(255,255,255,0.72);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
}

.overlay .btn {
    background-color: var(--orange);
    padding: 10px 22px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color 0.25s, transform 0.2s;
}

.overlay .btn:hover {
    background-color: var(--orange-dark);
    transform: translateX(4px);
}

/* ===== DETAIL PROJEKTU ===== */
.project-detail {
    padding: 0;
    margin-bottom: 24px;
}

.full-bg-right {
    position: relative;
    display: flex;
    min-height: 600px;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--orange);
}

.full-bg-right .detail-image {
    position: absolute;
    top: 0; bottom: 0; right: 0;
    width: 45%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0 var(--radius) var(--radius) 0;
    z-index: 1;
    transition: width 0.6s ease, border-radius 0.6s ease;
}

.full-bg-right .detail-text {
    position: relative;
    z-index: 2;
    width: 55%;
    padding: 48px 44px;
    background: var(--white);
    border-radius: var(--radius) 0 0 var(--radius);
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.full-bg-right .detail-text h1 {
    color: var(--navy);
    margin-bottom: 20px;
}

.full-bg-right .detail-text p {
    margin-bottom: 12px;
    font-size: 1.05em;
    color: var(--text);
}

.full-bg-right .detail-text p strong {
    color: var(--navy);
    font-weight: 600;
}

@media (hover: hover) {
    .full-bg-right .detail-image:hover {
        width: 100%;
        border-radius: var(--radius);
        z-index: 3;
    }

    .full-bg-right .detail-image:hover ~ .detail-text {
        opacity: 0;
        z-index: 1;
    }
}

.full-bg-right .detail-image.expanded {
    width: 100%;
    border-radius: var(--radius);
    z-index: 3;
}

.full-bg-right .detail-image.expanded ~ .detail-text {
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.toggle-close.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.toggle-close {
    position: absolute;
    top: 16px; right: 16px;
    cursor: pointer;
    font-size: 22px;
    color: white;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 32px; height: 32px;
    line-height: 32px;
    text-align: center;
    user-select: none;
    z-index: 10;
    transition: background-color 0.3s, opacity 0.3s;
    opacity: 0;
}

.detail-text .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 13px 28px;
    background-color: var(--navy);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.05em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: background-color 0.25s, transform 0.2s;
    align-self: flex-start;
}

.detail-text .btn:hover {
    background-color: var(--orange);
    transform: translateX(4px);
}

/* ===== KONTAKT ===== */
.contact {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 44px 40px;
    margin: 0 auto 48px;
    border-top: 4px solid var(--orange);
    max-width: 740px;
}

.contact h1 {
    margin-bottom: 12px;
}

.contact > p {
    font-size: 1.1em;
    margin-bottom: 24px;
    color: var(--text-muted);
}

.contact-details {
    background: var(--bg);
    border-radius: 8px;
    padding: 18px 22px;
    margin-bottom: 8px;
    border-left: 4px solid var(--orange);
}

.contact-details p {
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 1em;
    color: var(--text);
}

.contact-details p:last-child {
    margin-bottom: 0;
}

.contact-details a {
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
}

.contact-details a:hover {
    color: var(--orange-dark);
    text-decoration: underline;
}

.linkedin-icon {
    color: #0A66C2;
    margin-right: 6px;
    vertical-align: middle;
}

a.linkedin-link {
    text-decoration: none;
    color: inherit;
}

a.linkedin-link:hover .linkedin-icon {
    color: #004182;
}

.contact-form {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-form input,
.contact-form textarea {
    padding: 12px 16px;
    font-size: 1em;
    font-family: 'Barlow', sans-serif;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.25s;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #9baab8;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--orange);
    outline: none;
}

.contact-form button {
    background-color: var(--navy);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.15em;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.25s;
}

.contact-form button:hover {
    background-color: var(--orange);
}

.success-message,
.error-message {
    padding: 14px 18px;
    margin: 12px 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.success-message {
    background-color: #e6f4ea;
    color: #1a6632;
    border-left: 4px solid #2e9e52;
}

.error-message {
    background-color: #fbeaea;
    color: #a82020;
    border-left: 4px solid #d63b3b;
}

/* ===== FOOTER ===== */
footer {
    flex-shrink: 0;
    text-align: center;
    padding: 22px 20px;
    background-color: var(--navy);
    color: rgba(255,255,255,0.55);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.95em;
    letter-spacing: 0.04em;
    width: 100%;
}

/* ===== RESPONZIVITA ===== */
@media (max-width: 900px) {
    main {
        padding: 0 20px;
        margin: 32px auto;
    }

    .project-card {
        flex: 1 1 100%;
        max-width: 100%;
        height: 320px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 14px 20px;
        height: auto;
        flex-direction: column;
        gap: 8px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }

    nav ul li a {
        font-size: 0.95em;
        padding: 6px 10px;
    }

    main {
        margin: 24px auto;
        padding: 0 15px;
    }

    .about,
    .contact {
        padding: 28px 22px;
    }

    .full-bg-right {
        flex-direction: column;
        min-height: auto;
    }

    .full-bg-right .detail-image {
        position: relative;
        width: 100%;
        height: 240px;
        border-radius: var(--radius) var(--radius) 0 0;
        top: auto; bottom: auto; right: auto;
        transition: height 0.6s ease;
    }

    .full-bg-right .detail-text {
        width: 100%;
        padding: 28px 22px;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    /* JS toggle pro dotyk */
    .full-bg-right .detail-image.expanded {
        height: 80vw;
    }

    .full-bg-right .detail-image {
        cursor: zoom-in;
    }

    .about-header {
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .about-header img {
        height: 80px;
    }

    h1 { font-size: 1.9em; }
    h2 { font-size: 1.55em; }
}

