/**
 * ==========================================================================
 * Base Styles
 * ==========================================================================
 */
body {
    font-size: 0.85em;
}

/**
 * ==========================================================================
 * Main Layout
 * ==========================================================================
 */
main {
    display: grid;
    min-height: 730px;
}

main:has(.center-content iframe) {
    min-height: auto;
}

/**
 * ==========================================================================
 * Content Area
 * ==========================================================================
 */
.contents {
    padding-top: 5px;
}

.split-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
}

.vertical-divider > div {
    padding: 10px 20px;
}

.vertical-divider > div:not(:first-child) {
    border-left: 1px solid var(--gray_300);
}

.divider-title {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.hr-85 {
    width: 85%;
    margin: -10px auto 20px auto;
}

.hr-90 {
    width: 90%;
    margin: 20px auto;
}

/* --- Centering Utilities --- */
.center-content {
    text-align: center;
    padding-bottom: 20px;
}

.contents:has(.center-content iframe) h1 {
    margin-bottom: 0;
}

.center-content:has(iframe) {
    padding: 20px 10px;
}

.center-content iframe {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 960px;
    height: auto;
    aspect-ratio: 16 / 9;
}

.center-content p {
    text-align: center !important; /* Overrides default left alignment */
}

.wecare-hero {
    font-size: 3em;
    margin: 15px;
    text-align: center;
}

.center-content img {
    display: block;
    margin: 10px auto;
    max-width: 100%;
    height: auto;
}

.wecare-banner {
    width: 70%;
}

/* --- Typography --- */
.contents h3, .contents h4, .contents h5, .contents p {
    padding: 0 10px;
    text-align: left;
    font-weight: normal;
}

.contents h3 {
    font-size: 16px;
    color: var(--black);
    margin-bottom: 10px;
    font-weight: 500;
    border-left: 5px solid var(--blue);
    min-height: 25px;
}

.contents #red {
    color: var(--red);
    border-left: 5px solid var(--red);    
}

.contents h4 {
    font-size: 15px;
    color: var(--gray_800);
    padding-bottom: 10px;
    font-weight: 500;
    text-decoration:underline;
}

.dep_intro {
    color: var(--black);
    text-decoration: none;
    padding-left: 10px;
}

.contents .org-trigger {
    color: var(--blue);
    text-decoration: none;
    font-weight: bold;
}

.contact-links {
    background-color: var(--blue);
    color: var(--white);
    padding: 10px;
    text-align: center;
}

/**
 * ==========================================================================
 * Components: School Cards
 * ==========================================================================
 */
.school-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 40px;
    padding: 10px 30px;
}

.school-card {
    width: 430px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--white);
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.school-card > a {
    margin-right: 20px;
    flex-shrink: 0;
}

.school-card a {
    text-decoration: none;
    color: var(--blue);
    display: block;
}

.school-card img {
    display: block;
    margin-bottom: 0;
}

/* General Layout Enhancements */
.dep_intro h2 {
  color: var(--gray_800);
  font-size: 1.5rem;
  text-align: center;
  border-bottom: 2px solid var(--blue);
  padding-bottom: 10px;
  margin: 0 auto 20px auto;
  width: 90%;
}
/**
 * ==========================================================================
 * Sitemap Tree View Styles
 * ==========================================================================
 */
.sitemap-tree {
    --tree-line-color: var(--gray_300);
    --tree-bg-hover: var(--gray_50);
}

.sitemap-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-left: 10px;
}

.sitemap-controls button {
    padding: 5px 15px;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--white);
    background-color: var(--blue);
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.sitemap-controls button:hover {
    background-color: var(--yblue);
}

.contents .dep_intro ul.sitemap-tree,
.sitemap-tree ul {
    list-style: none;
    margin-left: 20px;
    padding-left: 0;
}

.sitemap-tree ul {
    margin: 10px 0 0 20px; /* Indentation for children */
}

/* List Items */
.sitemap-tree li {
    margin: 0;
    padding: 0 0 10px 30px; /* Left padding for connector space */
    position: relative;
    line-height: normal;
}

/* Vertical Connector */
.sitemap-tree li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--tree-line-color);
}

/* Horizontal Connector */
.sitemap-tree li::after {
    content: '';
    position: absolute;
    top: 15px; /* Centers roughly with the link */
    left: 0;
    width: 25px;
    height: 1px;
    background-color: var(--tree-line-color);
}

/* Remove vertical line extension for the last item */
.sitemap-tree li:last-child::before {
    height: 16px; /* Stops at the horizontal connector */
}

/* Node (Link) Styling - Card Look */
.sitemap-tree a {
    display: inline-block;
    padding: 8px 12px;
    background-color: var(--white);
    border: 1px solid var(--tree-line-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--gray_800);
    font-size: 0.95em;
    font-weight: normal; /* Override bold font-weight from general .contents a */
    transition: all 0.2s ease;
}

.sitemap-tree a:hover {
    border-color: var(--blue);
    color: var(--blue);
    background-color: var(--tree-bg-hover);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Interactive Toggle Button */
.sitemap-tree li.has-children > .sitemap-toggle {
    position: absolute;
    left: 8px; /* Places button on the horizontal connector */
    top: 15px; /* Aligns with the horizontal connector */
    width: 14px;
    height: 14px;
    background-color: var(--white);
    border: 1px solid var(--gray_400);
    border-radius: 2px;
    z-index: 10;
    cursor: pointer;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sitemap-tree li.has-children > .sitemap-toggle:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.sitemap-tree li.has-children > .sitemap-toggle::after {
    content: '\2212'; /* Minus sign */
    font-size: 12px;
    line-height: 1;
    font-weight: bold;
    margin-top: -2px;
}

.sitemap-tree li.collapsed > .sitemap-toggle::after {
    content: '\002B'; /* Plus sign */
    margin-top: 0;
}

.sitemap-tree li.collapsed > ul {
    display: none;
}

/**
 * ==========================================================================
 * Responsive Styles
 * ==========================================================================
 */

/* --- Desktop (1025px and up) --- */
@media (min-width: 1025px) {
    body { background-image: url('/assets/images/sub_Background.jpg'); background-position: top center; background-repeat: no-repeat; }
}    

/* --- Mobile & Tablet (1024px and down) --- */
@media (max-width: 1024px) {
    main { min-height: 600px; }  
    .contents { padding-top: 55px; }
    .school-cards-container { padding: 0 30px; gap: 20px; }
    .school-card { width: 100%; }

    .vertical-divider > div {
        padding: 10px;
    }

    @media (max-width: 768px) {
        .split-columns {
            grid-template-columns: 1fr;
        }

        .hr-90 {
            display: none;
        }

        .wecare-banner {
            width: 90%;
        }

        .wecare-hero {
            font-size: 2.5em;
        }

        .vertical-divider > div:not(:first-child) {
            border-left: none;
        }
    }
}