/*!
 * © 2025 Livest Kinnisvara. Kõik õigused kaitstud.
 * Kasutamine ilma loata keelatud.
 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  scroll-behavior: smooth;
}
:root {
  --accent-color: #a85f2d;
  --background-color-secondary: #eef3f373;
  --background-color: #ffffff;
  --font-family: 'Roboto', sans-serif;
  --font-size: 1em;
  --font-weight: 300;
  --footer-color: #1c0f02;
  --header-color: #4fc3f7;
  --line-height: 1.6;
  --text-color: #1c0f02;
}
* {
  font-size: var(--font-size);
  font-weight: var(--font-weight);
}
body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  margin: 0;
}
h1, h2, h3, p {
  margin: 0;
  padding: 0;
}
.large-heading {
  font-size:3rem;
  font-weight: 500;
  line-height:3rem;
  width: fit-content;
}
.heading {
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 1rem;
}
.sub-heading {
  font-size:1.2rem;
  font-weight:600;
}
ul,
ol{
  list-style: none;
  margin: 0;
  padding: 0;
}
a {
  text-decoration: none;
}
.main-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.language-bar {
  align-items: center;
  display: flex;
  gap: 3px;
  justify-content: end;
  line-height: 1.4rem;
  margin: 0;
  position:relative;
  top: 0;
  user-select: none;
  z-index: 4;
}

.language-bar .lang {
  background: transparent;
  border-radius: 4px;
  color: #333;
  cursor: pointer;
  font-size: 12px;
  height: 16px;
  line-height: 16px;;
  padding: 0 4px;
  transition: background-color 0.2s ease;
}


.language-bar .lang:hover {
  background-color: #ddd;
}

.language-bar .lang.active {
  background-color: var(--header-color);
  color: white;
}
.logo {
  align-items: center;
  background-color: var(--header-color);
  display: flex;
  flex-direction: column;
  height: 30vh;
  justify-content: center;
  padding: 1.5rem;
  width: 100%;
}
.logo .large-heading, .logo .heading {
  color: #FFFFFF;
  margin: 0 auto;
  padding: 0;
  text-align: center;
}
.logo  .heading {
  font-size: 1.4rem;
}
nav {
  display: flex;
  padding: 8px;
  width: 100%;
}
nav ul {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  padding: 2px;
  width: 100%;
}
nav ul li {
  text-align: center;
}
nav ul li a, .contact-details a {
  border-radius: 8px;
  color: var(--text-color);
  font-size: var(--font-size);
  font-weight: 500;
  padding: 8px;
  scroll-behavior: smooth;
}
.cta {
  color: var(--header-color);
  outline: 2px solid var(--header-color);
}
nav a:hover, .contact-details a:hover {
  background-color: rgba(0, 0, 0, .1);
  cursor: pointer;
}
nav a:focus, .contact-details a:focus {
  text-shadow: 0 0 .65px #333, 0 0 .65px #333;
}
.hero {
  align-items: center;
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  text-align: center;
  width: 100%;
}
.carousel {
  border: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  height: 300px;
  max-width: 800px;
  min-width: 200px;
  overflow: hidden;
  position: relative;
  width: 100%;
}
.carousel-item {
  display: flex;
  flex-direction: column;
  inset: 0;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  transition: opacity 1s ease-in-out 200ms;
}
.carousel-item[data-active] {
  opacity: 1;
  transition-delay: 0ms;
  z-index: 1;
}
.carousel-item img {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
  z-index: 1;
}
.carousel-button {
  background-color: rgba(0, 0, 0, .3);
  background: none;
  border-radius: .25rem;
  border: none;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  font-size: 2rem;
  padding: 0 .5rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2; 
}
.carousel-button:hover,
.carousel-button:focus {
  background-color: rgba(0, 0, 0, .2);
  color: white;
}

.carousel-button:focus {
  outline: 1px solid black;
}
.carousel-button.previous {
  left: 1rem;
}
.carousel-button.next {
  right: 1rem;
}
.image-label {
  background-color: var(--header-color);
  bottom:0;
  box-sizing: border-box;
  display:grid;
  font-weight: bold;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 1fr;
  height: 2rem;
  line-height: 2rem;
  opacity: 0.9;
  overflow: hidden;
  padding-left: 1rem;
  position: absolute;
  width: 100%;
  z-index: 5;
 
}
.image-label h2 {
  color: white;
  flex-shrink: 0;
  font-size: var(--font-size);
  text-align: start;
  white-space: nowrap;
  width: fit-content;
  z-index: 5;
}
.card-container {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: auto;
  margin: 1rem auto;
  width: 100%;
}
.services {
  align-content: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
  margin: 0 auto;
  max-width: 60rem;
  width: auto;

}
.service-card {
  background-color: var(--background-color-secondary);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  flex: 1 1 300px;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  padding-top: 1.5rem;
  position: relative;
  text-align: left;
  width: 20rem;
  z-index: 1;
}
.card-container img {
  display: block;
  margin: 0 auto;
  width: 3rem;
}
.service-card p {
    margin: 1rem 0;
}
.service-card p:last-of-type {
  margin-top: auto;
}

.service-card ul li {
  width: fit-content;
}
.content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 1rem;
}
.content ul {
  display:flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.content a {
  color: var(--text-color);
  margin: 0;
  padding: 0;
  text-decoration: none;
}
.about img {
  border-radius: 8px;
  float: left;         
  height: auto;
  margin: 0 1rem 0 0; 
  width: 20rem;
}
.about p{
  margin-bottom: 0.5rem;
}
.contacts, .about {
  background-color: var(--background-color-secondary);
  border-radius: 8px;
  margin: 0;
  max-width: 800px;
  min-width: 250px;
  padding: 1rem;
  text-align: left;
  width: 800px;
}
.contacts {
  align-items: start;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  justify-content: space-between;
  max-width: none;
}
.contacts .sub-heading {
  font-size: var(--font-size);
  white-space: nowrap;
}
.contact-form {
  grid-column: 1 / 2;
}
.broker {
  align-items: start;
  display: flex;
  flex-direction: column;
  grid-column: 2 / 4;
  height: 100%;
  justify-content: start;
  margin-left: 25%;
  width: 100%;
}
.img-container {
  display: flex;
  height: auto;
  justify-content: end;
  margin: 1rem auto;
  width: 100%;
}
.broker img {
  border-radius: 8px;
  height: 200px;
  margin-left: 0rem;
  object-fit: cover;
  overflow:hidden;
  width: 200px;
}
.with-icon {
  align-items: center;
  display: inline-flex;
  font-size: var(--font-size);
  gap: 0.4em;
}
.with-icon::before {
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  content: "";
  display: inline-flex;
  height: 20px;
  width: 20px;
}
.with-icon.phone::before {
  background-image: url('./Objektid/Helista_Livest_Kinnisvara.png');
}
.with-icon.email::before {
  background-image: url('./Objektid/Email_Livest_Kinnisvara.png');
}
.contact-form label {
  display: block;
  margin-bottom: 0.1rem;
}
.contact-form input,
.contact-form textarea {
    border-radius: 4px;
    border: 1px solid #ccc;
    font-family: var(--font-family);
    font-size: 0.9rem;
    margin-bottom: .5rem;
    padding: 0.5rem;
    width: 100%;
}
.contact-form button{
  background-color: var(--header-color);
  border-radius: 4px;
  border: none;
  color: #f0f0f0;
  cursor: pointer;
  padding: 0.5rem 1rem;
}
.contact-form button:hover {
  background-color: #3b9ed8;
  color: #FFFFFF;
}
.contact-form button:focus  {
  outline: 2px solid var(--header-color);
  outline-offset: 2px;
}
footer {
  background-color: var(--footer-color);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 3rem;
  min-height: 12rem;
  padding: 1rem;
  text-align: center;
}
footer a {
  color: #f0f0f0;
  font-weight: bold;
  text-decoration: none;
}
footer a:hover {
  border-bottom: 1px solid #ffffff;
  color: #ffffff;
}
.privacy-policy {
  background-color: #f9f9f9;
  border-radius: 8px;
  margin: 2rem auto;
  max-width: 1200px;
  padding: 1rem;
}
.error-message {
  margin-left: 2rem;
}
@media (max-width: 900px) {
    .service-card .content p:last-of-type {
    padding-top: var(--font-size);
    }
    main {
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin: 0 auto;
        width: 97%;
    }
    .large-heading {
    font-size: 2rem;
    }
    .heading {
    font-size: 2rem;
    text-align: start;
    }
    .sub-heading {
    margin-bottom: .4rem;
    }
    .image-label {
    justify-content: center;
    }
    .image-label h2:nth-child(1) {
    width: min-content;
    }
    .image-label h2 {
    font-size: 90%;
    text-align: start;
    }
    .about img {
    height: auto;
    margin-bottom: 1rem;
    width: 50%;
    }
    .carousel {
    width: 100%;
    }
    .services {
    align-items: center;
    flex-direction: column;
    gap: 2rem;
    grid-template-columns: 1fr;
    justify-content: center;
    }
    .service-card,
    .about,
    .contact-form {
    margin: 0 auto;
    width: 100%;
    }
    .service-card {
    height: auto;
    }
    .service-card .content {
    margin: 0 auto;
    }

    .contacts{
    flex-direction: column-reverse;
    overflow: hidden;   
    width: 100%;
    }
    .contact-form {
    margin: 0;
    width:100%;
    }
    .contact-details {
    align-items: center;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    }
    .broker img {
    height: 150px;
    top: -30px;
    width: 150px;
    }
}
@media (max-width: 600px) {
    .logo .heading {
    font-size: 1.2rem;
    }
    .carousel-item {
    display: flex;
    }
    .about img {
    float: none;
    height: 300px;
    margin-bottom: 1rem;
    width: 100%;
    }
    .image-label {
    padding-left: 140px;
    }
    .image-label h2 {
    font-size: .9rem;
    }
    .about {
    padding: 1rem 0.8rem;
    }
    .cta {
    position: relative;
    left: 8px;
    }
    .contacts {
    align-items: center;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    justify-content: center;
    }
    .contact-form, .broker {
    align-items: center;
    grid-column: 1 / 2;
    margin: 0 auto;
    width: 100%;
    } 
    .contact-form {
    grid-row: 3 / 4;
    }
    .contacts .sub-heading {
    font-size: 90%;
    grid-row: 1 / 2;
    text-align: center;
    white-space: normal;
    }
    .contacts .sub-heading {
    font-size: var(--font-size);
    margin: 0 auto;
    text-align: center;
    }
    .broker {
    grid-row: 2 / 3;
    }
    .broker img {
    margin: 0 auto;
    } 
}