/* ==========================================================================
   OAKDALE WAR MEMORIAL - MASTER PRESENTATION ENGINE (odw-profiles.css)
   Purpose: Unified stylesheet driving both the dynamic WWI/WWII 
            roster registries and individual historical profile pages.
   File Version: v2.2 (Added responsive portrait scaling & harmonized breakpoints)
   ========================================================================== */

* {
    box-sizing: border-box;
}

/* Archive Primary Source Citations */
.archive-source-note {
    background-color: var(--bg-note);
    border-left: 4px solid var(--odw-red);
    padding: 15px;
    margin: 20px 0 30px 0;
    font-family: var(--font-sans);
    font-size: 0.9em;
}

/* Archival Inline Media Thumbnails (Wikipedia Style Layout) */
.bio-inline-thumb {
    float: right;                       
    width: 100%;
    max-width: 270px;   
    margin: 4px 0 0px 20px;          
    background-color: #fbf9f4;          
    border: 1px solid var(--border-light);          
    padding: 6px;                       
    box-shadow: var(--shadow-subtle); 
}

.bio-inline-thumb.float-left {
    float: left;
    margin: 4px 20px 15px 0;          
}

@media (max-width: 530px) {
    .bio-inline-thumb,
    .bio-inline-thumb.float-left {
        float: left;               
        display: block;            
        width: 100%;
        max-width: 270px;        
        margin: 0 15px 15px 0 !important; 
    }
}

.bio-inline-thumb img {
    width: 100%;                        
    height: auto;
    display: block;
    margin-bottom: 5px;
    cursor: zoom-in;                 
}

.bio-paragraph-wrap {
    background-color: var(--bg-panel); 
    width: 100%; 
    padding: 0 30px 20px 30px;
}

@media (max-width: 500px) {
    .bio-paragraph-wrap {
        padding: 0 20px 20px 20px; 
    }
}

.bio-text {
    font-family: var(--font-serif);
    font-size: clamp(14px, 2vw, 16px); 
    text-align: justify;
    line-height: clamp(1.45em, 2.5vw, 1.7em); 
    color: #2b2b2b;
    margin-bottom: 20px;
}

.bio-text a {
    color: var(--text-dark);
    font-weight: 800;
    text-decoration: none; 
    text-underline-offset: 3px;            
    transition: color 0.2s ease-in-out, text-decoration-color 0.2s ease-in-out;
}

.bio-text a:hover {
    color: var(--odw-red);                        
    text-decoration: underline dashed 1px;  
}

.bio-thumb-caption {
    font-family: var(--font-sans);
    font-size: 11px;                    
    color: var(--text-muted);                     
    line-height: 1.3em;
    display: block;
    margin-top: 5px;
    margin-bottom: 0px;
    text-align: center;
}

/* Profile Fluid Flexbox Presentation Row */
.flex-container {
    max-width: 900px;
    display: flex;
    flex-wrap: wrap;
    background-color: var(--bg-panel);
    padding: 30px 30px 20px 30px;
    gap: 20px;
}

@media (max-width: 500px) {
    .flex-container {
        padding: 15px; 
    }
}

@media (max-width: 220px) {
    .flex-container {
        flex-direction: column; 
        align-items: flex-start; 
    }
}

/* UPDATED: Allows the image container to shrink if needed */
.image {
    flex: 0 1 160px;
    width: 100%;
    max-width: 160px;
    display: block;
}

.image a {
    cursor: zoom-in; 
    transition: opacity 0.2s ease-in-out;
}

.image a:hover {
    opacity: 0.85; 
}

/* NEW: Ensures the image scales down proportionally within the .image wrapper */
.soldier-portrait-img {
    width: 100%;
    height: auto;
    display: block;
}

/* NEW: Forces the image container to shrink slightly on mid-sized screens to save horizontal space */
@media (max-width: 720px) {
    .image {
        flex-basis: 120px;
        max-width: 120px;
    }
}

.img {
    flex: 0 0 160px; 
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--bg-panel);
    border: 1px solid #ff0000;
}

.medal {
    flex: 1 1 150px; 
    max-width: 225px; 
    min-width: 75px; 
    display: flex;
    flex-wrap: wrap;         
    justify-content: center;  
    align-content: flex-start;    
    gap: 0;             
    padding: 0; 
    background-color: var(--bg-panel);
}

@media (max-width: 720px) {
    .medal {
        justify-content: left;
    }
}

@media (max-width: 220px) {
    .medal {
        text-align: left;     
        width: 100%;
    }
}

.medal-ribbon-img {
    width: 75px; 
    height: 105px;
    cursor: zoom-in;              
}

.nav-btn-box { flex: 1 1 33.333%; }
.nav-btn-box.center { text-align: center; }
.nav-btn-box.left { text-align: left; }
.nav-btn-box.right { text-align: right; }

.profile {
    flex: 0 1 auto; 
    min-width: 325px; 
    max-width: 420px; 
    margin: 0;
    background-color: var(--bg-panel);
    border: 0px solid #ff0000;
}

/* UPDATED: Shifted this from 500px to 720px to coordinate with the medals & portrait scaling */
@media (max-width: 720px) {
    .profile {
        min-width: 0; 
    }
}

@media (max-width: 220px) {
    .profile {
        text-align: left;     
        width: 100%;
    }
}

.profile-artifact-dock {
    display: flex;
    gap: 12px;
    color: #ffffff;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .profile-artifact-dock {
        margin-left: 0; 
        justify-content: left;
    }
}

.profile-nav-btn {
    font-family: var(--font-sans);
    font-size: clamp(12px, 1.2vw, 13px); 
    font-weight: bold;
    color: var(--text-body);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1.5px;               
    transition: color 0.2s ease;
}

.profile-nav-btn:hover {
    color: var(--odw-red);                        
    text-decoration: underline dashed 1px;  
}

/* System-Injected Profile Navigation Row */
.profile-navigation-row {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    margin: 0px;               
    padding: 15px 0;
    border-top: 1px solid var(--border-light); 
    clear: both; 
}

.roster-content-panel {
    width: 100%;
    background-color: var(--bg-panel) !important;
    margin: 0px auto; 
    border: 0px solid #ff0000;
}

/* Roster Footnotes */
.roster-footnote {
    position: relative;
    margin-top: 30px;
    margin-bottom: 10px;  
    border: 0px;
}

.roster-footnote::before {
    content: "";
    display: block;
    width: 100%;
    max-width: 740px; 
    margin: 0px auto 0px auto;
    border-top: 0px solid var(--border-light); 
}

.roster-footnote-text {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
    margin-top: 20px; 
}

.roster-instruction-text {
    font-size: clamp(14px, 1.5vw, 16px);
    text-align: center;
    color: var(--text-body);
    margin-bottom: clamp(10px, 1.5vw, 15px);
}

.roster-lead-text {
    font-family: var(--font-serif);
    font-size: clamp(18px, 4vw, 22px);
    font-style: italic;
    font-weight: bold;
    line-height: 1.6;
    text-align: center;
    color: var(--odw-red); 
    margin-top: clamp(10px, 1.5vw, 15px);
    margin-bottom: 15px;
}

@media (max-width: 500px) {
    .roster-lead-text {
        text-align: center; 
        margin: 10px 20px 10px 20px;
    }
}

/* ========================================== */
/* SHARED BROTHERS PROFILE - FLEX LAYOUT      */
/* ========================================== */

.shared-profile-header {
  max-width: 800px;
  margin: 40px auto 20px auto;
  padding: 0 20px;
  text-align: center;
}

.shared-profile-header hr {
  margin-top: 20px;
  margin-bottom: 20px;
}

.shared-profile-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 0px auto 40px auto; 
  padding: 0 20px;
}

.shared-profile-card {
  background-color: #ffffff;
  text-align: left;
  max-width: 360px;
  width: 100%;
}

/* RESPONSIVE STACKING FOR MOBILE/TABLETS */
@media (max-width: 768px) {
  .shared-profile-container {
    flex-direction: column; 
    align-items: center; 
  }
  
  .shared-profile-card {
    max-width: 100%;        
  }
}

.soldier-detail {
    font-family: var(--font-sans);
    font-size: clamp(14px, 2vw, 16px); 
    color: var(--text-body);
    line-height: 1.4em; 
    margin: 0px 0px 4px 0px;
    word-wrap: break-word; 
    overflow-wrap: break-word;
    max-width: 325px;
    border: 0px solid #ff0000; 
}

@media (max-width: 500px) {
    .soldier-detail {
        max-width: 100%; 
    }
}

.soldier-medals-box  {
    display: flex;
    flex: 0 0 75px; 
    background-color: var(--bg-panel);
}

@media (max-width: 720px) {
    .soldier-medals-box {
        justify-content: left;
        flex-wrap: wrap; 
    }
}

.soldier-name {
    font-family: var(--font-serif);
    font-size: clamp(20px, 4vw, 28px); 
    font-weight: bold;
    color: var(--odw-red);
    margin: 0px 0px 6px 0px;
    line-height: 1.2em; 
    flex-shrink: 0;
    white-space: normal;
}

@media (max-width: 720px) {
    .soldier-name {
        white-space: normal; 
    }
}

.soldier-roster-grid {
    display: block;
    column-count: 3;
    column-gap: 30px;
    margin-left: 20px;
    width: 100%;
    max-width: 740px;
    border: 0px solid #ff0000;
}

@media (max-width: 768px) {
    .soldier-roster-grid {
        display: grid;
        grid-template-columns: repeat(2, max-content);
        justify-content: center; 
        column-gap: clamp(30px, 6vw, 60px); 
        margin: 15px auto;
    }
}

@media (max-width: 500px) {
    .soldier-roster-grid {
        grid-template-columns: 1fr;
        justify-content: center;
        column-gap: 0;
        margin-top: 10px;
        margin-left: 0px; 
    }
}

.soldier-roster-grid a {
    display: block;
    font-family: var(--font-serif);
    font-size: clamp(13px, 4vw, 15px); 
    font-weight: 800;
    line-height: 2.2em; 
    color: var(--text-dark);
    text-decoration: none;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

@media (max-width: 768px) {
    .soldier-roster-grid a {
        text-align: left; 
    }
}

@media (max-width: 500px) {
    .soldier-roster-grid a {
        text-align: center; 
        line-height: 2.6; 
        font-size: 16px;
    }
}

.soldier-roster-grid a:hover {
    font-style: none;
    color: var(--odw-red); 
    text-decoration: underline dashed 1px;
    text-underline-offset: 4px;
}

.source-data-italic {
    font-style: italic;
    line-height: 1.4em;
    color: var(--text-muted);
}

.source-heading {
    display: block;
    font-weight: bold;
    color: var(--text-body);
    margin-bottom: 5px;
}
