:root {
    --color-dark-gray: #403d39;
    --color-light-beige: #ccc5b9;
    --color-accent-orange: #eb5e28;
    --color-danger: #eb5e28;
    --color-danger-light: hsla(18, 83%, 54%, 0.15);
    --color-success: #00c476;
    --color-success-light: hsl(156, 100%, 38%, 15%);
    --color-black-soft: #252422;
    --color-dark-gray-transparent: rgba(64, 61, 57, 0.3);
    --color-off-white: #fffcf2;
    --color-background: #fffcf2;

    --transition: all 300ms ease;

    --container-width-lg: 74%;
    --container-width-md: 88%;
    --form-width: 40%;

    --card-border-radius-1: 0.3rem;
    --card-border-radius-2: 0.5rem;
    --card-border-radius-3: 0.8rem;
    --card-border-radius-4: 1.5rem;
    --card-border-radius-5: 5rem;
}

/* =================================================================
  General
  =================================================================
 */

* {
    margin: 0;
    padding: 0;
    outline: 0;
    border: 0;
    appearance: 0;
    list-style: none;
    text-decoration: none;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: "Poppins", sans-serif;
    line-height: 1.6;
    color: var(--color-dark-gray);
    overflow-x: hidden;
    background: var(--color-background);
    font-size: 0.9rem;

    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: var(--container-width-lg);
    max-width: 1800px;
    margin-inline: auto;
}

section {
    margin-top: 3rem;
    width: 100vw;
}

.section__extra-margin {
    margin-top: 7rem;
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--color-black-soft); /* Changed for visibility on light BG */
    line-height: 1.3;
}

h1 {
    font-size: 3rem;
    margin: 1rem 0;
}

h2 {
    font-size: 1.7rem;
    margin: 1rem 0;
}

h3 {
    font-size: 1.1rem;
    margin: 0.8rem 0 0.5rem;
}

h4 {
    font-size: 1rem;
}

a {
    color: var(--color-accent-orange); /* Changed to accent color for better visibility */
    transition: var(--transition);
}

img {
    display: block;
    width: 100%;
    object-fit: cover;
}

ion-icon {
    font-size: inherit;
}

/* width */
::-webkit-scrollbar {
    width: 5px;
}

/* Track */
::-webkit-scrollbar-track {
    background: var(--color-light-beige);
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: #403d39;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: #eb5e28;
}

/* center success and error messages */
.container.center {
    text-align: center;
}

/* =================================================================
  Navbar
=================================================================
 */

nav {
    background-color: transparent;
    width: 100vw;
    height: 4.5rem;
    position: fixed;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

nav button {
    display: none;
}

.nav__container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 70vw; /* MODIFIED: Set desktop width */
    margin-inline: auto; /* MODIFIED: Center the container */
}

.nav__container a {
    color: var(--color-dark-gray); /* MODIFIED: Ensure nav links are dark on transparent background */
    font-weight: 600;
}

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 0.3rem solid var(--color-background);
}

.nav__logo {
    font-weight: 600;
    font-size: 1.2rem;
}

.nav__items {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.nav__profile {
    position: relative;
    cursor: pointer;
}

.nav__profile ul {
    position: absolute;
    top: 155%;
    right: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 3rem 3rem rgba(0, 0, 0, 0.4);
    visibility: hidden;
    opacity: 0;
    transition: var(--transition);
}

/* show nav ul when nav profile is hovered */
.nav__profile:hover > ul {
    visibility: visible;
    opacity: 1;
}

.nav__profile ul li a {
    padding: 1rem;
    background: var(--color-dark-gray);
    color: var(--color-off-white); /* MODIFIED: Ensure dropdown text is light */
    width: 100%;
    border-top-width: 2px;
    border-left-width: 2px;
    border-right-width: 2px;
    border-style: solid;
    border-color: transparent;
    border-top-left-radius: var(--card-border-radius-2);
    border-top-right-radius: var(--card-border-radius-2);

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.nav__profile ul li a:hover {
    background: var(--color-black-soft);
    border-color: var(--color-light-beige);
}

.nav__profile ul li:last-child a {
    background: var(--color-danger);
    color: var(--color-off-white);
    border-top: 3px solid var(--color-black-soft);
    border-left-width: 2px;
    border-right-width: 2px;
    border-bottom-width: 2px;
    border-style: solid;
    border-color: transparent;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: var(--card-border-radius-2);
    border-bottom-right-radius: var(--card-border-radius-2);
}

.nav__profile ul li:last-child a:hover {
    background: #d35424; /* A slightly darker orange */
    color: var(--color-off-white);
    border-left-color: var(--color-danger);
    border-right-color: var(--color-danger);
    border-bottom-color: var(--color-danger);
}

@media screen and (min-width: 1025px) {
    .nav__items li a {
        position: relative;
        padding-bottom: 0.5rem; /* Add padding to make space for the line */
    }

    .nav__items li.active a {
        color: var(--color-accent-orange); /* Optionally change text color of active link */
    }

    .nav__items li.active a::after {
        content: "";
        position: absolute;
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--color-accent-orange);
        left: 0;
        bottom: 0;
    }
}

/* =================================================================
  Hero Section (Minimalist Rounded)
=================================================================
*/
.hero-split {
    padding: 4rem 0;
    margin-top: 4.5rem; /* Offset for fixed navbar */
    background: var(--color-background);
    overflow: hidden;
}

.hero-split__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
}

.hero-split__text h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--color-black-soft);
}

.hero-split__text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-dark-gray);
    margin-bottom: 2.5rem;
}

.hero-split__text .btn.btn-primary {
    font-size: 1rem;
    padding: 1rem 2.5rem;
    border-radius: 50px; /* Pill shape */
}

.hero-split__text .btn.btn-primary ion-icon {
    transform: rotate(0); /* Reset icon rotation */
    transition: var(--transition);
}
.hero-split__text .btn.btn-primary:hover ion-icon {
    transform: translateY(3px);
}

.hero-split__image {
    height: 450px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; /* Creates the "blob" shape */
    overflow: hidden;
    animation: blob-morph 8s ease-in-out infinite;
}

.hero-split__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Animation for the blob shape */
@keyframes blob-morph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    50% {
        border-radius: 60% 40% 30% 70% / 60% 70% 30% 40%;
    }
    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

/* Responsive styles for the split hero */
@media screen and (max-width: 900px) {
    .hero-split {
        padding: 3rem 0;
    }
    .hero-split__container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .hero-split__text {
        text-align: center;
    }
    .hero-split__image {
        grid-row: 1;
        height: 300px;
        margin-bottom: 2rem;
    }
    .hero-split__text h1 {
        font-size: 2.5rem;
    }

    .hero-split__text .btn.btn-primary {
        margin: 0 auto;
    }
}

/* =================================================================
  Category Button
=================================================================
 */

.category__button {
    background: var(--color-light-beige);
    color: var(--color-black-soft);
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--card-border-radius-2);
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    border: 2px solid transparent;

    justify-content: center;
    display: flex;
    align-items: center;
}

.category__button:hover {
    background: var(--color-background);
    color: var(--color-black-soft);
    border-color: var(--color-light-beige);
}

/* =================================================================
  General Post
=================================================================
 */
.posts .section__title {
    text-align: center;
    margin-bottom: 4rem;
}

.posts__container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.post {
    background: var(--color-light-beige); /* Light beige background for the card */
    border-radius: var(--card-border-radius-4);
    box-shadow:
        0 4px 6px -1px rgb(0 0 0 / 0.07),
        0 2px 4px -2px rgb(0 0 0 / 0.07);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.post:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 25px -5px rgb(0 0 0 / 0.1),
        0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.post__thumbnail {
    height: 340px;
    margin: -20px 20px 0;
    border-radius: var(--card-border-radius-3);
    overflow: hidden;
    box-shadow:
        0 10px 15px -3px rgb(0 0 0 / 0.1),
        0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.post__thumbnail img {
    height: auto;
    width: 100%;
    object-fit: cover;
    overflow: hidden;
    transition: transform 1s ease-in-out;
    border: 7px solid var(--color-dark-gray);
    border-radius: var(--card-border-radius-3);
    -webkit-border-radius: var(--card-border-radius-3);
    -moz-border-radius: var(--card-border-radius-3);
    -ms-border-radius: var(--card-border-radius-3);
    -o-border-radius: var(--card-border-radius-3);
    -webkit-transition: transform 1s ease-in-out;
    -moz-transition: transform 1s ease-in-out;
    -ms-transition: transform 1s ease-in-out;
    -o-transition: transform 1s ease-in-out;
}

.post:hover .post__thumbnail img {
    transform: translateY(calc(-100% + 340px));
    -webkit-transform: translateY(calc(-100% + 340px));
    -moz-transform: translateY(calc(-100% + 340px));
    -ms-transform: translateY(calc(-100% + 340px));
    -o-transform: translateY(calc(-100% + 340px));
}

.post__info {
    padding: 1.5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post__info .category__button {
    width: fit-content;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    font-weight: 700;
    background: var(--color-dark-gray);
    color: var(--color-off-white);
    border: 1px solid var(--color-black-soft);
}

.post__title {
    margin: 1rem 0;
    flex-grow: 1;
}

.post__title a {
    color: var(--color-black-soft);
    font-size: 1.4rem;
    line-height: 1.4;
}

/* .post__title a:hover {
    color: var(--color-accent-orange);
} */

.post__author {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-dark-gray-transparent); /* Subtle separator line */
}

.post__author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    overflow: hidden;
}

.post__author-info h5 {
    font-size: 0.85rem;
    margin: 0;
    color: var(--color-black-soft); /* Dark text */
}

.post__author-info small {
    font-size: 0.8rem;
    color: var(--color-dark-gray); /* Darker sub-text */
}

/* =================================================================
  Featured
=================================================================
 */

.featured {
    margin-top: 8rem;
}

.featured__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.featured .post__thumbnail {
    object-fit: cover;
    width: 100%;
    height: fit-content;
}

/* =================================================================
  Posts
=================================================================
 */

.posts__container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5rem;
    margin-bottom: 5rem;
}

.post .category__button {
    margin-bottom: 1rem;
}

/* =================================================================
  Archive CTA Section
=================================================================
*/
.archive-cta {
    position: relative; /* This is the positioning context */
    padding: 6rem 0;
    text-align: center;
    border-top: 1px solid var(--color-light-beige);
    overflow: hidden;
}

.archive-cta__container {
    position: relative;
    z-index: 2; /* Ensures content is ON TOP */
}

.archive-cta__bg-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16rem;
    color: var(--color-light-beige);
    opacity: 0.4;
    z-index: 1; /* Ensures icon is IN THE BACK */
}

.archive-cta h2 {
    font-size: 2.2rem;
    color: var(--color-black-soft);
}

.archive-cta p {
    max-width: 55ch;
    margin: 1rem auto 2.5rem;
    color: var(--color-dark-gray);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Outline Button Style */
.btn.btn-outline {
    background: transparent;
    color: var(--color-black-soft);
    border: 2px solid var(--color-dark-gray);
    font-weight: 600;
    padding: 0.8rem 2rem;
    border-radius: 50px;
}

.btn.btn-outline:hover {
    background: var(--color-dark-gray);
    color: var(--color-off-white);
}

.archive-cta .btn {
    margin-left: auto;
    margin-right: auto;
}

/* =================================================================
  Category Section
=================================================================
 */

.categories {
    padding: 4rem 0;
    background: var(--color-light-beige);
}

.section__title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-black-soft);
}

.categories__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category__card {
    background: var(--color-background);
    padding: 1.5rem;
    border-radius: var(--card-border-radius-3);
    border: 1px solid var(--color-dark-gray-transparent);
    text-align: left;
    transition: var(--transition);
}

.category__card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px var(--color-dark-gray-transparent);
}

.category__card h5 {
    font-size: 1.1rem;
    color: var(--color-black-soft);
    margin-bottom: 0.5rem;
}

.category__card p {
    color: var(--color-accent-orange);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category__card p ion-icon {
    transition: var(--transition);
}

.category__card:hover p ion-icon {
    transform: translateX(5px);
}

/* =================================================================
  Footer Section
=================================================================
 */

footer {
    background: var(--color-black-soft);
    padding: 4rem 0 0;
    color: var(--color-light-beige);
    margin-top: auto;
}

.footer__container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.footer__main {
    grid-column: 1 / -1; /* Make this section span full width initially */
    margin-bottom: 2rem;
    text-align: center;
}

.footer__logo h3 {
    color: var(--color-off-white);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer__tagline {
    color: var(--color-light-beige);
    max-width: 400px;
    margin: 0 auto 1.5rem;
    font-size: 0.9rem;
}

.footer__socials {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.footer__socials a {
    font-size: 1.2rem;
    color: var(--color-black-soft);
    background: var(--color-light-beige);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.footer__socials a:hover {
    background: var(--color-accent-orange);
    color: var(--color-off-white);
}

footer h4 {
    color: var(--color-off-white);
    margin-bottom: 1rem;
}

footer ul li {
    padding: 0.4rem 0;
}

footer ul a {
    color: var(--color-light-beige);
    opacity: 0.8;
    transition: var(--transition);
}

footer ul a:hover {
    opacity: 1;
    color: var(--color-accent-orange);
    padding-left: 0.5rem;
}

.footer__copyright {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--color-dark-gray-transparent);
    margin-top: 4rem;
    font-size: 0.85rem;
    color: var(--color-light-beige);
    opacity: 0.7;
}

@media screen and (min-width: 768px) {
    .footer__container {
        grid-template-columns: 2fr 1fr 1fr 1fr; /* On larger screens, give main section more space */
        gap: 3rem;
    }
    .footer__main {
        grid-column: auto; /* Revert to auto column span */
        text-align: left;
        margin-bottom: 0;
    }
    .footer__tagline,
    .footer__socials {
        margin: 0 0 1.5rem 0;
        justify-content: flex-start;
    }
}

/* =================================================================
  Search Bar
=================================================================
 */

.search-bar-wrapper {
    max-width: 500px;
    width: 80%;
    margin: 7rem auto 3rem auto;
    position: relative;
}

.search-bar-wrapper form {
    display: flex;
    flex-direction: row; /* Ensures input and button are side-by-side */
}

.search-bar-wrapper input {
    width: 100%;
    height: 50px;
    border: 1px solid var(--color-light-beige);
    border-radius: 50px; /* Pill shape */
    padding: 0 60px 0 20px; /* Make space for the button */
    font-size: 1rem;
    color: var(--color-black-soft);
    background-color: var(--color-background);
    transition: var(--transition);
}

.search-bar-wrapper input:focus {
    border-color: var(--color-dark-gray);
    box-shadow: 0 0 8px var(--color-dark-gray-transparent);
}

.search-bar-wrapper button {
    position: absolute;
    right: 5px;
    top: 5px;
    height: 40px;
    width: 40px;
    background: var(--color-dark-gray);
    color: var(--color-off-white);
    border: none;
    border-radius: 50%; /* Circle shape */
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-bar-wrapper button:hover {
    background: var(--color-accent-orange);
}

/* =================================================================
  Button
=================================================================
 */

.btn {
    display: inline-block;
    width: fit-content;
    padding: 0.6rem 1.2rem;
    background-color: var(--color-accent-orange);
    border-radius: var(--card-border-radius-2);
    cursor: pointer;
    transition: var(--transition);
    color: var(--color-off-white);

    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn ion-icon {
    transform: rotate(-40deg);
    font-size: inherit;
    transition: var(--transition);
}

.btn:hover {
    background-color: #d35424; /* Darker orange */
}

.btn:hover ion-icon {
    transform: rotate(0);
}

.btn.sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

.btn.danger {
    background-color: var(--color-danger);
}

/* =================================================================
  Single Post
=================================================================
 */

.singlepost {
    margin: 6rem 0 2rem;
}

.singlepost__container {
    width: var(--form-width);
    /* background: var(--color-dark-gray); */
    color: var(--color-off-white);
    padding: 1rem 2rem 3rem;
    border-radius: var(--card-border-radius-3);
}

.singlepost__container h1 {
    margin: 1.6rem 0;
    color: var(--color-accent-orange);
}

.singlepost__container .post__author-info h5,
.singlepost__container .post__author-info small {
    color: var(--color-black-soft);
}

.singlepost__thumbnail {
    margin: 1.5rem 0 1rem;
    border-radius: var(--card-border-radius-4);
    border: 1rem solid var(--color-black-soft);
    overflow: hidden;

    width: 100%;
    height: auto;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    margin-top: 0.8rem;
    padding: 0.6rem 1.2rem;
    text-align: center;
    background: var(--color-accent-orange);
    color: #fff;
    font-weight: 600;
    border-radius: var(--card-border-radius-4);
    text-decoration: none;
    transition: background 0.3s ease-in-out;
    -webkit-border-radius: var(--card-border-radius-4);
    -moz-border-radius: var(--card-border-radius-4);
    -ms-border-radius: var(--card-border-radius-4);
    -o-border-radius: var(--card-border-radius-4);
}

.download-btn:hover {
    background: var(--color-black-soft);
}

/* parse text ( markedown ) */
/* Container for post content */
.singlepost__content {
    margin-top: 1rem;
    line-height: 1.7;
    font-size: 1rem;
    padding: 1.5rem 2rem;
    background-color: var(--color-black-soft);
    color: var(--color-light-beige);
    border-radius: var(--card-border-radius-4);
}

/* Headings */
.singlepost__content h1,
.singlepost__content h2,
.singlepost__content h3,
.singlepost__content h4,
.singlepost__content h5,
.singlepost__content h6 {
    color: var(--color-off-white);
    font-weight: 600;
    line-height: 1.3;
    margin: 1.2rem 0 0.6rem;
}

.singlepost__content h1 {
    font-size: 2rem;
    font-weight: 700;
}

.singlepost__content h2 {
    font-size: 1.6rem;
}
.singlepost__content h3 {
    font-size: 1.3rem;
}
.singlepost__content h4 {
    font-size: 1.1rem;
}
.singlepost__content h5 {
    font-size: 1rem;
}
.singlepost__content h6 {
    font-size: 0.9rem;
    color: var(--color-gray-light);
}

/* Paragraphs */
.singlepost__content p {
    margin: 0.8rem 0;
}

/* Links */
.singlepost__content a {
    color: var(--color-accent-orange);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
.singlepost__content a:hover {
    color: var(--color-off-white);
}

/* Bold / Italic */
.singlepost__content strong {
    font-weight: 700;
}
.singlepost__content em {
    font-style: italic;
}

/* Lists */
.singlepost__content ul,
.singlepost__content ol {
    margin: 1rem 0 1rem 2rem;
    padding-left: 1rem;
}
.singlepost__content li {
    margin: 0.3rem 0;
}

/* Task Lists */
.singlepost__content input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Blockquote */
.singlepost__content blockquote {
    margin: 1rem 0;
    padding: 0.6rem 1rem;
    border-left: 4px solid var(--color-accent-orange);
    background: rgba(255, 255, 255, 0.05);
    font-style: italic;
    color: var(--color-light-beige);
}

/* Horizontal Rule */
.singlepost__content hr {
    border: none;
    border-top: 1px solid var(--color-gray-light);
    margin: 2rem 0;
}

/* Code blocks */
.singlepost__content pre {
    background: #1e1e1e;
    color: #f5f5f5;
    padding: 0.8rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9rem;
    margin: 1rem 0;
}
.singlepost__content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.95rem;
}

/* Tables */
.singlepost__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
.singlepost__content th,
.singlepost__content td {
    border: 1px solid var(--color-gray-light);
    padding: 0.6rem 0.8rem;
    text-align: left;
}
.singlepost__content th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}
.singlepost__content tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

/* Images */
.singlepost__content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
    display: block;
}

/* Captions (when using alt text creatively) */
.singlepost__content figure {
    margin: 1.5rem 0;
    text-align: center;
}
.singlepost__content figcaption {
    font-size: 0.85rem;
    color: var(--color-gray-light);
    margin-top: 0.3rem;
}

/* markdown text end */

/* .singlepost__container .btn {
    margin-top: 1.5rem;
    margin-left: auto;
    border: 2px solid transparent;
    color: var(--color-off-white);
    background-color: var(--color-accent-orange);
}

.singlepost__container .btn ion-icon {
    transform: rotate(0);
    font-size: 1rem;
}

.singlepost__container .btn:hover {
    border-color: var(--color-accent-orange);
    background-color: var(--color-dark-gray);
} */

/* Footer and Social Share section */
.singlepost__footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-dark-gray-transparent);
    text-align: center;
}

.singlepost__footer h3 {
    margin-bottom: 1.5rem;
    color: var(--color-black-soft);
}

.social__share-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.social__share-links a {
    font-size: 1.4rem; /* Icon size */
    color: var(--color-off-white);
    background: var(--color-dark-gray); /* Match footer socials */
    border-radius: 50%;
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social__share-links a:hover {
    background: var(--color-accent-orange);
    color: var(--color-off-white);
    transform: translateY(-4px);
}

/* =================================================================
  Category Post
=================================================================
 */

.category__title-minimal {
    margin-top: 4.5rem; /* Navbar offset */
    padding: 4rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--color-light-beige);
    background-color: var(--color-background);
    margin-bottom: 3rem;
}

.category__title-minimal h2 {
    font-size: 2.5rem;
    color: var(--color-black-soft);
}

.category__title-minimal p {
    font-size: 1.1rem;
    color: var(--color-dark-gray);
    margin-top: 0.5rem;
}

/* =================================================================
  Empty Page
=================================================================
 */

.empty__page {
    max-width: 960px;
    margin-top: 6rem;
    margin-bottom: 3rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    text-align: left;
    /* If you want vertical centering as well, keep or adjust the grid layout: */
    display: grid;
    place-content: center;
}

.empty__page h1,
.empty__page h2 {
    margin-bottom: 20px;
}

.empty__page p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.empty__page ul {
    padding-left: 25px;
    margin-bottom: 15px;
}

/* =================================================================
  General Form
=================================================================
 */

.form__section {
    display: grid;
    place-items: center;
    height: 100vh;
}

.form__section-container {
    width: var(--form-width);
}

.alert__message {
    padding: 0.8rem 1.4rem;
    margin-bottom: 1rem;
    border-radius: var(--card-border-radius-2);
}

.alert__message.error {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.alert__message.success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.alert__message.lg {
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form__control {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.form__control.inline {
    flex-direction: row;
    align-items: center;
}

input,
textarea,
select {
    padding: 0.8rem 1.4rem;
    background-color: var(--color-light-beige);
    border-radius: var(--card-border-radius-2);
    resize: vertical;
    color: var(--color-black-soft);
}

textarea {
    max-height: 30rem;
}

.form__section small {
    margin: 0 auto;
    margin-top: 1rem;
    display: block;
}

.form__section small a {
    color: var(--color-accent-orange);
}

.form__section .btn {
    width: fit-content;
    /* max-width: 30%; */
    justify-content: center;
    border: 2px solid transparent;
    background-color: var(--color-accent-orange);
    color: var(--color-off-white);
    margin-top: 1.5rem;
    margin-left: auto;
}

.form__section .btn:hover {
    border-color: var(--color-accent-orange);
    background-color: var(--color-background);
    color: var(--color-accent-orange);
    box-shadow: rgba(93, 97, 103, 0.2) 0px 8px 24px;
}

/* contact us form */
.contact_us-form textarea {
    font-family: inherit;
    padding-bottom: 0;
    resize: vertical;
    height: 9rem;
}

.contact_us-form form .success-message {
    text-align: left;
    bottom: 20px;
}

/* status color */
.color-red {
    color: var(--color-danger);
}

.color-green {
    color: hsl(152, 69%, 31%);
}

/* =================================================================
  Dashboard
=================================================================
 */

.dashboard {
    margin-top: 6rem;
}

.sidebar__toggle {
    display: none;
}

.dashboard__container {
    display: grid;
    grid-template-columns: 14rem auto;
    gap: 1rem;
    background: var(--color-off-white);
    padding: 2rem;
    margin-bottom: 5rem;
    border-radius: var(--card-border-radius-3);
    border: 1px solid var(--color-light-beige);
}

.dashboard aside a {
    background-color: var(--color-light-beige);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.6rem;
    color: var(--color-black-soft);
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
}

.dashboard aside ul li:first-child a {
    border-top: 2px solid transparent;
    border-top-left-radius: var(--card-border-radius-2);
    border-top-right-radius: var(--card-border-radius-2);
}

.dashboard aside ul li:last-child a {
    border-bottom: 2px solid transparent;
    border-bottom-left-radius: var(--card-border-radius-2);
    border-bottom-right-radius: var(--card-border-radius-2);
}

.dashboard aside ul li:not(:first-child):not(:last-child) a {
    border-bottom: 1px solid var(--color-background);
}

.dashboard aside ul li:not(:last-child) a {
    border-bottom: 1px solid var(--color-background);
}

.dashboard aside ul li:first-child a:hover {
    border-top-color: var(--color-dark-gray);
}

.dashboard aside ul li:last-child a:hover {
    border-bottom-color: var(--color-dark-gray);
}

.dashboard aside a:hover {
    border-left-color: var(--color-dark-gray);
    border-right-color: var(--color-dark-gray);
    background: var(--color-background);
}

.dashboard aside a.active {
    background-color: var(--color-background);
    border-left-color: var(--color-dark-gray);
    border-right-color: var(--color-dark-gray);
}

.dashboard aside ul li:first-child a.active {
    border-top-color: var(--color-dark-gray);
}

.dashboard aside ul li:last-child a.active {
    border-bottom-color: var(--color-dark-gray);
}

.dashboard main {
    margin-left: 1.5rem;
}

.dashboard main h2 {
    margin: 0 0 2rem 0;
    line-height: 1;
}

.dashboard main table {
    width: 100%;
    border-collapse: separate;
    text-align: left;
    /* border-spacing: 0; */
}

.dashboard main table th {
    background: var(--color-light-beige);
    padding: 0.8rem;
    color: var(--color-black-soft);
    margin: 1rem;

    border: 2px solid transparent;
}

.dashboard main table th:first-child {
    border-top-left-radius: var(--card-border-radius-2);
    border-bottom-left-radius: var(--card-border-radius-2);
    border-right: 2px solid transparent;
}

.dashboard main table th:last-child {
    border-top-right-radius: var(--card-border-radius-2);
    border-bottom-right-radius: var(--card-border-radius-2);
    border-left: 2px solid transparent;
}

.dashboard main table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--color-light-beige);
}

.dashboard main table th:not(:first-child):not(:last-child) {
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
}

.dashboard main table tr:hover td {
    background-color: var(--color-light-beige);
    color: var(--color-black-soft);
    cursor: default;
    transition: var(--transition);
}

.dashboard main .btn {
    width: fit-content;
    justify-content: center;
    border: 2px solid transparent;
}

.dashboard main .btn:not(.btn.danger) {
    background-color: var(--color-dark-gray);
    color: var(--color-off-white);
}

.dashboard main .btn:not(.btn.danger):hover {
    border-color: var(--color-dark-gray);
    background-color: var(--color-background);
    color: var(--color-dark-gray);
    box-shadow: rgba(93, 97, 103, 0.2) 0px 8px 24px;
}

.dashboard main .btn.danger {
    background-color: var(--color-danger);
}

.dashboard main .btn.danger:hover {
    border-color: var(--color-danger);
    background-color: #d35424;
    color: var(--color-off-white);
    box-shadow: rgba(178, 4, 4, 0.37) 0px 8px 24px;
}

/* =================================================================
  Media Queries ( Medium Devices )
=================================================================
 */

@media screen and (max-width: 1024px) {
    /* ======== General ======== */
    .container {
        width: var(--container-width-md);
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    h5 {
        font-size: 0.8rem;
    }

    /* ======== Nav ======== */
    nav button {
        display: inline-block;
        font-size: 1.5rem;
        background: transparent;
        color: var(--color-dark-gray); /* MODIFIED: Dark button icon */
        cursor: pointer;
    }

    nav button#close__nav-btn {
        display: none;
    }

    .nav__container {
        position: relative;
        width: 90vw; /* MODIFIED: Set tablet and mobile width */
    }

    .nav__items {
        position: absolute;
        flex-direction: column;
        top: 110%;
        right: 0;
        width: 12rem;
        align-items: flex-start;
        justify-content: center;
        gap: 0;
        display: none;
    }

    .nav__items li {
        width: 100%;
        height: 4.5rem;
        display: flex;
        align-items: center;
        box-shadow: -2rem 3rem 7rem rgba(0, 0, 0, 0.7);
        /* border-top: 1px solid var(--color-black-soft); */
        animation: animationDropdown 400ms 0s ease forwards;
        opacity: 0;
        transform-origin: top;
    }

    .nav__items li:nth-child(2) {
        animation-delay: 200ms;
    }

    .nav__items li:nth-child(3) {
        animation-delay: 400ms;
    }

    .nav__items li:nth-child(4) {
        animation-delay: 600ms;
    }

    .nav__items li:nth-child(5) {
        animation-delay: 800ms;
    }

    /* nav dropdown animation */
    @keyframes animationDropdown {
        0% {
            transform: rotateX(90deg);
        }

        100% {
            transform: rotateX(0deg);
            opacity: 1;
        }
    }

    .nav__items li a {
        border-radius: 0;
        width: 100%;
        height: 100%;
        background: var(--color-dark-gray);
        color: var(--color-off-white);
        padding: 0 2rem;
        display: flex;
        align-items: center;

        border-top-width: 2px;
        border-left-width: 2px;
        border-right-width: 2px;
        border-style: solid;
        border-color: transparent;
        border-top-left-radius: var(--card-border-radius-2);
        border-top-right-radius: var(--card-border-radius-2);
    }

    .nav__items li:not(:first-child) a {
        border-radius: 0;
        border-top-width: 0;
    }

    .nav__items li a:hover {
        background: var(--color-black-soft);
        border-color: var(--color-light-beige);
    }

    .nav__profile {
        background: var(--color-dark-gray);
    }

    .nav__profile ul {
        top: 100%;
        width: 100%;
    }

    .nav__profile .avatar {
        margin-left: 2rem;
        border: 0;
    }

    /* ======== Header Section ======== */
    /* .header-section {
        width: 90%;
        height: 30vh;
    }

    .header-section__content h1 {
        font-size: 2.5rem;
    }

    .header-section__content p {
        font-size: 1rem;
    } */

    /* ======== Features Section ======== */
    .featured__container {
        gap: 3rem;
    }

    /* ======== Post Section ======== */
    .posts__container {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .footer__container {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    /* ======== Single Post Page ======== */
    /* Markdown */
    .singlepost__content {
        font-size: 0.95rem;
        padding: 1.2rem 1.5rem;
    }

    .singlepost__content h1 {
        font-size: 1.7rem;
    }
    .singlepost__content h2 {
        font-size: 1.4rem;
    }
    .singlepost__content h3 {
        font-size: 1.2rem;
    }
    .singlepost__content h4 {
        font-size: 1rem;
    }

    /* Tables: add scroll for overflow */
    .singlepost__content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .singlepost__content th,
    .singlepost__content td {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    /* Code blocks: shrink font */
    .singlepost__content pre {
        font-size: 0.85rem;
        padding: 0.6rem;
    }

    /* ======== Blog ======== */
    .search__bar-container {
        width: 60%;
    }

    /* ======== General Form ======== */
    .form__section-container {
        padding: 3rem;
    }

    /* ======== Dashboard ======== */
    .dashboard__container {
        grid-template-columns: 4.5rem auto;
        padding: 0;
        background: transparent;
    }

    .dashboard aside h5 {
        display: none;
    }

    .dashboard main table thead {
        display: none;
    }

    .dashboard main table tr {
        display: flex;
        flex-direction: column;
    }

    .dashboard main table tr:nth-child(even) {
        background: var(--color-light-beige);
    }

    .dashboard main table tr:hover td {
        background: transparent;
    }
}

/* =================================================================
  Media Queries ( Small Devices )
=================================================================
 */

@media screen and (max-width: 600px) {
    section {
        margin-top: 2rem;
    }

    h1 {
        font-size: 2rem;
    }

    /* .header-section {
        width: 90vw;
        height: 30vh;
        margin-top: 5rem;
    }

    .header-section__content {
        padding: 1rem;
    }

    .header-section__content h1 {
        font-size: 1.8rem;
    }

    .header-section__content p {
        font-size: 0.9rem;
    }

    .header-section__btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    } */

    .post__thumbnail {
        height: 240px;
    }

    .posts {
        margin-top: 3.5rem;
    }

    .featured {
        margin-top: 6rem;
    }

    .featured__container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .posts__container {
        grid-template-columns: 1fr;
    }

    .category__buttons-container {
        grid-template-columns: 1fr 1fr;
    }

    .footer__container {
        grid-template-columns: 1fr;
        text-align: center;
        align-items: center;
        gap: 2rem;
    }

    /* ======== Blog ======== */
    .search__bar-container {
        width: var(--container-width-md);
    }

    /* ======== Single Post ======== */
    .singlepost__container {
        /* margin-top: 6rem; */
        background-color: transparent;
        padding: 0;
        color: var(--color-black-soft);
    }

    .singlepost__container .post__author-details small {
        color: var(--color-dark-gray);
    }

    /* .singlepost__container h1,
    .singlepost__container h2,
    .singlepost__container h3 {
        color: var(--color-black-soft);
    } */

    .singlepost__content {
        font-size: 0.9rem;
        padding: 1rem;
    }

    .singlepost__content h1 {
        font-size: 1.4rem;
    }
    .singlepost__content h2 {
        font-size: 1.2rem;
    }
    .singlepost__content h3 {
        font-size: 1rem;
    }
    .singlepost__content h4 {
        font-size: 0.9rem;
    }

    /* Paragraphs & lists spacing */
    .singlepost__content p,
    .singlepost__content li {
        margin: 0.5rem 0;
    }

    /* Tables: smaller text */
    .singlepost__content table {
        font-size: 0.85rem;
    }

    /* Images: center and reduce spacing */
    .singlepost__content img {
        margin: 0.6rem auto;
    }

    /* Code blocks: smaller font */
    .singlepost__content pre,
    .singlepost__content code {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    /* Blockquote: reduce padding */
    .singlepost__content blockquote {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    /* ======== General Form ======== */
    .form__section-container {
        padding: 0;
    }

    /* ======== Dashboard ======== */
    .dashboard {
        margin-top: 5rem;
    }

    .dashboard__container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .dashboard main {
        margin: 0;
    }

    .dashboard main h2 {
        margin-top: 1rem;
    }

    .dashboard aside {
        position: fixed;
        box-shadow: 2rem 0 4rem rgba(0, 0, 0, 0.4);
        left: -100%;
        transition: var(--transition);
        background: var(--color-off-white);
        top: 50%;
        transform: translateY(-50%);
    }

    .dashboard .sidebar__toggle {
        display: inline-block;
        background: var(--color-accent-orange);
        color: var(--color-off-white);
        position: fixed;
        right: 0;
        bottom: 4rem;
        z-index: 1;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50% 0 0 50%;
        font-size: 1.3rem;
        cursor: pointer;
        box-shadow: -1rem 0 2rem rgba(0, 0, 0, 0.4);

        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dashboard aside a h5 {
        display: inline-block;
    }

    #hide__sidebar-btn {
        display: none;
    }
}

/* =================================================================
  * Sign In Page
=================================================================
 */

/* Password wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 2.5rem; /* space for eye icon */
}

.password-wrapper ion-icon {
    position: absolute;
    right: 0.8rem;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-dark-gray);
    transition: var(--transition);
    display: none; /* initially hidden */
}

.password-wrapper ion-icon:hover {
    color: var(--color-accent-orange);
}

/* =================================================================
  First Results Page
=================================================================
*/
.first-results__header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.first-results {
    margin-bottom: 3rem;
}

.first-results__table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--color-light-beige);
    border-radius: var(--card-border-radius-2);
    overflow: hidden;
}

.first-results__table thead {
    background: var(--color-light-beige);
}

.first-results__table th {
    padding: 0.8rem 1.2rem;
    text-align: center;
    font-weight: 600;
    color: var(--color-black-soft);
}

.first-results__table tbody tr {
    border-bottom: 1px solid var(--color-light-beige);
}

.first-results__table tbody tr:last-child {
    border-bottom: none;
}

.first-results__table td {
    padding: 1rem 1.2rem;
    text-align: center;
    vertical-align: middle;
    background-color: var(--color-background);
}

.result-date {
    font-weight: 500;
    color: var(--color-dark-gray);
}

.result-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-black-soft);
}

.result-placeholder {
    font-size: 1.5rem;
    color: var(--color-light-beige);
}

.result-highlight {
    border: 2px solid var(--color-accent-orange) !important;
    box-shadow: 0 0 10px var(--color-danger-light);
    transform: scale(1.02);
}

/* Responsive styles for the table */
@media screen and (max-width: 768px) {
    .first-results__table thead {
        display: none;
    }

    .first-results__table,
    .first-results__table tbody {
        display: block;
        width: 100%;
        border: none;
    }

    .first-results__table tr {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas:
            "date date date"
            "mor day evn";
        gap: 0.5rem;
        padding: 1rem;
        margin-bottom: 1rem;
        border: 1px solid var(--color-light-beige);
        border-radius: var(--card-border-radius-2);
        background-color: var(--color-background);
    }

    .first-results__table td {
        background: none;
        border: none;
        padding: 0;
        text-align: center;
    }

    /* Style the Date as the card header */
    .first-results__table td[data-label="Date"] {
        grid-area: date;
        padding-bottom: 0.8rem;
        margin-bottom: 0.8rem;
        border-bottom: 1px solid var(--color-light-beige);
        text-align: left;
    }

    .result-date {
        font-size: 1.1rem;
        font-weight: 600;
    }

    /* Style the result cells */
    .first-results__table td[data-label="Morning (MOR)"] {
        grid-area: mor;
    }
    .first-results__table td[data-label="Day (DAY)"] {
        grid-area: day;
    }
    .first-results__table td[data-label="Evening (EVN)"] {
        grid-area: evn;
    }

    /* Add labels above the numbers */
    .first-results__table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 500;
        margin-bottom: 0.25rem;
        color: var(--color-dark-gray);
    }

    /* Hide the ::before label for the Date, as it's our header */
    .first-results__table td[data-label="Date"]::before {
        display: none;
    }

    .result-number {
        font-size: 1.8rem;
    }

    .first-results__table tr:last-child {
        border-bottom: 1px solid var(--color-light-beige) !important;
    }
}

/* =================================================================
  Minimalist Authentication & Form Pages
=================================================================
*/

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

.auth-panel {
    background-color: var(--color-black-soft);
    color: var(--color-off-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.auth-panel__logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-off-white);
    margin-bottom: 1rem;
    display: block;
}

.auth-panel__tagline {
    font-size: 1.1rem;
    color: var(--color-light-beige);
    opacity: 0.8;
}

.auth-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background-color: var(--color-background);
}

.auth-form__container {
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Override general form styles for these pages */
.auth-form form {
    gap: 1.5rem;
}

.auth-form input,
.auth-form textarea {
    background-color: transparent;
    border-radius: 0;
    border-bottom: 2px solid var(--color-light-beige);
    padding: 0.8rem 0.2rem;
}

.auth-form input:focus,
.auth-form textarea:focus {
    border-bottom-color: var(--color-accent-orange);
}

.auth-form .btn {
    width: 100%;
    margin-top: 1rem;
    background-color: var(--color-black-soft);
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-size: 1rem;
}

.auth-form .btn:hover {
    background-color: var(--color-accent-orange);
}

.auth-form small {
    text-align: center;
}

/* Responsive Styles for Auth Pages */
@media screen and (max-width: 900px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
    .auth-panel {
        padding: 4rem 2rem;
        min-height: 30vh;
    }
    .auth-form {
        padding: 3rem 1.5rem;
    }
}
