/* ============================================================
   Léčebna zrakových vad (ocnilecebna.cz)
   Reimplementace designu původního webu (šablona Optico):
   - zelená    #7fc540 (akcent, pre-header, aktivní menu)
   - modrá     #31a2e1 (odkazy v obsahu, btn-blue)
   - tm. šedá  #42464e (text), nadpisy Montserrat, text Poppins
   ============================================================ */

:root {
    --green: #7fc540;
    --green-dark: #6caa0f;
    --blue: #31a2e1;
    --text: #42464e;
    --text-soft: #6b7a88;
    --heading: #313131;
    --footer-bg: #f7f8fa;
    --border: #e5e5e5;
    --warning: #d77910;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Poppins", Tahoma, Geneva, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    color: var(--heading);
    line-height: 1.3;
    margin: 0 0 16px;
}

h1 { font-size: 28px; font-weight: 400; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }

p { margin: 0 0 20px; }

a { color: var(--blue); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green-dark); }

img { max-width: 100%; height: auto; }

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

svg.icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    vertical-align: -2px;
    flex-shrink: 0;
}

/* ---------- Pre-header (zelená kontaktní lišta) ---------- */
.pre-header {
    background: var(--green);
    color: #fff;
    font-size: 13px;
    padding: 8px 0;
}
.pre-header a { color: #fff; }
.pre-header a:hover { color: rgba(255, 255, 255, .8); }
.pre-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ph-item { display: inline-flex; align-items: start; gap: 6px; }
.ph-sep { opacity: .7; margin: 0 4px; }

/* ---------- Banner na podstránkách ---------- */
.page-banner img { display: block; width: 100%; }

/* ---------- Hlavička s menu ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 84px;
}
.site-branding a { display: block; color: var(--heading); }
.site-branding-title {
    display: block;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    font-size: 24px;
}
.site-branding-subtitle {
    display: block;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: var(--text-soft);
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}
.site-nav > ul > li { position: relative; }
.site-nav > ul > li > a {
    display: block;
    padding: 30px 14px;
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
}
.site-nav > ul > li > a:hover,
.site-nav > ul > li.active > a { color: var(--green); }

.site-nav li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .12);
    border-top: 2px solid var(--green);
    z-index: 100;
    flex-direction: column;
    align-items: stretch;
}
.site-nav li:hover > ul { display: flex; }
.site-nav li ul li a {
    display: block;
    padding: 10px 18px;
    color: var(--text);
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.site-nav li ul li:last-child a { border-bottom: none; }
.site-nav li ul li a:hover,
.site-nav li ul li.active a { color: var(--green); background: #fafafa; }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 10px;
    color: var(--text);
    cursor: pointer;
}

/* ---------- Hero carousel (homepage) ---------- */
.hero-swiper { width: 100%; }
.hero-swiper .swiper-slide { position: relative; }
.hero-swiper .swiper-slide img { display: block; width: 100%; }
.hero-slide-caption {
    position: absolute;
    top: 50%;
    left: 8%;
    transform: translateY(-50%);
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.hero-swiper .swiper-button-prev,
.hero-swiper .swiper-button-next {
    color: #fff;
    opacity: 0;
    transition: opacity .3s;
}
.hero-swiper:hover .swiper-button-prev,
.hero-swiper:hover .swiper-button-next { opacity: 1; }

/* ---------- Homepage: obsah + sidebar novinek ---------- */
.home-content { padding: 36px 0; }
.home-content-inner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.sidebar-news-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 24px;
}
.sidebar-news-title {
    font-size: 20px;
    margin-bottom: 8px;
    padding-bottom: 12px;
    position: relative;
}
.sidebar-news-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--green);
}
.sidebar-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-news-list li {
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.sidebar-news-list li:last-child { border-bottom: none; }
.sidebar-news-list h4 { font-size: 15px; margin: 0 0 6px; }
.sidebar-news-list h4 a { color: var(--heading); }
.sidebar-news-list h4 a:hover { color: var(--green); }
.sidebar-news-perex {
    font-size: 13px;
    color: var(--text-soft);
    margin: 0 0 8px;
}
.sidebar-news-perex p { margin: 0; }
.sidebar-news-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    color: var(--text-soft);
    margin: 0;
}
.sidebar-news-meta .read-more {
    color: var(--green-dark);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

/* ---------- Obsahová typografie (WYSIWYG) ---------- */
.prose { color: var(--text); }
.prose p { margin-left:10px; color: var(--text-soft); }
.prose a { color: var(--blue); }
.prose a:hover { text-decoration: underline; }
.prose ul li {
    list-style-type: disc;
    margin: 0 0 10px 20px;
    color: var(--text-soft);
    line-height: 1.5em;
}
.prose img { margin: 2px 5px; }
.prose table { border-collapse: separate; border-spacing: 0; }
.prose table td { padding: 10px; }
.prose table img { max-height: 100px; width: auto; margin: 0 auto; }

/* Sloupce v obsahu — kompatibilita s Bootstrap gridem z původního webu (row / col-*).
   auto-fit sloupce samo zalomí pod sebe, jakmile se nevejdou. */
.prose .row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0 32px;
}
.prose .row > [class*="col-"] { min-width: 0; }

/* Vložená mapa */
.prose .map-embed {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin: 4px 0 14px;
}

/* ---------- Breadcrumb + obecná stránka (core views) ---------- */
.breadcrumb {
    background: var(--footer-bg);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 10px 15px;
}
.breadcrumb li + li::before { content: '/'; margin-right: 6px; color: var(--text-soft); }
.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--green); }

.page-content { padding: 32px 0 48px; }
.page-divider {
    border: none;
    height: 2px;
    width: 40px;
    background: var(--green);
    margin: 0 0 24px;
}

/* Font Awesome ikony vložené redaktorem do obsahu stránek */
.page-content i[class*="fa-"] {
    color: var(--green);
    min-width: 22px;
    text-align: center;
    margin-right: 4px;
}

/* Denní režim – seznam s ikonami (obsah stránky) */
.day-modes p {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}
.day-modes p:last-child { border-bottom: none; }
.day-modes i[class*="fa-"] { flex: 0 0 22px; }

.page-attachments { margin-top: 32px; }
.page-attachments-title { font-size: 18px; }
.page-attachments-list { list-style: none; margin: 0; padding: 0; }
.page-attachments-list li { margin: 5px 0; }
.page-attachments-list a::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: -2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3C/svg%3E") no-repeat center / contain;
    color: #ec5237;
}

/* ---------- Výpis novinek (/novinky) ---------- */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list-item {
    display: flex;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid #f0f0f0;
}
.news-list-date {
    min-width: 60px;
    text-align: center;
    background: var(--green);
    color: #fff;
    border-radius: 4px;
    padding: 8px 4px;
    align-self: flex-start;
}
.news-list-date .day { display: block; font-size: 22px; font-weight: 700; line-height: 1; }
.news-list-date .month { display: block; font-size: 12px; text-transform: uppercase; }
.news-list-body h3 { font-size: 18px; margin: 0 0 6px; }
.news-list-body h3 a { color: var(--heading); }
.news-list-body h3 a:hover { color: var(--green); }
.news-list-body p { color: var(--text-soft); margin: 0; font-size: 14px; }

/* ---------- Detail novinky ---------- */
.news-detail-perex { font-weight: 600; }
.news-detail-img-link img { max-height: 380px; width: auto; border-radius: 4px; }
.news-detail-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}
.news-detail-gallery-thumb img {
    height: 110px;
    width: auto;
    border: 1px solid #ccc;
    border-radius: 3px;
}
.news-detail-attachments { margin-top: 28px; }
.news-detail-attachments-title { font-weight: 700; margin-bottom: 8px; }
.news-detail-attachments ul { list-style: none; margin: 0; padding: 0; }
.news-detail-attachments li { margin: 6px 0; }
.attachment-ext {
    display: inline-block;
    background: var(--green);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 3px;
    padding: 2px 6px;
    margin-right: 8px;
}
.news-detail-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-soft);
}

/* ---------- Galerie ---------- */
.gallery-folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.gallery-folder-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #ccc;
    border-radius: 3px;
    overflow: hidden;
    color: var(--text);
    transition: background .2s, box-shadow .2s;
}
.gallery-folder-card:hover {
    background: #efefef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    color: var(--text);
}
.gallery-folder-card-img { aspect-ratio: 4 / 3; overflow: hidden; }
.gallery-folder-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-folder-card-icon {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    background: #fafafa;
}
.gallery-folder-card-label {
    padding: 10px 12px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.gallery-folder-card-count {
    background: var(--green);
    color: #fff;
    font-size: 11px;
    border-radius: 10px;
    padding: 1px 8px;
}
.gallery-folder-card-lock {
    color: var(--text-soft);
    font-size: 13px;
}

/* ---------- Galerie chráněná heslem ---------- */
.gallery-lock {
    max-width: 420px;
    margin: 24px auto 0;
    padding: 28px 24px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fafafa;
    text-align: center;
}
.gallery-lock-icon { font-size: 32px; color: var(--green); margin-bottom: 12px; }
.gallery-lock-text { margin: 0 0 18px; color: var(--text-soft); }
.gallery-lock-error {
    margin: 0 0 14px;
    padding: 8px 12px;
    border-radius: 3px;
    background: #fdecea;
    color: #b3261e;
}
.gallery-lock-form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gallery-lock-form input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font: inherit;
}
.gallery-lock-form input:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
.gallery-lock-form button { border: none; cursor: pointer; padding: 9px 20px; border-radius: 3px; font: inherit; }
.gallery-lock-back { margin: 18px 0 0; font-size: 14px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.gallery-img-wrap a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    overflow: hidden;
}
.gallery-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border: 1px solid #ccc;
}

/* ---------- Tlačítka ---------- */
.btn {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 20px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.5;
}
.btn-green { background: var(--green-dark); color: #fff; }
.btn-green:hover { background: #5c920d; color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: #2a8fc7; color: #fff; }

/* ---------- Modal s důležitou novinkou ---------- */
.news-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 1050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 15vh 15px 20px;
    overflow-y: auto;
}
.news-modal {
    background: #fff;
    border-radius: 4px;
    max-width: 640px;
    width: 100%;
    padding: 24px 28px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
.news-modal-icon {
    width: 40px;
    height: 40px;
    fill: var(--warning);
    display: block;
    margin: 0 auto 12px;
}
.news-modal-text {
    text-align: left;
    margin: 12px 0 20px;
    max-height: 45vh;
    overflow-y: auto;
    color: var(--text-soft);
}
.news-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 320px)); gap: 30px; }
.footer-col-title {
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--heading);
    margin-bottom: 26px;
    position: relative;
}
.footer-col-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--green);
    margin-top: 13px;
}
.footer-contact-row {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
}
.footer-contact-row .icon { width: 18px; height: 18px; color: var(--green); margin-top: 4px; }
.footer-contact-row p { margin: 0 0 8px; font-size: 14px; }
.footer-contact-row a { color: var(--text); }
.footer-contact-row a:hover { color: var(--green); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 24px 0;
    font-size: 13px;
    color: rgba(0, 0, 0, .6);
}
.footer-bottom a { color: #323232; }
.footer-bottom a:hover { color: var(--green); }

/* ---------- Responsivita ---------- */
@media (max-width: 991px) {
    .nav-toggle { display: block; }
    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 200;
    }
    .site-nav ul#mainNav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        background: #fff;
        border-bottom: 2px solid var(--green);
        box-shadow: 0 12px 24px rgba(0, 0, 0, .12);
    }
    .site-nav ul#mainNav.open { display: flex; }
    .site-nav > ul > li > a { padding: 12px 18px; border-bottom: 1px solid #f0f0f0; }
    .site-nav li ul {
        display: flex;
        position: static;
        box-shadow: none;
        border-top: none;
        background: #fafafa;
    }
    .site-nav li ul li a { padding-left: 34px; }
    .header-inner { position: relative; }
}

@media (max-width: 800px) {
    .home-content-inner { grid-template-columns: 1fr; }
    .pre-header-inner { justify-content: center; text-align: center; }
}
