/*Import the font for title bar*/
@import url("https://fonts.googleapis.com/css2?family=Passion+One&display=swap");

/*Import font for the rest of website*/
@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap");

/* Base Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/*HTML graph styling for background*/
body {
    font-family: "Roboto", sans-serif;
    line-height: 1.6;
    color: #111;
    background:
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px) 0px 0px / 10px
            10px,
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px) 0px
            0px / 10px 10px,
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px) 0px 0px / 50px
            50px,
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px) 0px
            0px / 50px 50px #ffffcc;
}

/*Title of the website*/
.site-title {
    font-family: "Passion One", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 2rem;
    color: #ffffff;
    text-decoration: none;
}

/* Layout Architecture */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Mobile Header & Checkbox (Hidden on Desktop) --- */
.menu-toggle-checkbox {
    display: none;
}

.mobile-header {
    display: none;
}

/* --- Sidebar Styling (Prominent on Desktop) --- */
.sidebar {
    width: 300px;
    background-color: #2595d6;
    border-right: 1px solid #eaeaea;
    padding: 2rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 99;
}

.profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
    border: 2px solid #f0f0f0;
}

.sidebar nav {
    width: 100%;
}

.sidebar nav ul {
    list-style: none;
    width: 100%;
    padding-top: 1.5rem;
}

.sidebar nav ul li {
    margin-bottom: 0.5rem;
}

.sidebar nav ul li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    transition:
        background-color 0.2s,
        color 0.2s;
}

.sidebar nav ul li a:hover {
    background-color: #f0f4f8;
    color: #000;
}

/* --- Collapsible Blog Menu Styling --- */

/* 1. Hide the checkbox hack entirely */
.dropdown-checkbox {
    display: none;
}

/* 2. Wrapper to handle relative positioning for the arrow */
.blog-link-wrapper {
    position: relative;
    display: block;
}

/* 3. The toggle arrow (Consolidated transitions & base translation) */
.dropdown-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(40px, -50%); /* Base position */
    background: transparent;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.5rem;
    transition:
        background-color 0.2s,
        color 0.2s,
        transform 0.3s ease;
}

.dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 4. Sub-menu (Categories) Default Styling */
.categories-list {
    display: none; /* Hidden by default */
    padding-left: 0;
    margin-top: 0.5rem;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

/* 5. The Magic: Show list when checked */
.dropdown-checkbox:checked ~ .categories-list {
    display: block;
}

/* 6. The Magic: Rotate arrow while retaining translation when checked */
.dropdown-checkbox:checked ~ .blog-link-wrapper .dropdown-toggle {
    transform: translate(40px, -50%) rotate(180deg);
}

/* 7. Category Links Styling */
.categories-list li {
    margin-bottom: 0;
}

.categories-list li a {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.85);
}

.categories-list li a:hover {
    background-color: #f0f4f8;
    color: #000;
}

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    margin-left: 300px;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column; /* Stacks children vertically */
    align-items: center; /* Centers the content horizontally */
}

/* Text Threshold (Full width until 800px threshold) */
.content-container {
    width: 100%;
    max-width: 800px;
    background: transparent;
}

/* --- Typography & Post Styling --- */
.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: #111;
}

.post-meta {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.post-tags {
    margin-bottom: 2rem;
}

.post-tags span {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.post-cover-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 2.5rem;
}

.post-body h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
    color: #222;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 0.5rem;
}

.post-body p,
.post-body ul,
.post-body ol {
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    color: #444;
}

.post-body ul,
.post-body ol {
    padding-left: 1.5rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body strong {
    color: #111;
}

.site-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eaeaea;
    text-align: center;
    color: #777;
    font-size: 0.9rem;
}

/* --- Mobile View: Fixed Header & Collapsed Sidebar --- */
@media screen and (max-width: 768px) {
    /* Show Mobile Header */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background-color: #2595d6;
        border-bottom: 1px solid #eaeaea;
        z-index: 100;
        padding: 0 1.5rem;
    }

    /* Hamburger Button Styling */
    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 18px;
        cursor: pointer;
    }

    .hamburger-btn span {
        display: block;
        height: 2px;
        width: 100%;
        background-color: #ffffff; /* Changed from #333 to #ffffff for contrast */
        border-radius: 2px;
        transition:
            transform 0.3s ease,
            opacity 0.3s ease;
    }

    /* Transform Hamburger to 'X' when checkbox is checked */
    .menu-toggle-checkbox:checked
        ~ .mobile-header
        .hamburger-btn
        span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle-checkbox:checked
        ~ .mobile-header
        .hamburger-btn
        span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle-checkbox:checked
        ~ .mobile-header
        .hamburger-btn
        span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Collapse and animate Sidebar */
    .sidebar {
        left: -100%; /* Hidden off-screen to the left */
        top: 60px; /* Sits exactly below the mobile header */
        width: 100%;
        height: calc(100vh - 60px);
        transition: left 0.3s ease-in-out;
        border-right: none;
        padding-top: 1rem;
    }

    /* Slide Sidebar in when checkbox is checked */
    .menu-toggle-checkbox:checked ~ .sidebar {
        left: 0;
    }

    /* Adjust Main Content to account for fixed mobile header */
    .main-content {
        margin-left: 0;
        padding: calc(60px + 2rem) 1.5rem 2rem; /* Added 60px for the header height */
    }

    .post-title {
        font-size: 2rem;
    }
    .post-body p,
    .post-body ul,
    .post-body ol {
        font-size: 1rem;
    }
}
