:root {
    --background-color: #ecebea;
    --accent-color: #006A71;
    --primary-color: #9ACBD0;
    --text-grey: #303637;
    --logo-font: Cinzel;
    --headers-font: ;
    --body-font: ;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.space {
    height: 30px;
}

/* grid do całej strony */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 20px;
    gap: 45px;
    width: 100%;
}

.grid-item {
    height: 520px;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

h2 {
    color: var(--accent-color);
}

h3 {
    color: var(--text-grey);
    font-size: 18px;
}

/* logo part*/
.logo p {
    font-family: 'Cinzel';
    font-size: 20px;
    color: var(--text-grey);
    padding-bottom: 20px;
    font-weight: bold;
}

.logo {
    text-align: center;
}

.logo img {
    width: 100%;
    height: 380px;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
}

.typing-text {
    padding-top: 20px;
    font-family: 'Cinzel';
    font-size: 44px;
    color: var(--accent-color);
}

/* nawigacja strony */
.header {
    width: 100%;
    padding: 10px 0px;
    display: flex;
    flex-direction: column;
    justify-items: center;
    background-color: var(--primary-color);
}

.nav-list {
    display: flex;
    list-style: none;
    justify-content: center;
    padding: 0;
    gap: 25px;
    font-size: 18px;
}

.menu {
    list-style: none;
}

a {
    text-decoration: none;
    color: var(--text-grey);
}

/* link do sociali */
.facebook-link {
    position: fixed;
    top: 250px;
    left: 0;
    display: flex;
    align-items: center;
    background-color: var(--primary-color);
    padding: 5px;
    border-radius: 0 5px 5px 0;
    transition: width 0.3s ease-in-out;
    overflow: hidden;
    width: 40px;
    box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
}

.fb-icon {
    width: 30px;
    height: auto;
}

.facebook-link:hover {
    width: 150px;
}

.fb-text {
    color: var(--background-color);
    font-size: 14px;
    text-decoration: none;
    margin-left: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.facebook-link:hover .fb-text {
    opacity: 1;
}

/* o mnie */
#about h2 {
    font-size: 18px;
}

#about p {
    text-align: justify;
    font-size: 15px;
    line-height: 2.5;
    text-indent: 30px;
}

#gradowska-zdjecie {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
}

.fade-in {
    opacity: 0;
    transition: opacity 5s ease-in-out;
    /* Czas trwania efektu */
}


/* books */
#books {
    width: 100%;
    padding: 0 50px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.card-container {
    perspective: 1000px;
    cursor: pointer;
    height: 450px;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s;
}

.card div {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card .front {
    background-image: url(A_seamless_digital_illustration_features_a_pattern.png);
    display: flex;
    flex-direction: column;
    color: rgb(250, 235, 215);
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
}

.book-image {
    width: 65%;
    height: auto;
    box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
    padding: 5px;
}

.card .back {
    background: var(--primary-color);
    color: var(--text-grey);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: justify;
    transform: rotateY(180deg);
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
}

article p {
    font-size: 16px;
    padding: 8px 20px;
}

.card.flipped {
    transform: rotateY(180deg);
}

.icon {
    width: 30px;
    height: auto;
    color: var(--text-grey);
    padding-top: 20px;
}

/* tekst z tyłu carda */
.article {
    padding: 0 20px;
}

.card .back p {
    font-size: 13px;
    line-height: 15px;
    text-indent: 15px;
    color: var(--text-grey);
}

.button-link {
    display: inline-block;
    width: 80px;
    height: 40px;
    border-radius: 8px;
    text-decoration: none;
    background-color: var(--accent-color);
    color: var(--background-color);
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    margin-top: 15px;
    box-shadow: 0px 2px 4px var(--text-grey);
}

.button-link:hover {
    background-color: var(--text-grey);
}

.button-link:active {
    transform: scale(0.98);
}

.card .back a {
    padding: 10px;
}


/* meetings*/
#meetings {
    line-height: 2.3;
}

#meetings-description p {
    font-size: 16px;
}

#meetings-links a {
    color: var(--accent-color);
    font-size: 14px;
}

#meetings-links a:hover {
    color: var(--primary-color);
}

#meetings-links a:visited {
    color: var(--text-grey);
}

/* scripts */
#scripts a {
    color: var(--accent-color);
    line-height: 2.0;
    font-weight: normal;
    font-size: 15px;
}

#scripts a:hover {
    color: var(--primary-color);
}

#scripts a:visited {
    color: var(--text-grey);
}


/* slider */
.slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 10px;
    background-image: url(A_seamless_digital_illustration_features_a_pattern.png);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
}

.slider img {
    position: absolute;
    width: 90%;
    max-height: 90%;
    opacity: 0;
    transition: opacity 1s;
    box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
}

.slider img.active {
    opacity: 1;
}

/* offer */
#offer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0px 25px;
    line-height: 30px;
}

#offer a {
    color: var(--accent-color);
    text-emphasis-color: var(--accent-color);
}

#offer a:hover {
    color: var(--primary-color);
}

.script-title {
    font-weight: 600;
}

/*dialog for script*/
.content p {
    margin: 10px 0;
}

a.showFragment {
    color: blue;
    text-decoration: none;
    cursor: pointer;
}

a.showFragment:hover {
    text-decoration: underline;
}

.dialog {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
}

.dialog-content {
    background-color: var(--background-color);
    padding: 40px;
    border-radius: 5px;
    width: 60%;
    max-width: 500px;
    color: var(--text-grey);
}

.close {
    color: var(--accent-color);
    float: right;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* contact and footer */

#contact {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 2.5;
}

#contact p {
    font-size: 15px;
}

.author {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    color: var(--text-grey);
    width: 100%;
    padding: 10px;
}

#author-link {
    text-decoration: none;
    color: var(--text-grey);
}

#author-link:hover {
    text-decoration: none;
    color: var(--accent-color);
}


/* MEDIA RULES */

@media (min-width: 450px) and (max-width:950px) {
    html body {
        max-width: 100%;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: 1.5;
    }

    h2{
        font-size: 18px;
    }

    p {
        font-size: 12px;
    }

    .logo img {
        width: 100%;
        height: auto;
    }

    .grid-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto;
    }

    .grid-item {
        width: 100%;
        max-width: 950px;
        height: auto;
    }

    #gradowska-zdjecie {
        width: 100%;
        max-width: 600px;
        min-width: 400px;
        height: 380px;
        object-fit: cover;
        box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
    }

    .nav-list {
        display: flex;
        list-style: none;
        justify-content: center;
        padding: 0;
        gap: 15px;
        font-size: 14px;
    }

    .space {
        height: 20px;
    }

    .cards-grid {
        width: 100%;
        min-height: 320px;
        min-width: 450px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 0;
        margin: 0;
    }

    .card {
        width: 100%;
        min-height: 320px;
        min-width: 450px;
    }

    .book-image {
        width: 80%;
        height: auto;
        box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
        padding: 5px;
    }

    .slider {
        width: 100%;
        max-width: 600px;
        min-width: 400px;
        height: 380px;
        padding: 0;
        margin: 0;
    }

    .slider img {
        width: 80%;
    }

    #offer, #contact {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .content {
        width: 100%;
        text-overflow: ellipsis;
        margin: 0px;
        line-height: 1.8;
    }

}

@media (max-width:450px) {

    html body {
        max-width: 100%;
        overflow-x: hidden;
        line-height: 1.2;
    }

    .logo img {
        width: 100%;
        height: auto;
    }

    .grid-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        justify-items: center;
        width: 100%;
        height: auto;
        padding-bottom: 0px;
    }

    .grid-item {
        max-width: 350px;
        height: auto;
    }

    h2 {
        font-size: 16px;
    }

    h3 {
        font-size: 13px;
    }

    h4 {
        font-size: 11px;
    }

    p {
        font-size: 10px;
    }

    a {
        font-size: 10px;
    }

    .nav-list {
        display: flex;
        list-style: none;
        justify-content: center;
        align-items: center;
        text-align: center;
        font-size: 11px;
        padding: 0;
        gap: 8px;
    }

    .facebook-link {
        z-index: 1;
        width: 30px;
    }

    .fb-icon {
        width: 20px;
        height: auto;
    }

    .facebook-link:hover {
        width: 100px;
    }

    .fb-text {
        font-size: 12px;
    }

    .space {
        height: 8px;
    }

    #about p {
        text-align: justify;
        text-indent: 12px;
        padding: 0px;
    }

    #gradowska-zdjecie {
        max-width: 400px;
        min-width: 300px;
        height: 260px;
        object-fit: cover;
        box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
        padding: 10px;
    }

    #books {
        padding: 15px 15px;
    }

    .article {
        padding: 5px;
    }

    .cards-grid {
        width: 100%;
        max-width: 400px;
        min-width: 300px;
        min-height: 380px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 15px;
    }

    .card-container {
        width: 100%;
        max-width: 400px;
        min-width: 300px;
        height: 400px;
    }

    .card {
        width: 100%;
        min-height: 380px;
    }

    .book-image {
        width: 70%;
        height: auto;
        box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
        padding: 5px;
    }

    .card .back p {
        font-size: 11px;
        line-height: 14px;
        text-indent: 10px;
    }

    .button-link {
        display: inline-block;
        width: 70px;
        height: 35px;
        border-radius: 5px;
        text-decoration: none;
        background-color: var(--accent-color);
        color: var(--background-color);
        font-weight: 600;
        font-size: 12px;
        text-align: center;
        margin: 5px 0;
        box-shadow: 0px 2px 4px var(--text-grey);
    }
    
    .card .back a {
        padding: 10px;
    }


    /* meetings*/

    #scripts h3 {
        padding-top: 10px;
    }

    .slider {
        width: 100%;
        height: auto;
        min-height: 280px;
        max-width: 400px;
        min-width: 300px;
    }

    .slider img {
        width: 80%;
    }

    #offer, #contact {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    #offer {
        padding: 15px;
    }

    #offer p{
        margin-top: 0;
    }

    .dialog {
        width: 100%;
        max-height: 100%;
    }
    
    .dialog-content {
        padding: 20px;
        width: 80%;
        max-width: 350px;
        color: var(--text-grey);
    }

    .content {
        width: 100%;
        text-overflow: ellipsis;
        margin: 0px;
        line-height: 1.8;
    }

    #contact a {
        font-size: 14px;
    }
}