/* variables racine racine*/
:root {

    /* Couleurs */
    --bodybg: #FFDFB8;
    --bg: #FFD6A4;
    --border: #CA842D;
    --but: #CA842D;
    --txt: #7D4F00;
    --aux: #FFEBD1;

    /* Variables */
    --radius1: 30px;

}



/* TOUT */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: var(--txt);
}

body {
    background-color: var(--bodybg);
    margin: 0;
    padding: 0;
}

main {
    display: flex;
}

header {
    background-color: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;

    width: 4.5rem;
    height: 100vh;

    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
}

section {
    background-color: var(--bg);
    border: 1px solid var(--border);
}

h1 {
    font-size: 2rem;
    margin: 2rem 4rem;
}

/* ICONS */

#main-icon {
    width: 85%;
}

#profile-icon, #home-icon, #logout-icon {
    transition: all 0.3s ease;
}

#home-icon {
    transform: scale(0.7);
}

#profile-icon:hover {
    transform: scale(1.05);
}

#home-icon:hover, #logout-icon:hover {
    transform: scale(0.85);
}



/* LOGIN */

#login-section {
    position: absolute;
    top: 25%;
    left: 0;
    right: 0;
    text-align: center;
    width: calc(100% - 2rem);
    max-width: 600px;
    min-height: 400px;
    margin: 0 auto;


    border-radius: var(--radius1);
    box-shadow: 20px 20px 60px 0px #f0a953;
}

#login-form {
    margin: 4rem auto 2rem;
    display: flex;
    text-align: left;
    flex-direction: column;
    width: 75%;
}

#login-form label {
    font-size: 1.5rem;
}

#login-form label:hover {
    cursor: pointer;
}

#login-form input, #login-btn {
    margin-bottom: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    padding: 0.5rem;
    transition: all 0.3s ease;
}

#login-form input:hover {
    border-color: var(--txt);
    box-shadow: 0 0 0 2px var(--but);
}

#login-btn {
    background-color: var(--but);
    color: var(--bodybg);
    width: 20%;
    align-self: flex-end;
}

#login-btn:hover {
    background-color: var(--txt);
    transform: translateX(10px);
    cursor: pointer;
}



/* INDEX */

#main-index-section {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    margin: 0 2rem 0 calc(4.5rem + 2rem);
    text-align: center;
}

#main-index-section h1 {
    text-decoration: underline;
}

#img-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 42rem;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

#img-container > article {
    overflow: hidden;
    padding: 1rem;
    text-align: left;
    background-color: var(--aux);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1.25rem rgb(125 79 0 / 12%);
}

#img-container > article > .post-img {
    width: 100%;
    max-height: 38rem;
    margin: 0.75rem auto;
    object-fit: cover;
}

#img-container > article > ul {
    list-style: none;
}

.post-comments {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem 0 0.75rem;
}

.post-comment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.post-author,
.profile-post-author,
.profile-comment-author {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.post-author {
    flex-wrap: wrap;
}

.post-author time {
    margin-left: auto;
}

.profile-post-author {
    padding: 0.75rem 0.85rem;
}

.user-avatar {
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-link {
    display: inline-flex;
    flex: 0 0 auto;
}

.comment-author {
    font-weight: 700;
    text-decoration: none;
}

.comment-author:hover {
    text-decoration: underline;
}

.comment-content {
    white-space: pre-wrap;
}

.comment-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.comment-form input {
    min-width: 0;
    padding: 0.65rem 0.9rem;
    background-color: var(--bodybg);
    border: 1px solid var(--border);
    border-radius: var(--radius1);
}

.comment-form button {
    padding: 0.55rem 1rem;
    background-color: var(--but);
    color: var(--bodybg);
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    font-weight: 600;
}

.comment-form button:hover:not(:disabled) {
    cursor: pointer;
    background-color: var(--txt);
}

.comment-form button:disabled {
    opacity: 0.65;
}

.comment-feedback {
    grid-column: 1 / -1;
    min-height: 1.2em;
    margin: 0;
    font-size: 0.9rem;
}

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


/* PROFIL */

#main-profile-section {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    margin: 0 2rem 0 calc(4.5rem + 2rem);
    text-align: left;
}

#profile-info {
    border: 1px solid var(--border);
    min-height: 12rem;
    text-align: left;
    padding-left: 2rem;
    font-size: 2rem;
}

#bio {
    max-width: 100%;
    margin-right: 2rem;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.profile-stats {
    display: flex;
    align-items: baseline;
    gap: 2rem;
}

.profile-post-count {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.profile-post-count strong {
    font-size: 1.25rem;
}

#profile-nav {
    border: 1px solid var(--border);
    min-height: 4rem;
    display: flex;

    justify-content: space-around;
}

#profile-nav button {
    margin: 0.5rem;
    padding: 0.3rem 5rem;
    font-size: 1.5rem;

    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    transition: all 0.3s ease;
}

#profile-nav button:hover {
    cursor: pointer;
    background-color: var(--but);
    color: var(--bodybg);
    border-color: var(--txt);
}

#profile-nav button.active {
    background-color: var(--but);
    color: var(--bodybg);
    border-color: var(--txt);
}

#shared-content {
    padding: 1.5rem;
}

.profile-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 1.5rem;
}

.profile-photo-card {
    overflow: hidden;
    background-color: var(--aux);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1.25rem rgb(125 79 0 / 12%);
}

.profile-photo-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.profile-photo-card .profile-post-author .user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    aspect-ratio: auto;
}

.profile-photo-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem;
}

.profile-photo-details time {
    font-size: 0.9rem;
}

.profile-photo-card .post-comments,
.profile-photo-card .comment-form {
    margin-right: 0.85rem;
    margin-left: 0.85rem;
}

.profile-photo-card .comment-form {
    margin-bottom: 0.85rem;
}

.profile-comment {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.profile-comment-photo {
    flex: 0 0 5rem;
}

.profile-comment-photo img {
    width: 5rem;
    height: 5rem;
    object-fit: cover;
    border-radius: 0.75rem;
}

.profile-comment-details {
    min-width: 0;
}

.profile-comment-author {
    margin-bottom: 0.4rem;
}

.profile-comment-author a {
    font-weight: 700;
    text-decoration: none;
}

.profile-comment-details p {
    margin: 0 0 0.4rem;
    overflow-wrap: anywhere;
}

.profile-comment-details small {
    display: block;
}

.profile-like-count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    flex-shrink: 0;
}

/* POST */

#add-post-btn {
    text-decoration: none;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    background-color: var(--bodybg);
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    transition: all 0.3s ease;

    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    line-height: 1;

    position: fixed;
    z-index: 99;
    right: 2.1rem;
    bottom: 2.1rem;
}

#add-post-btn:hover {
    cursor: pointer;
    background-color: var(--but);
    color: var(--bodybg);
    border-color: var(--txt);
    transform: scale(1.5)
}

#post-section {
    position: relative;
    margin: 5rem 2rem 5rem calc(4.5rem + 2rem);
    text-align: center;
    max-width: 1200px;
    border-radius: var(--radius1);
    box-shadow: 20px 20px 60px 0px #f0a953;
}

#post-form {
    margin: 4rem auto;
    display: flex;
    text-align: left;
    flex-direction: column;
    width: 75%;
    align-items: center;
}

#post-form input, #post-form textarea {
    width: 80%;
    background-color: var(--aux);
    margin-bottom: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    padding: 0.5rem;
    resize: none;
    transition: all 0.3s ease;
}

#desc {
    height: 8rem;
}

#post-form input[type="file"] {
    height: auto;
    padding: 0.5rem;
}

#post-form input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.55rem 1rem;
    background-color: var(--but);
    color: var(--bodybg);
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    font-weight: 600;
    transition: all 0.3s ease;
}

#post-form input[type="file"]::file-selector-button:hover {
    cursor: pointer;
    background-color: var(--txt);
    border-color: var(--txt);
}

#post-form input:focus-visible,
#post-form textarea:focus-visible {
    outline: none;
    border-color: var(--txt);
    box-shadow: 0 0 0 3px rgb(125 79 0 / 15%);
}

#post-form input[type="file"]:focus-visible {
    outline: 2px solid var(--txt);
    outline-offset: 2px;
}


#close-btn, #send-post-btn {
    background-color: var(--but);
    color: var(--bodybg);
    width: 6rem;
    height: 4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    padding: 0.5rem;
    transition: all 0.3s ease;
    font-size: 2rem;
}


#close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
}


#send-post-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
}

#close-btn:hover, #send-post-btn:hover {
    background-color: var(--txt);
    cursor: pointer;
}

/* PHOTOS */

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

/* LIKES */

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.9rem;
    font-size: 1.2rem;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    transition: all 0.3s ease;
}

.like-btn:hover {
    cursor: pointer;
    background-color: var(--aux);
    transform: scale(1.1);
}

.like-btn.liked {
    background-color: var(--aux);
    border-color: var(--txt);
}






.fx-ember {
  animation: fx-ember 1.3s ease-in-out infinite alternate;
}

.brule {
    animation: ember 1.3s infinite alternate;
}

@keyframes fx-ember {
  0% {
    text-shadow:
      0 -2px 6px  #ffab40,
      0 -6px 14px #ff6d00,
      0 -12px 28px #dd2c00,
      0 -20px 44px rgba(179, 2, 2, 0.55);
  }
  100% {
    text-shadow:
      0 -3px 8px  #ffc46b,
      0 -9px 20px #ff8f1f,
      0 -18px 38px #ff3d00,
      0 -30px 60px rgba(213, 0, 0, .8);
  }
}

@keyframes ember {
  0% {
    box-shadow:
      0 -2px 6px  #ffab40,
      0 -6px 14px #ff6d00,
      0 -12px 28px #dd2c00,
      0 -20px 44px rgba(179, 2, 2, 0.55);
  }
  100% {
    box-shadow:
      0 -3px 8px  #ffc46b,
      0 -9px 20px #ff8f1f,
      0 -18px 38px #ff3d00,
      0 -30px 60px rgba(213, 0, 0, .8);
  }
}




@media screen and (max-width: 767px) {

    /* TOUT */

    header {
        background-color: var(--bg);
        border: 1px solid var(--border);
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;

        width: 100%;
        height: 3.5rem;

        position: fixed;
        top: 0;
        left: 0;
        z-index: 10;
    }

    nav {
        justify-content: flex-start;
    }

    /* INDEX */

    #main-index-section {
        margin: 4.5rem 1rem 0;
        text-align: center;
    }

    /* ICONS */

    #main-icon {
        width: 2em;
    }

    #profile-icon, #home-icon, #logout-icon {
        transition: all 0.3s ease;
    }

    #home-icon {
        transform: scale(0.7);
    }

    #profile-icon:hover {
        transform: scale(1.05);
    }

    #home-icon:hover, #logout-icon:hover {
        transform: scale(0.85);
    }

    /* PROFILE */

    #main-profile-section {
        margin: 4.5rem 1rem 0;
        text-align: center;
    }

    #profile-info {
        border: 1px solid var(--border);
        min-height: 15rem;
    }

    #profile-nav {
        border: 1px solid var(--border);
        height: 10%;
        display: flex;

        justify-content: space-around;
    }

    #profile-nav button {
        margin: 0.5rem;
        padding: 0.3rem 1rem;
        font-size: 1rem;

        background-color: transparent;
        border: 1px solid var(--border);
        border-radius: var(--radius1);
        transition: all 0.3s ease;
    }

    #profile-nav button:hover {
        cursor: pointer;
        background-color: var(--but);
        color: var(--bodybg);
        border-color: var(--txt);
    }

    #shared-content {
        padding: 1rem;
    }

    .profile-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .profile-photo-card img {
        aspect-ratio: 4 / 3;
    }

    .profile-photo-details {
        text-align: left;
    }

    /* POST */

    #post-section {
        position: relative;
        margin: 5rem 1rem;
        text-align: center;
        max-width: 1200px;
        max-height: 800px;
        border-radius: var(--radius1);
        box-shadow: 20px 20px 60px 0px #f0a953;
    }

    #close-btn, #send-post-btn {
        background-color: var(--but);
        color: var(--bodybg);
        width: 3rem;
        height: 2rem;
        border: 1px solid var(--border);
        border-radius: var(--radius1);
        padding: 0.5rem;
        font-size: 0.7rem;
        transition: all 0.3s ease;
    }
}
.profile-username {
    display: flex;
    align-items: center;
    gap: 10px;
}
#edit-profile-form {
    width: calc(100% - 2rem);
    max-width: 32rem;
    margin: 1.5rem auto;
    display: none;
    text-align: left;
}

#edit-profile-form label {
    display: block;
    margin-bottom: 0.4rem;
}

#edit-profile-form input[type="text"],
#edit-profile-form textarea,
#edit-profile-form input[type="file"] {
    display: block;
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--aux);
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#edit-profile-form textarea#profile-bio {
    min-height: 7rem;
    overflow-x: clip;
    resize: none;
    scrollbar-width: none;
}

#edit-profile-form textarea#profile-bio::-webkit-scrollbar {
    display: none;
}

#bio-character-count {
    display: block;
    width: fit-content;
    margin: -0.5rem 0 0.75rem auto;
    padding: 0.25rem 0.75rem;
    background-color: var(--aux);
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    color: var(--txt);
    font-size: 0.9rem;
    text-align: right;
}

#edit-profile-form input[type="file"] {
    padding: 0.5rem;
}

#edit-profile-form button {
    margin: 0.25rem 0.5rem 0.25rem 0;
}

#edit-profile-form input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.55rem 1rem;
    background-color: var(--but);
    color: var(--bodybg);
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    font-weight: 600;
    transition: all 0.3s ease;
}

#edit-profile-form input[type="file"]::file-selector-button:hover {
    cursor: pointer;
    background-color: var(--txt);
    border-color: var(--txt);
}

#edit-profile-form input:focus-visible,
#edit-profile-form textarea:focus-visible {
    outline: none;
    border-color: var(--txt);
    box-shadow: 0 0 0 3px rgb(125 79 0 / 15%);
}

#edit-profile-form input[type="file"]:focus-visible {
    outline: 2px solid var(--txt);
    outline-offset: 2px;
}

#edit-profile-btn,
#edit-profile-form button {
    padding: 0.55rem 1rem;
    background-color: var(--but);
    color: var(--bodybg);
    border: 1px solid var(--border);
    border-radius: var(--radius1);
    font-weight: 600;
    transition: all 0.3s ease;
}

#edit-profile-btn:hover,
#edit-profile-form button:hover {
    cursor: pointer;
    background-color: var(--txt);
    border-color: var(--txt);
}

#edit-profile-btn:focus-visible,
#edit-profile-form button:focus-visible {
    outline: 2px solid var(--txt);
    outline-offset: 2px;
}

#profile-icon {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}
#pp {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
}