/* Vzhled podle schváleného návrhu docs/design/navrh-uvodni-stranky.html */
:root {
    --lime: #aec90a;        /* hlavní barva z loga a starého webu */
    --lime-dark: #99b203;
    --ink: #1f1f1d;         /* tmavá ze starého webu */
    --ink-soft: #43433f;
    --paper: #ffffff;
    --paper-alt: #f4f5ef;
    --line: #e3e4dc;
    --text: #1f1f1d;
    --text-muted: #5c5c57;
    --error: #c9320a;       /* červená ze starého webu */
    --radius: 6px;
    --max: 1120px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--text);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1:focus { outline: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Pevná hlavička nesmí zakrýt cíl kotvy (#objednavka). */
[id] { scroll-margin-top: 80px; }

/* Hlavička */
.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo img { height: 42px; width: auto; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.nav a { text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:not(.btn):hover, .nav a.active { color: var(--lime); }
.menu-toggle { display: none; }
#menu:focus-visible + .menu-toggle { outline: 3px solid var(--lime); }

.btn {
    display: inline-block;
    padding: 12px 22px;
    border: 2px solid var(--lime);
    border-radius: var(--radius);
    background: var(--lime);
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--lime-dark); border-color: var(--lime-dark); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.nav .btn { padding: 8px 16px; font-size: 15px; }

/* Úvod */
.hero {
    position: relative;
    color: #fff;
    background: var(--ink) url("img/servis-3180.jpg") center 40% / cover no-repeat;
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(31,31,29,.94) 0%, rgba(31,31,29,.8) 50%, rgba(31,31,29,.45) 100%); }
.hero .wrap { position: relative; padding-top: 72px; padding-bottom: 72px; }
.hero h1 { margin: 0 0 16px; max-width: 16em; font-size: clamp(30px, 5vw, 48px); line-height: 1.1; }
.hero h1 em { font-style: normal; color: var(--lime); white-space: nowrap; }
@media (min-width: 861px) {
    .hero h1 em { display: block; }
}
.hero p { max-width: 34em; margin: 0 0 24px; font-size: 18px; color: #e8e8e2; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.pickup {
    display: inline-flex; flex-wrap: wrap; gap: 4px 16px;
    margin-bottom: 28px; padding: 10px 16px;
    border-left: 4px solid var(--lime);
    background: rgba(0,0,0,.45);
    font-size: 15px;
}
.pickup strong { color: var(--lime); }

/* Úvod podstránek: nižší, bez fotky */
.page-hero { background: var(--ink); }
.page-hero::before { display: none; }
.page-hero .wrap { padding-top: 48px; padding-bottom: 48px; }
.page-hero h1 { max-width: none; font-size: clamp(28px, 4vw, 40px); }
.page-hero p:last-child { margin-bottom: 0; }
.page-hero .pickup { display: flex; width: fit-content; max-width: 100%; }

/* Sekce */
section { padding: 64px 0; }
section.alt { background: var(--paper-alt); }
h2 { margin: 0 0 8px; font-size: clamp(24px, 3.5vw, 32px); line-height: 1.2; }
section h2 + .works, section h2 + .pricing { margin-top: 24px; }
.section-lead { margin: 0 0 32px; color: var(--text-muted); max-width: 40em; }
.eyebrow { display: inline-block; margin-bottom: 8px; color: var(--lime-dark); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* Textové stránky */
.prose { max-width: 760px; }
.prose h2 { margin-top: 32px; font-size: 22px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }

/* Servisní práce */
.works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.works li { padding: 20px; border: 1px solid var(--line); border-top: 4px solid var(--lime); border-radius: var(--radius); background: var(--paper); }
.works strong { display: block; margin-bottom: 4px; }
.works span { color: var(--text-muted); font-size: 15px; }

/* Ceník */
.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.price-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.price-row .name { font-weight: 600; }
.price-row .price { font-weight: 700; white-space: nowrap; text-align: right; }
.price-row .detail { grid-column: 1 / -1; color: var(--text-muted); font-size: 14px; }
.price-note { margin: 24px 0; color: var(--text-muted); font-size: 14px; }

/* Galerie */
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 220px 220px; gap: 12px; }
.gallery a { overflow: hidden; border-radius: var(--radius); }
.gallery a:first-child { grid-row: span 2; }
.gallery a:last-child { grid-column: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.03); }

/* Objednávka */
.order { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; }
.order-info p { margin: 0 0 16px; }
.order-info .contact-box { padding: 20px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.order-info .contact-box a { color: var(--lime); font-weight: 700; text-decoration: none; }
.order-form { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 8px 24px rgba(31,31,29,.06); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row { display: flex; flex-direction: column; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { margin-bottom: 4px; font-weight: 600; font-size: 15px; }
.form-row input, .form-row textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid #c8c9c0; border-radius: var(--radius);
    background: #fff; color: var(--text);
    font: inherit;
}
.form-row input:focus, .form-row textarea:focus { outline: 3px solid rgba(174,201,10,.45); border-color: var(--lime-dark); }
.form-row input.invalid, .form-row textarea.invalid { border-color: var(--error); }
.validation-message { margin-top: 4px; color: var(--error); font-size: 14px; }
.form-error { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--error); border-radius: var(--radius); color: var(--error); }
.form-note { margin: 16px 0; color: var(--text-muted); font-size: 14px; }
.order-form .btn { width: 100%; font-size: 18px; }
.cf-turnstile { margin-top: 16px; }

/* Kontakt */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact h2 { margin-top: 32px; font-size: 22px; }
.contact-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.contact-list dt { font-weight: 600; }
.contact-list dd { margin: 0; }
.contact-list a { font-weight: 600; }
.hours { border-collapse: collapse; }
.hours th, .hours td { padding: 4px 24px 4px 0; text-align: left; }
.contact-photo { border-radius: var(--radius); height: auto; }

/* Patička */
.site-footer { background: var(--ink); color: #d6d6cf; font-size: 15px; }
.site-footer .wrap { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; padding-top: 48px; padding-bottom: 32px; }
.site-footer h2 { margin: 0 0 12px; color: #fff; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; }
.site-footer p { margin: 0 0 8px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--lime); }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid var(--ink-soft); }
.footer-bottom .wrap { display: block; padding-top: 16px; padding-bottom: 16px; font-size: 13px; color: #9a9a92; }

/* Mobil */
@media (max-width: 1000px) {
    .works { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    /* Výšku řádku s logem drží odsazení loga; min-height by se při otevřeném menu rozdělila mezi řádky. */
    .site-header .wrap { flex-wrap: wrap; gap: 0; min-height: 0; }
    .logo { padding: 13px 0; }
    .menu-toggle {
        display: block; margin-left: auto; padding: 8px 12px;
        border: 1px solid rgba(255,255,255,.4); border-radius: var(--radius);
        background: none; color: #fff; font: inherit; font-weight: 600;
        cursor: pointer;
    }
    .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 12px; }
    .nav a { padding: 12px 0; border-top: 1px solid var(--ink-soft); }
    .nav .btn { margin-top: 12px; text-align: center; }
    .site-header:has(#menu:checked) .nav { display: flex; }
    .hero .wrap { padding-top: 48px; padding-bottom: 48px; }
    .page-hero .wrap { padding-top: 32px; padding-bottom: 32px; }
    .hero::before { background: rgba(31,31,29,.86); }
    .hero-actions .btn { flex: 1 1 auto; text-align: center; }
    section { padding: 48px 0; }
    .works { grid-template-columns: 1fr; }
    .pricing { grid-template-columns: 1fr; }
    .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 200px 160px 200px; }
    .gallery a:first-child { grid-row: auto; grid-column: span 2; }
    .order { grid-template-columns: 1fr; gap: 24px; }
    .order-form { padding: 20px 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .contact { grid-template-columns: 1fr; gap: 24px; }
    .site-footer .wrap { grid-template-columns: 1fr; gap: 24px; }
}

/* Administrace */
.admin-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    padding: 12px 16px;
    background: var(--ink);
    color: #fff;
}
.admin-header a { color: #fff; }
.admin-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; text-decoration: none; }
.admin-brand img { height: 32px; width: auto; }
.admin-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-left: auto; }
.admin-nav form { margin: 0; }
.admin-user { color: #c8c9c0; }
.admin-main { max-width: 64rem; margin: 0 auto; padding: 24px 16px 48px; }
.admin-main h1 { font-size: clamp(24px, 3.5vw, 30px); line-height: 1.2; }
.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--lime);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.admin-card {
    margin-bottom: 20px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
}
.admin-card h2 { margin-top: 0; font-size: 18px; }
.admin-card.login { max-width: 22rem; margin: 32px auto; }

.admin-form .form-row { margin-bottom: 12px; }

.admin-button {
    padding: 8px 20px;
    border: 2px solid var(--lime);
    border-radius: var(--radius);
    background: var(--lime);
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.admin-button:hover { background: var(--lime-dark); border-color: var(--lime-dark); }
.admin-button.danger { border-color: var(--error); background: var(--error); color: #fff; }
.admin-button.secondary { background: transparent; }
.admin-button:disabled, .status-option:disabled { opacity: .6; cursor: wait; }

.form-success { color: #4a6b00; }

.order-table { width: 100%; border-collapse: collapse; }
.order-table th, .order-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.order-table th { color: var(--text-muted); font-size: 14px; }

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--line);
    font-size: 14px;
    white-space: nowrap;
}
.status-nova .status-badge { background: var(--lime); font-weight: 700; }
.status-dokoncena { color: var(--text-muted); }

.order-detail { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.order-detail dt { font-weight: 700; }
.order-detail dd { margin: 0; }
.multiline { white-space: pre-line; }

.status-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.status-option {
    padding: 8px 16px;
    border: 2px solid #c8c9c0;
    border-radius: var(--radius);
    background: #fff;
    font: inherit;
    cursor: pointer;
}
.status-option.active { border-color: var(--lime); background: var(--lime); font-weight: 700; }
.danger-zone .admin-button { margin-right: 8px; }

/* Na mobilu tabulka jako karty. */
@media (max-width: 600px) {
    .order-table thead { display: none; }
    .order-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
    .order-table td { display: flex; gap: 8px; padding: 2px 0; border: 0; }
    .order-table td::before { content: attr(data-label); min-width: 5rem; color: var(--text-muted); }
    .order-detail { grid-template-columns: 1fr; }
    .order-detail dd { margin-bottom: 6px; }
}

/* Chyby Blazoru – společné pro všechny layouty. */
.blazor-error-boundary {
    padding: 16px;
    background: #b32121;
    color: white;
}
.blazor-error-boundary::after { content: "Nastala chyba."; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
