/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

svg {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    visibility: hidden;
}

header, nav, .navbar, .nav-links, .logo {
    vertical-align: top;
}

body {
    font-family: Arial, sans-serif !important;
    color: #333;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

header.nav-hidden {
    transform: translateY(-100%);
}

header.scrolled .navbar {
    background-color: rgb(139, 98, 73); /* Muutub tumedamaks */
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 5px 40px; /* Muutub veidi kitsamaks (compact mode) */
    transition: all 0.3s ease;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
    /* Muudame tausta väga läbipaistvaks, et pilt paistaks läbi */
    background-color: rgba(126, 49, 5, 0.2); 
}

.logo {
    padding: 1px 1px;
    font-weight: bold;
    color: white;
}

.logo a {
    text-decoration: none;
    font-weight: bold;
    color: white;
}

.logo img {
    display: block; /* Eemaldab pildi all oleva nähtamatu tühimiku */
    margin: 0;
    width: 12%;
    height: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 15px;
    margin: 0; /* Oluline! */
    padding: 0; /* Oluline! */
    align-items: center;
    font-size: 13px;
}

.nav-links a {
    text-decoration: none;
    position: relative;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
    padding: 12px 14px;
    border-radius: 5px;
    color: #ffffff;
    background-color: rgba(126, 49, 5, 0.404);
    font-weight: 500;
    display: inline-block
}

.nav-links a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ffffff;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    background-color: rgba(163, 71, 18, 0.4); /* Muudab värvi veidi heledamaks/erksamaks */
    transform: translateY(-2px); /* Tõstab nuppu visuaalselt 2 pikslit ülespoole */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* Suurendab varju, rõhutades tõusmist */
    text-decoration: none; 
}

/* HERO SECTION */
.hero {
    position: relative;
    width: 100%;
    height: 100vh; /* Võtab kogu ekraani kõrguse */
    background: url("../Pildid/pilt.jpg") center/cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    width: fit-content;
    max-width: 600px; 
    background-color: rgba(112, 38, 15, 0.6);
    padding: 20px 80px;
    border-radius: 12px;
}

.hero h1 {
    font-size: 60px;
    margin-top: 20px;
    font-weight: 300;
    font-family: 'Georgia', cursive !important;
    -webkit-font-smoothing: antialiased;
    display: inline-block; /* Aitab filtril paremini tekstile "kinnituda" */
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-shadow: 
        1px 1px 0px rgba(0,0,0,0.2),
        -1px -1px 0px rgba(0,0,0,0.1);
    filter: url(#rough);
}

/* WHITE CONTENT SECTION */
.content {
    background: #f3f3f3;
    padding: 100px 20px;
    display: flex;
    justify-content: center;
}

.content-inner {
    max-width: 900px;
    background: white;
    padding: 60px;
    text-align: left;
}

.columns {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    margin-bottom: 60px;
}

/* Päise osa: info vasakul, pildid paremal */
.course-header {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.course-info {
    flex: 1.2;
    min-width: 300px;
}

.course-info h2 {
    font-size: 28px;
    margin-bottom: 5px;
    color: #333;
}

.year-label {
    display: block;
    font-size: 22px;
    color: #7eb3b9; /* See spetsiifiline sinine toon pildilt */
    margin-bottom: 15px;
    font-weight: bold;
}

/* Ümmarguste piltide võrgustik (3 tulpas) */
.image-bubbles {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    min-width: 280px;
}

.bubble {
    aspect-ratio: 1 / 1; /* Teeb elemendi täiuslikuks ruuduks */
    border-radius: 50%; /* Teeb ruudust ringi */
    overflow: hidden;
    border: 2px solid #f0f0f0;
    background: #eee;
}

.bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Hoiab ära pildi väljavenimise */
    display: block;
}

/* MODAL TAUST */
.modal {
    display: none; 
    position: fixed;
    z-index: 9999; /* Väga kõrge, et miski peale ei jääks */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Tumedam taust toob pildi esile */
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

/* SUUR PILT EKRAANIL */
.modal-content {
    display: block;
    margin: auto;
    
    /* See rida sunnib pildi võtma 80% ekraani laiusest, 
       isegi kui fail ise on väiksem */
    width: 80vw; 
    
    /* See tagab, et pilt ei läheks proportsioonist välja */
    height: auto; 
    
    /* Piirangud, et pilt ei läheks hiiglaslikuks väga suurtel ekraanidel */
    max-width: 1000px; 
    max-height: 80vh;
    
    object-fit: contain;
    border: 4px solid white;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: zoomEffect 0.3s ease-out;
}

/* Animatsioon, et pilt ei "hüppaks" ette */
@keyframes zoomEffect {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* SULGEMISE NUPP */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover {
    color: #bbb;
}

.bubble img {
    cursor: pointer; /* Näitab kasutajale, et pilt on klikitav */
}

/* Testimonialide kujundus (2 tulpas) */
.testimonials-section {
    margin-top: 40px;
}

.testimonials-section h3 {
    font-size: 24px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.t-item {
    font-size: 0.95rem;
    line-height: 1.5;
}

.t-item p {
    font-style: italic;
    color: #555;
    margin-bottom: 10px;
}

.t-item strong {
    display: block;
    color: #333;
    font-style: normal;
}

/* Horisontaalne eraldusjoon aastate vahel */
.divider {
    border: 0;
    border-top: 2px solid #dadada;
    margin: 40px 0;
}

/* IMAGE SECTION (parallax style) */
.image-section {
    height: 900px;
    background: url("../Pildid/pilt.jpg") center/cover fixed no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-overlay {
    background: rgba(0,0,0,0.5);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 40px;
}

.schedule {
    color: white;
    text-align: center;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
    max-width: 1000px;
}

.schedule h3 {
    margin-bottom: 5px;
    font-size: 24px;
    font-weight: 300;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
}

.schedule h4 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 300;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
}

.schedule p {
    margin-top: 30px;
    font-size: 28px;
    line-height: 1.6;
}

.footer {
    height: auto;
    width: 100%;
    background-color: rgb(139, 98, 73);
    padding: 20px 20px 20px 20px;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
}

.footer-container {
    background-color: rgba(0, 0, 0, 0);
    margin: 0 auto;
    display: flex;
    justify-content: center; /* Lükkab kõik veerud lehe keskele */
    flex-wrap: wrap;
    gap: 60px; /* Panin vahe veidi suuremaks, et veerud ei oleks liiga pead-jalad koos */
}

/* 1. VEERG (Logo ja nimi) - Joondab sisu keskele */
.footer-content {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ÜLEJÄÄNUD VEERUD (Kontakt, Sotsiaalmeedia, Partnerid) - Joondab sisu keskele */
.footer-col {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo {
    width: 100px;
    height: auto;
}

/* Pealkirjad */
.footer-heading {
  color: #ffffff;
  font-size: 16px;
  margin-bottom: 20px;
  font-weight: bold;
}

.footer-nimi {
  font-size: 20px;
  color: #ffffff;
  margin-top: 15px;
}

/* Tekst ja nimekirjad */
.footer-text {
  font-size: 14px;
  color: #ffffff;
  margin-top: 15px;
}

.contact-list {
  list-style: none; /* Eemaldab täpid */
  padding: 0;
  margin: 0;
}

/* Kontaktide ridade tsentreerimine */
.contact-list li {
  margin-bottom: 12px;
  font-size: 14px;
  display: flex;
  align-items: center; 
  justify-content: center; /* Lükkab ikooni ja teksti veeru keskele */
  color: #ffffff;
}

.contact-list .icon {
  margin-right: 10px;
  font-size: 16px;
  color: #ffffff;
}

/* Sotsiaalmeedia ringide tsentreerimine */
.social-icons {
  display: flex;
  gap: 15px;
  justify-content: center; /* Lükkab nupud veeru keskele */
}

.social-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #d8d8d8; /* Nupu tumehall taust */
  color: #fff;
  border-radius: 50%; /* Teeb nupu ümmarguseks */
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.social-circle:hover {
  background-color: #b9b9b9; /* Hover efekt */
  transform: translateY(-2px);
}

/* Partnerite piltide tsentreerimine */
.partner-logos {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center; /* Lükkab logod veeru keskele */
}

.partner-logos img {
  max-width: 100px; /* Piirab logode suurust */
  height: auto;
}

/* Alumine joon ja copyright */
.footer-bottom {
  max-width: 1600px;
  margin: 40px auto 0 auto;
  padding-top: 20px;
  border-top: 1px solid #e9e9e9; 
  text-align: center;
  font-size: 13px;
  color: #ffffff;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    width: 35px;
    height: auto;
    transition: transform 0.2s ease;
}

.menu-toggle:active {
    transform: scale(0.9);
}

.menu-toggle img {
    width: 100%;
    display: block;
    /* Kui ikoon on pildil must, siis see rida muudab selle valgeks, et sobida navbariga */
    filter: brightness(0) invert(1);
}

/* NAVBARI MUUDATUSED ALATES 1000px */
@media (max-width: 1000px) {
    .navbar {
        padding: 10px 20px; /* Vähendame veidi ääri */
    }

    .menu-toggle {
        display: block; /* Näitame ikooni */
        order: 2; /* Viib ikooni paremale poole */
    }

    .logo {
        order: 1;
    }

    .nav-links {
        display: flex;
        position: absolute;
        top: 100%;
        right: 0;           /* Menüü joondub paremale serva */
        width: auto;         /* Laius kohandub sisu järgi */
        min-width: 200px;    /* Tagab, et menüü pole liiga kitsas */
        background-color: rgb(139, 98, 73);
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        box-shadow: -5px 5px 15px rgba(0,0,0,0.3); /* Vari ainult vasakul ja all */
        z-index: 999;
    }

    .nav-links.active {
        max-height: 600px;
        padding: 10px 0;    /* Lisab veidi ruumi üles ja alla */
    }

    .nav-links a {
        display: block;
        padding: 15px 40px !important; /* Suurem padding külgedel määrab menüü laiuse */
        background-color: transparent !important;
        border-radius: 0;
        text-align: center;
        white-space: nowrap; /* Keelab teksti murdmise mitmele reale */
        font-size: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    .nav-links a::after {
        display: none; /* Eemaldame hover-joone mobiilis */
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    /* 0. ÜLDINE KONTROLL - Keelab horisontaalse kerimise ja tsentreerib sisu */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Tsentreerib kõik pealkirjad valge kasti sees ja mujal */
    h1, h2, h3, h4, 
    .course-info h2, 
    .testimonials-section h3,
    [class^="l"] h1 {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        display: block !important;
    }

    .columns {
        flex-direction: column;
        gap: 40px;
    }

    /* 1. HERO SECTION */
    .hero {
        height: 100vh; 
        background-attachment: scroll; 
    }

    .hero-content {
        width: 90%; 
        padding: 30px 20px;
        max-width: none;
    }

    .hero h1 {
        font-size: 32px; 
        letter-spacing: 1px;
    }

    /* --- VALGE KASTI SISU (Course Header & Info) --- */
    .course-header {
        display: flex !important;
        flex-direction: column !important; 
        align-items: center !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .course-info {
        width: 100% !important;
        max-width: 100% !important;
        text-align: center !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    .course-info h2 {
        font-size: 22px !important;
        line-height: 1.2 !important;
        word-wrap: break-word !important;
    }

    .course-info p {
        font-size: 15px !important;
        line-height: 1.5 !important;
        margin: 15px 0 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important; 
    }

    .year-label {
        display: block !important;
        text-align: center !important;
        width: 100% !important;
        margin-bottom: 10px !important;
    }

    /* Mullide sektsioon - sunnitud keskele */
    .image-bubbles {
        display: flex !important;
        flex-wrap: wrap !important; 
        justify-content: center !important;
        gap: 15px !important;
        width: 100% !important;
        max-width: 320px !important; /* Hoiab mullid kompaktselt keskel */
        margin: 20px auto !important;
        padding: 0 !important;
    }

    .bubble {
        flex: 0 0 auto !important;
    }

    .bubble img {
        width: 90px !important; 
        height: 90px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
    }

    /* Testimonials sektsioon */
    .testimonials-section {
        width: 100% !important;
        margin-top: 30px !important;
        padding: 0 !important;
        text-align: center !important;
    }

    .testimonial-grid {
        display: flex !important;
        flex-direction: column !important; 
        gap: 20px !important;
        width: 100% !important;
    }

    .t-item {
        width: 100% !important;
        padding: 15px !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    /* 2. IMAGE SECTION */
    .image-section {
        height: auto; 
        min-height: 400px; 
        background-attachment: scroll; 
    }

    .image-overlay {
        height: auto; 
        padding: 20px;
    }

    .schedule {
        width: 100%;
        max-width: 100%; 
    }

    .schedule p {
        font-size: 16px; 
        line-height: 1.4;
        margin-top: 15px;
    }

    /* 4. Videote vahed */
    .video {
        height: auto; 
        padding: 20px; 
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .video iframe, 
    .video video {
        width: 100%; 
        max-width: 450px; 
        height: auto !important; 
        aspect-ratio: 16 / 9; 
        border-radius: 12px; 
    }

    .info, .video {
        padding: 20px;
    }

    /* FOOTER */
    .footer-container {
        flex-direction: column; 
        gap: 40px;
        text-align: center;
    }

    .footer-content {
        width: 100%;
        min-width: 0;
    }

    .contact-list li {
        justify-content: center; 
    }

    .partner-logos {
        flex-wrap: wrap; 
        justify-content: center;
    }

    .partner-logos img {
        max-width: 80px; 
    }

    .footer-bottom {
        margin-top: 20px;
        padding-top: 15px;
    }
}

/* Eriti väiksed ekraanid */
@media (max-width: 480px) {
    .hero h1 { font-size: 24px !important; }
    .image-bubbles { 
        display: flex !important;
        justify-content: center !important;
    }
    .schedule p {
        font-size: 16px;
    }
}

/* PARANDUS KÜLILIVAATELE (LANDSCAPE) */
@media (max-height: 500px) and (orientation: landscape) {
    
    /* Hero sektsioon ei tohiks võtta tervet ekraani, muidu ei saa kerida */
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 80px 0; /* Lisab ruumi üles ja alla, et tekst ei lämbuks */
    }

    .hero-content {
        padding: 20px 40px;
    }

    .hero h1 {
        font-size: 32px !important; /* Vähendame teksti, et see mahuks ära */
        margin-top: 10px;
    }

    .content-inner {
        padding: 30px;
    }

    /* Image section parallax (pilt2.jpg) ei tööta hästi madalal ekraanil */
    .image-section {
        height: auto;
        min-height: 100vh;
        background-attachment: scroll; /* Fixid pilt on madalal ekraanil segadusttekitav */
    }

    .schedule p {
        font-size: 18px;
        line-height: 1.2;
    }
}
