/* =================================================================
   OLD FRIENDS - RESPONSIVE CSS v5.1 - BOTTOM-PINNED SCHOOL NAME
   Updated for new semantic HTML structure (no tables)
   Percentage-based scaling with CSS calc() for smooth responsiveness
   School name now pinned to bottom of gradient background
   ================================================================= */

/* =================================================================
   BULLETIN BOARD & FEATURES SECTIONS - Flexbox layouts
   ================================================================= */

#bulletinBoard {
    max-width: 785px;
    width: 100%;
    margin: 0 auto;
    max-height: 385px;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll from rotated slideshow */
}

#bulletinBoard > div {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
    justify-content: flex-start;
}

.bulletin-item {
    /* Removed default text-align center */
}

/* Slogan - fills left space, always first in order */
.bulletin-slogan {
    order: 1;
    flex: 2 1 300px;
    min-width: 200px;
    max-width: 500px;
    text-align: left;
    margin-left: 10px;
    padding-top: 50px;  /* Desktop and tablet */
}

.bulletin-slogan h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.2;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Slideshow - always second, pushes right when space available */
.bulletin-slideshow {
    order: 2;
    flex: 0 1 150px; /* Don't grow */
    min-width: 150px;
    max-width: 180px; /* Reduced from 200px */
    margin-left: auto;
    margin-right: 20px; /* Add right margin to prevent overflow from rotation */
    margin-top: 15px; /* Push down from top */
}

/* Constrain slideshow images to fixed container */
.bulletin-slideshow .slideshow {
    position: relative;
    width: 150px;
    height: 150px;
    overflow: hidden;
}



.bulletin-slideshow .slideshow img {
    max-width: 150px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Sticky notes - third in order, takes full width of new row */
.bulletin-notes {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
}

/* Sticky notes wrap left to right inside their container */
#postems {
    display: contents;  /* Make children participate in parent flex layout */
    text-align: left;
}

#postems ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1em;
    padding: 1em;
    order: 3;  /* Place after slogan (order: 1) and images (order: 2) */
}

#postems ul li {
    flex: 0 0 auto; /* Don't grow or shrink */
}

/* Remove scrollbars from bulletin items */
#bulletinBoard .yearbook,
#bulletinBoard #postems {
    overflow: visible;
    max-height: none;
}

#features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start; /* Changed from space-around for better control */
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 5px; /* Add small padding to prevent edge overflow */
    box-sizing: border-box;
}

.upperSections {
    flex: 1 1 180px;
    min-width: 150px;
    max-width: 220px;
    text-align: center;
    box-sizing: border-box;
}

/* Mobile adjustments for bulletin board and features */
@media (max-width: 569px) {
    #bulletinBoard > div {
        gap: 10px;
        padding: 5px;
    }
    
    .bulletin-item {
        min-width: 100%;
    }
}

/* =================================================================
   BASE STYLES - Desktop (applies to all unless overridden)
   ================================================================= */

#header {
    margin: 0;
    padding: 0;
    width: 790px;
    max-width: 100%; /* Allow header to shrink below 790px */
    position: relative;
    overflow: visible;
}

.header-gradient {
    width: 750px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 20;
    aspect-ratio: var(--gradient-aspect-ratio, 4.8) / 1;
    overflow: visible;
}

.header-marquee {
    width: 790px;
    height: 164.5px;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 25;
    display: block;
}

.header-content {
    position: absolute;
    top: 5px;
    left: 10px;
    right: 10px;
    bottom: 0;
    z-index: 30;
    padding: 10px 10px 0 10px;
    box-sizing: border-box;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 10px;
}

.header-logo {
    text-align: left;
}

.logo-link {
    font-family: 'Poller One', cursive;
    font-size: 40pt;
    font-weight: normal;
    line-height: 0.6;
    text-shadow: 2px 3px 5px #555;
    -webkit-text-stroke: 1px black;
    text-shadow: 3px 4px 6px #888, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    text-decoration: none;
    display: inline-block;
    padding-top: 0;
}

.logo-tagline {
    font-family: 'Delius', sans-serif;
    font-size: 12pt;
    color: #476373;
    text-shadow: none;
    display: block;
    margin-top: 5px;
    margin-left: 7px;
}

.header-nav {
    font-family: 'Lato', sans-serif;
    font-size: 13pt;
    text-align: right;
    white-space: nowrap;
    position: relative;
}

.about-link {
    font-size: 18pt;
    color: firebrick;
}

.nav-link {
    font-size: 13pt;
    text-decoration: none;
    color: inherit;
}

.nav-link:hover {
    text-decoration: underline;
}

/* User dropdown */
.user-dropdown {
    display: inline-block;
    position: relative;
    cursor: pointer;
}

.user-name {
    font-size: 13pt;
    padding: 2px 4px;
}

.dropdown-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid currentColor;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: -10px;
    background: white;
    border: 1px solid #999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-width: 120px;
    z-index: 1000;
    margin-top: -2px;
    padding-top: 4px;
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    font-size: 13pt;
    white-space: nowrap;
    border-bottom: 1px solid #ddd;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #f0f0f0;
}

.nav-button {
    margin: 0;
    padding: 2px 6px;
    font-size: 10pt;
    background: #CADFED;
    border: 1px solid #999;
    cursor: pointer;
}

.header-school-name {
    text-align: center;
    letter-spacing: 2px;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 10px;
    padding-bottom: var(--school-name-padding-desktop, 0px);
    box-sizing: border-box;
}

.header-school-name h1 {
    margin: 0;
    padding: 0 0 5px 0;
    font-size: min(var(--school-name-size-desktop, 3.44vw), var(--school-name-max-desktop, 46.24px));
}

/* Smooth transitions */
#header * {
    transition: font-size 0.2s ease-out, padding 0.2s ease-out;
}

/* =================================================================
   SCHOOL INFO BAR - Desktop base styles
   ================================================================= */

.schoolInfo-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
    padding: 5px 10px;
    box-sizing: border-box;
}

.schoolInfo-item {
    flex-shrink: 1;
}

.schoolInfo-share {
    text-align: left;
}

.schoolInfo-colors {
    text-align: left;
    min-width: 150px;
}

.schoolInfo-address {
    text-align: center;
    flex-grow: 1;
}

.schoolInfo-actions {
    text-align: right;
    min-width: 150px;
}

/* =================================================================
   ADMIN BANNER
   ================================================================= */

div[style*="background-color: #EDD679"] {
    padding: 8px 10px;
}

/* =================================================================
   FIVE FEATURE BOXES - Desktop grid
   ================================================================= */

.upperSections {
    min-height: 200px;
    padding: 15px;
    box-sizing: border-box;
}

.upperSection-lowerPart {
    text-align: center;
    margin-top: 15px;
}

.panelItemHdg {
    font-size: 1.5em;
}

/* =================================================================
   CORK BOARD SECTION
   ================================================================= */

div[id="class info"] {
    padding: 10px;
}

div[id="class info"] h2 {
    font-size: 1.5rem;
}

.slideshow {
    max-width: 200px;
    display: block;
}

/* =================================================================
   TEACHING STAFF
   ================================================================= */

.EducatorsBlock {
    max-height: 300px;
    overflow-y: auto;
}

/* =================================================================
   YEAR NAVIGATION
   ================================================================= */

.arrow-button {
    padding: 8px 20px 8px 12px;
    font-size: 100%;
}

.arrow-button-left {
    padding-left: 25px;
}

.arrow-button-right {
    padding-right: 25px;
}

div[id="class listing"] h2 {
    font-size: 1.5rem;
}

/* =================================================================
   CLASS LIST
   ================================================================= */

#classListAjax {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.classList {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.classList table {
    max-width: 100%;
}

/* =================================================================
   STICKY NOTES
   ================================================================= */

#postems ul {
    padding: 1em;
}

/* Sticky note wrapper - auto-sizing with flexbox */
#postems ul li {
    margin: 1em;
    list-style: none;
    display: inline-flex;  /* Changed from float */
    align-items: stretch;
    justify-content: center;
}

#postems ul li h3 {
    font-size: 100%;
    font-weight: bold;
    padding-bottom: 10px;
}

/* Sticky note - auto-size to content, maintain 5:3 landscape ratio */
#postems ul li a {
    text-decoration: none;
    color: #000;
    background: #ffc;
    display: flex;
    flex-direction: column;
    align-items: center;  /* Center pushpin horizontally */
    min-width: 8em;   /* Minimum size */
    max-width: 12em;  /* Maximum size - wider for landscape */
    min-height: 4.8em;  /* 8em × 3/5 for 5:3 ratio */
    max-height: 7.2em;  /* 12em × 3/5 for 5:3 ratio */
    width: fit-content;   /* Auto-size to content */
    height: fit-content;
    aspect-ratio: 5 / 3;  /* Landscape - wider than tall */
    padding: 1em;
    box-shadow: 5px 5px 7px rgba(33,33,33,.7);
    transform: rotate(-6deg);
    transition: transform .15s linear;
    overflow: hidden;  /* Prevent content overflow */
}

/* Pushpin image - centered at top */
#postems ul li a img {
    width: 20px;
    margin: -1em auto 0 auto;  /* Negative top margin to move up */
}

/* Paragraph inside sticky note */
#postems ul li a p {
    text-align: left;  /* Content left-aligned */
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

#postems ul li:nth-child(even) a {
    transform: rotate(4deg);
    position: relative;
    top: 5px;
    background: #cfc;
}

#postems ul li:nth-child(3n) a {
    transform: rotate(-3deg);
    position: relative;
    top: -5px;
    background: #ccf;
}

#postems ul li:nth-child(5n) a {
    transform: rotate(5deg);
    position: relative;
    top: -10px;
}

#postems ul li a:hover,
#postems ul li a:focus {
    box-shadow: 10px 10px 7px rgba(0,0,0,.7);
    transform: scale(1.25);
    position: relative;
    z-index: 5;
}

/* =================================================================
   FOOTER
   ================================================================= */

#footer {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
}

#footer table {
    width: 100%;
}

.footerItem {
    display: inline-block;
    padding: 10px 15px;
    font-size: 125%;
}

.column-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.column-list li {
    flex: 1 0 33.333%;
    padding: 10px;
    box-sizing: border-box;
}

/* =================================================================
   MODALS
   ================================================================= */

.modal {
    display: none;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    -webkit-border-radius: 7px;
    -moz-border-radius: 7px;
    border-radius: 7px;
    background: -webkit-linear-gradient(#F4FFFA, #D0DEE6);
    background: -o-linear-gradient(#F4FFFA, #D0DEE6);
    background: -moz-linear-gradient(#F4FFFA, #D0DEE6);
    background: linear-gradient(#F4FFFA, #D0DEE6);
    border: solid 1px #ccc;
    padding: 0 20px 20px;
    padding-top: 20px; /* Space for close button */
    z-index: 10000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    width: 90% !important;
    max-width: 700px !important;
    max-height: 90vh;
    min-height: 100px;
    overflow: visible; /* Allow close button to extend outside */
    box-sizing: border-box;
    margin: 0 !important; /* Remove any margins that could offset position */
}

/* Modal content wrapper for scrolling */
.modal-content-scroll {
    max-height: calc(90vh - 60px); /* Account for padding and close button */
    overflow-y: auto;
    overflow-x: hidden;
}

/* Desktop modal sizing */
@media (min-width: 571px) {
    .modal {
        width: 500px !important;
        min-width: 350px;
    }
}

.modal p {
    font-size: 14px;
    text-align: left;
    margin: 10px 0 0;
}

.modal p:hover, 
.modal p:focus {
    cursor: pointer;
}

/* Close button - positioned inside top-right corner of modal (consistent across all sizes) */
.closeBtn {
    display: block !important;
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    z-index: 10001 !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;  /* Transparent so image shows through */
    color: white !important;
    border: none !important;  /* No border - image has its own */
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: none !important;  /* No box-shadow - prevents double circle */
    float: none !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    overflow: visible !important;
}

.closeBtn:hover,
.closeBtn:focus {
    opacity: 0.8;
    transform: scale(1.1);
    outline: none;
}

/* Close button image - make it fill the button */
.closeBtn img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    border-radius: 0 !important;  /* Don't round the image itself */
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Mobile: slightly smaller close button */
@media (max-width: 569px) {
    .closeBtn {
        width: 28px !important;
        height: 28px !important;
    }
}

/* =================================================================
   MODAL VARIANTS
   ================================================================= */

/* Standard responsive modals - scales to fit viewport */
.modal-responsive {
    width: 90% !important;
    max-width: 700px !important;
}

@media (min-width: 571px) {
    .modal-responsive {
        width: 500px !important;
        min-width: 350px;
    }
}

/* Other Years modal - needs more width on desktop */
#otherClassYears {
    width: 90% !important;
    max-width: 850px !important;
}

@media (min-width: 571px) {
    #otherClassYears {
        width: 700px !important;
    }
}

/* Wide modals with minimum width - scrolls horizontally on small screens */
.modal-wide {
    min-width: 600px !important;
    width: auto !important;
    max-width: 90vw !important;
}

/* Fix positioning for wide modals on small screens */
@media (max-width: 650px) {
    .modal-wide {
        /* Keep it centered even when wider than viewport */
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin-left: 0 !important;
    }
}

/* Extra wide modals (for tables, forms with many columns) */
.modal-extra-wide {
    min-width: 800px !important;
    width: auto !important;
    max-width: 95vw !important;
}

@media (max-width: 850px) {
    .modal-extra-wide {
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin-left: 0 !important;
    }
}


.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
}

/* =================================================================
   HIDE OLD JQUERY UI AUTOCOMPLETE (using custom autocomplete now)
   ================================================================= */

.ui-autocomplete {
    display: none !important;
}

/* =================================================================
   CUSTOM AUTOCOMPLETE DROPDOWN STYLING
   ================================================================= */

.custom-autocomplete-dropdown {
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10002; /* Above modal */
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.custom-autocomplete-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.custom-autocomplete-item {
    padding: 2px 12px;
    cursor: pointer;
    font-size: 11pt;
    line-height: 1.2;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.15s ease;
}

.custom-autocomplete-item:last-child {
    border-bottom: none;
}

.custom-autocomplete-item:hover,
.custom-autocomplete-item.selected {
    background-color: #e3f2fd;
}

.custom-autocomplete-item.selected {
    font-weight: 500;
}

/* Separator between US states and Canadian provinces */
.custom-autocomplete-separator {
    list-style: none;
    padding: 0;
    margin: 4px 0;
}

.custom-autocomplete-separator hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 0;
}

/* Mobile adjustments */
@media (max-width: 569px) {
    .custom-autocomplete-item {
        padding: 4px 12px;
        font-size: 10pt;
    }
}

/* Scrollbar styling for dropdown */
.custom-autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-autocomplete-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.custom-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.custom-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* =================================================================
   COMPARISON TABLE
   ================================================================= */

table.comparisonTable {
    width: 100%;
    border-collapse: collapse;
}

table.comparisonTable th,
table.comparisonTable td {
    border: 1px solid #999;
    padding: 8px;
    text-align: left;
}

table.comparisonTable th {
    background: #f0f0f0;
    font-weight: bold;
}

/* =================================================================
   MOBILE: Below 570px
   ================================================================= */

@media (max-width: 569px) {
    
    .content {
        width: 100% !important;
        padding: 0 !important; /* Remove horizontal padding */
    }
    
    /* =================================================================
       MASTHEAD - Mobile scaling
       ================================================================= */
    
    #header {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        position: relative;
    }
    
    .header-gradient {
        width: 94.937% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        aspect-ratio: var(--gradient-aspect-ratio, 4.8) / 1;
        position: relative;
        z-index: 20;
    }
    
    .header-marquee {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 25 !important;
        display: block !important;
        object-fit: contain;
    }
    
    .header-content {
        top: 3px !important;
        left: 0 !important;
        right: 0 !important;
        padding: clamp(3px, 1vw, 8px) 10px 0 10px !important;
    }
    
    .header-top-row {
        flex-direction: row !important;
        gap: 5px;
    }
    
    .header-logo {
        text-align: left !important;
    }
    
    .logo-link {
        font-size: clamp(1.8rem, 8vw, 2.2rem) !important;
        line-height: 1 !important;
        padding-top: 0 !important;
    }
    
    .logo-tagline {
        display: none !important;
    }
    
    .header-nav {
        text-align: right !important;
        font-size: clamp(0.7rem, 2.8vw, 0.9rem) !important;
        padding-right: 0 !important;
    }
    
    .user-name {
        font-size: inherit !important;
    }
    
    .dropdown-item {
        font-size: 11pt !important;
    }
    
    .header-school-name {
        bottom: 0 !important;
        padding: 0 5px !important;
        /* Padding increases as width decreases: 0px at 569px, ~7px at 360px */
        padding-bottom: clamp(0px, calc(7px * (569px - 100vw) / 209), 7px) !important;
    }
    
    .header-school-name h1 {
        /* Use pure vw for smooth scaling within mobile range, capped at tablet size */
        font-size: min(var(--school-name-size-mobile, 5.58vw), var(--school-name-max-mobile, 40.64px)) !important;
        line-height: 1.1 !important;
        word-wrap: break-word;
        hyphens: auto;
		padding: 0 ;
    }
    
    /* Use tighter aspect ratio for two-line names on mobile */
    .header-gradient {
        aspect-ratio: var(--gradient-aspect-ratio-mobile, 4.8) / 1;
    }
    
    /* Bulletin board mobile adjustments */
    #bulletinBoard > div {
        gap: 10px; /* Tighter gap on mobile */
    }
    
    .bulletin-slogan h2 {
        font-size: clamp(1.2rem, 5vw, 1.8rem); /* Smaller on mobile */
    }
    
    .bulletin-slideshow {
        margin-left: 0; /* Remove auto margin on mobile */
        max-width: 150px;
    }
    
    .bulletin-item {
        min-width: 140px; /* Smaller minimum on mobile */
        text-align: left !important; /* Force left alignment */
    }
    
    /* Force single column stacking on mobile */
    .bulletin-slogan,
    .bulletin-slideshow,
    .bulletin-notes {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
    }
    
    /* Maintain order */
    .bulletin-slogan { order: 1; }
    .bulletin-slideshow { order: 2; }
    .bulletin-notes { order: 3; }
    
    /* =================================================================
       SCHOOL INFO BAR
       ================================================================= */
    
    .schoolInfo-flex {
        flex-direction: row !important;
        gap: 8px;
        padding: 8px 5px !important;
    }
    
    .schoolInfo-item {
        width: auto !important;
    }
    
    .schoolInfo-share,
    .schoolInfo-colors,
    .schoolInfo-address,
    .schoolInfo-actions {
        min-width: auto !important;
    }
    
    /* =================================================================
       ADMIN BANNER
       ================================================================= */
    
    div[style*="background-color: #EDD679"] {
        padding: 10px 5px !important;
        font-size: 90% !important;
    }
    
    /* =================================================================
       FIVE FEATURE BOXES - Stack vertically
       ================================================================= */
    
    .upperSections {
        width: 100% !important;
        min-width: auto !important;
        margin: 10px 0 !important;
        padding: 10px !important;
        min-height: auto !important;
    }
    
    .panelItemHdg {
        font-size: clamp(1.2rem, 5vw, 1.8rem) !important;
    }
    
    /* =================================================================
       CORK BOARD SECTION
       ================================================================= */
    
    div[id="class info"] table {
        display: block !important;
        width: 100% !important;
    }
    
    div[id="class info"] tbody,
    div[id="class info"] tr {
        display: block !important;
        width: 100% !important;
    }
    
    div[id="class info"] td {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 15px;
    }
    
    div[id="class info"] h2 {
        font-size: clamp(1.2rem, 5vw, 1.8rem) !important;
    }
    
    .slideshow {
        margin: 0 auto !important;
        max-width: 150px;
        display: block;
    }
    
    /* =================================================================
       TEACHING STAFF
       ================================================================= */
    
    .EducatorsBlock {
        max-height: 200px !important;
        overflow-y: auto;
    }
    
    /* =================================================================
       YEAR NAVIGATION
       ================================================================= */
    
    .arrow-button {
        padding: 8px 20px 8px 12px !important;
        font-size: 90% !important;
    }
    
    .arrow-button-left {
        padding-left: 25px !important;
    }
    
    .arrow-button-right {
        padding-right: 25px !important;
    }
    
    div[id="class listing"] h2 {
        font-size: clamp(1.2rem, 5vw, 1.8rem) !important;
    }
    
    /* =================================================================
       ACTION BUTTONS - Stack vertically
       ================================================================= */
    
    div[style*="display: flex"][style*="justify-content: space-around"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
        padding: 10px 15px !important;
    }
    
    div[style*="display: flex"] button {
        width: 100% !important;
        margin: 5px 0 !important;
        min-height: 44px;
        font-size: 12pt !important;
    }
    
    /* =================================================================
       CLASS LIST
       ================================================================= */
    
    #classListAjax {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .classList {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .classList table {
        max-width: 100% !important;
    }
    
    .classList div[style*="border: solid 1px chocolate"] {
        font-size: 8pt !important;
        padding: 5px !important;
    }
    
    /* =================================================================
       STICKY NOTES
       ================================================================= */
    
    #postems ul {
        padding: 1em !important;
    }
    
    #postems ul li {
        margin: 0.5em !important;
        float: none !important;
        display: inline-block;
        width: calc(50% - 1em) !important;
    }
    
    #postems ul li a {
        height: 6em !important;
        width: 100% !important;
        font-size: 85% !important;
    }
    
    /* =================================================================
       FOOTER
       ================================================================= */
    
    #footer table {
        display: block;
    }
    
    #footer tbody,
    #footer tr {
        display: block;
    }
    
    #footer td {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 10px 5px !important;
    }
    
    .footerItem {
        font-size: 110% !important;
        display: inline-block;
        padding: 5px 10px;
    }
    
    .column-list {
        flex-direction: column !important;
    }
    
    .column-list li {
        flex: 1 0 100% !important;
        margin: 10px 0 !important;
    }
    
    /* =================================================================
       MODALS - Mobile centering
       ================================================================= */
    
    .modal {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 95% !important;
        max-width: 95% !important;
        min-width: 0 !important;
        margin: 0 !important;
        max-height: 90vh;
        overflow-y: auto;
        padding: 15px !important;
        padding-top: 20px !important;
    }
    
    /* Override inline widths on specific modals */
    #msg,
    #account,
    #chgSchool,
    #otherClassYears {
        width: 95% !important;
        max-width: 95% !important;
        min-width: 0 !important;
    }
    
    .modal textarea,
    .modal input[type="text"],
    .modal input[type="email"],
    .modal input[type="password"] {
        box-sizing: border-box;
        font-size: 16px !important;
    }
    
    .modal button {
        min-height: 44px;
        font-size: 14pt !important;
    }
    
    /* =================================================================
       COMPARISON TABLE
       ================================================================= */
    
    table.comparisonTable {
        width: 100% !important;
        font-size: 85% !important;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    
    /* =================================================================
       UTILITY
       ================================================================= */
    
    button,
    .smallButton {
        min-height: 44px;
        padding: 10px 15px !important;
    }
}

/* =================================================================
   TABLET: 570px - 840px
   ================================================================= */

@media (max-width: 840px) and (min-width: 570px) {
    
    .content {
        width: 100% !important;
        padding: 0 !important; /* Remove horizontal padding */
    }
    
    /* Features section - better wrapping behavior */
    #features {
        justify-content: space-evenly; /* Better distribution in tablet range */
        gap: 8px;
    }
    
    .upperSections {
        flex: 1 1 160px; /* Slightly smaller basis for tablet */
        min-width: 140px;
        max-width: 200px;
    }
    
    /* =================================================================
       MASTHEAD - Exact desktop ratios maintained
       ================================================================= */
    
    #header {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        position: relative;
    }
    
    /* Gradient background - centered, narrower than viewport */
    .header-gradient {
        width: 94.937% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        aspect-ratio: var(--gradient-aspect-ratio, 4.8) / 1;
        position: relative;
        z-index: 20;
    }
    
    /* Marquee graphic - full width, sibling of gradient */
    .header-marquee {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 25 !important;
        display: block !important;
        object-fit: contain;
    }
    
    /* Header content overlay */
    .header-content {
        top: 5px !important;
        left: 0 !important;
        right: 0 !important;
        padding: clamp(5px, 1.2vw, 10px) 15px 0 15px !important;
    }
    
    /* Navigation - add right padding to prevent overflow */
    .header-nav {
        padding-right: 40px !important;
    }
    
    /* Logo - fluid scaling with better range for tablet */
    .logo-link {
        font-size: clamp(2.2rem, 5.5vw, 2.67rem) !important;
        line-height: 1 !important;
        padding-top: 0 !important;
    }
    
    .logo-tagline {
        font-size: clamp(0.7rem, 2vw, 0.85rem) !important;
        line-height: 1.2 !important;
        margin-top: 3px !important;
    }
    
    /* School name - character-based scaling with viewport-based interpolation */
    .header-school-name {
        bottom: 0 !important;
        padding: 0 10px !important;
        /* Padding increases as width decreases: 0px at 840px, ~5px at 570px */
        padding-bottom: clamp(0px, calc(5px * (840px - 100vw) / 270), 7px) !important;
    }
    
    .header-school-name h1 {
        /* Use pure vw for smooth scaling within tablet range, capped at desktop size */
        font-size: min(var(--school-name-size-tablet, 4.46vw), var(--school-name-max-tablet, 46.24px)) !important;
        line-height: 1.2 !important;
        word-wrap: break-word;
        hyphens: auto;
		padding: 0 0 1px 0 ;
    }
    
    /* =================================================================
       FIVE FEATURE BOXES - Three columns
       ================================================================= */
    
    /* Features responsive behavior handled by base flex rules */
}

/* =================================================================
   DESKTOP: 785px and above (minimal overrides)
   ================================================================= */

@media (min-width: 785px) {
    /* Keep desktop base styles - just ensure nothing breaks */
    #header {
        width: 790px !important;
        max-width: 790px !important;
    }
}

/* =================================================================
   PRINT STYLES
   ================================================================= */

@media print {
    .modal,
    .overlay,
    button {
        display: none !important;
    }
    
    #header * {
        transition: none !important;
    }
}


















/* =================================================================
   FEATURES SECTION - Responsive Flexbox Layout
   ================================================================= */
/* =================================================================
   FEATURES SECTION - Responsive Flexbox Layout
   ================================================================= */

/* Base Features Container */
#features {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: space-between;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 5px;
    box-sizing: border-box;
}

/* Base Feature Box Styles - CENTERED CONTENT */
.upperSections {
    position: relative;
    margin: 1px;
    padding: 10px 5px;
    background-color: #ede6ca;
    border-radius: 10px;
    min-height: 220px;
    /*max-height: 240px;*/
    box-sizing: border-box;
    
    /* CENTER ALL CONTENT */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    
    /* Allow boxes to shrink below their basis before wrapping */
    flex: 1 1 145px;
    min-width: 120px;  /* Allow narrower before wrapping */
    max-width: 200px;
}

/* Title at top */
.panelItemHdg {
    margin: 0;
    padding: 0;
    font-size: 28.16px !important;  /* Was 2.2em - now fixed px */
    font-family: "Yanone Kaffeesatz", "arial", "sans-serif" !important;
    color: #476373 !important;
}

/* CRITICAL: Override inline position:absolute with !important */
.upperSection-lowerPart {
    position: static !important;  /* Override position: absolute */
    bottom: auto !important;
    left: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    flex: 1;
    margin: 0 !important;
}

/* Status text styling - BROWN COLOR */
.status-text {
    font-size: 0.8em !important;
    font-family: "Lato", "sans-serif" !important;
    color: #a52a2a !important;
    display: block;
    margin: 0;
    padding: 3px 5px;
}

/* Yearbook thumbnails - target the link wrapping images */
.status-text a:has(img) {
    display: flex !important;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
}

.status-text a img {
    display: block;
    margin: 0;
}

/* Images - center and spacing */
.upperSections img {
    margin: 8px auto;
    padding: 0;
    display: block;
}

/* Buttons should be at bottom */
.upperSections .smallButton {
    margin: 5px auto;
}

/* Links containing buttons */
.upperSections a {
    display: block;
    margin: 3px 0;
}

/* Spirit Points score display */
#SpiritPoints {
    margin: 10px 0;
    text-align: center;
}

#SpiritPoints > span:first-child {
    font-size: 28pt !important;  /* Larger score */
    font-weight: bold !important;
    color: #476373 !important;
    display: block;
    margin-bottom: 5px;
}

/* Spirit Points score from AJAX */
.spirit-points {
    font-size: 20pt !important;  /* 26.66px */
    font-weight: bold !important;
    font-family: "Lato", "sans-serif" !important;
    color: #a52a2a !important;  /* Brown */
    display: block;
}

#SpiritPoints .status-text {
    font-size: 0.7em !important;
    font-family: "Lato", "sans-serif" !important;
    color: #a52a2a !important;
}

/* Spirit Points combined box - extra buttons container */
.spirit-extra-buttons {
    margin-top: 10px;
    display: flex;  /* Visible by default (desktop) */
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* Yearbook recommendations text */
.yb-recs {
    font-size: 0.8em !important;
    font-family: "Lato", "sans-serif" !important;
    color: #a52a2a !important;
    margin-top: 5px;
}

/* Secondary boxes - center images vertically */
.upperSections-secondary {
    justify-content: center !important;  /* Center all content vertically */
}

.upperSections-secondary img {
    margin: auto 0;  /* Center image in available space */
}

/* =================================================================
   DESKTOP (> 840px) - 5 boxes in single row
   ================================================================= */
@media (min-width: 841px) {
    #features {
        justify-content: space-between;
        align-items: stretch;  /* Make all boxes equal height */
    }
    
    .upperSections {
        flex: 1 1 145px;
        min-width: 145px;
        max-width: 160px;
        min-height: auto;  /* Let content determine height */
        padding-bottom: 5px;  /* Consistent bottom padding for all boxes */
        
        /* Flexbox layout for proper spacing */
        display: flex;
        flex-direction: column;
    }
    
    /* Title at top */
    .panelItemHdg {
        flex-shrink: 0;
    }
    
    /* Content grows to fill space */
    .upperSection-lowerPart {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;  /* Start from top */
        align-items: center;
        padding-bottom: 0;  /* No bottom padding in content area */
    }
    
    /* Content group - grows to fill space and centers its children */
    .content-group {
        flex: 1;  /* Grow to take available space */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;  /* Center children within the group */
        gap: 5px;
    }
    
    /* Single buttons push to bottom */
    .upperSection-lowerPart > a:last-child {
        margin-top: auto;
        margin-bottom: 0;  /* No bottom margin - rely on box padding */
        width: 90%;
    }
    
    .upperSection-lowerPart > a .smallButton {
        width: 100%;
        margin: 0;  /* Remove button margin */
    }
    
    /* Two buttons container - side by side at bottom */
    .upperSection-lowerPart > div:has(a + a) {
        margin-top: auto;
        margin-bottom: 0;  /* No bottom margin - rely on box padding */
        display: flex;
        gap: 5px;
        width: 90%;
    }
    
    .upperSection-lowerPart > div:has(a + a) a {
        flex: 1;
        margin: 0;  /* Remove link margin */
    }
    
    .upperSection-lowerPart > div:has(a + a) .smallButton {
        width: 100%;
        margin: 0;  /* Remove button margin */
    }
    
    /* Show the combined Spirit Points box with all buttons */
    .upperSections-combined {
        display: flex !important;
    }
    
    /* Spirit Points - special layout with space-between */
    .upperSections-combined .upperSection-lowerPart {
        padding: 0;
        justify-content: space-between !important;  /* Space between top and bottom */
    }
    
    .upperSections-combined #SpiritPoints {
        margin: 0;
        padding: 0;
    }
    
    .upperSections-combined #SpiritPoints > span:first-child,
    .upperSections-combined #SpiritPoints .spirit-points {
        margin: 0;
        padding: 0;
    }
    
    .upperSections-combined #SpiritPoints .status-text {
        margin: 0;
        padding: 0;
    }
    
    .upperSections-combined .upperSection-lowerPart > a {
        margin: 0;
    }
    
    .upperSections-combined hr {
        margin: 0;
    }
    
    .upperSections-combined .spirit-extra-buttons {
        margin: 0;
        padding: 0;
        gap: 0;
    }
    
    .upperSections-combined .spirit-extra-buttons a {
        margin: 0;
    }
    
    .upperSections-combined .spirit-extra-buttons .smallButton {
        margin: 0;
    }
    
    .upperSections-combined .yb-recs {
        margin: 0;
        padding: 0;
    }
    
    /* Hide the two separate boxes on desktop */
    .upperSections-secondary {
        display: none !important;
    }
    
    /* Scale images appropriately for desktop */
    .upperSections img {
        max-width: 100px;
        height: auto;
    }
    
    
    /* Reunions and Online Reunions - images at 90% of box width */
    .reunions-box .content-group,
    .online-reunions-box .content-group {
        width: 90%;
    }
    
    .reunions-box .content-group img,
    .online-reunions-box .content-group img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
    /* Desktop Spirit Points score - largest */
    #SpiritPoints > span:first-child {
        font-size: 28pt !important;
    }
}

/* =================================================================
   TABLET (571px - 840px) - 2 rows: 3 top, 4 bottom
   ================================================================= */
@media (min-width: 571px) and (max-width: 840px) {
    #features {
        justify-content: flex-start;  /* Align to start */
        align-items: stretch;
        gap: 10px;  /* Fixed gap between boxes */
    }
    
    .upperSections {
        flex: 1 1 165px;  /* Grow to fill space, can shrink, basis 165px */
        min-width: 160px;
        max-width: none;  /* Remove limit - allow boxes to grow */
        min-height: auto !important;
        max-height: none;
        padding: 5px;
        
        /* Three-section layout: title, content, buttons */
        display: flex;
        flex-direction: column;
    }
    
    /* Title pinned to top */
    .panelItemHdg {
        font-size: 23px !important;
        padding: 3px 0;
        margin: 0;
        flex-shrink: 0;
    }
    
    /* Content area - grows to fill space, centers content */
    .upperSections .upperSection-lowerPart {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;  /* Start from top */
        align-items: center;
        padding: 3px 0;
    }
    
    /* Content group - grows to fill space and centers its children */
    .content-group {
        flex: 1;  /* Grow to take available space */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;  /* Center children within the group */
        gap: 5px;
    }
    
    /* Images and status text - don't push down */
    .upperSections img {
        margin: 0;
        max-width: 70px;
        height: auto;
    }
    
    .upperSections .status-text {
        padding: 0 5px;
        margin: 2px 0;
        font-size: 0.75em !important;
    }
    
    /* Button links - push to bottom of lowerPart */
    .upperSections .upperSection-lowerPart > a:last-child {
        margin-top: auto !important;
        width: 90%;
    }
    
    /* Single button */
    .upperSections .upperSection-lowerPart > a .smallButton {
        width: 100%;
        padding: 8px 5px;
        margin: 0;
    }
    
    /* Two buttons container - push to bottom */
    .upperSections .upperSection-lowerPart > div:has(a + a) {
        margin-top: auto !important;
        display: flex;
        gap: 5px;
        width: 90%;
    }
    
    .upperSections .upperSection-lowerPart > div:has(a + a) a {
        flex: 1;
    }
    
    .upperSections .upperSection-lowerPart > div:has(a + a) .smallButton {
        width: 100%;
        padding: 8px 5px;
        margin: 0;
    }
    
    /* Spirit Points content - don't push down */
    #SpiritPoints {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        margin: 0;
        padding: 0;
    }
    
    #SpiritPoints > span:first-child,
    #SpiritPoints .spirit-points {
        font-size: 24pt !important;
        margin: 0;
        padding: 0;
    }
    
    #SpiritPoints .status-text {
        margin: 2px 0;
        padding: 0;
    }
    
    /* Spirit Points combined - hide extra buttons on tablet */
    .upperSections-combined .spirit-extra-buttons {
        display: none !important;
    }
    
    /* Secondary boxes - keep vertical layout */
    .upperSections-secondary .upperSection-lowerPart {
        flex-direction: column !important;  /* Back to vertical */
        justify-content: space-evenly;
        align-items: center;
        padding: 3px 0;
    }
    
    .upperSections-secondary img {
        max-width: 60px;
        margin: 0;
    }
    
    /* Button wrapper in secondary boxes - push to bottom */
    .upperSections-secondary .upperSection-lowerPart > div {
        margin-top: auto !important;
        width: 90% !important;  /* Force width */
        flex: 0 0 auto !important;  /* Override inline flex: 1 */
    }
    
    /* Links inside wrapper - full width of wrapper */
    .upperSections-secondary .upperSection-lowerPart > div a {
        display: block;
        width: 100%;
    }
    
    /* Direct child links - same 90% as wrappers */
    .upperSections-secondary .upperSection-lowerPart > a:last-child {
        display: block;
        width: 90%;  /* Changed from 100% to match wrapper width */
        margin-top: auto !important;
    }
    
    .upperSections-secondary .smallButton {
        width: 100%;
        padding: 8px 5px;
        margin: 0;
    }
    
    .upperSections-secondary .yb-recs {
        margin: 2px 0;
        padding: 0;
        font-size: 0.7em;
    }
    
    
    /* Reunions and Online Reunions - images at 90% of box width */
    .reunions-box .content-group,
    .online-reunions-box .content-group {
        width: 90%;
    }
    
    .reunions-box .content-group img,
    .online-reunions-box .content-group img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
    /* Show the two separate boxes */
    .upperSections-secondary {
        display: flex !important;
    }
}

/* =================================================================
   MOBILE (≤ 570px) - Accordion with chevrons
   ================================================================= */
@media (max-width: 570px) {
    #features {
        justify-content: flex-start;
        gap: 4px;
        flex-direction: column;
    }
    
    .bulletin-slogan {
        padding-top: 20px;  /* Mobile */
    }
    
    .upperSections {
        flex: 1 1 100%;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        min-height: auto;
        max-height: none;
        margin: 0;
        padding: 0;
        overflow: hidden;
        transition: all 0.3s ease;
    }
    
    /* Accordion header - always visible */
    .panelItemHdg {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
        cursor: pointer;
        font-size: 28.16px !important;  /* Same as desktop */
        margin: 0;
        background-color: #ede6ca;
        border-radius: 10px;
        transition: border-radius 0.3s ease;
    }
    
    /* Add chevron icon after title */
    .panelItemHdg::after {
        content: '';
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 10px solid #476373;
        transition: transform 0.3s ease;
        flex-shrink: 0;
        margin-left: 10px;
    }
    
    /* Rotate chevron when open */
    .upperSections.accordion-open .panelItemHdg::after {
        transform: rotate(180deg);
    }
    
    /* Round only top corners when open */
    .upperSections.accordion-open .panelItemHdg {
        border-radius: 10px 10px 0 0;
    }
    
    /* Content area - collapsible */
    .upperSection-lowerPart {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
        padding: 0 15px;
        background-color: #ede6ca;
        border-radius: 0 0 10px 10px;
    }
    
    /* Expanded content */
    .upperSections.accordion-open .upperSection-lowerPart {
        max-height: 600px;
        opacity: 1;
        padding: 5px 15px;
    }
    
    /* Hide images on mobile accordion */
    .upperSections .upperSection-lowerPart img {
        display: none !important;
    }
    
    /* Full width buttons */
    .upperSections .smallButton {
        width: 100% !important;
        box-sizing: border-box;
        font-size: 0.9em;
        padding: 10px 8px;
        margin: 3px 0;
    }
    
    /* Hide br tags in buttons on mobile */
    .upperSections .smallButton br {
        display: none;
    }
    
    /* Links containing buttons should be full width */
    .upperSections .upperSection-lowerPart > a {
        width: 100%;
        display: block;
    }
    
    /* Two buttons side by side - equal width */
    .upperSections .upperSection-lowerPart > div:has(a + a) {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    
    .upperSections .upperSection-lowerPart > div:has(a + a) a {
        flex: 1;
        margin: 0;
    }
    
    .upperSections .upperSection-lowerPart > div:has(a + a) .smallButton {
        margin: 0;
    }
    
    /* Spirit Points - show value in collapsed mode */
    #SpiritPoints {
        display: block;
    }
    
    /* Hide Spirit Points content when collapsed */
    .upperSections:not(.accordion-open) #SpiritPoints {
        display: none !important;
    }
    
    /* Spirit Points in expanded mode */
    .upperSections.accordion-open #SpiritPoints {
        display: block !important;
        margin: 8px 0;
    }
    
    .upperSections.accordion-open #SpiritPoints > span:first-child {
        font-size: 20pt !important;
    }
    
    /* Hide extra buttons in combined Spirit box */
    .upperSections-combined .spirit-extra-buttons {
        display: none !important;
    }
    
    /* Show the two separate boxes */
    .upperSections-secondary {
        display: flex !important;
    }
    
    /* Secondary boxes - icon and button in same row */
    .upperSections-secondary .upperSection-lowerPart {
        display: flex !important;
        align-items: center;
        gap: 12px;
    }
    
    /* Show icons in secondary boxes */
    .upperSections-secondary img {
        display: block !important;
        max-width: 60px;
        height: auto;
        flex-shrink: 0;
    }
    
    /* Button wrapper not full width in secondary boxes */
    .upperSections-secondary .upperSection-lowerPart > a,
    .upperSections-secondary .upperSection-lowerPart > div {
        width: auto !important;
        flex: 1;
    }
    
    /* Button not full width in secondary boxes */
    .upperSections-secondary .smallButton {
        width: 100% !important;
    }
    
    /* Yearbook recommendations text in secondary */
    .upperSections-secondary .yb-recs {
        margin-top: 5px;
    }
    
    /* Status text */
    .status-text {
        font-size: 0.75em !important;
        padding: 2px 5px;
    }
}
/* =================================================================
   NEW STICKY NOTE STYLES - Flex-based (converted from legacy ul/li)
   Based on original main.css sticky note design
   ================================================================= */

/* Base sticky note styles - Desktop (converted from #postems ul li a) */
.sticky-note a {
    text-decoration: none;
    color: #000;
    background: #ffc;  /* Default yellow */
    display: block;
    height: 7.92em;      /* Square - 6.6em * 1.20 = 7.92em */
    width: 7.92em;       /* Square - 6.6em * 1.20 = 7.92em */
    padding: 0 0.3em 0 0.3em;
    -moz-box-shadow: 5px 5px 7px rgba(33,33,33,1);
    -webkit-box-shadow: 5px 5px 7px rgba(33,33,33,.7);
    box-shadow: 5px 5px 7px rgba(33,33,33,.7);
    -moz-transition: -moz-transform .15s linear;
    -o-transition: -o-transform .15s linear;
    -webkit-transition: -webkit-transform .15s linear;
}

/* Base rotation for sticky notes */
.sticky-note a {
    -webkit-transform: rotate(-6deg);
    -o-transform: rotate(-6deg);
    -moz-transform: rotate(-6deg);
    transform: rotate(-6deg);
}

/* Font styling for note content */
.sticky-note p {
    font-family: 'Short Stack', cursive;
    font-size: 80%;
}

/* Color and rotation variations */
.sticky-note:nth-child(even) a {
    -o-transform: rotate(4deg);
    -webkit-transform: rotate(4deg);
    -moz-transform: rotate(4deg);
    transform: rotate(4deg);
    position: relative;
    top: 5px;
    background: #cfc;  /* Green */
}

.sticky-note:nth-child(3n) a {
    -o-transform: rotate(-3deg);
    -webkit-transform: rotate(-3deg);
    -moz-transform: rotate(-3deg);
    transform: rotate(-3deg);
    position: relative;
    top: -5px;
    background: #ccf;  /* Blue */
}

.sticky-note:nth-child(5n) a {
    -o-transform: rotate(5deg);
    -webkit-transform: rotate(5deg);
    -moz-transform: rotate(5deg);
    transform: rotate(5deg);
    position: relative;
    top: -10px;
}

/* Pin styling - position above note */
.sticky-note img[src*="pushPin"] {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: auto;
    z-index: 10;
}

/* Make sticky-note itself positioned for absolute pin */
.sticky-note {
    position: relative;
    margin: 1em;
}

/* Subject text (bold) */
.sticky-note span[style*="font-weight: bold"] {
    font-size: 110%;
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
}

/* Timestamp text (smaller) */
.sticky-note span[style*="font-size: 80%"] {
    font-size: 80%;
    color: #666;
    font-style: italic;
}

/* =================================================================
   TABLET (571px - 1024px) - Sticky Notes
   ================================================================= */
@media (min-width: 571px) and (max-width: 1024px) {
    .sticky-note a {
        height: 7.13em;  /* Square - 5.94em * 1.20 = 7.13em */
        width: 7.13em;   /* Square - 5.94em * 1.20 = 7.13em */
        font-size: 90%;
    }
    
    .sticky-note {
        margin: 0.8em;
    }
}

/* =================================================================
   MOBILE (≤ 570px) - Sticky Notes
   ================================================================= */
@media (max-width: 570px) {
    .sticky-note a {
        height: 6.34em;  /* Square - 5.28em * 1.20 = 6.34em */
        width: 6.34em;   /* Square - 5.28em * 1.20 = 6.34em */
        font-size: 85%;
        padding: 0 0.2em 0 0.2em;
    }
    
    .sticky-note {
        margin: 0.6em;
    }
    
    /* Gentler rotations on mobile */
    .sticky-note a {
        -webkit-transform: rotate(-4deg);
        -o-transform: rotate(-4deg);
        -moz-transform: rotate(-4deg);
        transform: rotate(-4deg);
    }
    
    .sticky-note:nth-child(even) a {
        -o-transform: rotate(3deg);
        -webkit-transform: rotate(3deg);
        -moz-transform: rotate(3deg);
        transform: rotate(3deg);
    }
    
    .sticky-note:nth-child(3n) a {
        -o-transform: rotate(-2deg);
        -webkit-transform: rotate(-2deg);
        -moz-transform: rotate(-2deg);
        transform: rotate(-2deg);
    }
    
    .sticky-note:nth-child(5n) a {
        -o-transform: rotate(4deg);
        -webkit-transform: rotate(4deg);
        -moz-transform: rotate(4deg);
        transform: rotate(4deg);
    }
    
    .sticky-note img[src*="pushPin"] {
        width: 16px;
    }
}

/* =================================================================
   YEAR NAVIGATION AND ACTION BUTTONS
   ================================================================= */

/* Year Navigation Wrapper */
.year-navigation-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
    flex-wrap: nowrap; /* Keep on one line */
}

/* Center section with CLASS OF and Other Years button */
.year-center-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
}

/* Other Years button - pill shaped matching arrow button colors */
.other-years-button {
    background: #476373; /* Match arrow button dark blue/slate */
    color: white; /* White text for contrast */
    border: 1px solid #365361;
    border-radius: 50px; /* Pill shape */
    padding: 2px 20px !important; /* Reduced height - force override */
    margin: 0 !important; /* Remove default button margin */
    font-family: Lato, sans-serif;
    font-size: 9pt;
    font-weight: normal !important; /* Override bold */
    text-transform: none !important; /* Override uppercase */
    line-height: 1.2 !important; /* Tight line height */
    cursor: pointer;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.other-years-button:hover,
.other-years-button:focus {
    background: #587484;
}

/* Action Buttons Wrapper */
.action-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 0 20px; /* Add horizontal padding to match other content */
}

.action-buttons-wrapper button {
    flex: 1 1 auto;
    min-width: fit-content;
    padding: 4px 0 !important; /* Add vertical padding to buttons */
}

.action-buttons-wrapper a {
    flex: 1 1 auto;
    min-width: fit-content;
}

/* Make buttons inside anchor tags fill their container */
.action-buttons-wrapper a button {
    width: 100%;
}

/* Mobile adjustments for navigation */
@media (max-width: 570px) {
    .year-navigation-wrapper {
        gap: 10px;
    }
    
    .year-center-section h2 {
        font-size: 1.2rem; /* Slightly smaller on mobile */
    }
    
    .arrow-button {
        font-size: 90%;
        padding: 6px 15px 6px 10px;
    }
    
    .arrow-button-left {
        padding-left: 20px;
    }
    
    .arrow-button-right {
        padding-right: 20px;
    }
    
    .other-years-button {
        font-size: 8pt !important;
        padding: 2px 14px !important; /* Keep short height - force override */
        line-height: 1.1 !important; /* Extra tight on mobile */
        min-height: 0 !important; /* Remove any min-height */
        height: auto !important; /* Let content dictate height */
    }
    
    /* Keep action buttons wrapping, not stacked */
    .action-buttons-wrapper {
        gap: 8px;
    }
    
    .action-buttons-wrapper button {
        font-size: 9pt;
    }
}

/* =================================================================
   FOOTER FLEXBOX LAYOUT
   ================================================================= */

#footer {
    padding: 15px 20px;
}

/* Footer Links - Flexbox row */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.footer-links a {
    flex: 1 1 auto;
    min-width: fit-content;
    text-align: center;
    padding: 5px 10px;
}

/* Contact us button - bold and larger */
.footer-contact {
    font-size: 120%;
    font-weight: bold;
}

/* Footer copyright and disclaimer */
.footer-copyright,
.footer-disclaimer {
    color: #000000;
    text-align: center;
    font-family: 'Lato', sans-serif;
    font-size: 0.8em;
    margin-top: 8px;
}

/* Mobile - Grid layout with auto-fit (responsive columns) */
@media (max-width: 570px) {
    .footer-links {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Auto-fit columns based on space */
        gap: 8px;
        justify-items: stretch;
    }
    
    .footer-links a {
        text-align: center;
        padding: 8px 5px;
    }
    
    /* Contact us spans all columns */
    .footer-contact {
        grid-column: 1 / -1;
    }
}

/* =================================================================
   NEARBY SCHOOLS GRID LAYOUT
   ================================================================= */

.nearby-schools-header {
    padding: 10px 20px 5px 20px;
    text-align: center;
}

/* Nearby Schools - CSS Grid with auto-fit for uniform appearance */
.nearby-schools-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    padding: 10px 20px;
}

.nearby-school-item {
    /* Grid item - no flex properties needed */
}

.nearby-school-item a {
    display: block;
    text-align: center;
    padding: 8px 12px;
    background: #DBEEF9;
    border: 1px solid #DDDDDD;
    border-radius: 7px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.nearby-school-item a:hover,
.nearby-school-item a:focus {
    background: #B9CCD7;
}

/* Mobile - Narrower columns for nearby schools */
@media (max-width: 570px) {
    .nearby-schools-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
        padding: 10px;
    }
    
    .nearby-school-item a {
        padding: 10px 8px;
        font-size: 0.9em;
    }
}

/* =================================================================
   CLASS LIST - CSS COLUMNS FOR VERTICAL WRAPPING
   ================================================================= */

.classListDiv {
    width: 100%;
    padding: 0;
}

/* Admin stats and ads rows */
.admin-stats-row,
.ads-row {
    margin-bottom: 15px;
}

/* Student grid container - CSS columns (2 columns on desktop) */
.class-list-grid {
    column-count: 2;
    column-gap: 20px;
    padding: 10px 20px;
}

/* Student group - keeps students together in column */
.student-group {
    break-inside: avoid;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

/* Individual student card */
.student-card {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    padding: 4px 10px;
    border-bottom: 1px solid firebrick;
    background: white;
    gap: 0;
    box-sizing: border-box;
}

.student-name {
    text-align: right;
    font-size: 12pt;
    flex: 1 1 auto;
    min-width: 0;
}

.student-name .StudentName {
    font-weight: 500;
}

.student-name .msgStr {
    font-size: 10pt;
    color: #666;
}

.student-name .dthStr {
    font-size: 10pt;
    color: #999;
    font-style: italic;
}

/* Icon styling */
.iconTribute {
    height: 25px;
    border: 0;
    width: 30px;
    padding: 0 5px;
}

.personThumbs {
    padding: 0 2px;
}

.student-status {
    flex: 0 0 auto;
    text-align: center;
}

.student-contact {
    flex: 0 0 auto;
    text-align: center;
    padding: 0 3px 0;
}

.student-photos {
    flex: 0 0 55px;
    width: 55px;
    text-align: center;
}

.student-options {
    flex: 0 0 auto;
    text-align: left;
}

/* Tablet - 2 columns */
@media (max-width: 1024px) and (min-width: 771px) {
    .class-list-grid {
        column-count: 2;
    }
}

/* Mobile - 1 column, but keep horizontal card layout */
@media (max-width: 770px) {
    .class-list-grid {
        column-count: 1;
        padding: 10px;
    }
}

#formSubmisionResults, #formSubmisionResultsWithPgReload {
	padding-top: 35px;
}