#galleries_container {
    display: grid;
    justify-items: center;
    justify-content: center;
    align-items: start;
    padding: 40px;
}

#galleries_nav {
    display: grid;
    grid-template-columns: 96px 600px 400px 96px;
    justify-content: center;
    align-items: start;
    width: fit-content;
    margin: 0 auto 40px 48px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#galleries_nav.visible {
    pointer-events: auto;
    opacity: 1;
}

#galleries_nav button {
    padding: 8px;
    background: maroon;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: medium;
    font-weight: 600;
}

#galleries_prev {
    grid-column: 3;
    justify-self: end;
}

#galleries_next {
    grid-column: 2;
    justify-self: start;
}

#galleries_nav button:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

#galleries_nav button:hover:not(:disabled) {
    background: darkred;
}

.gallery_title {
    text-align: left;
    font-size: large;
    color: white;
    font-weight: 600;
    width: 1192px;
    margin: 0 auto 0 0;
    padding-left: 142px;
    padding-bottom: 16px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery {
    display: grid;
    justify-items: center;
    width: 100%;
    margin-bottom: 80px;
}

.gallery .image_viewer {
    display: grid;
    grid-template-columns: 96px 600px 400px 96px;
    gap: 0px;
    border-radius: 20px;
    overflow: hidden;
    width: 1192px;
    margin: 0px auto auto 48px;
    align-items: stretch;
    opacity: 0;
    transform: scale(0.5);
    max-height: 0;
    margin: 0 auto;
    pointer-events: none;
    border-width: 0;
    transition: transform 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
}

.image_viewer.is-visible {
    opacity: 1;
    transform: none;
    max-height: 600px;
    margin: 0px auto auto 48px;
    pointer-events: auto;
    border-width: 2px;
}

.image_viewer .image {
    grid-column: 2;
    grid-row: 1;
    height: 600px;
    width: 600px;
    display: grid;
    place-items: center;
    background: #000;
}

.image_viewer .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.comments {
    grid-column: 3;
    grid-row: 1;
    width: 400px;
    height: 600px;
    border-left: 1px solid white;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    background: white;
    overflow: hidden;
}

.comments .header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto;
    row-gap: 8px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid grey;
    font-weight: 400;
    background: white;
}

.comments .header .author, .comments .header .caption {
    font-size: 16px;
    font-weight: 800;
    color: #1D3461;
}

.comments .header .author, .comments .header .caption {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comments .header .author {
    grid-column: 1;
    grid-row: 1;
}

.comments .header .caption {
    grid-column: 1 / span 3;
    grid-row: 2;
}

.comments .header .post_date {
    grid-column: 3;
    grid-row: 1;
    font-size: 16px;
    margin-right: 24px;
    margin-left: 8px;
    color: #1D3461;
    justify-self: end;
}

.comments .header .delete {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    height: 24px;
    width: 24px;
    background-image: url("/media/delete-icon.png"); 
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
}

.comments .list {
    padding: 12px 12px;
    display: grid;
    grid-auto-rows: row;
    row-gap: 8px;
    overflow-y: scroll;
}

.comment {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto 1fr;
    width: 100%;
    height: 100px;;
    column-gap: 8px;
    row-gap: 4px;
    background: #edede9;
    box-sizing: border-box;
    padding: 8px;
    border-radius: 8px;
    color: black;
}

.comment .details {
    grid-column: 1;
    grid-row: 1;
    font-size: 16px;
    font-weight: 400;
    align-self: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comment .date {
    grid-column: 2;
    grid-row: 1;
    font-size: 14px;
    align-self: center;
    margin-right: 16px;
}

.comment .text {
    grid-column: 1 / span 3;
    grid-row: 2;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comment .delete {
    grid-column: 3;
    grid-row: 1;
    width: 24px;
    height: 24px;
    background-image: url("/media/comment-delete-icon.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    cursor: pointer;
    justify-self: end;  
    align-items: start;
    border: none;
    background-color: transparent; 
    padding: 0;
}

.comments .buttons {
    border-top: 1px solid gray;
    padding: 8px 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
}

.buttons button {
    height: 24px;
    border-radius: 4px;
    border: 1px solid black;
    background: #829CBC;
    color: white;
    cursor: pointer;
}

.buttons button[disabled] {
    opacity: .75;
    cursor: not-allowed;
}

.comments .input {
    border-top: 1px solid gray;
    padding: 8px 8px;
    display: grid;
    grid-template-rows: auto auto auto;
    background: #edede9;
}

.comments .input textarea {
    box-sizing: border-box;
    height: 60px;
    width: 100%;
    padding: 8px;
    border: 1px solid gray;
    color: black;
    border-radius: 4px;
}

.comments .input button {
    box-sizing: border-box;
    padding: 10px 20px;
    background: #1D3461;
    color: white;
    font-size: medium;
    text-align: center;
    cursor: pointer;
}

.comments .input button:hover {
    background-color: #2E5095;
}

.image_viewer .prev, 
.image_viewer .next {
    align-self: center;
    width: 64px;
    height: 64px;
    color: white;
    display: grid;
    justify-self: center;
    place-items: center;
    font-size:xx-large;
    background: transparent;
    cursor: pointer;
    border: 0;
    border-radius: 50%;
}

.image_viewer .prev {
    grid-column: 1;
    grid-row: 1;
}

.image_viewer .next {
    grid-column: 4;
    grid-row: 1;
}

.image_viewer .prev:hover, .image_viewer .next:hover {
    background: #6290C8;
}

.image_viewer .prev[disabled], .image_viewer .next[disabled] {
    cursor: not-allowed;
}