/* ==========================================================================
   Sassi Külalistemaja – stiilid
   Üks fail: fondid, põhistiil, päis, jaotised, galerii, kontakt, lightbox,
   kuupäevavalija ja mobiilivaade. Paigutus on tehtud CSS grid / flexboxiga.
   ========================================================================== */

/* ---------- Fondid ---------- */
@font-face {
    font-family: 'Geared Slab';
    src: url('fonts/gearedslab-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Geared Slab Bold';
    src: url('fonts/gearedslab-bold-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Sansus Webissimo';
    src: url('fonts/sansus_webissimo-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ---------- Muutujad ---------- */
:root {
    --accent: #ff6644;
    --dark: #2b2b2d;
    --text: #888;
    --card: #a96c4f;
    --line: #ccc;
    --wrap: 940px;
    --header-h: 79px;
    --font-heading: 'Geared Slab', Georgia, 'Times New Roman', serif;
    --font-heading-bold: 'Geared Slab Bold', Georgia, 'Times New Roman', serif;
    --font-body: 'Sansus Webissimo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-serif: Georgia, 'Times New Roman', serif;
}

/* ---------- Alus ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) - 10px);
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    background: url(../images/body-bg.png) repeat;
    color: var(--text);
    font: 15px/1.25 var(--font-body);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }
p { margin: 0 0 10px; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; transition: color 0.35s ease; }
a:hover, a:focus { color: #333; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: normal; margin: 0; }
button { font: inherit; }

.wrap {
    width: min(var(--wrap), 100% - 32px);
    margin-inline: auto;
}

/* ---------- Laadimisekraan ---------- */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #f5f5f5 url(../images/loader.gif) no-repeat center;
    transition: opacity 0.8s ease, visibility 0.8s;
}
.page-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- Päis ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: var(--header-h);
    background: url(../images/edge_top.png) repeat-x left top;
}
.site-header__inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    height: 100%;
}
.brand {
    position: absolute;
    top: 7px;
    left: 10px;
    z-index: 10;
}
.brand img { width: 166px; }

.lang-switch {
    display: flex;
    gap: 2px;
    margin: 30px 0 0 240px;
}
.lang-switch a { display: block; padding: 0 1px; }
.lang-switch img { width: 16px; height: 11px; }

.main-nav { margin-left: auto; }
.main-nav__toggle { display: none; }
.main-nav__list {
    display: flex;
    padding: 25px 0;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}
.main-nav__list li { padding: 0 11px; }
.main-nav__list li:last-child { padding-right: 0; }
.main-nav__list a {
    display: block;
    color: #fff;
    font: 18px/21px var(--font-heading);
    text-transform: uppercase;
}
.main-nav__list a:hover,
.main-nav__list a.is-current { color: var(--accent); }

/* ---------- Jaotised ---------- */
.section {
    position: relative;
    padding: 3px 0 40px;
}
/* triibuline eraldaja iga jaotise kohal */
.section::before,
.hero-slider::after,
.site-footer::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 12px;
    background: url(../images/heading_bg.png);
    border-block: 1px solid var(--line);
}
.section::before { top: 0; }
.section--hero { padding: 0; }
.section--hero::before { display: none; }

.section-title {
    margin: 60px 0 14px;
    padding: 10px 0;
    background: url(../images/bg_seperator.png) no-repeat center;
    color: var(--dark);
    font-size: 36px;
    line-height: 28px;
    text-align: center;
    text-transform: uppercase;
}
.section-title span {
    position: relative;
    padding: 5px 19px;
    background: url(../images/body-bg.png) repeat;
}
.section-title span::before,
.section-title span::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -4px;
    background: url(../images/circle_bg.png) no-repeat;
}
.section-title span::before { left: -3px; }
.section-title span::after { right: -3px; }

.section-intro {
    margin-bottom: 25px;
    padding-bottom: 15px;
    background: url(../images/line_bg.png) repeat-x left bottom;
    text-align: center;
}

/* ---------- Avaleht: slaider ja loosung ---------- */
.hero-slider {
    position: relative;
    overflow: hidden;
}
.hero-slider::after { bottom: -12px; height: 8px; z-index: 1; }
.hero-slider__track {
    display: grid;
}
.hero-slider__slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s;
}
.hero-slider__slide.is-active { opacity: 1; visibility: visible; }
.hero-slider__slide img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
}
.hero-slider__arrow {
    position: absolute;
    top: 50%;
    z-index: 10;
    width: 40px;
    height: 62px;
    margin-top: -20px;
    padding: 0;
    border: 0;
    background: #2b2b2d url(../images/flexslider_arrow.png) no-repeat 0 0;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    opacity: 0;
    transition: all 0.35s ease;
}
.hero-slider__arrow--prev { left: 0; }
.hero-slider__arrow--next { right: 0; background-position: 100% 0; }
.hero-slider:hover .hero-slider__arrow,
.hero-slider__arrow:focus-visible { opacity: 1; }
.hero-slider__arrow:hover { background-color: var(--accent); }

.tagline {
    margin: 0;
    padding: 50px 0 30px;
    background: url(../images/bg_seperator.png) no-repeat bottom center;
    color: var(--accent);
    font: 36px/1.28 var(--font-heading-bold);
    text-align: center;
    text-transform: uppercase;
}

/* ---------- Maria bänner (liigub kerimisel järele) ---------- */
.maria-badge {
    position: absolute;
    right: 5px;
    top: 0;
    z-index: 99;
    width: 166px;
    height: 116px;
    background: url(../images/maria_logo.png) no-repeat center / contain;
    text-indent: -9999px;
    overflow: hidden;
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

/* ---------- Kaardid (Meist, Menüüd) ---------- */
.card-grid {
    display: grid;
    gap: 25px;
    align-items: start;
}
.card-grid--about { grid-template-columns: repeat(3, 1fr); gap: 25px 40px; }
.card-grid--menus { grid-template-columns: repeat(4, 1fr); gap: 25px 20px; }

.info-card {
    padding: 22px 15px 10px 35px;
    border-radius: 3px;
    background: var(--card);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    color: #fff;
    font: 15px/17px var(--font-serif);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}
.info-card p { margin: 0 0 15px; }
.info-card__title {
    margin-bottom: 18px;
    color: #fff;
    font-size: 26px;
    line-height: 22px;
}
.info-card__label { margin: 9px 0 18px; line-height: 22px; }
.info-card__label span {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 3px;
    background: var(--dark);
    color: #fff;
    font-size: 20px;
}

/* ---------- Galerii ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0 20px;
}
.photo-grid__item {
    position: relative;
    padding: 5px 0 25px;
}
/* vari pildi all */
.photo-grid__item::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 3px;
    z-index: -1;
    width: 100%;
    height: 21px;
    background: url(../images/shadow_bg.png) no-repeat center bottom;
    opacity: 0.9;
}
.photo-grid__link {
    position: relative;
    display: block;
    padding: 5px;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}
.photo-grid__link img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: url(../images/progress.gif) no-repeat center;
}
/* hõljumisel tume kate luubiga */
.photo-grid__link::after {
    content: "";
    position: absolute;
    inset: 5px;
    background: #333 url(../images/hover-magnify.png) no-repeat center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.photo-grid__link:hover::after,
.photo-grid__link:focus-visible::after { opacity: 0.8; }

/* ---------- Kontakt ---------- */
.map-frame {
    margin-bottom: 20px;
    padding: 3px;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}
.map-frame iframe {
    display: block;
    width: 100%;
    height: 310px;
    border: 0;
}

.contact-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.side-title {
    margin-bottom: 20px;
    background: url(../images/heading_bg2.png) repeat-x center 12px;
    color: var(--dark);
    font-size: 20px;
    line-height: 24px;
}
.side-title span {
    padding-right: 10px;
    background: url(../images/body-bg.png) repeat;
}
.contact-layout__info .side-title + .contact-list + .side-title { margin-top: 15px; }

.inquiry-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}
.field {
    width: 100%;
    height: 30px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    color: #555;
    font: 14px/20px var(--font-body);
    transition: border-color 0.2s linear, box-shadow 0.2s linear;
}
select.field { padding: 4px 3px; }
.field:focus {
    border-color: rgba(82, 168, 236, 0.8);
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}
.field.is-invalid { border-color: #e9322d; box-shadow: 0 0 6px #f8b9b7; }
.field::placeholder { color: #999; }
.field--wide { grid-column: 1 / -1; }
textarea.field { height: auto; min-height: 50px; resize: vertical; }

.send-button {
    margin-top: 10px;
    padding: 4px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom-color: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    background: linear-gradient(#fbb450, #f89406);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #fff;
    font-size: 14px;
    line-height: 20px;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
    cursor: pointer;
}
.send-button:hover { background: #f89406; }
.send-button:disabled { opacity: 0.65; cursor: wait; }

/* contact.php vastus */
.form_thanks {
    display: block;
    margin: 0 0 20px;
    padding: 10px;
    border-radius: 3px;
    background: var(--accent);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    color: #fff;
    font: 600 18px/1.3 var(--font-body);
    text-align: center;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

.form_error {
    margin: 0 0 20px;
    padding: 10px;
    border-radius: 3px;
    background: #c9302c;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    color: #fff;
    font: 600 16px/1.35 var(--font-body);
    text-align: center;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

.contact-list__item {
    position: relative;
    padding: 0 0 15px 40px;
    font: bold 15px/24px var(--font-serif);
}
.contact-list__item strong { color: var(--dark); }
.contact-list__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: -3px;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: var(--accent) no-repeat center;
}
.contact-list__item--phone::before { background-image: url(../images/phone_icon_small.png); }
.contact-list__item--email::before { background-image: url(../images/contact_icon_small.png); }
.contact-list__item--facebook::before { background-image: url(../images/facebook_icon_small.png); }
.contact-list__item--home::before { background-image: url(../images/home_icon.png); }

/* ---------- Jalus ---------- */
.site-footer {
    position: relative;
    padding: 20px 0 60px;
}
.site-footer::after { bottom: 0; height: 8px; }
.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 24px;
}
.consent-settings {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}
.consent-settings:hover, .consent-settings:focus-visible { color: var(--accent); }

/* ---------- Küpsiste bänner ja kaardi kohatäide (sama mis Maria lehel) ---------- */
.consent-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 99990;
    padding: 14px 0;
    background: rgba(43, 43, 45, 0.95);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
    color: #fff;
    text-shadow: none;
}
.consent-banner[hidden] { display: none; }
.consent-banner__inner {
    display: flex;
    align-items: center;
    gap: 12px 24px;
}
.consent-banner__text { flex: 1; margin: 0; font-size: 14px; line-height: 1.4; }
.consent-banner__actions,
.map-placeholder__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.consent-button {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f5f5f5;
    color: #333;
    font: 14px/20px var(--font-body);
    text-shadow: none;
    white-space: nowrap;
    cursor: pointer;
}
.consent-button:hover, .consent-button:focus-visible { border-color: #999; background: #fff; color: #333; }
.consent-button--accept {
    border-color: rgba(0, 0, 0, 0.15);
    background: linear-gradient(#fbb450, #f89406);
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.consent-button--accept:hover, .consent-button--accept:focus-visible { border-color: rgba(0, 0, 0, 0.25); background: #f89406; color: #fff; }

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    height: 310px;
    padding: 20px;
    background: #f1ece3;
    color: #555;
    text-align: center;
}
.map-placeholder[hidden] { display: none; }
.map-placeholder p { margin: 0; font-size: 16px; }
.map-placeholder__actions { justify-content: center; }

/* ---------- Lightbox: udustatud taust, pilt otse lehe peal, ilma animatsioonideta ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(20, 14, 10, 0.35);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    text-shadow: none;
}
.lightbox.is-open { display: flex; }
.lightbox__frame { position: relative; }
.lightbox__image {
    display: block;
    max-width: calc(100vw - 140px);
    max-height: calc(100vh - 80px);
    border-radius: 3px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
    user-select: none;
}
.lightbox__nav {
    position: fixed;
    top: 50%;
    width: 48px;
    height: 72px;
    margin-top: -36px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: rgba(43, 43, 45, 0.75);
    color: #fff;
    font: 40px/72px Arial, sans-serif;
    cursor: pointer;
}
.lightbox__nav:hover, .lightbox__nav:focus-visible { background: var(--accent); outline: 0; }
.lightbox__nav--prev { left: 10px; }
.lightbox__nav--next { right: 10px; }
.lightbox__counter {
    position: fixed;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    padding: 3px 10px;
    border-radius: 3px;
    background: rgba(43, 43, 45, 0.75);
    color: #fff;
    font: 13px/18px Arial, sans-serif;
}
.lightbox__close {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(43, 43, 45, 0.75);
    color: #fff;
    font: bold 24px/40px Arial, sans-serif;
    cursor: pointer;
}
.lightbox__close:hover, .lightbox__close:focus-visible { background: var(--accent); outline: 0; }
@media (max-width: 767px) {
    .lightbox__image { max-width: 100vw; max-height: calc(100vh - 120px); border-radius: 0; }
    .lightbox__nav { top: auto; bottom: 8px; margin-top: 0; width: 44px; height: 44px; font-size: 32px; line-height: 44px; }
}

/* ---------- Kuupäevavalija ---------- */
.date-picker {
    position: absolute;
    z-index: 2000;
    width: 17em;
    padding: 0.2em;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #eee;
    color: #333;
    font: 1.1em Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.date-picker[hidden] { display: none; }
.date-picker__head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2em 0;
    border: 1px solid #e78f08;
    border-radius: 4px;
    background: #f6a828 linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.04));
    color: #fff;
    font-weight: bold;
}
.date-picker__title { flex: 1; text-align: center; line-height: 1.8em; }
.date-picker__step {
    width: 1.8em;
    height: 1.8em;
    margin: 0 2px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    color: #fff;
    font: bold 1.1em/1 Arial, sans-serif;
    cursor: pointer;
}
.date-picker__step:hover { border-color: #fbd850; background: #fdf5ce; color: #c77405; }
.date-picker table { width: 100%; border-collapse: collapse; font-size: 0.9em; margin: 0 0 0.4em; }
.date-picker th { padding: 0.7em 0.3em; font-weight: bold; text-align: center; }
.date-picker td { padding: 1px; border: 0; }
.date-picker td button {
    display: block;
    width: 100%;
    padding: 0.2em;
    border: 1px solid #ccc;
    background: #f6f6f6;
    color: #1c94c4;
    font: bold 1em Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
    text-align: right;
    cursor: pointer;
}
.date-picker td button:hover { border-color: #fbcb09; background: #fdf5ce; color: #c77405; }
.date-picker td button.is-today { border-color: #fed22f; background: #ffe45c; color: #363636; }
.date-picker td button.is-selected { border-color: #fbd850; background: #fff; color: #eb8f00; }

/* ==========================================================================
   Kohanduv vaade
   ========================================================================== */
@media (max-width: 979px) {
    .lang-switch { margin-left: 200px; }
    .main-nav__list li { padding: 0 7px; }
    .main-nav__list a { font-size: 16px; }
    .card-grid--about { gap: 25px 20px; }
    .card-grid--menus { grid-template-columns: repeat(2, 1fr); }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
    .hero-slider__arrow { opacity: 1; }
}

@media (max-width: 767px) {
    :root { --header-h: 66px; }
    .site-header { background-size: auto 66px; }
    .brand { top: 4px; left: 0; }
    .brand img { width: 130px; }
    .lang-switch { margin: 26px 0 0 145px; }

    .main-nav { position: relative; }
    .main-nav__toggle {
        display: block;
        margin-top: 12px;
        padding: 6px 10px 6px 40px;
        border: 0;
        border-radius: 3px;
        background: #ecebeb url(../images/menu-icon.png) no-repeat 10px center;
        color: #000;
        font: 20px/24px var(--font-heading);
        cursor: pointer;
    }
    .main-nav__list {
        position: absolute;
        right: 0;
        top: 100%;
        display: none;
        min-width: 150px;
        margin-top: 4px;
        padding: 5px 0;
        background: url(../images/menu_bg.png) repeat;
    }
    .main-nav.is-open .main-nav__list { display: block; }
    .main-nav__list li, .main-nav__list li:last-child { padding: 0; }
    .main-nav__list a { padding: 8px 14px; text-align: center; font-size: 18px; }

    .section-title { margin-top: 45px; font-size: 30px; }
    .tagline { padding: 35px 0 25px; font-size: 26px; }

    .card-grid--about,
    .card-grid--menus { grid-template-columns: 1fr; }
    .info-card { padding: 20px 20px 8px 25px; }

    .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 0 14px; }

    .contact-layout { grid-template-columns: 1fr; gap: 30px; }
    .map-frame iframe, .map-placeholder { height: 250px; }
    .consent-banner__inner { flex-direction: column; align-items: stretch; text-align: center; }
    .consent-banner__actions { justify-content: center; }
    .consent-button { white-space: normal; }

    .maria-badge { width: 110px; height: 77px; }
}

@media (max-width: 479px) {
    .lang-switch { margin-left: 138px; gap: 0; }
    .lang-switch img { width: 14px; height: auto; }
    .brand img { width: 120px; }
    .main-nav__toggle { padding-left: 36px; font-size: 18px; background-position: 8px center; }
    .inquiry-form { grid-template-columns: 1fr; }
    .tagline { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}
