html {
    height: 100%;
    padding: env(safe-area-inset); /* for iphone notch */
    /* prevent font scaling in landscape while allowing user zoom */
    text-size-adjust: var(--text-size-adjust);
    -webkit-text-size-adjust: var(--text-size-adjust);
    -moz-text-size-adjust: var(--text-size-adjust);
    scroll-behavior: smooth;
}

body {
    background-color: rgb(232, 213, 178);
    font-family: sans-serif;
    margin: 0;
    padding: 1rem;
    line-height: 1.4;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
}

header .nav-right {
    text-align:right;
}

h1 {
    margin: 2.5rem 0 0.6rem;
}

.post-meta {
    margin: 0.6em 0 1.6em;
}

.page-info {
    font-style: italic;
    opacity: 0.5;
    margin-bottom: 1.6em;
}

.alert {
    border: 1.5px solid black;
    padding: 1rem;
    margin: 1rem 0;
    background: antiquewhite;
}

article a:has(h2) {
    text-decoration: none;
    display: inline-block;
}

article h2 {
    margin: 0;
}

hr {
    margin: 3em 0;
}

/* LINKS */

a {
    color: darkcyan;
}

a:hover {
    color: mediumaquamarine;
}

/* BUTTONS & BADGES */

header a,
.post-meta a,
.btn,
.badge, input::file-selector-button {
    color: black;
    text-decoration: none;
    padding: 0.1em 0.5em;
    margin:0.2em 0;
    border: 1.5px solid black;
    border-radius: 0.5em;
    font-size: 1rem;
    font-family: sans-serif;
    display:inline-block;
}

input::file-selector-button, button.btn, input[type=submit] {
    padding:0.3em 0.5em;
    cursor:pointer;
}

header a:hover,
.post-meta a:hover {
    background-color: black;
    color: antiquewhite;
}

.btn:hover {
    background: black;
    color: antiquewhite;
    cursor: pointer;
}

.btn-primary {
    background: black;
    color: antiquewhite;
}

.btn-primary:hover {
    background: antiquewhite;
    color: black;
}

.btn-danger {
    background: antiquewhite;
    color: red;
    border-color: red;
}

.btn-danger:hover {
    background: red;
    color: antiquewhite;
}

.badge {
    background-color: black;
    color: antiquewhite;
    opacity: 0.5;
}

/* FORMS */

form {
    margin-bottom: 1em;
}

.form-group {
    margin-bottom: 1em;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1.5px solid black;
    background: antiquewhite;
    font-family: sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
}

input[type=date] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
}

input[type=checkbox] {
    width:1.2em;
    height:1.2em;
}

form small {
    display:block;
    margin-top:0.3em;
}

form input::file-selector-button {
    text-transform:lowercase;
    background-color:antiquewhite;
    margin-right:1ch;
    cursor:pointer;
}

form input::file-selector-button:hover {
    color:antiquewhite;
    background-color:black;
}

form .new-img, form .current-img {
    display:flex;
    flex-direction:column;
}

form .current-img {
    margin-top:1.3em;
}

form .new-img h3 {
    margin:1em 0 0.3em;
}

form .remove-img {
    margin-top:0.3em;
}

input[type=file] {
    margin-bottom:0.3em;
}

form .img-thumbnail {
    width:300px;
    max-width:100%;
    margin-bottom:0.3em;
}

form details > summary {
    list-style: none;
}

form details > summary::marker, /* latest Chrome, Edge, Firefox */ 
form details > summary::-webkit-details-marker /* safari */ {
    display: none;
}

form details > summary h2 {
    cursor:pointer;
}

form details > summary h2::before {
    content:'(+)';
    padding-right:0.5ch;
    opacity:0.5;
}

form details[open] > summary h2::before {
    content:'(−)';
}

/* IMAGES */

.post-image {
    margin: 2rem 0;
    text-align: center;
    padding-right:0.5rem;
}

.post-image img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border: 1.5px solid black;
    box-shadow: 0.6rem 0.6rem 0 rgba(0, 0, 0, 0.2);
    box-sizing:border-box;
}

.post-content img {
    max-width: 100%;
    height: auto;
}

/* PAGINATION */

.pagination {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    margin: 2rem auto;
    font-weight: bold;
}

.page-item a,
.page-item span {
    padding: 0.4rem;
}

.page-item.disabled {
    opacity: 0.3;
}

/* LIGHTBOX */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 1000;
    padding: 0.3rem;
    box-sizing: border-box;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: calc(90% - 1rem);
    max-height: calc(90% - 1rem);
    object-fit: contain;
}

.lightbox-close, .lightbox-nav {
    position: absolute;
    opacity:0.6;
    border-radius: 2rem;
    cursor: pointer;
    padding: 0.1rem 0.8rem 0.3rem;
    font-size:1.5rem;
    color:antiquewhite;
    background:rgba(0, 0, 0, 0.5);
    border:1.5px solid rgb(250, 235, 215, 0.5);
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-nav:hover, .lightbox-close:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 0rem;
}

.lightbox-next {
    right: 0rem;
}

.lightbox-loading {
    color: antiquewhite;
    font-size: 1.2rem;
    text-align: center;
}