:root {
    --ink: #14251f;
    --muted: #61716b;
    --paper: #fbfcfa;
    --soft: #eef3ef;
    --line: #d7e0da;
    --green: #1e644b;
    --green-dark: #154936;
    --gold: #c49442;
    --white: #fff;
    --shadow: 0 18px 45px rgba(22, 57, 45, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.6; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: sticky; z-index: 1000; top: 0; border-bottom: 1px solid rgba(215, 224, 218, .85); background: rgba(251, 252, 250, .96); backdrop-filter: blur(12px); }
.header-inner { width: min(1180px, calc(100% - 40px)); min-height: 76px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); font-size: 1.2rem; font-weight: 800; letter-spacing: .02em; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50% 50% 50% 12%; background: var(--green); color: var(--white); font-family: Georgia, serif; font-size: 1.45rem; }

.main-menu, .submenu { margin: 0; padding: 0; list-style: none; }
.main-menu { display: flex; align-items: center; gap: .25rem; }
.main-menu > li { position: relative; }
.main-menu a, .submenu-button { min-height: 44px; display: flex; align-items: center; gap: .45rem; padding: .65rem .9rem; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.main-menu a:hover, .main-menu a:focus-visible, .submenu-button:hover, .submenu-button:focus-visible { background: var(--soft); color: var(--green); outline: none; }
.submenu-button::after { content: "⌄"; font-size: .8rem; transition: transform .2s ease; }
.has-submenu.open > .submenu-button::after { transform: rotate(180deg); }

.submenu { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: 255px; padding: .45rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-5px); transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.submenu li { position: relative; }
.submenu a, .submenu .submenu-button { width: 100%; justify-content: space-between; padding: .7rem .75rem; font-size: .92rem; text-align: left; }
.nested > .submenu { top: -.45rem; left: calc(100% + 8px); }
.has-submenu:hover > .submenu, .has-submenu:focus-within > .submenu, .has-submenu.open > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.menu-toggle { display: none; }

.hero { min-height: 620px; display: grid; align-items: center; padding: 7rem max(24px, calc((100vw - 1180px) / 2)); background: radial-gradient(circle at 80% 25%, rgba(196, 148, 66, .18), transparent 26%), linear-gradient(135deg, #f7faf7 0%, #e7f0e9 100%); overflow: hidden; }
.hero-content { max-width: 760px; }
.eyebrow { margin: 0 0 .5rem; color: var(--green); font-size: .78rem; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; font-family: Georgia, "Times New Roman", serif; line-height: 1.13; }
h1 { max-width: 780px; margin-bottom: 1.3rem; font-size: clamp(2.7rem, 6vw, 5.5rem); font-weight: 500; letter-spacing: -.035em; }
h2 { margin-bottom: 1rem; font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 500; }
h3 { margin-bottom: .7rem; font-size: 1.55rem; }
.hero p:not(.eyebrow) { max-width: 630px; color: var(--muted); font-size: 1.18rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1.2rem; border: 1px solid var(--green); border-radius: 5px; font-weight: 750; text-decoration: none; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--green); color: var(--white); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { background: transparent; color: var(--green); }

.content-section { padding: 6rem max(24px, calc((100vw - 1180px) / 2)); }
.content-section.alternate { background: var(--soft); }
.section-heading { max-width: 650px; margin-bottom: 2.4rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.card { min-height: 300px; padding: 2rem; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; background: var(--white); box-shadow: 0 8px 24px rgba(22, 57, 45, .05); }
.card.featured { background: var(--green); color: var(--white); }
.card-number { margin-bottom: auto; color: var(--gold); font-size: .78rem; font-weight: 850; letter-spacing: .15em; }
.card p { color: var(--muted); }
.card.featured p { color: #dcebe4; }
.card a { margin-top: auto; color: var(--green); font-weight: 800; text-decoration: none; }
.card.featured a { color: #f3cf8a; }
.guide-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.guide-link { min-height: 130px; padding: 1.4rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font-family: Georgia, serif; font-size: 1.2rem; text-decoration: none; transition: border-color .15s, transform .15s; }
.guide-link:hover { transform: translateY(-3px); border-color: var(--green); }

.contact-section { padding: 5rem max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; background: var(--green-dark); color: var(--white); }
.contact-section .eyebrow { color: #efca83; }
.contact-section p:not(.eyebrow) { max-width: 650px; color: #cfe0d7; }
.button.light { border-color: var(--white); color: var(--white); }
footer { padding: 1.2rem max(24px, calc((100vw - 1180px) / 2)); display: flex; justify-content: space-between; gap: 1rem; background: #0e2e22; color: #bcd0c6; font-size: .85rem; }
footer a { color: inherit; text-decoration: none; }

/* Stránky návodov */
.subpage-hero { padding: 5rem max(24px, calc((100vw - 1000px) / 2)) 3.5rem; background: linear-gradient(135deg, #f4f8f4, #e3eee6); }
.subpage-hero .hero-content { max-width: 820px; }
.subpage-hero h1 { margin-bottom: 1rem; font-size: clamp(2.4rem, 5vw, 4.6rem); }
.subpage-hero p:not(.eyebrow) { max-width: 720px; color: var(--muted); font-size: 1.1rem; }
.breadcrumbs { margin-bottom: 1.5rem; color: var(--muted); font-size: .88rem; }
.breadcrumbs a { color: var(--green); text-decoration: none; }
.tutorial { padding: 5rem max(24px, calc((100vw - 1000px) / 2)); }
.tutorial-intro { max-width: 760px; margin-bottom: 3rem; }
.tutorial-steps { display: grid; gap: 2rem; }
.tutorial-step { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 2rem; align-items: center; padding: 1.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 10px 28px rgba(22, 57, 45, .06); }
.tutorial-step:nth-child(even) .tutorial-image { order: 2; }
.tutorial-image { min-height: 330px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #f2f5f2; }
.tutorial-image img { width: 100%; height: auto; max-height: 580px; display: none; object-fit: contain; background: var(--white); }
.tutorial-image.has-image img { display: block; }
.tutorial-image.has-image .image-placeholder { display: none; }
.image-placeholder { padding: 2rem; color: var(--muted); text-align: center; }
.image-placeholder strong { display: block; margin: .55rem 0; color: var(--green); overflow-wrap: anywhere; }
.image-placeholder small { display: block; }
.step-copy { padding: .5rem; }
.step-label { color: var(--gold); font-size: .75rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.step-copy h2 { margin: .5rem 0 1rem; font-size: clamp(1.7rem, 3vw, 2.35rem); }
.step-copy ul { padding-left: 1.2rem; color: var(--muted); }
.tutorial-note { margin-top: 3rem; padding: 1.2rem 1.4rem; border-left: 4px solid var(--gold); background: #fff8e9; }
.page-switch { padding: 2rem max(24px, calc((100vw - 1000px) / 2)) 5rem; display: flex; justify-content: space-between; gap: 1rem; }

/* TCM diagnostické diagramy */
.library-toolbar { margin: 2rem 0 1rem; display: flex; align-items: center; gap: 1rem; }
.library-search { width: 100%; min-height: 48px; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink); font: inherit; }
.library-search:focus { border-color: var(--green); outline: 3px solid rgba(30, 100, 75, .12); }
.library-count { flex: 0 0 auto; color: var(--muted); font-size: .9rem; }
.diagnosis-groups { display: grid; gap: 2.4rem; }
.diagnosis-group h2 { margin-bottom: 1rem; padding-bottom: .65rem; border-bottom: 1px solid var(--line); font-size: clamp(1.55rem, 3vw, 2.15rem); }
.diagnosis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.diagnosis-card { min-height: 155px; padding: 1.25rem; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); text-decoration: none; box-shadow: 0 7px 20px rgba(22, 57, 45, .05); transition: transform .15s, border-color .15s, box-shadow .15s; }
.diagnosis-card:hover, .diagnosis-card:focus-visible { transform: translateY(-3px); border-color: var(--green); box-shadow: var(--shadow); outline: none; }
.diagnosis-card .card-type { color: var(--gold); font-size: .7rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.diagnosis-card strong { margin: .55rem 0; font-family: Georgia, serif; font-size: 1.25rem; line-height: 1.25; }
.diagnosis-card small { margin-top: auto; color: var(--muted); overflow-wrap: anywhere; }
.diagnosis-card .open-label { margin-top: .8rem; color: var(--green); font-size: .85rem; font-weight: 800; }
.diagnosis-empty { padding: 2rem; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; }

@media (max-width: 850px) {
    .header-inner { min-height: 68px; }
    .menu-toggle { width: 44px; height: 44px; padding: 10px; display: grid; align-content: center; gap: 5px; border: 0; border-radius: 5px; background: var(--soft); cursor: pointer; }
    .menu-toggle > span:not(.sr-only) { width: 100%; height: 2px; display: block; background: var(--ink); }
    nav { position: absolute; top: 100%; right: 0; left: 0; }
    .main-menu { max-height: calc(100vh - 68px); display: none; align-items: stretch; overflow-y: auto; border-top: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
    .main-menu.open { display: block; }
    .main-menu > li { border-bottom: 1px solid var(--line); }
    .main-menu a, .submenu-button { width: 100%; justify-content: space-between; padding: .8rem 24px; }
    .submenu, .nested > .submenu { position: static; width: auto; display: none; padding: 0 0 .35rem 1rem; border: 0; border-radius: 0; background: #f3f6f3; box-shadow: none; opacity: 1; visibility: visible; transform: none; }
    .has-submenu:hover > .submenu, .has-submenu:focus-within > .submenu { display: none; }
    .has-submenu.open > .submenu { display: block; }
    .card-grid, .guide-list { grid-template-columns: 1fr; }
    .diagnosis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card { min-height: 240px; }
    .tutorial-step { grid-template-columns: 1fr; }
    .tutorial-step:nth-child(even) .tutorial-image { order: initial; }
    .tutorial-image { min-height: 260px; }
}

@media (max-width: 600px) {
    .header-inner { width: min(100% - 28px, 1180px); }
    .hero { min-height: 560px; padding-top: 5rem; padding-bottom: 5rem; }
    .content-section { padding-top: 4rem; padding-bottom: 4rem; }
    .contact-section { align-items: flex-start; flex-direction: column; }
    footer { flex-direction: column; }
    .page-switch { align-items: stretch; flex-direction: column; }
    .library-toolbar { align-items: stretch; flex-direction: column; }
    .diagnosis-grid { grid-template-columns: 1fr; }
}
