/* =========================================================
   Paepealse Turismitalu – Modern light theme (A11Y)
   ========================================================= */

/* -------------------------
   1) Design tokens
------------------------- */
:root{
    /* Backgrounds */
    --bg0: #f4f7f5;     /* page base */
    --bg1: #ffffff;     /* cards/surfaces */

    /* Surfaces */
    --surface: #ffffff;
    --surface2: #f0f4f1;
    --border: #cfd8d3;

    /* Text (high contrast) */
    --text: #0f172a;    /* near-black */
    --muted: #334155;   /* readable muted */

    /* Accents (green) */
    --accent: #166534;  /* dark green */
    --accent2: #16a34a; /* green */

    /* Effects */
    --shadow: 0 8px 20px rgba(0,0,0,.08);
    --radius: 16px;

    /* Layout */
    --sidebar: 290px;
    --max: 1240px;
}

/* -------------------------
   2) Base / Reset
------------------------- */
*{ box-sizing: border-box; }

html, body{
    height: 100%;
    min-height: 100%;
}

body{
    margin: 0;
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    line-height: 1.6;

    /* unified background (no repeating sections) */
    background: linear-gradient(180deg, #eef3ef, #f8faf9 40%, #eef3ef);
    background-attachment: fixed;
}

a{
    color: var(--accent);
    text-decoration: none;
}
a:hover{ opacity: .95; }

.muted{ color: var(--muted); }
.small{ font-size: 13px; }
.no-scroll{ overflow: hidden; }

/* Visible focus (keyboard accessibility) */
a:focus-visible,
button:focus-visible{
    outline: 3px solid #22c55e;
    outline-offset: 2px;
    border-radius: 6px;
}

/* -------------------------
   3) Header / Footer chrome
------------------------- */
.site-header{
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.80);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.site-header .inner,
.site-footer .inner{
    max-width: calc(var(--max) + var(--sidebar) + 48px);
    margin: 0 auto;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand{
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark{
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(22,101,52,.14), rgba(22,163,74,.12));
    border: 1px solid var(--border);
    font-weight: 700;
    letter-spacing: .6px;
}

.brand-text{ min-width: 0; }

.brand h1{
    margin: 0;
    font-size: 16px;
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tagline{
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
}

.header-actions{
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Language pills */
.lang{
    display: flex;
    gap: 8px;
}

.lang a{
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.85);
    color: var(--muted);
    font-size: 13px;
}

.lang a:hover{
    background: rgba(255,255,255,1);
    color: var(--text);
}

/* Hamburger */
.menu-toggle{
    display: none;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.90);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 16px;
}

/* Footer */
.site-footer{
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,.65);
}

/* -------------------------
   4) Main layout
------------------------- */
.layout{
    max-width: calc(var(--max) + var(--sidebar) + 48px);
    margin: 0 auto;
    padding: 18px;
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    gap: 18px;
    align-items: start;

    /* ensure no background resets per section */
    background: transparent;
}

/* -------------------------
   5) Sidebar
------------------------- */
.sidebar{
    position: sticky;
    top: 78px;
    align-self: start;

    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar-head{
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}

.sidebar-title{ font-weight: 650; }

.sidebar-close{
    border: 1px solid var(--border);
    background: rgba(255,255,255,.90);
    color: var(--text);
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 14px;
}

.menu{
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
}

.menu a{
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: transform .06s ease, background .12s ease, border-color .12s ease;
}

.menu a:hover{
    background: var(--surface2);
    color: var(--text);
    transform: translateY(-1px);
}

.menu a.active{
    background: rgba(22,163,74,.14);
    border-color: rgba(22,163,74,.30);
    color: var(--text);
}

.sidebar-foot{
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cta{
    display: inline-block;
    text-align: center;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(22,163,74,.35);
    background: rgba(22,163,74,.10);
    color: var(--text);
    font-weight: 650;
}

/* -------------------------
   6) Content
------------------------- */
.content{
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.content-inner{
    padding: 18px 18px 22px;
}

.content-inner h2{
    margin: 0 0 10px;
    color: #052e16; /* very dark green */
}

.content-inner h3{
    margin: 18px 0 10px;
    color: #14532d;
}

.content-inner p,
.content-inner li{
    color: var(--text);
    font-size: 16px;
}

/* Images inside content */
.content-inner img{
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    border: 1px solid var(--border);
    margin: 12px 0 16px;
}

/* Notice box */
.notice{
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface2);
}

/* Inline code */
code{
    background: rgba(15,23,42,.06);
    padding: 2px 6px;
    border-radius: 8px;
}

/* -------------------------
   7) Overlay (mobile drawer)
------------------------- */
.overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    z-index: 120;
}
.overlay.show{
    opacity: 1;
    pointer-events: auto;
}

/* -------------------------
   8) Cards (services etc.)
------------------------- */
.cards{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.card{
    display: block;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.card:hover{
    background: var(--surface2);
}

.card-title{
    font-weight: 700;
    margin-bottom: 6px;
    color: #064e3b;
}

.card-text{
    color: var(--muted);
    margin-bottom: 10px;
}

.card-link{
    color: var(--accent);
    font-weight: 650;
}

/* Home page extras */
.lead{
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 10px;
}

.intro-image{
    max-width: 520px;
    margin: 10px 0 20px;
}

/* Highlight services cards slightly */
.services .card{
    border-color: rgba(22,163,74,.28);
    background: linear-gradient(135deg, rgba(22,163,74,.08), rgba(22,101,52,.04));
}
.services .card:hover{
    box-shadow: 0 12px 30px rgba(0,0,0,.10);
    transform: translateY(-2px);
}

/* -------------------------
   9) Gallery
------------------------- */
.gallery{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.gallery-item{
    display: block;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
}

.gallery-item img{
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    border: 0;
    margin: 0;
    border-radius: 0;
}

/* -------------------------
   10) Responsive
------------------------- */
@media (max-width: 900px){
    .menu-toggle{ display: inline-block; }
    .tagline{ display: none; }

    .layout{
        grid-template-columns: 1fr;
    }

    .sidebar{
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(88vw, 360px);
        transform: translateX(-110%);
        transition: transform .18s ease;
        z-index: 140;
        border-radius: 0 16px 16px 0;
    }
    .sidebar.open{ transform: translateX(0); }

    .sidebar-head{ display: flex; }
}

/* Avalehe intro pilt – väiksem ja stabiilne */
.intro{
    max-width: 520px;
}

.intro .intro-image{
    width: 100%;
    max-width: 520px;
    height: auto;
}

/* Responsive Google Maps embed */
.map-wrapper{
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3; /* hea nii desktopis kui mobiilis */
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface2);
    margin: 12px 0 16px;
}

.map-wrapper iframe{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Language dropdown */
.lang-dropdown{ position: relative; }
.lang-btn{
    border: 1px solid var(--border);
    background: rgba(255,255,255,.90);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
}

.lang-menu{
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 160px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    z-index: 60;
}

.lang-menu a{
    display: block;
    padding: 10px 10px;
    border-radius: 10px;
    color: var(--text);
}

.lang-menu a:hover{
    background: var(--surface2);
}

/* Language flags */
.lang-wrap{
    display: flex;
    align-items: center;
}

/* Desktop */
.lang-inline{
    display: flex;
    gap: 10px;
}

.lang-inline a{
    padding: 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.9);
}

.lang-inline a:hover{
    background: var(--surface2);
}

.lang-inline img{
    width: 22px;
    height: 16px;
    border-radius: 2px;
}

/* Mobile dropdown */
.lang-dropdown{
    position: relative;
    display: none;
}

.lang-btn{
    border: 1px solid var(--border);
    background: rgba(255,255,255,.9);
    border-radius: 12px;
    padding: 8px 10px;
}

.lang-btn img{
    width: 22px;
    height: 16px;
    border-radius: 2px;
}

.lang-menu{
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    z-index: 60;
}

.lang-menu a{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
}

.lang-menu a:hover{
    background: var(--surface2);
}

.lang-menu img{
    width: 20px;
    height: 14px;
    border-radius: 2px;
}

/* Switch desktop ↔ mobile */
@media (max-width: 900px){
    .lang-inline{ display: none; }
    .lang-dropdown{ display: block; }
}

.lang-btn{
    background: inherit; /* võtab headeri tausta */
    border: 1px solid rgba(255,255,255,.35);
}