/*
  1. Use a more-intuitive box-sizing model.
*/
*,
*::before,
*::after {
  box-sizing: border-box;
}
/*
  2. Remove default margin
*/
* {
  margin: 0;
}
/*
  3. Allow percentage-based heights in the application
*/
html,
body {
  height: 100%;
}
/*
  Typographic tweaks!
  4. Add accessible line-height
  5. Improve text rendering
*/
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/*
  6. Improve media defaults
*/
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}
/*
  7. Remove built-in form typography styles
*/
input,
button,
textarea,
select {
  font: inherit;
}
/*
  8. Avoid text overflows
*/
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}
/*
  9. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

ul,
li {
  margin: 0;
  padding: 0;
}

/* */

:root {
  --h1-font-size: clamp(3.2em, 2.8em + 1vw, 4em);
  --h2-font-size: clamp(2.2em, 2em + 0.5vw, 2.6em);
  --h3-font-size: calc(var(--h2-font-size) / 1.2);
  --p-font-size: clamp(1.4em, 13px + 0.25vw, 1.6em);

  /**/
  --color-main: #5e0b25;
  --color-sub: #1a2034;
  --color-bg: #ecdfcd;
  --font-header: 'Montserrat', serif;
  --font-body: 'Montserrat', serif;

  --h1-margin-bottom: clamp(32px, 24px + 2vw, 48px);
  --h2-margin-bottom: 24px;
  --h3-margin: 48px;

  --s_24_32: clamp(24px, 20px + 1vw, 32px);
  --s_16_32: clamp(16px, 8px + 2vw, 32px);

  --section-padding: clamp(48px, 40px + 2vw, 64px);
  --div-nekretnineDet-font-size: 1.6em;
  --ul-text-small-font-size: 1.6em;
}

html {
  scroll-behavior: smooth;
}

body {
  color: #333;
  font-family: var(--font-body);
  font-size: 62.5%;
  font-weight: 300;
}

p,
ul {
  font-size: var(--p-font-size);
  line-height: 1.6;
}

p + p,
ul + p {
  margin-top: calc(var(--s_24_32) * 0.75);
}

p + ul {
  margin-top: 16px;
}

ul.text {
  li {
    list-style: none;
    padding-left: 32px;
    position: relative;

    &:before {
      content: '✅';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
    }
  }

  li + li {
    margin-top: 4px;
  }
}

.c {
  text-align: center;
}

span.head {
  font-weight: 500;
}

/**/

a.link {
  color: var(--color-main);
  text-decoration: underline;

  &:hover {
    text-decoration: none;
  }
}

header {
  display: flex;
  height: 100vh;
  padding: min(5vw, 64px);

  > div {
    align-items: flex-end;
    animation: fadeIn 0.5s ease-in-out 1s forwards;
    background-image: url('images/index.jpg');
    background-position: center;
    background-size: cover;
    border-radius: 8px;
    display: flex;
    justify-content: flex-end;
    flex: 1;
    position: relative;
    opacity: 0;
    overflow: hidden;
    transition: opacity 2s ease-in-out;

    nav {
      bottom: var(--s_16_32);
      left: var(--s_16_32);
      position: absolute;
      width: calc(100% - 320px - calc(var(--s_16_32) * 2));

      ul {
        display: flex;
        gap: 8px;
        list-style: none;

        & > li {
          display: flex;
          flex: 1 0 auto;
        }

        @media screen and (max-width: 1400px) {
          display: grid;
          grid-template-columns: 1fr 1fr 1fr;
          gap: 8px;
        }

        @media screen and (max-width: 1150px) {
          display: grid;
          grid-template-columns: 1fr 1fr;
          gap: 8px;
        }

        @media screen and (max-width: 950px) {
          display: grid;
          grid-template-columns: 1fr;
          gap: 8px;
        }
      }

      @media screen and (max-width: 800px) {
        bottom: auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        top: var(--s_16_32);
        width: calc(100% - calc(var(--s_16_32) * 2));

        ul {
          grid-template-columns: 1fr 1fr;
        }
      }

      a {
        color: #000;
        background-color: rgba(255, 255, 255, 1);
        border-radius: 8px;
        display: flex;
        flex: 1 0 auto;
        justify-content: center;
        padding: 16px;
        text-align: center;
        text-decoration: none;
        transition: all 0.5s;

        &:hover {
          background-color: rgba(255, 255, 255, 0.5);
        }
      }
    }

    div.logo {
      animation: fadeIn 0.5s ease-in-out 2.5s forwards;
      border-top: calc(var(--s_16_32) / 2) solid rgba(255, 255, 255, 1);
      border-left: calc(var(--s_16_32) / 2) solid rgba(255, 255, 255, 1);
      opacity: 0;
      width: min(320px, 100%);

      @media screen and (max-width: 600px) {
        border-left: 0;
        width: 100%;
      }
    }
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

section {
  padding: calc(var(--s_24_32) * 2) 0;

  & + section {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  h2 {
    font-size: var(--h1-font-size);
    font-weight: 400;
    margin: 0 auto calc(var(--s_24_32) * 1.5);
    width: min(1080px, 90%);
    text-align: center;
  }
}

#onama {
  background-color: rgba(0, 0, 0, 0.05);

  > div {
    columns: 2;
    gap: calc(var(--s_16_32) * 2);
    margin: 0 auto;
    width: min(1080px, 90%);

    p {
      text-align: justify;
    }

    @media screen and (max-width: 760px) {
      columns: 1;

      p {
        text-align: left;
      }
    }
  }
}

#kontakt {
  @media screen and (max-width: 640px) {
    padding-bottom: 8px;

    fieldset.upit {
      border-radius: 0;
    }
  }
}

ul.gallery {
  display: grid;
  gap: calc(var(--s_24_32) / 2);
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  list-style: none;
  margin: 0 auto;
  width: min(1200px, 90%);

  li {
    background-color: #eee;
    border-radius: 8px;
    display: flex;
    overflow: hidden;

    &:nth-child(1) {
      grid-column: span 2;
      grid-row: span 2;
    }

    &:nth-child(2),
    &:nth-child(3) {
      grid-column: span 1;
      grid-row: span 1;
    }

    &:nth-child(4) {
      grid-column: span 2;
      grid-row: span 2;
    }

    &:nth-child(5),
    &:nth-child(6) {
      grid-column: span 1;
      grid-row: span 1;
    }

    a {
      display: flex;
    }

    img {
      aspect-ratio: 4 / 3;
      display: flex;
      object-fit: cover;
      transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;

      &:hover {
        transform: scale(1.1);
      }
    }

    span {
      background-color: #fff;
      border-radius: 4px;
      bottom: 16px;
      display: flex;
      padding: 8px 16px;
      position: absolute;
      right: 16px;
    }
  }

  @media screen and (max-width: 760px) {
    grid-template-columns: 1fr 1fr;

    li {
      &:nth-child(1) {
        grid-column: span 1;
        grid-row: span 1;
      }

      &:nth-child(2),
      &:nth-child(3) {
        grid-column: span 1;
        grid-row: span 1;
      }

      &:nth-child(4) {
        grid-column: span 1;
        grid-row: span 1;
      }

      &:nth-child(5),
      &:nth-child(6) {
        grid-column: span 1;
        grid-row: span 1;
      }
    }

    img {
      aspect-ratio: 3 / 2 !important;
    }
  }

  @media screen and (max-width: 460px) {
    grid-template-columns: 1fr;

    li {
      &:first-child {
        grid-column: 1 / 1;
        grid-row: 1 / 1;
      }

      &:last-child {
        grid-column: 1 / 1;
      }
    }
  }
}

ul.gallery_list {
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  list-style: none;
  margin: 0 auto;
  width: min(1200px, 90%);

  li {
    aspect-ratio: 4 / 3;
    background-color: #eee;
    border-radius: 8px;
    overflow: hidden;

    img {
      aspect-ratio: 4 / 3;
      object-fit: cover;
      transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
      width: 100%;

      &:hover {
        transform: scale(1.1);
      }
    }
  }

  @media screen and (max-width: 760px) {
    li {
      aspect-ratio: 3 / 2;
    }
  }
}

/**/

.holder {
  margin: 48px auto 0;
  width: min(100%, 640px);
}

h3 {
  font-size: 3em;
  font-weight: 400;
  margin: 0 auto 32px;
  width: 90%;
  text-align: center;
}

fieldset.upit {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  margin: 0 auto;
  max-width: 760px;
  padding: var(--s_24_32);

  ul {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
  }

  li {
    align-items: center;
    display: flex;
    flex: 0 0 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;

    &:last-child {
      margin-top: calc(var(--s_24_32) / 2);
    }

    &.chck {
      align-items: flex-start;
      flex-wrap: nowrap;
    }
  }

  label {
    display: flex;
    padding: 0 4px;

    &.err {
      color: red;
      font-weight: bold;
    }
  }
}

a.mehanizacija {
  border-radius: 8px;
  display: block;
  overflow: hidden;
  width: 100%;

  & > img {
    border-radius: 8px;
    margin-inline: auto;
    width: 90%;
  }
}

fieldset.upit li.chck label {
  align-items: flex-start;
  display: flex;
  font-size: 0.8em;
  line-height: 125%;
}

#captcha-label {
  color: #000;
  font-weight: 500;
  transition: color 0.3s ease;
}

#captcha-label.error {
  color: #d32f2f;
  font-weight: 600;
}

#captcha.error {
  border: 2px solid #d32f2f;
  background-color: #ffebee;
}

fieldset.upit div.provjera {
  align-items: center;
  color: #aaa;
  display: flex;
  margin: 0;
  padding: 0;
  width: 125px;

  img {
    border: 1px solid #aaa;
    height: 34px;
  }

  span {
    align-items: center;
    display: flex;
    font-size: var(--p-font-size);
    justify-content: center;
    padding: 0 3px;
    width: 25px;
  }
}

fieldset.upit input.text,
fieldset.upit input.textx,
input.slike,
select,
textarea,
input.submit {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-sizing: border-box;
  color: #000;
  margin: 0;
  padding: 12px 16px;
  width: 100%;
}

#captcha {
  width: 180px;
}

fieldset.upit input.textx {
  width: 120px;
}

textarea {
  padding: 16px;
}

input.checkbox {
  margin: 4px 12px 0 0;
}

input.submit {
  background: #000;
  color: #fff;
  cursor: pointer;
  padding: 16px;
  transition: all 0.5s;
}

input.submit:hover {
  background: green;
}

#results.ok,
#results.err {
  margin-bottom: 24px;
}

#results p {
  background: #f7f7f7;
  border: 1px solid #eee;
  flex: 0 0 100%;
  font-weight: bold;
  justify-content: center;
  margin: 0 auto;
  max-width: 760px;
  padding: 16px;
}

#results_inner {
  border-radius: 8px;
  color: red;
  display: none;
  font-size: 1.6em;
  text-align: center;
  width: 100%;
}

#results.ok #results_inner {
  color: green;
}

#results.ok #results_inner,
#results.err #results_inner {
  display: flex;
}

/**/

/**/

footer {
  background-color: #eee;
  padding: calc(var(--s_24_32) * 2) 0;

  p {
    margin: 0 auto;
    text-align: center;
    width: 90%;

    & + p {
      margin-top: 16px;
    }
  }
}

.lazyload,
.lazyloading {
  opacity: 0;
}

.lazyloaded {
  opacity: 1;
  /*  transition is applied to lazyloaded not lazyload */
  transition: opacity 300ms;
}
