body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #fafafa;
    color: #222;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* make main content expand */
.content {
    flex: 1 0 auto;
}

/* Logo image styles */
img[alt="Village Montessori School Logo"] {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100vw;
    object-fit: contain;
}

.footer {
    text-align: center;
    background: rgb(42, 134, 208);
    color: #eee;
    font-size: 0.95rem;
    box-shadow: 0 -3px 12px rgba(26,115,232,0.08);
    border-top: 1px solid #e0e7ef;
    width: 100%;
    height: fit-content;
    padding-top: 20px;
    padding-bottom: 20px;
}

.footer span {
    display: block;
    margin: 0.2rem 0;
}   

/* Modern navigation menu styles */
.hamburger {
    display: none;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem; /* move in a bit so rotated elements stay visible */
    width: 2.4rem;
    height: 2.4rem;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    z-index: 20;
    overflow: visible; /* allow bars to extend outside container */
}


.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #1a237e;
    margin: 0.45rem 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: 35%; /* rotate around center */
}

.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* exactly four columns */
    justify-items: center;
    gap: 1.5rem 2rem;
    list-style: none;
    padding: 1.6rem 0 1rem 0;
    margin: 0 0 2rem 0;
    background: linear-gradient(90deg, #e0e7ef 0%, #f8fafc 100%);
    box-shadow: 0 6px 24px rgba(26,115,232,0.10), 0 1.5px 0 rgba(0,0,0,0.02);
    border-radius: 0 0 2.5rem 2.5rem;
    font-size: 1.18rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background 0.4s;
    animation: menuFadeIn 1.2s cubic-bezier(.4,0,.2,1);
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu li {
    padding: 0;
    border-radius: 2rem;
    transition: background 0.22s, color 0.22s, box-shadow 0.22s, transform 0.18s;
    cursor: pointer;
    outline: none;
    font-family: inherit;
    font-size: 1em;
    position: relative;
    text-align: center;
}

/* link inside items */
.menu li a {
    display: block;
    padding: 0.8rem 1.8rem;
    color: #1a237e;
    text-decoration: none;
    border-radius: 2rem;
    transition: color 0.22s, background 0.22s;
    text-align: center;
    position: relative;
}

.menu li a::after {
    content: '';
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #1a237e;
    transition: width 0.3s ease;
}

/* hover expands underline centered */
.menu li a:hover::after,
.menu li a:focus::after {
    width: 60%;
}

.menu li:hover,
.menu li:focus {
    transform: translateY(-2px) scale(1.02);
}

/* active/current page indicator */
.menu li.active a,
.menu li a[aria-current="page"] {
    background: rgba(26,115,232,0.15);
    color: #0d47a1;
    font-weight: 700;
}

.menu li.active a::after,
.menu li a[aria-current="page"]::after {
    width: 60%;
}

.menu li:hover a,
.menu li:focus a {
    background: rgba(255,255,255,0.95);
    color: #0d47a1;
    box-shadow: 0 4px 16px rgba(26,115,232,0.13);
}

.menu li:active {
    transform: scale(0.98);
}

.menu li:active a {
    background: #e3eafc;
    color: #0d47a1;
}

/* image grid styling */
#image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* three columns */
    gap: 1rem;
    padding: 1rem;
    max-width: 960px; /* keeps roughly 3 items across */
    margin: 0 auto;
}

.grid-2x2{
    grid-template-columns: repeat(2, 1fr) !important;
}

/* when there are more than 9 items, grid will automatically flow to additional rows */

#image-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#image-grid img:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* disclaimer styling */
#disclaimer {
    margin: 2rem auto;
    max-width: 960px;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    text-align: center;
}

#disclaimer strong {
    font-weight: 700;
}

/* program overview and tuition styling */
.section {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.section h1,
.section h2 {
    color: #1a237e;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}
.section p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #444;
}

#tuition table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

/* board of directors styling */
.board-director {
    max-width: 960px;
    margin: 2rem auto;
    padding: 1.5rem 1rem;
    background: #fff;
    border-left: 4px solid #1a237e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 0.5rem;
}
.board-director:nth-of-type(even) {
    background: #f7f9fc;
    border-left-color: #1565c0;
}
.board-director h2 {
    margin-top: 0;
    color: #1a237e;
}
.board-director p:first-of-type {
    font-weight: 600;
    color: #333;
}
.board-director p {
    line-height: 1.6;
    color: #444;
    margin-bottom: 0.8rem;
}

/* mobile app page button styles */
.app-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    align-items: center;
    align-content: center;
}
.app-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #1a237e;
    color: #fff;
    text-decoration: none;
    border-radius: 0.4rem;
    font-weight: 600;
    transition: background 0.2s;
}
.app-button:hover {
    background: #1565c0;
}
.app-button svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.app-icon {
    height: 1.2rem;
    width: auto;
    display: inline-block;
}#tuition td {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
}
#tuition tfoot td {
    font-size: 0.9rem;
    color: #666;
    border-top: none;
    padding-top: 1rem;
}

@media (max-width: 700px) {
    #tuition td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    #tuition tr {
        display: block;
        margin-bottom: 0.5rem;
    }
}

/* teacher profile layout */
.teacher-profile {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: nowrap; /* keep photo and info side by side */
}
.teacher-profile:nth-of-type(even) {
    flex-direction: row-reverse;
}
.teacher-photo {
    flex: 0 0 200px;
}
.teacher-photo img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.teacher-info {
    flex: 1 1 auto;
}
.teacher-info h2 {
    margin-top: 0;
    color: #1a237e;
}
.teacher-role {
    display: block;
    font-style: italic;
    color: #555;
    margin-bottom: 0.5rem;
}
@media (max-width: 800px) {
    .teacher-profile {
        flex-direction: column;
        flex-wrap: wrap; /* allow stacking */
    }
    .teacher-photo {
        flex: 0 0 auto;
        width: 100%;
    }
}



@media (max-width: 900px) {
    .hamburger { display: block; }
    .menu {
        /* show first four items by default, hide remaining */
        grid-template-columns: repeat(2, 1fr);
    }
    .menu li:nth-child(n+5) {
        display: none;
    }
    .menu.open li:nth-child(n+5) {
        display: block;
    }
    #image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    #disclaimer {
        max-width: 500px;
        margin: 0 auto;
        padding: 1rem
    }
}
@media (max-width: 600px) {
    .menu {
        grid-template-columns: 1fr;
    }
    .menu li:nth-child(n+5) {
        display: none;
    }
    .menu.open li:nth-child(n+5) {
        display: block;
    }
    #image-grid {
        grid-template-columns: 1fr;
    }
    .footer {
        font-size: small;
        padding: 1rem 1.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        line-height: 1.4;
    }
    #disclaimer {
        max-width: 300px;
        margin: 0 auto;
        padding: 1rem;
    }
}