/* General Blog Post Page Styles */
body {
    margin: 0;
    padding: 0;
    font-family: monospace, sans-serif;
    background-color: #d6daff;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1em 1em;
}

/* Header Styling */
h1 {
    text-align: center;
    font-size: 2.5em;
    margin-top: 1em;
    color: #2c3e50;
}

h2, h3, h4, h5, h6 {
    max-width: 800px;
    margin: 2em auto;
    padding: 0 0.01em;
    text-align: left;
}

ul, ol {
    max-width: 800px;
    margin: 2em auto;
    padding-left: 2em;
}

li {
    text-align: left;
}

/* Paragraph Styling */
p {
    max-width: 800px;
    margin: 2em auto;
    padding: 0 0.01em;
    text-align: justify;
}

/* Link Styling */
a {
    display: block;
    text-align: center;
    margin: 2em auto;
    font-size: 1.2em;
    color: #2980b9;
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: none;
}

/* Blog Images */

.blog-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1em auto;
    border: 1px solid #cecece;
    border-radius: 8px;
}

/* Back button Styling */
.back-button {
    position: fixed;
    top: 2em; /* Start position */
    left: 2em;
    font-size: 1em;
    font-weight: bold;
    color: #2980b9;
    text-decoration: none;
    padding: 0.5em 1.5em;
    border: none solid #6c8eaf;
    border-radius: 5em; /* Pill shape */
    background-color: #f4f4f4;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1); /* Floating effect */
    transition: transform 0.2s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    z-index: 10;
}

.back-button:hover {
    background-color: #2980b9;
    color: #f4f4f4;
    text-decoration: none;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1); /* Enhanced shadow */
}

.back-button:active {
    background-color: #96ccff;
}

h1 {
    margin-top: -0.05em; /* Ensure there is enough space above the heading */
}


/* Style for figure and figcaption */
.image-with-caption {
    display: block; 
    text-align: center; 
    margin: 20px auto; 
    max-width: 80%; 
    text-align: center;
}

.image-with-caption img {
    max-width: 100%; 
    height: auto; 
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); 
}

.image-with-caption figcaption {
    font-size: 0.9em; 
    color: #555; 
    margin-top: 5px; 
    font-style: italic; 
}

/* Image with caption on left */
.image-with-caption-left {
    display: flex;
    flex-direction: row; /* Change to row for side-by-side layout */
    align-items: flex-start;
    margin: 20px auto;
    max-width: 90%;
    gap: 20px; /* Add consistent spacing */
}

.image-with-caption-left img {
    max-width: 50%; /* Adjust image width */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.image-with-caption-left figure {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.image-with-caption-left figcaption {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
    font-style: italic;
    text-align: right;
}

.image-with-caption-left .content {
    flex: 1; /* Allow content to expand */
    text-align: justify;
    font-size: 1.1em;
    line-height: 1.5;
}

/* Image with caption on the right */
.image-with-caption-right {
    display: flex;
    flex-direction: row-reverse; /* Reverse the order for right image */
    align-items: flex-start;
    margin: 20px auto;
    max-width: 90%;
    gap: 20px; /* Add consistent spacing */
}

.image-with-caption-right figure {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.image-with-caption-right img {
    max-width: 50%;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.image-with-caption-right figcaption {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
    font-style: italic;
    text-align: left;
}

.image-with-caption-right .content {
    flex: 1; /* Allow content to expand */
    text-align: justify;
    font-size: 1.1em;
    line-height: 1.5;
}

/* Responsive adjustments for small screens */
@media (max-width: 768px) {
    .image-with-caption-left, 
    .image-with-caption-right {
        flex-direction: column; /* Stack vertically */
        gap: 10px; /* Reduce spacing */
    }

    .image-with-caption-left img,
    .image-with-caption-right img {
        max-width: 100%; /* Full width on small screens */
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 1em 0;
    background-color: #34495e;
    color: #ecf0f1;
    margin-top: auto;
}

/* Back to top button styling */
.back-to-top {
    position: fixed;
    bottom: 2em;
    right: 2em;
    width: 2em;
    height: 2em;
    background-color: #2980b9;
    color: #f2f2f2;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 50%;
    box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.3);
    display: flex; /* Make it appear as a centered block */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transform: scale(2); /* Initially scaled down */
    transition: background-color 0.3s ease, transform 0.3s ease;
    visibility: hidden; /* Initially hidden */
    opacity: 0;
}

/* Hover effects for back-to-top button */
.back-to-top:hover {
    background-color: #3498db;
    transform: scale(1.1); /* Enlarge if hovering over */
}

.back-to-top:active {
    background-color: #e74c3c;
}

/* Tilt effect when hovering */
.back-to-top.tilt {
    transform: perspective(600px) rotateX(5deg) rotateY(-5deg);
}

/* Make the button visible */
.back-to-top.show {
    transform: scale(1);
    visibility: visible;
    opacity: 1;
}
