/* ==========================================================================
   1. GLOBAL PAGE & TYPOGRAPHY SETTINGS
   ========================================================================== */
body {
    background-image: url('GrayMarble.jpg');
    background-repeat: repeat; 
}

/* Fluid Typography Template (h1 - h3) */
h1 {
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    color: #003b8b; /* Dark, saturated blue or indigo */
    background-color: gray;
    border: 3px solid black;
    font-size: clamp(1.4rem, 4vw, 2.25rem);
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.75rem);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

p { 
    color: black;
}

a { 
    color: #003b8b;
    background-color: white;
}

img { 
    border: 0;
    padding: 10px;
}

/* ==========================================================================
   2. DESKTOP SIDEBAR NAVIGATION INTERFACE
   ========================================================================== */
ul.nav { 
    list-style-type: none;
    margin-left: 0;
    padding-left: 0;
    background-color: #bfcee2;
    display: block !important; 
    width: 140px;   
}

ul.nav li { 
    margin: 0 10px 1em 10px;
    padding: 0.5em;
    text-align: center;
    background-color: #003B8B;
}

ul.nav li a { 
    text-decoration: none;
    font-weight: bold;
    background-color: #003B8B;
    display: block;
}

ul.nav li a:link { color: white; }
ul.nav li a:visited { color: white; }
ul.nav li a:hover { color: yellow; }

#leftcolumn { 
    float: left !important;
    width: 140px !important;  
    background-color: #bfcee2 !important;
    margin: 0;
    display: block !important;
}

#rightcolumn { 
    margin-left: 170px !important;
}

/* ==========================================================================
   3. STRUCTURAL UTILITIES & REUSABLE UTILITIES
   ========================================================================== */
.bluebox2 { 
    clear: both; 
    background-color: #bfcee2;  
    color: #1a1a1a;            
    font-size: 0.9em;          
    padding: 10px 15px;        
    margin-top: 6px; 
    border-radius: 4px;        
    text-align: center;        
    display: block;            
    text-decoration: none;     
}

.bluebox2:hover {
    background-color: #a3b8d3;  
}

.boxtext { 
    margin-top: 10px;
    border: solid 1px black;
    padding: 10px;
    width: 100%;
}

.category { 
    background-color:white; 
    color:#003B8B;  
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 1.5em;
}

.classlocations {
    padding: 0px 0px 3px 20px; 
    line-height: 13px; 
    background-image: url(classlocations.gif); 
    background-repeat: no-repeat; 
    font-size:11px; 
}

.equation { 
    background-color:#bfcee2; 
    color:#b22222; 
    margin-left: 30px;
    border: outset navy;
    width: 45%;
}

.foo {
    float: left;
    width: 30px;
    height: 20px;
    margin: 5px;
    border: 1px solid rgba(0, 0, 0, .2);
}

.blue { background: #13b4ff; } 
.purple { background: #ab3fdd; } 
.wine { background: #ae163e; } 

.greenbox2 { 
    clear: both; 
    background-color: #fff; 
    background-image: url(../images/greenbx2bkgd.gif); 
    background-repeat: repeat-y; 
    padding: 6px 12px; 
    margin-top: 12px; 
}

.myRow { 
    margin-top: 10px;
    width: 96%;
}

.pageref { 
    font-weight: bold;
    color: #003b8b;
    text-decoration: underline;
}

a.pageref:hover { 
    background-color: yellow;
}

#myComment { 
    width: 100%;
    height: 6em;
}

#container { 
    width: 88%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0; 
}

#header { 
    float: none;              
    width: 100%;
    background-color: #bfcee2;
    text-align: center;       
}

#header img { 
    background-color: #bfcee2;
    display: inline-block;    
}

.banner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
}

.banner-main-img {
    width: 410px;
    height: auto;
}

.banner-side-img {
    width: 100px;
    height: auto;
}

#footer { 
    font-size: 1.1em;
    font-style: italic;
    margin: 2em 0 3em 170px;
}

/* Hidden by default on Desktop Viewports */
.mobile-top-bar, #mobile-menu-btn, .mobile-top-heading {
    display: none !important; 
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ==========================================================================
   4. SCHEDULE & RESOURCES DATA TABLES (Original Blues + Transparencies)
   ========================================================================== */
#promotions, #tutorials, #resources { 
    border-collapse: separate; 
    border-spacing: 0;
    margin: 1.25rem 0;
    width: 100%;
    background-color: transparent !important;
}

#promotions { border: 2px solid #00008B; margin-left: 12em; }  
#promotions th { border: 1px solid #003B8B; padding: 10px; color: white; background-color: #483d8b; } 
#promotions td { border: 1px solid #003B8B; padding: 10px; background-color: transparent !important; }

#tutorials { 
    border: 2px solid #00008B; /* Original Dark Blue Outer Table Border */
}   
#tutorials th { 
    border: 1px solid #003B8B; /* Original Blue Inner Grid Lines */
    padding: 0.75rem 0.5rem; 
    color: white !important; 
    background-color: #B22222 !important; /* Original Firebrick Header */
    text-align: center;
}
#tutorials td { 
    border: 1px solid #003B8B; /* Original Blue Inner Grid Lines */
    padding: 0.65rem 0.75rem; 
    line-height: 1.35;
    background-color: transparent !important;
}

#tutorials td:nth-child(1),
#tutorials td:nth-child(2) {
    text-align: center;
}
#tutorials td:nth-child(3) {
    text-align: left;
    padding-left: 1rem;
}

#resources { border: 0; }
#resources th { padding: 10px; color: white; background-color: #B22222; }
#resources td { padding: 10px; background-color: transparent !important; }
#resources td img, #resources td p { margin-bottom: 20px; }
.resourcename { font-weight: bold; color: #003b8b; } 

/* ==========================================================================
   5. IMAGE GALLERY SECTION (Global Rules)
   ========================================================================== */
.gallery-container {
    max-width: 800px;
    margin: 20px auto;
    font-family: sans-serif;
}

/*
.main-view {
    position: relative;
    width: 100%;
}

.main-view img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top; 
    border-radius: 8px;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
*/
/* Main Display Box positioning the arrows */
.main-view {
  position: relative;
  width: 100%;
  background-color: #000; 
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  
  /* ADD THIS: Smoothly animates the height change when switching images */
  transition: height 0.3s ease-in-out; 
}


/* Main Display Image Settings */
.main-view img {
  width: 100%;
  height: auto; /* Let the image dictate its true native height */
  max-height: 75vh; /* Prevents portrait images from becoming taller than the screen */
  object-fit: contain; /* Ensures 100% of the photo is visible */
  display: block;
  
  /* Keeps your existing zoom transition */
  transition: transform 0.4s ease; 
}

/* The rest of your hover effects stay exactly the same */
.main-view:hover img {
  transform: scale(1.05); 
}
#active-img {
  transition: transform 0.4s ease; 
}
.main-view:hover #active-img {
  transform: scale(1.05); 
}

.thumbnails-container {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto; 
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch; 
}

.thumb {
    width: 80px;
    height: 55px;
    flex-shrink: 0;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.thumb.active, .thumb:hover {
    opacity: 1;
    border-color: #007bff;
}

.thumbnails-container::-webkit-scrollbar { 
    height: 6px; 
}
    
.thumbnails-container::-webkit-scrollbar-thumb {
    background-color: #ccc; 
    border-radius: 4px; 
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 24px;
    padding: 16px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s, transform 0.1s;
    z-index: 10;
    user-select: none;
}

.prev-arrow { left: 10px; }
.next-arrow { right: 10px; }

.nav-arrow:hover { 
    background-color: rgba(0, 123, 255, 0.8);
}
.nav-arrow:active { 
    transform: translateY(-50%) scale(0.95);
}

#image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 5;
    pointer-events: none;
    font-family: sans-serif;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ==========================================================================
   6. BLACK BELT STUDENTS LIST (No Dots On Desktop or Mobile)
   ========================================================================== */
.black-belt-logo-wrapper {
  text-align: center;
  margin-bottom: 30px;
  
}

.black-belt-section {
  max-width: 500px;
  margin: 0 auto 40px auto;
  padding: 0 15px;
  text-align: center;
}

.belt-group-title {
  color: #000080;
  font-family: "cezanne", "mistral", "ms sans serif", "sans-serif";
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.student-text-list {
  list-style: none !important;       
  list-style-type: none !important;  
  padding: 0 !important;             
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 1.1rem;
}

.student-text-list li {
  display: flex;                    
  align-items: center;              
  justify-content: center;          
  gap: 10px;                        
  margin-bottom: 1.25rem; 
  list-style-type: none !important; 
}

.list-inline-img {
  width: 200px;                      
  height: auto;                     
  padding: 0 !important;            
  display: inline-block;
  flex-shrink: 0;                   
  mix-blend-mode: multiply; 
}

.student-text-list strong {
  font-weight: bold;
  color: #000080; 
}

.student-text-list .student-rank {
  font-family: "Courier New", Courier, monospace; 
  font-size: 0.95rem;                             
  font-weight: bold;                              
  color: #B22222;                                 
}
.student-text-list .yellow-belt { color: #ffff00; font-weight: bold; }
.student-text-list .orange-belt { color: #ff8c00; font-weight: bold; }
.student-text-list .blue-belt { color: #4169E1; font-weight: bold; }
.student-text-list .green-belt { color: #2aa543; font-weight: bold; }
.student-text-list .purple-belt { color: #7b2cbf; font-weight: bold; }
.student-text-list .brown-belt { color: #5C4033; font-weight: bold; }
.student-text-list .black-belt { color: #000000; font-weight: bold; }

/* Desktop-Lock Layout Rules */
.initial2 { font-weight: bold; color: silver; background-color: black; }

/* Clean layout spacing for the index page (no top nav bar) */
    body .desktop-lock-container, body #container {
        margin-top: 10px !important;
        width: 100% !important; 
        position: relative !important;
        z-index: 1 !important; 
        padding: 0 12px !important;
        box-sizing: border-box !important;
    }
  
    /* MAGIC LINE: Safely pushes down the content ONLY on your sub-pages so the banner isn't hidden! */
    body.sub-page .desktop-lock-container, body.sub-page #container {
        margin-top: 65px !important; 
    }

/* ---
.desktop-lock-container {
    width: 800px;
    margin: 0 auto;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
}
---*/

.karate-img {
    float: left; 
    margin-right: 15px; 
    mix-blend-mode: multiply; 
    width: 180px; 
    height: auto;
}
.iaido-img {
    float: right; 
    margin-left: 15px; 
    mix-blend-mode: multiply; 
    width: 180px; 
    height: auto;
}

/* Global Fallback Content Alignment Settings */
.kanji-img {
  mix-blend-mode: multiply;
  height: auto;
}

/* ==========================================================================
   7. RESPONSIVE MOBILE PORTRAIT MEDIA OVERRIDES (Triggers at 768px and Narrower)
   ========================================================================== */
@media screen and (max-width: 768px) and (orientation: portrait) {
    
    body .mobile-top-bar {
        display: flex !important; 
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important; 
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 50px !important; 
        background-color: #ffffff !important; 
        border-bottom: 2px solid #ccc !important;
        z-index: 10000 !important; 
        box-sizing: border-box !important;
        padding: 0 15px !important;
        justify-content: space-between !important; 
        align-items: center !important;
    }
    
    body .mobile-menu-trigger {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        width: 100% !important;
        gap: 20px !important; 
    }

    body a.mobile-home-link {
        font-size: 2.2rem !important;      
        font-weight: bold !important;
        color: #003B8B !important;         
        background: transparent !important;
        text-decoration: none !important;
        display: inline-flex !important;
        flex: 0 0 30px !important;         
        width: 30px !important;
        height: 40px !important;
        align-items: center !important;
        justify-content: center !important;
        margin-right: 10px !important;
        line-height: 1 !important;
        z-index: 10005 !important;
    }
    
    body .mobile-top-heading {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0 auto !important;         
        text-align: center !important;     
        flex-grow: 1 !important;
        font-family: sans-serif !important;
        font-size: 1.4em !important; 
        font-weight: 800 !important; 
        color: #003399 !important;
        height: auto !important;
        cursor: default !important;
        user-select: none !important;
    }
 
    /* FIXED: Changed margin-top from 55px to 10px to eliminate the empty top bar gap */
    body .desktop-lock-container, body #container {
        margin-top: 10px !important;
        width: 100% !important; 
        position: relative !important;
        z-index: 1 !important; 
        padding: 0 12px !important;
        box-sizing: border-box !important;
    }
/*  
    body #header {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin: 0 auto !important;
        padding: 5px 0 !important;
        background-color: #bfcee2 !important;
        height: 50px !important; 
    }
*/
     body #header {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin: 0 auto !important;
        padding: 5px 0 !important;
        background-color: #bfcee2 !important;
        
        /* CHANGE THIS LINE FROM 50px TO auto. Forces it to stretch with the image size*/
        height: auto !important; 
    }
    
    
    
    body #header .banner-wrapper {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 5px !important;
        box-sizing: border-box !important;
    }
    
    
    body #header .banner-wrapper img {
    display: block !important;
    width: 100% !important; 
    height: auto !important; 
    object-fit: contain !important; 
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important; /* <--- Add this! Prevents the cache engine from squishing it */
}
    
    body #header .banner-wrapper .banner-main-img {
        width: 60% !important;
        max-width: 410px !important;
    }
    body #header .banner-wrapper .banner-side-img {
        width: 18% !important;
        max-width: 100px !important;
    }

    body #leftcolumn {
        width: 100% !important;
        float: none !important;
        background-color: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body ul.nav {
        display: none !important;   
        width: 100% !important;     
        background-color: #bfcee2 !important;
        padding: 10px 0 !important;
        margin: 0 !important;
        position: fixed !important;
        top: 50px !important;  
        left: 0 !important;
        z-index: 9999 !important; 
        box-shadow: 0 4px 10px rgba(0,0,0,0.15); 
    }
    
    body ul.nav.menu-open {
        display: block !important;
    }

    body ul.nav li {
        margin: 5px 15px !important;
    }
    
    body #rightcolumn {
        margin-left: 0px !important;
        width: 100% !important;
        float: none !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }
    
    /* FIXED: Added a flex center box wrapper rule around your main landing content */
    body .desktop-lock-container div[style*="text-align: center"] {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        clear: none !important; /* Allows it to squeeze accurately between floats */
    }

    /* SHRINK FLUID KANJI IMAGES PROPORTIONALLY SIDE-BY-SIDE INSTEAD OF STACKING */
    .karate-img, .iaido-img {
        width: 22% !important;
        max-width: 90px !important;
        height: auto !important;
        display: inline-block !important;
    }
    
    .karate-img {
        float: left !important;
        margin-right: 10px !important;
    }
    
    .iaido-img {
        float: right !important;
        margin-left: 10px !important;
    }

    /* Shrink the inner roster line icons slightly so content strings stay clean */
    .list-inline-img {
        width: 120px !important;
    }
    
    body #mobile-menu-btn {
        display: inline-flex !important; 
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center !important;
        background: none !important; 
        color: #003B8B !important; 
        border: none !important;
        cursor: pointer !important;
        height: auto !important;
    }
    
    body #menu-icon {
        font-size: 1.8em !important;
        font-weight: bold !important;
        line-height: 1 !important;
    }
    
    body #menu-text {
        font-size: 1em !important;
        font-weight: bold !important;
        margin-left: 6px !important;
    }
    
    body #footer {
        margin: 2em 0 !important;
        font-size: 0.9em !important;
        margin-left: 0px !important;
    }
    
    body ul.nav.menu-open ~ #footer,
    body ul.nav.menu-open + #footer {
        display: none !important;
    }

    /* Force the data table elements to use native structural tag dimensions */
    #tutorials, #tutorials thead, #tutorials tbody, #tutorials th, #tutorials td, #tutorials tr {
        display: table !important; 
        width: 100% !important;
    }

    #tutorials tr {
        display: table-row !important;
        border: none !important;
        margin-bottom: 0 !important;
    }

    #tutorials th, #tutorials td {
        display: table-cell !important;
        border: 1px solid #003B8B !important; 
        padding: 0.5rem 0.4rem !important;    
        font-size: 0.95rem !important;        
    }
    
    #tutorials th:nth-child(1), #tutorials td:nth-child(1) { width: 22% !important; }
    #tutorials th:nth-child(2), #tutorials td:nth-child(2) { width: 43% !important; }
    #tutorials th:nth-child(3), #tutorials td:nth-child(3) { width: 35% !important; }

    #tutorials td::before {
        content: "" !important;
        display: none !important;
    }

    h1 { font-size: 1.5rem !important; }
    h2 font { font-size: 4 !important; }

    form {
        display: flex;
        justify-content: center;
        gap: 15px;
    }
    
    /* Mobile-specific adjustments for portrait mode */
  #image-caption {
    font-size: 13px;       /* Shrinks text so it takes up fewer lines */
    padding: 6px 0px;      /* Halves the spacing above and below the text */
    letter-spacing: 0.2px; /* Tightens text slightly to save horizontal space */
    line-height: 1.3;      /* Keeps sentences tight and compact */
  }
} /* Clean closing tag for media query block */

/* ==========================================================================
   8. DESKTOP MEDIA OVERRIDES (Screens 601px and wider)
   ========================================================================== */
@media (min-width: 601px) {
  .kanji-img {
    width: 100%;
    max-width: 180px; 
  }
  .img-left {
    float: left;
    margin-right: 20px;
  }
  .img-right {
    float: right;
    margin-left: 20px;
  }

/* ==========================================================================
   9. MOBILE LANDSCAPE OVERRIDES (Triggers when phones/tablets tilt sideways)
   ========================================================================== */
@media screen and (max-width: 980px) and (orientation: landscape) {
    
    /* 1. Unlock the container width for landscape screens */
    /*body .desktop-lock-container, body #container {
    /*    width: 100% !important;
    /*    max-width: 100% !important;
    /*    margin-top: 10px !important;
    /*    padding: 0 15px !important;    /* top is 0, left and right are 15
    /*    box-sizing: border-box !important;
    /* }
    
      /* 1. Unlock the container width for landscape screens and remove top gaps */
    body .desktop-lock-container, body #container {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 0px !important;  /* Force top margin to disappear */
        padding-top: 0px !important; /* Force top padding to disappear */
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
    }
    
    /* 2. Shrink the Kanji images slightly more so the center column expands */
    .karate-img, .iaido-img {
        width: 14% !important; /* Drops from 22% to 14% to make room for text */
        max-width: 85px !important;
        height: auto !important;
    }
    
    .karate-img { float: left !important; margin-right: 15px !important; }
    .iaido-img { float: right !important; margin-left: 15px !important; }

    /* 3. Force the main landing block to dynamically stretch out */
    body .desktop-lock-container div[style*="text-align: center"] {
        display: block !important;
        text-align: center !important;
        width: auto !important;
        overflow: hidden !important; /* Clean containment context */
    }

    /* 4. Drop the line-height and font sizes slightly so text doesn't wrap awkwardly */
    body .desktop-lock-container div font {
        font-size: 4vw !important; /* Responsive scaling based on width */
        line-height: 1.2 !important;
    }

    /* 5. Keep navigation buttons side-by-side but compact */
    form {
        display: flex !important;
        justify-content: center !important;
        gap: 15px !important;
        margin-top: 10px !important;
    }
    
     /* 6. Clean fix for sub-page spacing in landscape mode */
    body.sub-page .desktop-lock-container, body.sub-page #container {
        margin-top: 0px !important; /* Changed from 55px to 0px to remove the gap */
    }
    

}