/*
================================================================
--- ISOLATED SITEMAP STYLES (v3 - With CSS Reordering) ---
================================================================
*/

/* --- Main Wrapper & Theming --- */
.my-sitemap-wrapper {
    --primary-color: #3a86ff;
    --secondary-color: #0056B3;
    --text-dark: #1a202c;
    --text-medium: #2c3e50;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e9ecef;
    --font-primary: 'Poppins', sans-serif;

    background-color: var(--bg-light);
    color: var(--text-medium);
    font-family: var(--font-primary);
    padding: 80px 5%;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Basic Reset for Elements within the Wrapper --- */
.my-sitemap-wrapper *,
.my-sitemap-wrapper *::before,
.my-sitemap-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- Page Header --- */
.my-sitemap-wrapper .sitemap-header {
    max-width: 800px;
    margin: 0 auto 60px auto;
    text-align: center;
}

.my-sitemap-wrapper .sitemap-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.my-sitemap-wrapper .sitemap-header h1 .highlight {
    color: var(--secondary-color);
}

.my-sitemap-wrapper .sitemap-header p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-medium);
}

.my-sitemap-wrapper .section-decorator {
    height: 4px;
    width: 120px;
    margin: 0 auto 25px auto;
    background-image: radial-gradient(circle at center, var(--primary-color) 45%, transparent 50%);
    background-size: 15px 4px;
    background-repeat: repeat-x;
}

/*
============================================================
--- TARGETING RANK MATH'S HTML STRUCTURE ---
============================================================
*/
.my-sitemap-wrapper .sitemap-content {
    max-width: 1200px;
    margin: 0 auto;
}

/*
============================================================
--- NEW: CSS Flexbox for Reordering Sections ---
This is the magic that reorders your content!
============================================================
*/
.my-sitemap-wrapper .rank-math-html-sitemap {
    display: flex;
    flex-direction: column;
}

/* Set the display order: lower numbers appear first */
.my-sitemap-wrapper .rank-math-html-sitemap__section--page { order: 1; }
.my-sitemap-wrapper .rank-math-html-sitemap__section--category { order: 2; }
.my-sitemap-wrapper .rank-math-html-sitemap__section--post { order: 3; }
/* Any other future sections will appear after these */

/* Style for Section Titles (e.g., "Posts", "Pages") */
.my-sitemap-wrapper .rank-math-html-sitemap__title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 50px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* Removes top margin from the very first item in the new order */
.my-sitemap-wrapper .rank-math-html-sitemap__section:first-child {
    margin-top: 0;
}
.my-sitemap-wrapper .rank-math-html-sitemap__section:first-child .rank-math-html-sitemap__title {
    margin-top: 0;
}


/* The Grid Container for Sitemap Links */
.my-sitemap-wrapper .rank-math-html-sitemap__list {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Individual Sitemap Item (The Card) */
.my-sitemap-wrapper .rank-math-html-sitemap__item {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.my-sitemap-wrapper .rank-math-html-sitemap__item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* The Clickable Link */
.my-sitemap-wrapper .rank-math-html-sitemap__link {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 20px 25px;
    display: block;
    transition: color 0.3s ease;
    flex-grow: 1;
}

.my-sitemap-wrapper .rank-math-html-sitemap__link:hover {
    color: var(--primary-color);
}

/* The Publication Date */
.my-sitemap-wrapper .rank-math-html-sitemap__date {
    display: block;
    font-size: 0.85rem;
    color: #8a99b5;
    padding: 0 25px 15px 25px;
    margin-top: auto;
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .my-sitemap-wrapper {
        padding: 60px 5%;
    }
    .my-sitemap-wrapper .sitemap-header h1 {
        font-size: 2.4rem;
    }
    .my-sitemap-wrapper .rank-math-html-sitemap__title {
        font-size: 1.6rem;
    }
    .my-sitemap-wrapper .rank-math-html-sitemap__list {
        grid-template-columns: 1fr;
    }
}