/* =========================================================
   Saaremaa Talu — avalik teema
   Värvid: roheline body #3d5f22
   Pilte: /images/header.jpg, /images/content-mainbg.jpg, /images/footer.png
   ========================================================= */

:root {
    --green-dark: #3d5f22;
    --green-darker: #2f4a1a;
    --green-light: #6b8e4e;
    --accent: #c47e1e;
    --white: #ffffff;
    --text: #1a1a1a;
    --text-muted: #555;
    --site-width: 1200px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--green-dark);
    font-family: 'Open Sans', Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
   
}

a { color: var(--accent); }
a:hover { color: var(--green-darker); }

/* ---------- Kontaineri raam ---------- */
.site {
    width: var(--site-width);
    max-width: 100%;
    margin: 0 auto;
}

/* ---------- HEADER ---------- */
.site-header {
    margin-top: 60px;
    position: relative;
    width: var(--site-width);
    height: 415px;
    background: url('/images/header.jpg') no-repeat center top;
    background-size: var(--site-width) 415px;
}

/* Locale switcher ülemises paremas */
.topbar {
    position: absolute;
    top: 12px;
    right: 30px;
    z-index: 3;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
}
.topbar a {
    color: var(--white);
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.25);
}
.topbar a:hover { background: rgba(0, 0, 0, 0.45); }
.topbar a.active { background: var(--accent); color: #fff; font-weight: 700; }

/* Saidi nimi vasakul (kui pildil pole logo) — peidetud, kuid screen reader-le */
.site-title {
    position: absolute;
    left: -9999px;
}

/* ---------- PEAMENÜÜ — absolute header pealt ---------- */
.main-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: -40px;
    z-index: 2;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0 30px;
}

.main-menu .menu__item {
    position: relative;
}

.main-menu > .menu__item > a {
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    padding: 0.4rem 0.6rem;
    display: inline-block;
}
.main-menu > .menu__item > a:hover {
    color: #ffe28a;
}

/* ---------- ALAMMENÜÜ — absolute hover-iga ---------- */
.main-menu .menu__submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 180px;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    list-style: none;
    margin: 0;
    padding: 0.4rem 0;
    display: none;
    flex-direction: column;
    gap: 0;
    z-index: 10;
    border-radius: 12px;
}
.main-menu .menu__item:hover > .menu__submenu,
.main-menu .menu__item:focus-within > .menu__submenu {
    display: flex;
}

.main-menu .menu__submenu .menu__item {
    width: 100%;
}
.main-menu .menu__submenu a {
    display: block;
    color: #000;
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 400;
    text-shadow: none;
    white-space: nowrap;
}
.main-menu .menu__submenu a:hover {
    background: #f0f0f0;
    color: var(--green-darker);
}

/* ---------- MAIN ---------- */
.site-main {
    position: relative;
    width: var(--site-width);
    background: url('/images/content-mainbg.jpg') repeat-y center top;
    background-size: var(--site-width) auto;
    min-height: 400px;
}

.site-main__inner {
    padding: 30px 60px 40px;
    color: var(--text);
}

.site-main h1 { font-size: 2rem; margin-top: 0; color: var(--green-darker); }
.site-main h2 { color: var(--green-dark); }
.site-main img { max-width: 100%; height: auto; }

/* ---------- FOOTER ---------- */
.site-footer {
    position: relative;
    width: var(--site-width);
    height: 170px;
    background: url('/images/footer.png') no-repeat center top;
    background-size: var(--site-width) 170px;
    color: #fff;
    font-size: 0.85rem;
}
.site-footer__inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 30px 14px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* ---------- ADMIN EDIT LINK (ainult sisselogitud) ---------- */
.edit-link {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 100;
    background: var(--green-darker);
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0.85;
    transition: opacity 0.15s, transform 0.15s;
}
.edit-link:hover {
    opacity: 1;
    color: #fff;
    transform: translateY(-1px);
}

/* ---------- LEHE BLOKID ---------- */
.page-blocks { display: flex; flex-direction: column; gap: 2rem; margin: 1.5rem 0; }

/* Hover-edit per block (ainult sisselogitud) */
.block-wrap { position: relative; }
.block-edit-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 5;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--green-darker);
    color: #fff;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.15s, transform 0.15s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.block-wrap:hover .block-edit-btn { opacity: 1; transform: translateY(0); }
.block-edit-btn:hover { background: var(--accent); }
.block-wrap:hover { outline: 2px dashed rgba(196, 126, 30, 0.4); outline-offset: 6px; border-radius: 4px; }

/* Modal */
.block-edit-modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.block-edit-modal.is-open { display: block; }
.block-edit-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.block-edit-modal__panel {
    position: absolute;
    inset: 30px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.block-edit-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    background: var(--green-darker);
    color: #fff;
}
.block-edit-modal__close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.4rem;
}
.block-edit-modal__close:hover { color: var(--accent); }
.block-edit-modal__iframe { flex: 1; width: 100%; border: 0; }

.block { margin: 0; }
.block img { display: block; width: 100%; height: auto; border-radius: 4px; }

/* Tekst + pilt */
.block--text-image {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.block--text-image .block__body { min-width: 0; }
.block--text-image figure { margin: 0; }
.block--text-image figcaption { font-size: 0.85rem; color: #777; margin-top: 0.3rem; text-align: center; }

/* Üks pilt */
.block--image { margin: 0 auto; }
.block--image figcaption { font-size: 0.85rem; color: #777; margin-top: 0.4rem; text-align: center; font-style: italic; }
.block--w-full { width: 100%; }
.block--w-wide { width: 80%; }
.block--w-narrow { width: 50%; }

/* Galerii */
.block--gallery {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), 1fr);
    gap: 0.75rem;
}
.block__gallery-item { display: block; overflow: hidden; border-radius: 4px; }
.block__gallery-item img { aspect-ratio: 4/3; object-fit: cover; transition: transform 0.3s; }
.block__gallery-item:hover img { transform: scale(1.05); }

@media (max-width: 700px) {
    .block--text-image { grid-template-columns: 1fr; }
    .block--gallery { grid-template-columns: repeat(2, 1fr); }
    .block--w-wide, .block--w-narrow { width: 100%; }
}

/* ---------- HINNAKIRI ---------- */
.price-list { margin: 1.5rem 0; }
.price-list__table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: #fff;
}
.price-list__table thead th {
    background: var(--green-dark);
    color: #fff;
    text-align: left;
    padding: 0.6rem 0.8rem;
    font-weight: 700;
}
.price-list__table thead th.price-list__category { font-size: 1.05rem; }
.price-list__table thead th.price-list__price-col { text-align: right; width: 30%; font-weight: 400; font-style: italic; font-size: 0.9rem; }
.price-list__table tbody td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
.price-list__table tbody tr:last-child td { border-bottom: none; }
.price-list__table tbody tr:nth-child(even) { background: #f9f9f4; }
.price-list__price { text-align: right; white-space: nowrap; font-weight: 600; color: var(--green-darker); }
.price-list__price small { display: block; font-weight: 400; color: #888; font-size: 0.8rem; }
.price-list__desc { color: #777; font-size: 0.85rem; margin-top: 0.15rem; }

/* ---------- TAGASISIDE VORM ---------- */
.feedback-form-wrap {
    background: #f7f5ee;
    border: 1px solid #e4dfd0;
    border-radius: 6px;
    padding: 1.2rem 1.5rem;
    margin: 1.5rem 0;
}
.feedback-form-title { margin: 0 0 1rem; color: var(--green-darker); font-size: 1.3rem; }
.feedback-form { display: flex; flex-direction: column; gap: 0.75rem; }
.feedback-form .row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.feedback-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.feedback-form input,
.feedback-form textarea {
    padding: 0.5rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font: inherit;
    background: #fff;
}
.feedback-form input:focus,
.feedback-form textarea:focus {
    outline: 2px solid var(--accent);
    border-color: transparent;
}
.feedback-sent {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 0.7rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}
@media (max-width: 600px) {
    .feedback-form .row.two-col { grid-template-columns: 1fr; }
}

/* ---------- VORMID (broneering) ---------- */
.booking-form { display: flex; flex-direction: column; gap: 1rem; max-width: 600px; }
.booking-form .row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.booking-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.booking-form input,
.booking-form select,
.booking-form textarea {
    padding: 0.5rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font: inherit;
}
.booking-form input:focus,
.booking-form select:focus,
.booking-form textarea:focus {
    outline: 2px solid var(--accent);
    border-color: transparent;
}
.btn-primary {
    padding: 0.7rem 1.4rem;
    background: var(--accent);
    color: white;
    border: 0;
    border-radius: 4px;
    font-weight: 700;
    font-family: Georgia, serif;
    cursor: pointer;
    align-self: flex-start;
}
.btn-primary:hover { background: #a86916; }
.form-errors {
    background: #fee;
    border: 1px solid #fcc;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    color: #800;
}
.form-errors ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1220px) {
    .site,
    .site-header,
    .site-main,
    .site-footer {
        width: 100%;
    }
    .site-header,
    .site-footer {
        background-size: cover;
    }
    .site-main__inner { padding: 24px 30px; }
    .main-menu { gap: 1.2rem; bottom: 10px; }
    .main-menu > .menu__item > a { font-size: 0.95rem; padding: 0.3rem 0.4rem; }
}

@media (max-width: 600px) {
    .site-header { height: 200px; }
    .site-footer { height: 100px; }
    .main-menu { gap: 0.8rem; bottom: 8px; }
    .main-menu > .menu__item > a { font-size: 0.85rem; }
    .topbar { top: 6px; right: 10px; }
}

