@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Playfair+Display:wght@700&family=Roboto:wght@400;700&display=swap');

:root {
    --primary-bg-color: #fcf9f3; /* Light cream */
    --secondary-bg-color: #fff8e1; /* Even lighter cream */
    --text-color: #333; /* Dark gray */
    --heading-color: #7a421a; /* Earthy brown */
    --accent-color: #a87e5b; /* Muted gold/brown */
    --border-color: #d4c5b4; /* Soft border */
    --button-bg: #8c5b3c; /* Richer brown */
    --button-hover-bg: #6e462c; /* Darker brown for hover */
    --om-color: #b36b00; /* Golden for Om */
}

body {
    font-family: 'Merriweather', serif;
    background-color: var(--primary-bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    /*background-image: url('battlefield.png');*/
}

h1, h2 {
    font-family: 'Playfair Display', serif;
    color: var(--heading-color);
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 3.5em; /* Larger for Om */
    color: var(--om-color);
    margin-top: 0;
    margin-bottom: 10px;
}

h2 {
    font-size: 2.2em;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    display: inline-block;
}

a {
    text-decoration: none;
}

button {
    font-family: 'Roboto', sans-serif;
    background-color: var(--button-bg);
    color: white;
    border: none;
    padding: 12px 25px;
    margin: 10px 5px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: var(--button-hover-bg);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Specific styles for index.html buttons */
body > a > button {
    min-width: 180px;
}

.container {
    background-color: var(--secondary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin: 20px auto;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
}

form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

input[type="number"], #shPart {
    font-family: 'Roboto', sans-serif;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    width: 180px;
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="number"]:focus, #shPart:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(168, 126, 91, 0.2);
}

/* Chapter navigation buttons */
#back, #forward {
    padding: 10px 15px;
    font-size: 1.2em;
    margin: 0 5px;
}

.p {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 5%;
    width: 90%;
    max-width: 800px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#p1 {
    font-family: 'Merriweather', serif;
    font-size: 1.2em; /* Increased font size for content */
    white-space: pre-wrap; /* Preserves line breaks from JS */
    text-align: left; /* Align shlok content to left */
    max-width: 100%;
    overflow-wrap: break-word; /* Ensures long words break */
    margin: 0; /* Remove default paragraph margin */
    padding: 0;
}

/* Chapters Page Specific Styles */
#chapters-container { /* If you add a container later */
    width: 90%;
    max-width: 1000px;
    margin: 20px auto;
}

.chapters-page-content { /* Assuming a class for the main content area */
    background-color: var(--secondary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}


[id^="ch"] { /* Selects all divs with IDs starting with 'ch' (for chapters.html) */
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box; /* Include padding in width */
    max-width: 800px;
    text-align: left; /* Align chapter info to the left */
}

[id^="ch"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

[id^="ch"] h3 {
    font-family: 'Playfair Display', serif;
    color: var(--heading-color);
    font-size: 1.6em;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

[id^="ch"] p {
    font-size: 1.1em;
    margin: 8px 0;
    padding-left: 15px; /* Indent summary paragraphs */
}

div[id^="ch"]{
    opacity: 0.85;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2.8em;
    }
    h2 {
        font-size: 1.8em;
    }
    button {
        padding: 10px 20px;
        font-size: 1em;
    }
    input[type="number"] {
        width: 150px;
    }
    form {
        flex-direction: column;
        gap: 10px;
    }
    #back, #forward {
        width: 60px; /* Make nav buttons smaller */
        padding: 8px 12px;
    }
    .container, [id^="ch"] {
        padding: 20px;
        width: 95%;
    }
    #p1 {
        font-size: 1.1em;
    }
    [id^="ch"] h3 {
        font-size: 1.4em;
    }
    [id^="ch"] p {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.2em;
    }
    h2 {
        font-size: 1.5em;
    }
    button {
        width: 100%;
        margin: 5px 0;
    }
    input[type="number"] {
        width: 100%;
        max-width: 250px; /* Constrain width even if 100% */
    }
    form {
        width: 100%;
    }
    #p1 {
        font-size: 1em;
    }
}