/* 
==============================================================
IATRICS HUB STYLES
Grids & Sidebars. Transparent Doctor, 
Zoomed to Overflow Top, Padding Reduced.
============================================================== 
*/

   body { overflow-x: hidden; }
   /* --- Header Logo Display Logic --- */

/* ==============================================================
   PART 1: GLOBAL SHARED COMPONENTS (Card Grids & Layout)
   ============================================================== */
.card-grid-section { padding: var(--gap-lg) 0; }
.section-header { text-align: center; margin-bottom: var(--gap-xl); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }


.card-icon img { margin-bottom: 25px; }

/* Ensure Main Content Layout Grid is active (Left Content / Right Sidebar) */
.iatrics-content-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
    padding-top: var(--gap-md);
}

/* ==============================================================
   PART 2: SINGLE PATIENT RESOURCE VIEW
   ============================================================== */

/* ==========================================================================
   GLOBAL UNIFORM HERO HEADERS (Full Grid Width, Left Aligned)
   ========================================================================== */
.resource-hero.alignfull {
    position: relative;
    display: flex;
    align-items: center; 
    justify-content: center; 
    text-align: left; 
    min-height: 380px; 
    /* Removed left/right padding so the .iatrics-grid-container handles it perfectly */
    padding: 60px 0; 
    background-color: #16202c; 
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 0;
}

.resource-hero .hero-bg-overlay {
    position: absolute; inset: 0; background-size: cover; background-position: center; background-repeat: no-repeat; opacity: 0.25; z-index: 1;
}

.resource-hero::after {
    content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(30, 41, 59, 0.4) 0%, rgba(30, 41, 59, 0.95) 100%); z-index: 2;
}

/* Removed the 900px box and margin auto! Let the grid container do its job */
.resource-hero .hero-content-relative {
    position: relative; 
    z-index: 10; 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; /* Forces content exactly to the left safe-padding edge */
}

.resource-hero .entry-title { 
    color: #ffffff !important; 
    font-size: clamp(2.5rem, 4vw, 3.5rem); 
    margin-bottom: 15px; 
    font-weight: 800; 
    line-height: 1.2; 
    text-align: left; 
}

/* We keep a max-width on the text only so paragraphs don't stretch 100 miles wide */
.resource-hero .resource-lead,
.resource-hero .resource-lead p  { 
    font-size: 1.1rem; 
    color: #cbd5e1 !important; 
    max-width: 850px; 
    line-height: 1.6; 
    text-align: left; 
    margin: 0; 
}


.procedure-quick-facts {
    display: flex; 
    justify-content: flex-start !important; 
    gap: 15px; 
    flex-wrap: wrap; 
    color: #ffffff; 
    font-size: 0.9rem;
    margin-top: 25px;
}

/* HIGH CONTRAST PILL BREADCRUMBS */
.hero-breadcrumb-pill { 
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.95) !important; border: 1px solid rgba(255, 255, 255, 1) !important; 
    padding: 6px 20px !important; border-radius: 50px; font-size: 0.75rem; font-weight: 700; 
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 25px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.hero-breadcrumb-pill a { color: var(--medical-primary, #8f001a) !important; text-decoration: none; transition: color 0.2s ease; }
.hero-breadcrumb-pill a:hover { color: #1e293b !important; }
.hero-breadcrumb-pill .separator { color: #94a3b8 !important; margin: 0 10px; font-weight: 700; font-size: 1rem; line-height: 1; }

/* ==========================================================================
   MOBILE & TABLET HEADER OVERRIDES (Center Alignment)
   ========================================================================== */
@media (max-width: 1024px) {
    .resource-hero { 
        text-align: center; 
    }
    
    .resource-hero .hero-content-relative { 
        align-items: center; /* Center flex children */
    }
    
    .resource-hero .entry-title,
    .resource-hero .resource-lead { 
        text-align: center; 
        margin-left: auto; 
        margin-right: auto;
    }
    
    .procedure-quick-facts { 
        justify-content: center !important; 
    }

    .resource-hero .resource-lead p {text-align:center;}
}
/*- 2. Main Layout Wrapper --- */
.resource-layout-wrapper {
    padding-top: var(--gap-md) !important; 
    padding-bottom: var(--gap-xl);
    position: relative;
    z-index: 20;
}

/* --- 3. THE 60/40 PRESENTER LAYOUT --- */
.resource-presenter-layout {
    display: grid !important;
    grid-template-columns: 60% 40% !important;
    background-color: var(--medical-header-bg) !important;
    border-radius: var(--medical-radius) !important;
    border: 1px solid var(--medical-border) !important;
    box-shadow: var(--medical-shadow) !important;
    overflow: visible !important; 
    margin-top: 0 !important; 
    margin-bottom: var(--gap-xl) !important;
    align-items: stretch !important;
    position: relative;
    z-index: 20;
}

/* --- 60% Left: Content Column --- */
.resource-content-col { padding: var(--gap-md) !important; display: flex; flex-direction: column; justify-content: center; border-radius: var(--medical-radius) 0 0 var(--medical-radius) !important; }
.resource-content-col h2, .resource-content-col h3 { margin-top: 0; color: var(--medical-heading); font-family: var(--font-heading); }
.resource-content-col p { width: 100%; }

.resource-content-col ul, 
.resource-content-col ol { 
    list-style: none !important; 
    padding-left: 0 !important; 
    margin-left: 0 !important; 
}

.resource-content-col li { 
    position: relative; 
    font-family: var(--font-primary);
    margin-bottom: 15px; 
    background: var(--medical-bg-light); 
    padding: 18px 20px 18px 55px;
    border-left: 4px solid var(--medical-accent); 
    color: var(--medical-body-text);
    font-weight: 500;
}

.resource-content-col li::before { 
    content: "✓"; 
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%); 
    color: var(--medical-accent); font-size: 20px; font-weight: 900; 
}
.resource-content-col li::marker { 
    position: absolute; left: 0; top: 50%; transform: translateY(-50%); 
    color: var(--medical-accent); font-size: 20px; font-weight: 900; 
}

/* --- Presenter Column --- */
.resource-presenter-col {
    background: transparent !important; 
    border-left: none !important; 
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    padding: 0 !important;
    position: relative;
    box-shadow: none !important;
}
.resource-presenter-col::after { display: none !important; } 

.resource-important-info {
    margin-top: 50px;
    margin-bottom: 20px; 
    padding: 30px; 
    background: var(--medical-accent); 
    border-left: 4px solid var(--medical-heading);
    border-radius: 0 8px 8px 0;
    color: var(--medical-header-bg); /* Use header-bg as white */
}
.resource-important-info .protocol-content {
    font-family: var(--font-primary);
    color: var(--medical-bg-light);
    font-size: var(--font-size-body);
}

.protocol-content {font-size: 0.95rem; line-height: 1.6; color: var(--medical-body-text);}
.phase-card,
.resource-important-info .protocol-content li { color: var(--medical-header-bg) !important;margin: 0 0 .5em .5em; }
.resource-important-info .protocol-content strong {font-weight:bold;}
.resource-important-info p,.resource-important-info li {
    color: var(--medical-header-bg) !important; 
    font-size: var(--font-size-h5);
}
.resource-important-info a {
    text-decoration: underline;
    cursor: pointer; 
    color:var(--medical-header-bg);
}
.resource-important-info h5 { 
    margin-top: 0; 
    color: var(--medical-header-bg) !important;
    font-size: var(--font-size-h5);
    line-height: 1.1rem;
    letter-spacing: 1px;
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 15px;
}
.resource-important-info h3{
    margin-top: 0; 
    color: var(--medical-header-bg) !important;
    font-size: var(--font-size-h3);
    line-height: 1.5rem;
    letter-spacing: 1px;
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 15px;
}

/* --- The Image --- */

.presenter-img {
    width: 100% !important; 
    max-width: none !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: bottom right !important; 
    display: block !important;
    filter: drop-shadow(-10px 10px 20px rgba(0,0,0,0.12)) !important; 
    transform: scale(1.20) !important; 
    transform-origin: bottom right !important;
    margin-bottom: -1px !important; 
    position: relative;
    z-index: 5;
}

.desktop-presenter-img { display: block !important; }
.mobile-presenter-img { display: none !important; }
.presenter-img.desktop-presenter-img {
    width: 100% !important;
    margin-top:10%;
}

/* --- 4. CLINIC PROTOCOLS SECTION (Premium Cards) --- */
.clinic-protocols-wrapper {
    margin-top: 50px;
    margin-bottom: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--medical-border); 
}
.discharge-intro {
    margin-bottom: 30px; 
    font-size: 1.05rem; 
    color: var(--medical-body-text); 
    line-height: 1.6;
} 
.protocols-section-title {
    font-size: 1.75rem;
    color: var(--medical-heading);
    margin-bottom: 30px;
    font-weight: 700;
}

.clinic-protocols-grid {
   display: flex !important;
    flex-wrap: wrap !important;
    gap: 24px !important;
}
.clinic-protocols-grid .protocol-box {
    /* flex-grow: 1 (This is the magic! It forces orphans to stretch)
       flex-shrink: 1 
       flex-basis: 260px (Allows 3-4 boxes per row on desktop, 2 on tablet, 1 on mobile)
    */
    flex: 1 1 260px !important;
    
    /* Keep the internal content aligned nicely to the top even if the box stretches */
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
}
/* Premium Info Cards */
.protocol-box {
    background: var(--medical-bg-light); 
    border: 1px solid var(--medical-border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: var(--medical-transition);
} 
.protocol-box img {width:100px;height:100px;}
.seek_med {
    border-left: 4px solid var(--medical-accent) !important;
}

.protocol-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.05);
}

.protocol-box h4 {
    color: var(--medical-accent);
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 700;
}
.protocol-content {
    font-size: 0.95rem; 
    line-height: 1.6; 
    color: var(--medical-body-text);
}

.protocol-content ul { padding-left: 20px; margin-bottom: 0; }
.protocol-content li { margin: 0 0 .5em .5em; }
.protocol-content li:last-child { margin-bottom: 0; }

.protocol-box h4 .dashicons { 
    color: var(--medical-accent); 
    font-size: 22px; 
    width: 22px; 
    height: 22px; 
    transition: transform 0.3s ease;
}

.protocol-box:hover h4 .dashicons { transform: scale(1.15); }

/* --- 5. SIDEBAR WIDGETS (PREMIUM CLINICAL DESIGN) --- */
.sidebar-widget img,  .sidebar-widget .download-widget,.sidebar-widget .dashicons-location,.taxonomies-sidebar {
    width: 50px;
    height: 50px; 
    margin-right: 8px; 
    filter: brightness(0) invert(1);
}

.scientific-widget h3,
.resource-sync-widget h3 { color: var(--medical-header-bg) !important; }

.resource-sync-widget .ottawa-resources-icon {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto 16px;
    border-radius: 6px;
    filter: brightness(0) invert(1);
}
.resource-sync-widget { 
    background: var(--medical-heading);
    border: 1px solid var(--medical-border); 
    padding: 15px; 
    border-radius: var(--medical-radius); 
    margin-bottom: 30px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.resource-sync-widget h3 {
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 12px;
    font-size: var(--font-size-body);
    color: var(--medical-header-bg);
    display: flex;
    align-items: center;
    gap: 10px;
}
.resource-sync-widget h3 .dashicons { color: var(--medical-header-bg); font-size: var(--font-size-body);  }
.resource-sync-list { list-style: none !important; padding: 0 !important; margin: 0 !important; display: flex; flex-direction: column; gap: 10px; }
.resource-sync-list li { 
    background: var(--medical-header-bg); 
    border: 1px solid var(--medical-border); 
    border-radius: 8px; 
    transition: var(--medical-transition); 
    margin: 0 !important; 
    position: relative;
    overflow: hidden;
}
.resource-sync-widget .dashicons .dashicons-building {font-size:3rem!important;}
.resource-sync-list li:hover { 
    border-color: var(--medical-accent); 
    background: #fdfafb; 
    transform: translateX(4px); 
    box-shadow: 0 5px 15px rgba(143, 0, 26, 0.05); 
}
.resource-sync-list li::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--medical-accent);
    transform: scaleY(0); transition: transform 0.3s ease;
}
.resource-sync-list li:hover::before { transform: scaleY(1); }

.resource-sync-list a { display: flex; align-items: center; padding: 12px 15px; text-decoration: none; color: var(--medical-heading); gap: 12px; }

.resource-icon { 
    flex-shrink: 0; display: flex; align-items: center; justify-content: center; 
    background: var(--medical-bg-light); 
    width: 36px; height: 36px; 
    border-radius: 6px; 
    border: 1px solid var(--medical-border); 
    transition: var(--medical-transition); 
    
}
.resource-icon .dashicons { color: var(--medical-heading); font-size: 18px; transition: color 0.3s ease;  }

.resource-sync-list li:hover .resource-icon { background: var(--medical-accent); border-color: var(--medical-accent); }
.resource-sync-list li:hover .resource-icon .dashicons { color: #ffffff; }

.resource-info { flex-grow: 1; display: flex; flex-direction: column; }
.resource-info strong { 
    font-size: 0.95rem; 
    line-height: 1.3; 
    font-weight: 600; 
    transition: color 0.3s ease; 
}
.resource-sync-list li:hover .resource-info strong { color: var(--medical-accent); }

.resource-info small { font-size: 0.75rem; color: var(--medical-body-text); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.resource-arrow {
    color: #cbd5e1;
    font-size: 1rem;
    transition: color 0.3s ease, transform 0.2s ease;
}
.resource-arrow .dashicons { display: none; }
.resource-arrow::after { content: '→'; }
.resource-sync-list li:hover .resource-arrow { color: var(--medical-accent); transform: translateX(3px); }

/* Active filter state — persists hover styling on the selected filter */
.resource-sync-list li.active-filter {
    border-color: var(--medical-accent);
    background: #fdfafb;
    box-shadow: 0 5px 15px rgba(143, 0, 26, 0.05);
}
.resource-sync-list li.active-filter::before { transform: scaleY(1); }
.resource-sync-list li.active-filter .resource-icon { background: var(--medical-accent); border-color: var(--medical-accent); }
.resource-sync-list li.active-filter .resource-icon .dashicons { color: #ffffff; }
.resource-sync-list li.active-filter .resource-info strong { color: var(--medical-accent); }
.resource-sync-list li.active-filter .resource-arrow { color: var(--medical-accent); }

/* --- Alternate Science/Academic Styling --- */
.scientific-widget h3 .dashicons { color: var(--medical-header-bg); }
.scientific-widget .resource-sync-list li:hover { border-color: var(--medical-heading); background: var(--medical-bg-light); box-shadow: 0 5px 15px rgba(30, 41, 59, 0.05); }
.scientific-widget .resource-sync-list li::before { background: var(--medical-heading); }
.scientific-widget .resource-sync-list li:hover .resource-icon { background: var(--medical-heading); border-color: var(--medical-heading); }
.scientific-widget .resource-sync-list li:hover .resource-info strong { color: var(--medical-heading); }

.download-widget h3 .dashicons,.download-widget  { color: var(--medical-header-bg); }

/* --- Areas of Focus (Premium Burgundy Authority Card) --- */
.sidebar-card-burgundy {
    background: var(--medical-accent) !important;
    border: none !important;
    box-shadow: 0 10px 25px rgba(143, 0, 26, 0.2) !important;
    margin-bottom: 30px;
}

/* Only add top spacing when NOT the first item in the sidebar */
.iatrics-sidebar > *:not(:first-child).sidebar-card-burgundy,
.iatrics-sidebar > .sidebar-card-burgundy:not(:first-child) {
    margin-top: 20px;
}

.sidebar-card-burgundy h3 {
    color: #ffffff !important;
}
.sidebar-card-burgundy h3 .dashicons { color: #ffffff !important; opacity: 0.8; }
.sidebar-card-burgundy p { color: rgba(255, 255, 255, 0.85); }

.sidebar-view-all {
    display: block;
    text-align: right;
    color: var(--medical-header-bg)!important;
    font-size: 0.85rem;
    margin-top: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.sidebar-view-all:hover {
    opacity: 0.8;
}

.widget-heading-link {
    text-decoration: none;
    color: inherit;
}

.resource-empty-item {
    padding: 15px;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    border: none;
    background: transparent;
}

.news-date {
    color: var(--medical-accent);
}

.focus-silo-content { display: flex; flex-direction: column; gap: 12px; }

.focus-item-detailed {
    font-family: var(--font-primary);
    font-size: .9rem;
    font-weight: 400;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    border-radius: 8px;
    transition: var(--medical-transition);
}

.focus-item-detailed strong {
    font-family: var(--font-heading); 
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff !important;
    display: block;
    margin-bottom: 8px;
    letter-spacing: 1px;
    line-height: 1.2rem;
}

.focus-item-detailed:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.focus-term-link {
    display: block;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    margin-bottom: 4px;
}

.focus-stats {
    display: block;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.focus-item-detailed .focus-stats {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85); 
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    display: block;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.iatrics-field-group .full-width {
    background: var(--medical-bg-light);
    padding: 20px; 
    border-radius: 8px; 
    border: 1px solid var(--medical-border);
    margin-bottom: 20px;
}
/* ==========================================================
   SURGERY ARCHIVE CARD STYLES
   ========================================================== */

/* Align icons and badges inside the card */
.medical-feature-card {
    background-color: var(--medical-header-bg);
    border: 1px solid var(--medical-border);
    border-radius: var(--medical-radius);
    padding: 40px 30px;
    text-align: center;
    transition: var(--medical-transition);
    display: flex;
    flex-direction: column;
}

.medical-feature-card:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--medical-shadow); 
    border-color: var(--medical-accent); 
}
.medical-feature-card .card-icon-wrapper {
    text-align: center;
    margin-bottom: 20px;
}

/* Ensure the taxonomy badge uses the primary color */
.medical-feature-card .card-anatomy-badge {
    background: transparent;
    color: var(--medical-primary);
    border: 1px solid var(--medical-primary);
    display: inline-block;
    margin-bottom: 15px;
}

/* Taxonomy Icon sizing */
.medical-feature-card .taxonomy-icon {
    width: 50px;
    height: auto;
    display: block;
    margin: 0 auto 15px;
}

/* Constrain featured images so they match icon-card heights */
.medical-feature-card .featured-card-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin: 0 auto 15px;
}

/* Push the link wrapper to the bottom of the card */
.medical-feature-card .archive-card-action {
    margin-top: auto; 
    padding-top: 20px;
    text-align: center;
}

/* The sleek "VIEW DETAILS ->" link */
.medical-feature-card .sleek-card-link {
    display: inline-block;
    color: var(--medical-accent);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none !important; /* Removes the ugly default underline */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.medical-feature-card .sleek-card-link:hover {
    opacity: 0.7;
    transform: translateX(4px); /* Slight slide interaction on hover */
}

/* ==========================================================
   SIDEBAR COLLABORATION WIDGET
   ========================================================== */
.collaboration-widget .collaboration-text {
    color: #cbd5e1;
}
.sidebar-full-btn {
    width: 100%;
    text-align: center;
    display: block;
}
/* ==========================================================
   OTTAWA RESOURCES: DIRECTORY CARD GRID
   ========================================================== */

.iatrics-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 30px;
    margin-bottom: 40px;
}

.directory-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.directory-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(143, 0, 26, 0.05); /* Soft burgundy shadow */
    border-color: #cbd5e1;
}

/* Card Header & Title */
.directory-card h4 {
    margin: 0 0 15px 0;
    color: var(--medical-heading);
    font-size: 1.25rem;
    font-family: var(--font-heading);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

/* Icon List for Contact Info */
.directory-contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.directory-contact-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--medical-body-text);
    line-height: 1.4;
}

.directory-contact-list .dashicons {
    color: var(--medical-accent);
    margin-right: 10px;
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.directory-contact-list a {
    color: var(--medical-accent);
    text-decoration: none;
    font-weight: 500;
}

.directory-contact-list a:hover {
    text-decoration: underline;
}

/* Tags / Badges for specific features (e.g., Accepts Pets, Bariatric) */
.directory-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto; /* Pushes tags to the bottom of the card */
}

.directory-badge {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

.directory-badge.highlight {
    background: rgba(143, 0, 26, 0.08);
    color: var(--medical-accent);
}
/* ==========================================================
   STRUCTURED DIRECTORY CARDS (Main Content Area)
   ========================================================== */

.data-directory-grid {
    display: grid;
    /* Auto-fits as many 280px cards as possible into the space next to the sidebar */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 50px;
}

.data-directory-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.data-directory-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(143, 0, 26, 0.05); /* Soft burgundy shadow */
    border-color: #cbd5e1;
}

.data-directory-card h4 {
    margin: 0 0 15px 0;
    color: var(--medical-heading);
    font-size: 1.15rem;
    font-family: var(--font-heading);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

/* Row variant for taxonomy list views */
.resource-articles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.resource-articles-list .data-directory-card {
    text-decoration: none;
    flex-direction: row;
    align-items: center;
    padding: 20px;
}

.resource-articles-list .hub-icon-wrapper {
    margin-bottom: 0;
    margin-right: 20px;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.resource-articles-list .card-content {
    flex-grow: 1;
}

.resource-articles-list .card-content h3 {
    margin: 0 0 5px 0;
    color: var(--medical-heading);
    font-size: 1.2rem;
}

.resource-articles-list .card-content p {
    margin: 0;
    color: var(--medical-body-text);
    font-size: 0.9rem;
}

.resource-articles-list .card-arrow {
    color: var(--medical-accent);
    padding-left: 16px;
    font-size: 1rem;
}
.resource-articles-list .card-arrow .dashicons { display: none; }
.resource-articles-list .card-arrow::after { content: '→'; }

/* Accent Icon Utility */
.icon-accent {
    color: var(--medical-accent);
}

/* Rehabilitation Phases */
.rehab-phases-heading {
    font-size: 1.25rem;
    color: var(--medical-heading);
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.phase-card h5 {
    margin: 0;
    color: var(--medical-accent);
    font-size: 1.1rem;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
}

.phase-number-badge {
    background: var(--medical-accent);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 12px;
    font-family: var(--font-primary);
    flex-shrink: 0;
}

.phase-protocol-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--medical-body-text);
}

.physio-notes-content {
    font-size: 0.9rem;
    font-style: italic;
}

/* Resource Downloads & Directory Sections */
.resource-downloads-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--medical-border);
}

.resource-downloads-section > h4 {
    font-size: 1.25rem;
    color: var(--medical-heading);
    margin-bottom: 20px;
}

.resource-downloads-section > h4 > .dashicons {
    color: var(--medical-accent);
    vertical-align: middle;
}

.resource-directory-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--medical-border);
}

.resource-directory-section > h3 {
    font-size: 1.5rem;
    color: var(--medical-heading);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-directory-section > h3 > .dashicons {
    color: var(--medical-accent);
}

/* Global Disclaimer */
.global-disclaimer {
    margin-top: 40px;
    padding: 20px;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    border-radius: 8px;
}

.global-disclaimer p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Contact List inside Card */
.directory-contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    flex-grow: 1;
}

.directory-contact-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--medical-body-text);
    line-height: 1.4;
}

.directory-contact-list .dashicons {
    color: var(--medical-accent);
    margin-right: 10px;
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.directory-contact-list a {
    color: var(--medical-accent);
    text-decoration: none;
    font-weight: 500;
}

.directory-contact-list a:hover {
    text-decoration: underline;
}

/* Gray Notes Box */
.directory-notes {
    background: #f8fafc;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* Tags/Badges */
.directory-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.directory-badge {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}





/* ==============================================================
   PART 3: UNIFIED MOBILE RESPONSIVENESS (Grids + Layouts)
   Status: Sidebar Drops on Tablet, 50/50 Split, Mobile Stack.
   ============================================================== */

/* --- TABLET (1024px to 769px) --- */
@media (max-width: 1024px) {
    .iatrics-content-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    .resource-main-content, .iatrics-sidebar { width: 100% !important; }

    .resource-presenter-layout { 
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 40px;
        align-items: start;
        margin-bottom: 40px;
    }
    .resource-presenter-col .presenter-img {
        width: 100%;
        height: auto;
    }
    
    .resource-content-col {
        padding: 40px !important;
        border-radius: var(--medical-radius) 0 0 var(--medical-radius) !important;
    }

    .resource-presenter-col {
        border-left: none !important;
        justify-content: flex-end !important; 
        padding: 0 !important;
    }
    
    .presenter-img {
        width: 100% !important; 
        transform: scale(1.15) !important; 
        transform-origin: bottom right !important; 
        margin-bottom: -1px !important; 
    }

    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .phase-card .protocol-content ul {
        column-count: 2;
        column-gap: 40px;
        margin-bottom: 20px;
    }
    
    .phase-card .protocol-content li {
        /* Prevents a single bullet point from being chopped in half across columns */
        break-inside: avoid; 
        page-break-inside: avoid;
        margin-bottom: 12px;
    }
}

.phase-card {
    background: var(--medical-bg-light); 
    border: 1px solid var(--medical-border); 
    border-radius: 8px; 
    padding: 24px;
}
.phase-card h5 {
    margin-top: 0; 
    color: var(--medical-accent); 
    font-size: var(--font-size-h5);
    margin-bottom: 15px;
    font-family: var(--font-primary);
}
.phase-card span .phase-title {
    background: var(--medical-accent); 
    color: var(--medical-header-bg); 
    border-radius: 50%; 
    width: 24px; 
    height: 24px;
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 14px; 
    margin-right: 8px;
}
/* ==========================================================
   RESOURCE HUB & ARCHIVE GRIDS
   ========================================================== */

.resource-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 0;
    margin-bottom: 60px;
}

/* Bottom breathing room before footer on resource hub page */
.resource-view {
    padding-bottom: var(--gap-lg);
}

/* Extend last card if it's alone in the final row (1 of 3 columns) */
.hub-folder-card:last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
}

/* Extend last card if it's second in the final row (2 of 3 columns) */
.hub-folder-card:last-child:nth-child(3n + 2) {
    grid-column: span 2;
}

.hub-folder-card {
    background: #ffffff;
    border: 1px solid var(--medical-border);
    border-radius: 12px;
    padding: 30px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
}

.hub-folder-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--medical-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.hub-folder-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(143, 0, 26, 0.06);
    border-color: #cbd5e1;
}

.hub-folder-card:hover::before {
    transform: scaleX(1);
}

.hub-icon-wrapper {
    background: var(--medical-bg-light);
    color: var(--medical-accent);
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.hub-icon-wrapper .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.hub-folder-card h3 {
    margin: 0 0 10px 0;
    color: var(--medical-heading);
    font-size: 1.35rem;
    font-family: var(--font-heading);
}

.hub-folder-card p {
    margin: 0 0 20px 0;
    color: var(--medical-body-text);
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
}

.hub-folder-action {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--medical-accent);
    font-weight: 500;
    font-size: 0.875rem;
}

.hub-folder-action .dashicons { display: none; }
.hub-folder-action::after { content: '→'; font-style: normal; transition: transform 0.3s ease; }

.hub-folder-card:hover .hub-folder-action::after {
    transform: translateX(4px);
}
/* ==========================================================
   PHYSIO PHASES: DE-STACKING & TYPOGRAPHY
   ========================================================== */

/* 1. Transform bold text (Goals, Precautions) into distinct sub-headers */
.phase-card .protocol-content strong {
    display: inline-block;
    background: #f1f5f9; /* Subtle slate background */
    color: var(--medical-accent);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    border-left: 3px solid var(--medical-accent);
}

/* 2. Add a beautiful soft divider spanning the full width ABOVE each section */
/* We use the modern :has() selector to target the paragraph wrapping the badge */
.phase-card .protocol-content p:has(strong) {
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
    margin-top: 24px;
}

/* Remove the line and spacing for the very first badge so it stays flush at the top */
.phase-card .protocol-content > *:first-child:has(strong),
.phase-card .protocol-content p:first-child:has(strong) {
    border-top: none;
    padding-top: 0;
    margin-top: 5px;
}
@media (min-width: 1024px) {
    .phase-card .protocol-content ul {
        column-count: 2;
        column-gap: 40px;
        margin-bottom: 20px;
    }
    
    .phase-card .protocol-content li {
        /* Prevents a single bullet point from being chopped in half across columns */
        break-inside: avoid; 
        page-break-inside: avoid;
        margin-bottom: 12px;
    }}

/* ==========================================================
   PREMIUM CLINICAL ACCORDIONS (Native HTML5)
   ========================================================== */

.iatrics-accordion-panel {
    margin-top: 30px;
    margin-bottom: 30px;
    background: #ffffff;
    border: 1px solid var(--medical-border);
    border-radius: var(--medical-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 1. The Clickable Header */
.iatrics-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    cursor: pointer;
    background: var(--medical-bg-light);
    transition: background 0.3s ease;
    
    /* Removes the ugly default browser arrows */
    list-style: none; 
}

.iatrics-accordion-header::-webkit-details-marker {
    display: none; /* Safari specific removal */
}

.iatrics-accordion-header:hover {
    background: #f1f5f9;
}

/* Force the title inside the accordion to sit flush */
.iatrics-accordion-header h3.protocols-section-title {
    margin-bottom: 0 !important;
    font-size: 1.5rem;
    color: var(--medical-heading);
}

/* 2. The Animated Arrow Icon */
.accordion-icon {
    font-size: 24px;
    color: var(--medical-accent);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Rotate arrow when panel is open */
.iatrics-accordion-panel[open] .accordion-icon {
    transform: rotate(180deg);
}

.iatrics-accordion-panel[open] .iatrics-accordion-header {
    border-bottom: 1px solid var(--medical-border);
}

/* 3. The Content Inside */
.accordion-content {
    padding: 30px;
    /* Soft fade-in animation when opened */
    animation: accordionFadeIn 0.4s ease-in-out;
}

@keyframes accordionFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* ==========================================================
   SIDEBAR ACCORDION STYLES
   ========================================================== */

/* 1. The Details Container */
details.sidebar-widget,
details.sidebar-card-burgundy {
    cursor: pointer;
    margin-bottom: 20px;
}

/* 2. The Clickable Header */
.sidebar-accordion-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
    list-style: none; /* Hides default browser arrow */
}
.sidebar-accordion-summary::-webkit-details-marker {
    display: none; /* Safari fix */
}
.sidebar-accordion-summary h3,
.sidebar-accordion-summary h4 {
    margin: 0;
    border: none;
    padding: 0;
    color: #ffffff; /* Assuming these headers should be white based on the design */
    font-size: var(--font-size-body);
}

/* 3. The Animated Arrow */
.sidebar-accordion-icon {
    color: #ffffff;
    transition: transform 0.3s ease;
}
details[open] .sidebar-accordion-icon {
    transform: rotate(180deg);
}

/* 4. The Expanded Content Wrapper */
.sidebar-accordion-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* 5. The Premium Icons inside the Accordion */
.sidebar-expanded-icon {
    width: 70px;
    height: auto;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

/* Specific override for the Ottawa Hospital Icon */
img.sidebar-expanded-icon.ottawa-resources-icon {
    display: block;
    max-width: 220px;
    width: auto;
    margin-left: auto;
    margin-right: auto;
}

/* --- Sidebar CTA Card (Need Help?) --- */
.sidebar-cta-card {
    margin-top: 30px;
    background: var(--medical-heading);
    color: #ffffff;
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
}
.sidebar-cta-card h4 { color: #ffffff !important; margin: 0 0 15px 0; }
.sidebar-cta-card p  { color: #cbd5e1; margin-bottom: 25px; }
.sidebar-cta-card .sidebar-view-all {
    display: inline-block;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50px;
    padding: 10px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    margin-top: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.sidebar-cta-card .sidebar-view-all:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.65);
    opacity: 1;
}

/* ==========================================================
   NESTED ACCORDIONS (PHYSIO PHASES)
   ========================================================== */

/* 1. Reset the phase card to act as an accordion container */
details.phase-card {
    padding: 0 !important; /* Removes the old rigid padding */
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden; /* Keeps our bulletproof divider hack working perfectly! */
    transition: box-shadow 0.3s ease;
}

details.phase-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

/* 2. The Sub-Accordion Clickable Header */
.iatrics-sub-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    cursor: pointer;
    background: transparent;
    list-style: none; /* Hide native browser arrows */
}

.iatrics-sub-accordion-header::-webkit-details-marker {
    display: none; /* Safari fix */
}

.iatrics-sub-accordion-header:hover {
    background: #f1f5f9;
}

/* 3. The Dropdown Content Area */
.sub-accordion-content {
    padding: 24px;
    background: #ffffff; /* Contrast switch from the slate header */
    border-top: 1px solid #e2e8f0;
    animation: accordionFadeIn 0.4s ease-in-out;
}

/* 4. Arrow Animation Logic */
details.phase-card[open] .accordion-icon {
    transform: rotate(180deg);
}

   .physio-intro-grid {
       display: grid; 
       grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
       gap: 24px;
        margin-bottom: 40px;
    }

/* --- MOBILE (768px and below) --- */
@media (max-width: 768px) {
        .iatrics-accordion-header { padding: 18px 20px; }
    .accordion-content { padding: 20px; }
    .iatrics-accordion-header h3.protocols-section-title { font-size: 1.25rem !important; }
    /* ==========================================================
       MOBILE FIXES: PADDING & TYPOGRAPHY SCALE
       ========================================================== */

    /* 1. Rewrite the CSS Variables strictly for mobile */
    :root {
        /* Drops the massive padding. 15px prevents text from literally touching the screen edge, but reclaims the wasted space. (Change to 0px if you want strict edge-to-edge). */
        --iatrics-safe-padding: 20px !important; 

        /* Globally shrink all header sizing math for mobile */
        --font-size-h1: clamp(1.3rem, 4vw, 2rem) !important;
        --font-size-h2: clamp(1.2rem, 3.5vw, 1.75rem) !important;
        --font-size-h3: clamp(1.1rem, 3vw, 1.5rem) !important;
        --font-size-body: clamp(0.9rem, 2.5vw, 1rem) !important;
    }

    /* 2. Force the Grid Container to respect the new thin padding */
    .iatrics-grid-container {
        padding-left: var(--iatrics-safe-padding) !important;
        padding-right: var(--iatrics-safe-padding) !important;
    }

    /* 3. Aggressively shrink the Hero Title specifically */
    .resource-hero .entry-title {
        /* Brings the minimum size down to ~18px so long words fit perfectly */
        font-size: clamp(1.15rem, 4vw, 1.4rem) !important; 
        line-height: 1.25 !important;
        margin-bottom: 10px !important;
        max-width: 100%;
    }

    /* 4. Tighten the Hero padding slightly so it doesn't feel too tall */
    .resource-hero {
        padding: 15px 0 25px !important;
      
    }

    /* 1. Force the Header to strict Left/Right layout */
    .header-inner {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important; /* Prevents stacking */
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important; /* Kills horizontal scroll */
    }

    /* 2. Hide the Giant Desktop Rectangle Image */
    .site-branding img.custom-logo {
        display: none !important;
    }

    /* 3. Turn the <a> link into the Square Logo */
    .site-branding a {
        display: inline-block !important;
        width: 45px !important;  /* Perfect square size for mobile header */
        height: 45px !important;
        
        /* Make sure this filename matches exactly what is in your assets/img folder! */
        background-image: url('../icons/grammatopoulos-mobile-logo-emblem.png') !important; 
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: left center !important;
    }

    /* 4. Fix Hero Title Overflow (Extremely long medical words) */
    .resource-hero .entry-title {
        font-size: clamp(1.35rem, 5vw, 1.8rem) !important; 
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
        /* Forces long words like "Physiotherapy" to wrap instead of breaking the screen */
        word-wrap: break-word !important; 
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }
    .resource-presenter-layout { 
        display: flex !important;
        flex-direction: column !important; 
    }
    .site-branding .custom-logo img {max-height:3rem;}
    .resource-content-col {
        padding: 30px 20px 40px 20px !important;
        border-radius: var(--medical-radius) var(--medical-radius) 0 0 !important;
    }

    .resource-presenter-col {
        min-height: 350px; 
        border-radius: 0 0 var(--medical-radius) var(--medical-radius) !important;
        justify-content: center !important; 
        align-items: flex-end !important;
    }
    
    .presenter-img {
        width: 80% !important; 
        max-width: 350px;
        transform: scale(1.1) translateY(-15px) !important; 
        transform-origin: bottom center !important; 
        object-position: bottom center !important; 
    }

    .card-grid { grid-template-columns: 1fr; }
    
    .resource-layout-wrapper { padding-top: 20px !important; padding-bottom: 50px !important; }
    .resource-hero { padding: 30px 0 40px !important;   min-height:333px;}
    .resource-hero .entry-title { font-size: 2rem !important; }
    .resource-hero .iatrics-breadcrumbs { flex-wrap: wrap; line-height: 1.5; padding: 10px 18px !important; }

    .resource-presenter-layout {
        gap: 24px;
    }
    
    .resource-presenter-col {
        order: -1; 
        max-width: 300px;
        margin: 0 auto;
    }

    .resource-important-info {
        padding: 20px !important;
        margin-top: 30px !important;
    }

    .phase-card {
        padding: 16px !important;
    }

    .physio-intro-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .protocols-section-title {
        font-size: 1.4rem !important;
        margin-bottom: 20px !important;
    }
    .desktop-presenter-img { display: none !important; }
    .mobile-presenter-img { 
        display: block !important; 
        width: 100% !important; /* Perfect square size */
        height: auto !important;
        object-fit: cover !important;
        margin: 0 auto !important;
        background-color: transparent;
        
        /* Gently sink it halfway into the text box below it */
        transform: translateY(30px) !important; 
        position: relative;
        z-index: 10;
    }

    /* Reset the presenter column from the desktop styling */
    .resource-presenter-col {
        min-height: auto !important; 
        border-radius: 0 !important;
        justify-content: center !important; 
        align-items: center !important;
        padding-top: 20px !important;
    }
}
