:root {
    --main-text-color: #626262;
    --secondary-text-color: #B4AD9E;
    --nav-list-color: #7D7D7D;
    --accent-color: #03A9F4;
    --bg-color: #ffffff;
    --main-text-size: 14px;
    --title-text-size: 30px;
}

body {
    background-color: var(--bg-color);
    font-family: "Playfair Display", serif;
    font-size: var(--main-text-size);
    color: var(--main-text-color);
}

h1, h2, h3, h4, p {
    margin: 0;
}

ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

address {
    font-style: normal;
}


a {
    text-decoration: none;
    color: currentColor;
}

/* .link {
    color: inherit;
    text-decoration: none;
} */

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.visually-hidden {
    position: absolute;
    white-space: nowrap;
    width: 1px;
    height: 1px;
    overflow: hidden;
    border: 0;
    padding: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    margin: -1px;
  }

.container {
    /* max-width: 936px; */
    width: 936px;
    margin: 0 auto;
    /* margin-left: auto;
    margin-right: auto; */
    padding: 0 15px;
    
    outline: 2px dashed #f44336;
}

.header {
    padding-top: 71px;
    padding-bottom: 92px;
}

.header-nav-list {
    width: 555px;
    margin: 0 auto;
    display: flex;
    gap: 100px;
    justify-content: center;
}

.header-nav-link {
    color: var(--nav-list-color);
}

.header-nav-link.current {
    color: var(--accent-color);
}

.gallery {
    padding-bottom: 66px;
}

.gallery-list {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 90px;

    /* 1 v - gap */
    column-gap: 65px;
    row-gap: 130px;
    
    /*  4 v - space-beetween -проміжок, якщо не рівна кількість    */

    /*3 відємні марджини */
    /* margin: -65px -32px; */
}

.gallery-item {
    width: calc((100% - 65px) / 2);
    /* width: 420px; */

    /* 3 відємні марджини */
   /* margin: 65px 32px; */
}

/* 2v - nth-child with 0*/
/* .gallery-item {
    margin-bottom: 130px;
}
.gallery-item:nth-child(2n) {
    margin-left: 65px;
}
.gallery-item:nth-last-child(-n + 2) {
    margin-bottom: 0px;
} */

/* 2v - nth-child */
/* 1 */
/* .gallery-item:nth-child(2n) {
    margin-left: 65px;
} 
.gallery-item:nth-last-child(n + 3) {
    margin-bottom: 130px;
} */
/* 2 */
/* .gallery-item:nth-child(2n + 1) {
    margin-right: 65px;
}
.gallery-item:not(:nth-last-child(-n + 2)) {
    margin-bottom: 130px;
} */

.gallery-photo {
    margin-bottom: 62px;
}

.gallery-name {
    margin-bottom: 32px;
    font-family: "Ubuntu", sans-serif;
    color: var(--secondary-text-color);
}

.gallery-title {
    margin-bottom: 40px;
}

.gallery-btn {
    display: block;
    margin: auto;
    padding: 20px 48px;
    border: 1px solid var(--main-text-color);
    outline: none;
    background-color: transparent;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
    text-align: center;
    color: var(--main-text-color);
    background-color: var(--bg-color);
}
