/* style.css - UW Pediatrics Branding & Layout */
/* UW brand fonts (Encode Sans Compressed, from the UW WordPress theme: github.com/uweb/uw_wp_theme) */
@font-face { font-family: 'Encode Sans Compressed'; src: url('fonts/encodesanscompressed-600-semibold-webfont.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Encode Sans Compressed'; src: url('fonts/encodesanscompressed-700-bold-webfont.woff') format('woff'); font-weight: 700; font-display: swap; }

/* UW brand palette (uw.edu/brand) */
:root {
    --husky-purple: #32006e;
    --uw-purple: #4b2e83;      /* Spirit Purple */
    --husky-gold: #b7a57a;
    --uw-gold: #85754d;        /* Heritage Gold */
    --heading-font: 'Encode Sans Compressed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
    --metallic-gold: #e8e3d3;
    --light-gray: #f4f4f4;
    --dark-gray: #333333;
    --white: #ffffff;
    --focus-blue: #0055b8;
}

body { font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; margin: 0; padding: 0; background-color: var(--light-gray); color: var(--dark-gray); line-height: 1.6; }

*:focus-visible { outline: 3px solid var(--focus-blue); outline-offset: 2px; }

/* UW "thin strip": the standard top bar on UW websites */
.uw-thinstrip { background: var(--husky-purple); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 20px; }
.uw-brand { display: flex; align-items: center; gap: 10px; }
.uw-w { height: 26px; width: auto; }
.uw-wordmark { height: 12px; width: auto; }
.uw-dept { color: var(--white); font-family: var(--heading-font); font-weight: 600; font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; }
.uw-dept:hover { color: var(--husky-gold); }

header { background-color: var(--uw-purple); color: var(--white); padding: 40px 20px; text-align: center; border-bottom: 5px solid var(--husky-gold); }
header h1 { margin: 0; font-family: var(--heading-font); font-weight: 700; font-size: 3rem; line-height: 1.1; letter-spacing: 0.01em; }
header h1::after { content: ""; display: block; width: 70px; height: 5px; margin: 14px auto 0; background: var(--husky-gold); transform: skewX(-25deg); }
.section-title, .tab-btn, .now-playing-banner h2, .modal-title { font-family: var(--heading-font); letter-spacing: 0.01em; }
.section-title { font-size: 2.1rem; }
header p { font-size: 1.1rem; max-width: 800px; margin: 10px auto 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 30px 20px; }
.section-title { color: var(--uw-purple); border-bottom: 2px solid var(--uw-gold); padding-bottom: 5px; margin-bottom: 20px; }

/* Video Showcase */
.video-showcase { margin-bottom: 40px; }
.main-player-wrapper { max-width: 900px; margin: 0 auto 20px; background: #000; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 20px rgba(0,0,0,0.15); }
.video-container { width: 100%; aspect-ratio: 16 / 9; }
video { width: 100%; height: 100%; display: block; }
.now-playing-banner { background: var(--uw-purple); color: var(--white); padding: 12px 20px; text-align: center; }
.now-playing-banner h2 { margin: 0 0 4px 0; font-size: 1.3rem; }
.now-playing-banner p { margin: 0; font-size: 0.9rem; opacity: 0.9; text-transform: uppercase; }

.thumbnail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.thumb-card { cursor: pointer; border-radius: 8px; background: var(--white); overflow: hidden; border: 2px solid transparent; transition: all 0.2s; }
.thumb-card:hover { transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0,0,0,0.1); }
.thumb-card.active { border-color: var(--uw-gold); background: var(--metallic-gold); }
.thumb-img-wrapper { position: relative; aspect-ratio: 16/9; background: #ddd; }
.thumb-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.thumb-info { padding: 10px; }
.thumb-name { font-weight: bold; font-size: 1rem; color: var(--dark-gray); }
.thumb-role { font-size: 0.8rem; color: #666; }

/* Tab Navigation */
.tab-nav { display: flex; gap: 10px; margin-bottom: 30px; border-bottom: 2px solid #ddd; padding-bottom: 10px; flex-wrap: wrap; }
.tab-btn { background: transparent; border: none; font-size: 1.2rem; font-weight: bold; color: #666; cursor: pointer; padding: 10px 20px; border-radius: 8px 8px 0 0; transition: all 0.2s; }
.tab-btn:hover { background: #e8e8e8; color: var(--uw-purple); }
.tab-btn[aria-selected="true"] { background: var(--uw-purple); color: var(--white); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Filters */
.filter-panel { background: var(--white); padding: 20px; border-radius: 8px; margin-bottom: 30px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.filter-row { margin-bottom: 15px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-label { font-weight: bold; width: 100%; color: var(--uw-purple); margin-bottom: 5px; }
.pill-btn { background: var(--white); border: 2px solid #ccc; color: #555; padding: 6px 14px; border-radius: 20px; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: all 0.2s ease;}
.pill-btn:hover { background: #eee; }
.pill-btn[aria-pressed="true"] { background: var(--uw-purple); border-color: var(--uw-purple); color: var(--white); }

/* Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
/* Restored top colored border */
.card { background: var(--white); border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); display: flex; flex-direction: column; overflow: hidden; border-top: 6px solid transparent; transition: transform 0.2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); }
.card img { width: 100%; height: 160px; object-fit: cover; }
.card-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 10px 0; color: var(--dark-gray); }
.card p { font-size: 0.9rem; color: #555; margin-bottom: 15px; flex-grow: 1; }
.btn { text-align: center; background: var(--uw-purple); color: var(--white); text-decoration: none; padding: 10px; border-radius: 4px; font-weight: bold; display: block; border: none; cursor: pointer; transition: background 0.2s ease; }
.btn:hover { background: #3b2466; }

/* Restored Fun Tags */
.tag-container { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; display: inline-block; font-weight: bold; text-transform: uppercase; }
.tag-eligibility { background-color: #eee; color: #555; }

/* Modal (Popup) */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; padding: 15px; box-sizing: border-box; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content { background: var(--white); width: 100%; max-width: 800px; max-height: 90vh; border-radius: 8px; overflow-y: auto; position: relative; }
.close-btn { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.7); color: white; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; z-index: 10; }
.modal-hero { width: 100%; height: 200px; object-fit: cover; }
.modal-body { padding: 30px; }
.modal-title { color: var(--uw-purple); margin-top: 0; }
.salary-box { background: #f9f9f9; padding: 15px; border-left: 4px solid var(--uw-gold); margin: 20px 0; }
.action-zone { display: flex; gap: 15px; margin-top: 20px; flex-wrap: wrap; }

footer { background-color: #e8e3d3; color: var(--dark-gray); padding: 40px 20px; text-align: center; margin-top: 50px; border-top: 4px solid var(--uw-purple); }
.footer-links { margin-bottom: 15px; }
.footer-links a { color: var(--uw-purple); font-weight: bold; text-decoration: none; margin: 0 10px; }
.footer-links a:hover { text-decoration: underline; }
.footer-disclaimer { font-size: 0.85rem; max-width: 800px; margin: 0 auto 15px; color: #555; }

/* Logo (set in site-config.js) */
.site-logo { display: block; max-height: 70px; max-width: 80%; margin: 0 auto 15px; }

/* Secondary link buttons on opportunity cards (extraLinks) */
.btn-secondary { background: transparent; border: 2px solid; margin-top: 8px; padding: 8px; }
.btn-secondary:hover { background: #f4f4f4; }

/* Empty-state message when filters match nothing */
.no-results { grid-column: 1 / -1; text-align: center; padding: 40px 20px; background: var(--white); border-radius: 8px; color: #666; font-style: italic; }

/* Hidden attribute must win over component display rules */
[hidden] { display: none !important; }

/* Phones: keep the story picker compact so programs/careers aren't buried below 8 full-width cards */
@media (max-width: 600px) {
    header { padding: 28px 16px; }
    header h1 { font-size: 2.1rem; }
    .uw-thinstrip { padding: 8px 14px; }
    .uw-wordmark { display: none; }
    .uw-dept { font-size: 0.9rem; }
    header p { font-size: 1rem; }
    .container { padding: 20px 14px; }
    .section-title { font-size: 1.7rem; }
    .thumbnail-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .thumb-info { padding: 6px 8px; }
    .thumb-name { font-size: 0.85rem; }
    .thumb-role { font-size: 0.72rem; line-height: 1.3; }
    .tab-btn { flex: 1 1 100%; font-size: 1.05rem; }
    .modal-body { padding: 20px; }
}

/* "Start here" strip + grade picker */
.start-here { background: var(--white); border-left: 6px solid var(--husky-gold); border-radius: 8px; padding: 16px 20px; margin-bottom: 30px; box-shadow: 0 2px 5px rgba(0,0,0,0.06); }
.start-line { margin: 0 0 12px; font-size: 1.1rem; }
.start-line strong { font-family: var(--heading-font); color: var(--uw-purple); font-size: 1.3rem; margin-right: 4px; }
.start-line a { color: var(--uw-purple); font-weight: 600; }
.age-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.age-picker-label { font-weight: bold; color: var(--uw-purple); }
.age-picker-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.age-btn { font-size: 0.95rem; padding: 8px 16px; }
.age-status { margin: 4px 0 0; font-size: 0.95rem; color: #555; }
.age-status a { color: var(--uw-purple); font-weight: 600; }

/* Career pop-up: traits + path */
.modal-section h3 { color: var(--uw-purple); font-size: 1.1rem; margin: 20px 0 8px; }
.trait-list { margin: 0; padding-left: 20px; }
.trait-list li { margin-bottom: 4px; }
.roadmap { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.roadmap li { counter-increment: step; position: relative; padding: 8px 12px 8px 44px; margin-bottom: 6px; border-radius: 6px; background: #f6f4fa; }
.roadmap li::before { content: counter(step); position: absolute; left: 10px; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--uw-purple); color: var(--white); font-weight: bold; font-size: 0.85rem; text-align: center; line-height: 24px; }
.roadmap li.you-are-here { background: #fbf6e6; outline: 2px solid var(--husky-gold); }
.here-badge { display: inline-block; background: var(--husky-gold); color: var(--husky-purple); font-size: 0.72rem; font-weight: bold; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; margin-right: 8px; }
@media (max-width: 600px) {
    .start-here { padding: 14px; }
    .start-line { font-size: 1rem; }
    .age-btn { flex: 1 1 calc(50% - 8px); }
}

/* Shown in place of a hotlinked photo that fails to load */
.img-fallback { width: 100%; height: 160px; display: flex; align-items: center; justify-content: center; padding: 0 20px; box-sizing: border-box; color: var(--white); font-family: var(--heading-font); font-weight: 700; font-size: 1.5rem; text-align: center; line-height: 1.15; }

/* imageFit: "contain" (logos): whole image on white, no cropping */
.card img.img-contain, .modal-hero.img-contain { object-fit: contain; background: var(--white); padding: 14px; box-sizing: border-box; border-bottom: 1px solid #eee; }

/* Caption toggle in the now-playing banner + caption text style */
.now-playing-banner { position: relative; }
@media (min-width: 701px) { .now-playing-text { padding: 0 160px; } }
.cc-btn { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.75); border-radius: 6px; padding: 6px 10px; font-weight: bold; font-size: 0.85rem; cursor: pointer; }
.cc-btn:hover { background: rgba(255,255,255,0.12); }
.cc-btn[aria-pressed="true"] { background: var(--husky-gold); border-color: var(--husky-gold); color: var(--husky-purple); }
.cc-icon { border: 2px solid currentColor; border-radius: 3px; padding: 0 3px; font-size: 0.7rem; line-height: 1.3; }
video::cue { background-color: rgba(0, 0, 0, 0.78); color: #fff; }
@media (max-width: 700px) {
    .cc-btn { position: static; transform: none; margin-top: 8px; }
}
