/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Typography */
body {
    font-family: 'Georgia', serif;
    color: #333;
    background-color: #f4ecd8;
    line-height: 1.8;
    scrollbar-width: thin;
    scrollbar-color: #b8ac94 #f4ecd8;
}
body::-webkit-scrollbar {
    width: 8px;
}
body::-webkit-scrollbar-track {
    background: #f4ecd8;
}
body::-webkit-scrollbar-thumb {
    background-color: #b8ac94;
    border-radius: 4px;
}

body, html {
    height: 100%;
}

#main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
}
p {
    margin-bottom: 1em;
}

/* Navbar styling */
.navbar {
    display: flex;
    align-items: center;
    padding: 1em 2em;
    background-color: #eae0c8;
    border-bottom: 1px solid #d6ccb2;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-menu {
    display: flex;
    flex: 1;
    justify-content: space-between; /* Distribute space between navbar-start and navbar-end */
}

.navbar-start,
.navbar-end {
    display: flex;
    align-items: center;
}

.navbar-item {
    color: #5b4636;
    text-decoration: none;
    margin-right: 1.5em;
    font-size: 1em;
    padding: 0.5em 1em;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.navbar-item:last-child {
    margin-right: 0; /* Remove margin from the last item */
}

.navbar-item:hover {
    background-color: #d6ccb2;
    color: #3e2e20;
}

.navbar-item.active {
    font-weight: 600;
    background-color: #d6ccb2;
}

/* Hamburger menu */
.navbar-burger {
    display: none;
    cursor: pointer;
}

.navbar-burger span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px;
    background-color: #5b4636;
}

/* Inputs and buttons */
.input {
    padding: 0.5em 1em;
    border: 1px solid #b8ac94;
    border-radius: 8px;
    font-size: 1em;
    width: 100%; /* Make input fields take full width of their container */
    max-width: 300px; /* Set a maximum width */
    background-color: #fff;
}

.small-input {
    max-width: 120px; /* Smaller width for "Salmenr." input */
}

.button {
    padding: 0.5em 1em;
    background-color: #5b4636;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    margin-left: 0.5em;
}

.small-button {
    padding: 0.3em 0.6em;
    font-size: 0.9em;
    border-radius: 5px;
}

.button:hover {
    background-color: #3e2e20;
}
.button.is-small {
    display: flex;
    align-items: center;
    padding: 0.5em;
    background-color: #faf6ef;
    border: 1px solid #d6ccb2;
    border-radius: 4px;
    color: #5b4636;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}
.button.is-small:hover {
    background-color: #eae0c8;
}
.button.is-light {
    background-color: #faf6ef;
    color: #5b4636;
    border: 1px solid #d6ccb2;
    border-radius: 4px;
    padding: 0.5em 0.8em;
    min-width: 40px;
    text-align: center;
    font-size: 1em;
    transition: background-color 0.2s ease;
}
.button.is-light:hover {
    background-color: #eae0c8;
}

/* Buttons container */
.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

/* Sections and containers */
.section {
    margin-bottom: 2em;
    flex-grow: 1;
}
.container {
    max-width: 800px;
    margin: 2em auto;
    padding: 0 1em;
}

/* Cards */
.card {
    background-color: #fff;
    border: 1px solid #d6ccb2;
    border-radius: 12px;
    margin-bottom: 2em;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.card-content {
    padding: 2em;
}
.card-footer {
    border-top: 1px solid #d6ccb2;
    display: flex;
}
.card-footer-item {
    flex: 1;
    text-align: center;
    padding: 1em;
    color: #5b4636;
    text-decoration: none;
    cursor: pointer;
}
.card-footer-item:hover {
    background-color: #f4ecd8;
}
.card-image img {
    width: 100%;
    display: block;
}

/* Content */
.content {
    font-size: 1.25em;
    color: #333;
}
.content p {
    margin-bottom: 1em;
}
.content ol {
    list-style-type: none;
    counter-reset: verse;
    padding-left: 2em;
}
.content ol li {
    counter-increment: verse;
    margin-bottom: 1.5em;
    position: relative;
}
.content ol li::before {
    content: counter(verse);
    position: absolute;
    left: -2em;
    top: 0;
    font-weight: bold;
    color: #5b4636;
    font-size: 0.8em;
}
.content ol li p {
    margin-bottom: 0.5em;
    text-indent: 1em;
}
.content ol li p:first-child {
    text-indent: 0;
}

/* Lists of Psalms */
.list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.list-item {
    padding: 1em;
    margin-bottom: 0.5em;
    background-color: #faf6ef;
    border: 1px solid #d6ccb2;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.list-item:hover {
    background-color: #eae0c8;
    transform: translateX(5px);
}
.list-item .psalm-number {
    font-weight: bold;
    color: #5b4636;
    margin-right: 1em;
}
.list-item .psalm-title {
    flex-grow: 1;
}
.psalm-title {
    font-size: 1.1em;
    color: #5b4636;
    margin-bottom: 0.5em;
}
.psalm-info {
    font-size: 0.9em;
    color: #666;
}

/* Notification and Featured Psalm */
.notification {
    background-color: transparent;
    padding: 0;
}
.notification .card,
.featured-psalm {
    background-color: #faf6ef;
    margin-bottom: 1em;
}
.notification .card-content,
.featured-psalm .card-content {
    padding: 1em;
}
.notification .content,
.featured-psalm .content {
    font-size: 1em;
    color: #5b4636;
}
.featured-psalm {
    margin-top: 2em;
}
.featured-psalm .title {
    color: #5b4636;
    margin-bottom: 1em;
}
.featured-psalm .content p {
    font-style: italic;
}
.featured-psalm .content em {
    font-style: normal;
    color: #5b4636;
}
.featured-psalm .card-image img {
    max-height: 150px;
    object-fit: cover;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Responsive design */
/* Mobile styles */
@media screen and (max-width: 1024px) {
    .navbar-burger {
        display: block;
    }
    .navbar-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        margin-top: 1em;
    }
    nav .navbar-menu.is-active {
        display: flex;
    }
    .navbar-menu.is-active {
        display: flex;
    }
    .navbar-start,
    .navbar-end {
        flex-direction: column;
        width: 100%;
    }
    .navbar-item {
        width: 100%;
        margin: 0;
        padding: 0.5em 1em;
    }
    .navbar-item:not(:last-child) {
        border-bottom: 1px solid #d6ccb2;
    }

    /* Adjust input and button widths */
    .input,
    .button {
        width: 100%;
        margin: 0.5em 0;
        max-width: none;
    }

    /* Specific styles for the always-visible search-number */
    .search-number {
        display: flex;
        align-items: center;
        margin-left: auto;
    }
    .search-number .input {
        max-width: 120px; /* Small width */
        margin-right: 0.5em;
    }
    .search-number .button {
        padding: 0.3em 0.6em;
        font-size: 0.9em;
    }
}

/* Desktop styles */
@media screen and (min-width: 1025px) {
    .navbar-burger {
        display: none;
    }
    .navbar-menu {
        display: flex;
        flex-direction: row;
    }
    .navbar-start,
    .navbar-end {
        display: flex;
        flex-direction: row;
        align-items: center;
    }
    .navbar-item {
        margin-right: 1.5em;
        padding: 0.5em 1em;
        width: auto;
    }
    .navbar-item:last-child {
        margin-right: 0;
    }

    /* Adjust input and button widths */
    .input,
    .button {
        width: auto;
        max-width: 150px;
        margin: 0 0.5em;
    }

    /* Specific styles for the always-visible search-number */
    .search-number {
        display: flex;
        align-items: center;
        margin-left: auto;
    }
    .search-number .input {
        max-width: 120px; /* Small width */
        margin-right: 0.5em;
    }
    .search-number .button {
        padding: 0.5em 1em;
    }
}

/* Ensure the 'is-active' class on navbar-burger rotates the icon (optional) */
.navbar-burger.is-active span:first-child {
    transform: rotate(45deg) translate(5px, 5px);
}
.navbar-burger.is-active span:nth-child(2) {
    opacity: 0;
}
.navbar-burger.is-active span:last-child {
    transform: rotate(-45deg) translate(6px, -6px);
}

.psalm-navigation {
    position: relative;
    height: 0;
    margin-top: -2em;
}

.nav-button {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(91, 70, 54, 0.2);
    color: #5b4636;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.2s;
    z-index: 10;
}

.nav-button:hover {
    background-color: rgba(91, 70, 54, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.prev-button {
    left: 20px;
}

.next-button {
    right: 20px;
}

.nav-button i {
    font-size: 1.5em;
}

@media screen and (max-width: 768px) {
    .nav-button {
        width: 40px;
        height: 40px;
    }

    .nav-button i {
        font-size: 1.2em;
    }

    .prev-button {
        left: 10px;
    }

    .next-button {
        right: 10px;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    display: none; /* Hidden by default */
    background-color: rgba(91, 70, 54, 0.6); /* Semi-transparent */
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    text-align: center;
    line-height: 40px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: background-color 0.3s, transform 0.3s, opacity 0.3s;
    opacity: 0.7;
}

.back-to-top:hover {
    background-color: rgba(91, 70, 54, 0.8);
    transform: translateY(-5px);
    opacity: 1;
}

.back-to-top:active {
    background-color: rgba(91, 70, 54, 1);
    transform: translateY(-3px);
}

.back-to-top i {
    font-size: 1.2em;
    vertical-align: middle;
}

/* Adjust the position for smaller screens */
@media screen and (max-width: 1024px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 35px;
        height: 35px;
        line-height: 35px; /* Update line-height to match height */
    }

    .back-to-top i {
        font-size: 1em;
    }
}

@media screen and (max-width: 480px) {
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
        line-height: 30px;
    }

    .back-to-top i {
        font-size: 0.9em;
    }
}