:root {
    --background: #F3EDE4;
    --surface: #DED0BE;
    --accent: #AC865E;
    --brown: #655344;
    --text: #24211D;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

header {
    padding: 35px 20px;
    text-align: center;
    border-bottom: 1px solid var(--surface);
}

header h1 {
    font-family: Georgia, serif;
    font-size: 36px;
    letter-spacing: 3px;
}

header p {
    color: var(--brown);
    font-size: 12px;
    letter-spacing: 4px;
}

main {
    max-width: 1440px;
    margin: auto;
    padding: 40px 24px;
}

h2 {
    font-size: clamp(32px, 5vw, 64px);
    line-height: 1.1;
}

footer {
    padding: 25px;
    text-align: center;
    color: var(--brown);
    border-top: 1px solid var(--surface);
}

/* Rozlozeni bytu */

.apartments {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 35px;
}

.apartment {
    background: var(--surface);
    padding: 20px;
}

.apartment-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #C5B39D;
    overflow: hidden;
}

.apartment h3 {
    font-size: 26px;
    margin-top: 20px;
}

.apartment p {
    color: var(--brown);
    margin-top: 8px;
}

/* Tablet */

@media (max-width: 1024px) {
    .apartments {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobil */

@media (max-width: 600px) {
    .apartments {
        grid-template-columns: 1fr;
    }

    main {
        padding: 25px 16px;
    }

    header h1 {
        font-size: 28px;
    }

    header p {
        letter-spacing: 2px;
    }
}

/* Cisla jednotlivych bytu */

.apartment h3 {
    font-family: Georgia, serif;
    font-size: clamp(42px, 5vw, 72px);
    font-weight: 400;
    line-height: 1.2;
    color: var(--brown);
    letter-spacing: -2px;
}

.apartment p {
    border-top: 1px solid var(--accent);
    padding-top: 15px;
}


/* Tlacitka detailu bytu */

.detail-button {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 16px 20px;
    background: var(--brown);
    color: #FFFFFF;
    text-decoration: none;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    transition: background 0.25s ease;
}

.detail-button:hover {
    background: var(--accent);
    color: var(--text);
}

.detail-button:focus-visible {
    outline: 2px solid var(--brown);
    outline-offset: 4px;
}

/* Zpetna navigace */

main > a {
    display: inline-block;
    padding: 12px 20px;
    margin-bottom: 30px;
    border: 1px solid var(--accent);
    color: var(--brown);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    transition: background 0.25s ease;
}

main > a:hover {
    background: var(--surface);
}

main > a:focus-visible {
    outline: 2px solid var(--brown);
    outline-offset: 4px;
}

/* Vyska stranky a paticka */

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    width: 100%;
    margin: 0 auto;
}

footer {
    margin-top: auto;
}

/* Logo a hlavicka */

.site-logo {
    display: block;
    width: 110px;
    height: auto;
    margin: 0 auto 15px;
}

header {
    padding: 30px 20px;
}

header h1 {
    font-weight: 400;
    letter-spacing: 4px;
}

header p {
    margin-top: 6px;
}

@media (max-width: 600px) {
    .site-logo {
        width: 85px;
        margin-bottom: 10px;
    }

    header {
        padding: 24px 15px;
    }

    header h1 {
        letter-spacing: 2px;
    }
}

/* Fotografie bytu */

.apartment-image {
    position: relative;
    overflow: hidden;
}

.apartment-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

@media (hover: hover) {
    .apartment:hover .apartment-image img {
        transform: scale(1.04);
    }
}

/* Docasne zastupne fotografie */

.apartment-image:empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.apartment-image:empty::after {
    content: "FOTOGRAFIE PŘIPRAVUJEME";
    color: var(--brown);
    font-size: 11px;
    letter-spacing: 2px;
    text-align: center;
    padding: 15px;
}

/* Hlavni nadpis */

#byty > h2 {
    font-family: Georgia, serif;
    font-weight: 400;
    letter-spacing: -1px;
    color: var(--text);
}

#byty > h2::after {
    content: "";
    display: block;
    width: 65px;
    height: 3px;
    margin-top: 22px;
    background: var(--accent);
}

@media (max-width: 600px) {
    #byty > h2 {
        letter-spacing: 0;
    }

    #byty > h2::after {
        margin-top: 16px;
    }
}

/* Stinovani panelu */

.apartment {
    border: 1px solid rgba(101, 83, 68, 0.15);
    box-shadow: 0 5px 18px rgba(101, 83, 68, 0.08);
    transition: box-shadow 0.3s ease;
}

@media (hover: hover) {
    .apartment:hover {
        box-shadow: 0 8px 24px rgba(101, 83, 68, 0.16);
    }
}

/* Uprava rozlozeni pro tablet */

@media (min-width: 601px) and (max-width: 1024px) {
    .apartments {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .apartment {
        padding: 12px;
    }

    .apartment h3 {
        font-size: 36px;
    }

    .detail-button {
        padding: 14px 8px;
        font-size: 11px;
        letter-spacing: 1px;
    }
}

/* Prirozene umisteni paticky */

body {
    min-height: 0;
}

main {
    flex: none;
}

footer {
    margin-top: 0;
}

/* Kontaktni sekce */

.contact-section {
    margin-top: 40px;
    padding: 40px 24px;
    background: var(--surface);
    text-align: center;
    border: 1px solid rgba(101, 83, 68, 0.15);
}

.contact-section h2 {
    font-family: Georgia, serif;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 400;
    color: var(--brown);
    margin: 0;
}

.contact-section h2::after {
    content: "";
    display: block;
    width: 55px;
    height: 3px;
    margin: 20px auto;
    background: var(--accent);
}

.contact-section p {
    line-height: 1.6;
    margin: 15px 0 25px;
}

.contact-details {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px 50px;
    color: var(--brown);
}

@media (max-width: 600px) {
    .contact-section {
        margin-top: 25px;
        padding: 30px 16px;
    }

    .contact-details {
        flex-direction: column;
        gap: 15px;
    }
}

/* Zarovnani kontaktnich ikon */

.contact-details > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.contact-details svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--brown);
}

/* Horni navigace */

header {
    position: relative;
}

.main-nav {
    position: absolute;
    top: 30px;
    left: 4%;
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav a {
    position: relative;
    padding-bottom: 10px;
    color: #302114;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-decoration: none;
}

.main-nav a.active::after,
.main-nav a:hover::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #BC7B32;
}

@media (max-width: 1024px) {
    .main-nav {
        position: static;
        justify-content: center;
        flex-wrap: wrap;
        gap: 22px;
        margin-bottom: 25px;
    }
}

@media (max-width: 600px) {
    .main-nav {
        gap: 18px;
    }

    .main-nav a {
        font-size: 11px;
    }
}

/* Nova barevna paleta podle predlohy */

:root {
    --background: #F8EFE5;
    --surface: #F2E2D0;
    --accent: #BC7B32;
    --brown: #49301C;
    --text: #302114;
}

body {
    background: var(--background);
    color: var(--text);
}

header {
    background: var(--background);
}

.apartment {
    background: var(--surface);
}

.detail-button {
    background: var(--accent);
    color: #FFFFFF;
}

.detail-button:hover {
    background: var(--brown);
}

/* Originalni logo Bydleni Dobra */

.site-logo {
    display: block;
    width: 320px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

@media (max-width: 1024px) {
    .site-logo {
        width: 280px;
    }
}

@media (max-width: 600px) {
    .site-logo {
        width: 240px;
    }
}

/* Telefon a rozlozeni zahlavi */

header {
    position: relative;
    padding: 25px 4%;
}

.header-phone {
    position: absolute;
    top: 30px;
    right: 4%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--brown);
    font-size: 15px;
    font-weight: 700;
    border-left: 1px solid var(--accent);
    padding-left: 20px;
}

@media (max-width: 1024px) {
    .header-phone {
        position: static;
        margin-top: 15px;
        border-left: none;
        padding-left: 0;
    }
}

@media (max-width: 600px) {
    header {
        padding: 20px 16px;
    }

    .header-phone {
        font-size: 13px;
    }
}

/* Hlavni nadpis podle graficke predlohy */

#byty > h2 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(30px, 5.5vw, 76px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 2px;
    color: var(--text);
}

@media (max-width: 600px) {
    #byty > h2 {
        letter-spacing: 0;
    }
}

/* Zarovnani hlavniho nadpisu */

#byty > h2 {
    text-align: center;
    margin: 0;
}

#byty > h2::after {
    width: 65px;
    height: 4px;
    margin: 22px auto 0;
}

/* Doladeni rozestupu hlavni stranky */

header {
    padding-top: 20px;
    padding-bottom: 10px;
}

main {
    padding-top: 20px;
}

.apartments {
    margin-top: 30px;
}

@media (max-width: 600px) {
    header {
        padding-top: 15px;
        padding-bottom: 10px;
    }

    main {
        padding-top: 15px;
    }

    .apartments {
        margin-top: 25px;
    }
}

/* Nove rozlozeni karet bytu */

.apartment-content {
    display: grid;
    grid-template-columns: 35% minmax(0, 1fr);
    align-items: stretch;
    margin-top: 22px;
}

.apartment-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding-right: 12px;
    border-right: 1px solid var(--accent);
}

.apartment-info {
    min-width: 0;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.apartment-info p {
    border-top: none;
    padding-top: 0;
}

/* Typografie cisel jednotlivych bytu */

.apartment-number {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--brown);
    line-height: 1;
}

.apartment-number span {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.apartment-number strong {
    font-size: clamp(42px, 5.5vw, 92px);
    font-weight: 900;
    letter-spacing: -3px;
}

@media (min-width: 601px) and (max-width: 1024px) {
    .apartment-number strong {
        font-size: clamp(32px, 5vw, 52px);
    }

    .apartment-number span {
        font-size: 12px;
    }
}

/* Graficka uprava parametru bytu */

.apartment-parameters {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.parameter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--brown);
    border-bottom: 1px solid #D8C3AB;
}

.parameter:last-child {
    border-bottom: none;
}

.parameter strong {
    font-weight: 700;
    text-align: right;
}

@media (min-width: 601px) and (max-width: 1024px) {
    .parameter {
        font-size: 11px;
        gap: 4px;
        padding: 6px 0;
    }
}

/* Finalni vzhled tlacitek detailu */

.apartment-info .detail-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 12px 8px;
    background: var(--accent);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    transition: background 0.2s ease;
}

.apartment-info .detail-button:hover {
    background: var(--brown);
}

@media (min-width: 601px) and (max-width: 1024px) {
    .apartment-info .detail-button {
        font-size: 10px;
        letter-spacing: 0;
    }
}

/* Responzivni rozlozeni karet */

.apartment {
    min-width: 0;
}

@media (min-width: 601px) and (max-width: 1024px) {
    .apartment-content {
        grid-template-columns: 30% minmax(0, 1fr);
        margin-top: 15px;
    }

    .apartment-number {
        padding-right: 6px;
    }

    .apartment-number strong {
        font-size: clamp(24px, 4vw, 44px);
        letter-spacing: -1px;
    }

    .apartment-info {
        padding-left: 8px;
    }

    .parameter {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .apartment-content {
        grid-template-columns: 32% minmax(0, 1fr);
        margin-top: 18px;
    }

    .apartment-number strong {
        font-size: clamp(42px, 14vw, 76px);
    }

    .apartment-info {
        padding-left: 12px;
    }

    .parameter {
        font-size: 13px;
    }
}

/* Telefonni ikona v mobilnim zahlavi */

@media (max-width: 600px) {
    .header-phone {
        position: absolute;
        top: 3px;
        right: 8px;
        margin: 0;
        padding: 0;
        width: 44px;
        height: 44px;
        border: none;
    }

    .header-phone span {
        display: none;
    }

    .header-phone svg {
        width: 22px;
        height: 22px;
    }

    .main-nav {
        padding-right: 36px;
    }
}

/* Sjednoceni typografie cisel bytu */

.apartment h3.apartment-number,
.apartment-number span,
.apartment-number strong {
    font-family: Arial, Helvetica, sans-serif;
}

.apartment h3.apartment-number {
    margin: 0;
    gap: 5px;
}

.apartment-number strong {
    font-weight: 900;
    line-height: 1;
}

@media (min-width: 601px) and (max-width: 1024px) {
    .apartment-number strong {
        font-size: clamp(24px, 5vw, 48px);
    }
}

/* Zarovnani ikon parametru */

.parameter-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.parameter-label svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--brown);
}

@media (min-width: 601px) and (max-width: 1024px) {
    .parameter-label {
        gap: 4px;
    }

    .parameter-label svg {
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 600px) {
    .parameter-label {
        gap: 6px;
    }

    .parameter-label svg {
        width: 16px;
        height: 16px;
    }
}

/* Graficka uprava sekce O DOME */

.about-section {
    margin-top: 55px;
}

.about-section > h2 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(26px, 4vw, 44px);
    font-weight: 900;
    text-align: center;
    color: var(--text);
    margin: 0 0 30px;
}

.about-section > h2::after {
    content: "";
    display: block;
    width: 55px;
    height: 3px;
    background: var(--accent);
    margin: 18px auto 0;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 35px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid #D8C3AB;
}

.about-image {
    aspect-ratio: 4 / 3;
    background: #C5B39D;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--brown);
    font-size: 12px;
}

.about-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--brown);
}

.about-text h3 {
    font-size: 28px;
    margin: 0 0 15px;
}

.about-text p {
    font-size: 16px;
    line-height: 1.7;
}

@media (max-width: 600px) {
    .about-section {
        margin-top: 35px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 12px;
    }

    .about-text h3 {
        font-size: 23px;
    }

    .about-text p {
        font-size: 14px;
    }
}

/* Graficka uprava kontaktni sekce */

.contact-section {
    margin-top: 55px;
    padding: 40px 25px;
    background: var(--surface);
    border: 1px solid #D8C3AB;
}

.contact-section h2 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 900;
    color: var(--text);
}

.contact-section p {
    color: var(--brown);
    font-size: 16px;
}

.contact-details {
    margin-top: 25px;
    gap: 0;
}

.contact-details > div {
    padding: 12px 35px;
    font-weight: 700;
    color: var(--brown);
}

.contact-details > div + div {
    border-left: 1px solid var(--accent);
}

@media (max-width: 600px) {
    .contact-section {
        margin-top: 35px;
        padding: 25px 15px;
    }

    .contact-section p {
        font-size: 14px;
    }

    .contact-details > div {
        padding: 12px;
    }

    .contact-details > div + div {
        border-left: none;
    }
}

/* Plynule posouvani stranky */

html {
    scroll-behavior: smooth;
}

#byty,
#o-dome,
#kontakt {
    scroll-margin-top: 25px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Detailni stranka bytu */

.apartment-detail {
    max-width: 1440px;
    margin: 0 auto;
}

.detail-title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(36px, 5.5vw, 76px);
    font-weight: 900;
    text-align: center;
    color: var(--text);
    margin: 25px 0 35px;
}

.detail-title::after {
    content: "";
    display: block;
    width: 65px;
    height: 4px;
    background: var(--accent);
    margin: 20px auto 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
    gap: 30px;
}

.detail-gallery {
    min-width: 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid #D8C3AB;
}

.detail-main-image {
    aspect-ratio: 4 / 3;
    background: #C5B39D;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--brown);
    font-size: 12px;
    letter-spacing: 2px;
}

.detail-thumbnails {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.detail-thumbnails > div {
    aspect-ratio: 4 / 3;
    background: #C5B39D;
}

.detail-information {
    min-width: 0;
    padding: 25px;
    background: var(--surface);
    border: 1px solid #D8C3AB;
}

.detail-information h2 {
    font-size: 28px;
    color: var(--brown);
    margin: 0 0 20px;
}

.detail-parameters {
    margin-bottom: 25px;
}

.detail-parameters .parameter {
    font-size: 16px;
    padding: 16px 0;
}

.detail-information .detail-button {
    box-sizing: border-box;
    text-align: center;
    width: 100%;
}

.detail-description {
    margin-top: 30px;
    padding: 25px;
    background: var(--surface);
    border: 1px solid #D8C3AB;
    color: var(--brown);
}

.detail-description h2 {
    margin-top: 0;
    font-size: 28px;
}

.detail-description p {
    line-height: 1.7;
}

@media (max-width: 768px) {
    .detail-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .detail-gallery,
    .detail-information,
    .detail-description {
        padding: 15px;
    }

    .detail-information h2,
    .detail-description h2 {
        font-size: 23px;
    }

    .detail-parameters .parameter {
        font-size: 14px;
        padding: 12px 0;
    }

    .detail-title {
        margin: 20px 0 25px;
    }
}

/* Fotogalerie detailu bytu */

.detail-main-image {
    overflow: hidden;
    position: relative;
}

.detail-main-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-thumbnails > div {
    overflow: hidden;
    border: 1px solid #D8C3AB;
}

.detail-thumbnails img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

@media (hover: hover) {
    .detail-thumbnails > div:hover img {
        transform: scale(1.05);
    }
}

.gallery-note {
    margin: 15px 0 0;
    color: var(--brown);
    font-size: 11px;
    text-align: center;
}

@media (max-width: 600px) {
    .detail-thumbnails {
        gap: 8px;
        margin-top: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .detail-thumbnails img {
        transition: none;
    }
}

/* Oprava rozmeru fotogalerie */

.detail-main-image,
.detail-thumbnails > div {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    box-sizing: border-box;
}

.detail-main-image img,
.detail-thumbnails img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

/* Celoobrazovkova fotogalerie */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-image {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.detail-main-image img {
    cursor: zoom-in;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    color: white;
    font-size: 38px;
    cursor: pointer;
    z-index: 2;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 58px;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 2;
}

.lightbox-prev {
    left: 15px;
}

.lightbox-next {
    right: 15px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 15px;
    letter-spacing: 3px;
}

.lightbox-image {
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
}

/* Finalni vzhled lightboxu */

.detail-thumbnails img {
    cursor: pointer;
}

.lightbox-image {
    border-radius: 3px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    border-radius: 4px;
    transition: background 0.2s ease;
}

@media (hover: hover) {
    .lightbox-close:hover,
    .lightbox-prev:hover,
    .lightbox-next:hover {
        background: #BC7B32;
    }
}

.lightbox button:focus-visible,
.detail-main-image img:focus-visible {
    outline: 3px solid #BC7B32;
    outline-offset: -3px;
}

.lightbox:not([hidden]) {
    animation: lightboxFade 0.2s ease;
}

@keyframes lightboxFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 600px) {
    .lightbox-image {
        max-width: 100vw;
        max-height: 80vh;
    }

    .lightbox-prev {
        left: 5px;
    }

    .lightbox-next {
        right: 5px;
    }

    .lightbox-close {
        top: 15px;
        right: 10px;
    }

    .lightbox-counter {
        bottom: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox:not([hidden]) {
        animation: none;
    }

    .lightbox button {
        transition: none;
    }
}

/* Fotografie na hlavni strance */

.apartment-image {
    position: relative;
    overflow: hidden;
}

.apartment-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    font-size: 10px;
    z-index: 1;
}

a.apartment-image {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

a.apartment-image:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* Graficke efekty karet */

.apartment {
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.apartment-image img {
    transition: transform 0.4s ease;
}

@media (hover: hover) and (pointer: fine) {
    .apartment:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 25px rgba(73, 48, 28, 0.15);
    }

    .apartment:hover .apartment-image img {
        transform: scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    .apartment,
    .apartment-image img {
        transition: none;
    }

    .apartment:hover,
    .apartment:hover .apartment-image img {
        transform: none;
    }
}

/* Dostupnost bytu */

.availability {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.3;
    white-space: normal;
}

.availability::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.availability[data-status="available"] {
    color: #38764B;
    background: #DFEDDF;
}

.availability[data-status="reserved"] {
    color: #96620C;
    background: #F7E8C7;
}

.availability[data-status="rented"] {
    color: #9A4545;
    background: #F1DDDA;
}

.availability[data-status="pending"] {
    color: #655344;
    background: #E8DFD3;
}

@media (min-width: 601px) and (max-width: 1024px) {
    .availability {
        font-size: 10px;
        padding: 4px;
    }
}

.logo-link {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    text-decoration: none;
}

.logo-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* Graficke doladeni milniku 120 */

.apartments {
    align-items: stretch;
}

.apartment {
    display: flex;
    flex-direction: column;
}

.apartment-content {
    flex: 1;
}

.apartment-info .detail-button {
    margin-top: auto;
}

.apartment-parameters {
    flex: 1;
}

.detail-button {
    min-height: 44px;
    box-sizing: border-box;
}

.detail-button:focus-visible,
.main-nav a:focus-visible,
.back-link:focus-visible {
    outline: 2px solid var(--brown);
    outline-offset: 4px;
}

@media (max-width: 600px) {
    .apartments {
        gap: 20px;
    }

    .apartment {
        padding: 12px;
    }

    .apartment-content {
        margin-top: 15px;
    }

    .detail-description {
        margin-top: 20px;
    }

    .photo-label {
        font-size: 9px;
    }
}

/* Centralni kontaktni udaje */

.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.contact-link:hover {
    color: var(--accent);
}

.contact-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

@media (max-width: 600px) {
    .header-phone .contact-link {
        width: 44px;
        height: 44px;
    }

    .header-phone .contact-link span {
        display: none;
    }
}

/* Back to top */

.back-to-top {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,.20);
    cursor: pointer;
    z-index: 1000;
    transition: background .2s, transform .2s;
}

.back-to-top[hidden] {
    display: none;
}

.back-to-top:hover {
    background: var(--brown);
    transform: translateY(-3px);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--brown);
    outline-offset: 4px;
}

@media (max-width: 600px) {
    .back-to-top {
        right: 15px;
        bottom: calc(15px + env(safe-area-inset-bottom));
        width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: none;
    }

    .back-to-top:hover {
        transform: none;
    }
}

/* Dynamicka fotogalerie */

.detail-thumbnails:empty {
    display: none;
}

.detail-thumbnails {
    min-width: 0;
}

.detail-thumbnails > div {
    min-width: 0;
}

/* Zarovnani hlavicky s kartami bytu */

@media (min-width: 1025px) {
    .main-nav {
        left: max(24px, calc((100% - 1440px) / 2 + 24px));
    }

    .header-phone {
        right: max(24px, calc((100% - 1440px) / 2 + 24px));
    }
}

/* Ikony parametru detailu bytu */

.detail-parameters .parameter-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.detail-parameters .parameter-label svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--brown);
}

/* Kompaktni rozlozeni detailu bytu */

@media (min-width: 1025px) {
    .apartment-detail > .back-link {
        margin-bottom: 0;
    }

    .apartment-detail .detail-title {
        margin-top: 0;
        margin-bottom: 25px;
        line-height: 1.1;
    }

    .apartment-detail .detail-title::after {
        margin-top: 20px;
    }

    .apartment-detail .detail-layout {
        margin-top: 0;
    }
}

/* Kompaktni detail bytu na mobilu a tabletu */

@media (max-width: 1024px) {
    .apartment-detail > .back-link {
        margin-bottom: 0;
    }

    .apartment-detail .detail-title {
        margin-top: 15px;
        margin-bottom: 25px;
        line-height: 1.1;
    }
}

/* Fotografie bez problikavani pri nacteni */

img[data-photo-pending="true"]:not([src]) {
    visibility: hidden;
}

.apartment-image,
.detail-main-image,
.detail-thumbnails > div {
    background-color: var(--surface);
}

/* Byt bez nahranych fotografii */

.photo-empty {
    position: relative;
    background: var(--surface);
}

.photo-empty::after {
    content: "Fotografie připravujeme";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--brown);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-align: center;
    pointer-events: none;
}

.photo-empty .photo-label {
    display: none;
}


/* PRONAJATE BYTY */

.apartment.is-rented {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.apartment.is-rented::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.30);
    z-index: 90;
    pointer-events: none;
}

.apartment.is-rented::after {
    content: "PRONAJATO";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    color: rgba(73, 48, 28, 0.60);
    font-size: clamp(52px, 5vw, 80px);
    font-weight: 900;
    letter-spacing: 3px;
    white-space: nowrap;
    z-index: 91;
    pointer-events: none;
}



/* HIDE APARTMENT PHOTO LABEL */

.apartment .apartment-image .photo-label {
    display: none !important;
}



/* MOBILE NAVIGATION ONLY */

@media (max-width: 767px) {

    header .header-phone {
        display: none !important;
    }

    header .main-nav {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: none;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
        display: flex;
        justify-content: center;
        box-sizing: border-box;
    }
}


/* TABLET RENTED LABEL */

@media (min-width: 768px) and (max-width: 1023px) {
    .apartment.is-rented::after {
        font-size: 34px;
    }
}


/* TABLET HEADER LAYOUT */

@media (min-width: 768px) and (max-width: 1023px) {

    header {
        position: relative;
    }

    header .main-nav {
        position: absolute;
        top: 20px;
        left: 24px;
        right: auto;
        width: auto;
        transform: none;
        margin: 0;
        padding: 0;
        justify-content: flex-start;
    }

    header .header-phone {
        position: absolute;
        top: 20px;
        right: 24px;
        left: auto;
        width: auto;
        transform: none;
        margin: 0;
        display: flex;
        align-items: center;
    }

    header .header-phone span {
        display: inline;
    }

    header .site-logo {
        margin-top: 30px;
    }
}


/* DESKTOP RENTED LABEL */

@media (min-width: 1024px) {
    .apartment.is-rented::after {
        font-size: clamp(40px, 4vw, 60px);
    }
}



/* VIEWING AVAILABILITY */

.detail-button.viewing-disabled {
    opacity: 0.55;
    pointer-events: none;
    cursor: default;
}


/* HIDE GALLERY TEST NOTE */

.gallery-note {
    display: none !important;
}

