/*
Theme Name: Ecorise Curriculum Theme
Theme URI: https://learn.ecorise.org
Author: Fortafy
Description: Custom child theme for the EcoRise LMS experience based on Kadence.
Version: 0.4.7
Template: kadence
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 8.1
Text Domain: ecorise-lms
*/

/* --- ECORISE CUSTOM CARD BLOCK --- */

/* prior styles */
.ld-course-tags .ld-tag {
	background: #e6f4ea;
	color: #1b5e20;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Override the spacing above the button */
#ld-cg-moim1bsqgv .grid > .item .content .entry-content * {
    padding-bottom: 15px;
}

/* --- GROUP CATEGORIES AS ROUNDED TAG BADGES --- */

.taxonomy-ld_group_category.wp-block-post-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.taxonomy-ld_group_category.wp-block-post-terms a {
    background-color: #e6f4ea; /* EcoRise light green */
    color: #1b5e20; /* EcoRise dark green */
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.taxonomy-ld_group_category.wp-block-post-terms a:hover {
    background-color: #1b5e20;
    color: #ffffff;
    text-decoration: none;
}

/* Hide comma separators */
.taxonomy-ld_group_category.wp-block-post-terms .wp-block-post-terms__separator {
    display: none !important;
}

/* --- HIDE FILE BLOCK FILENAME BELOW EMBEDS --- */
.wp-block-file.wp-block-file--hide-filename a:not(.wp-block-file__button),
.wp-block-file.wp-block-file--hide-filename .wp-block-file__textlink {
    display: none !important;
}

/* --- FILEBIRD DOCUMENT LIBRARY LIST OVERRIDES --- */
#filebird-document-library {
    width: calc(100% - 12px) !important;
    max-width: calc(100% - 12px) !important;
    margin-left: 6px !important;
    margin-right: 6px !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
}

.njt-fbdl,
.fbdl-spinner,
.fbdl-spinner > div,
.fbdl-listview,
.fbdl-listview-wrapper,
.fbdl-listview-container,
.fbdl-list,
.fbdl-table,
.filebird-document-library-table {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
}

[class*="filebird-document-library"] table,
[class*="fbdl-"] table,
.filebird-document-library-table {
    font-size: 0.8rem !important;
}

[class*="filebird-document-library"] th,
[class*="filebird-document-library"] td,
[class*="fbdl-"] th,
[class*="fbdl-"] td {
    font-size: 0.8rem !important;
    font-family: var(--global-body-font-family, inherit) !important;
}

/* --- FILEBIRD DOCUMENT LIBRARY ALIGNMENTS & TOOLTIPS --- */
[class*="filebird-document-library"] td,
[class*="fbdl-"] td,
.filebird-document-library-table td {
    vertical-align: middle !important;
}

.fbdl-list-item-icon {
    display: flex !important;
    align-items: center !important;
}

.fbdl-list-item-icon-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    margin-right: 12px !important;
    position: relative !important;
}

.fbdl-list-item-icon-wrapper img {
    height: 32px !important;
    width: auto !important;
    display: block !important;
}

/* Custom CSS-based Brand Green Tooltip on PDF Icon */
.fbdl-list-item-icon-wrapper::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    background-color: #1b5e20 !important; /* EcoRise Brand Green */
    color: #ffffff !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    width: max-content;
    max-width: 250px;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    z-index: 99999 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}

.fbdl-list-item-icon-wrapper:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.fbdl-list-item-icon-wrapper::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1b5e20 transparent transparent transparent !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
    z-index: 99999 !important;
}

.fbdl-list-item-icon-wrapper:hover::before {
    opacity: 1;
    visibility: visible;
}

/* --- CUSTOM OVERRIDES FOR FILEBIRD DISPLAY IN TOPICS & MODULES --- */

/* Hide the entire toolbar (Search, View Switcher, etc.) in Firebird */
.fbdl-layout-control-wrapper {
    display: none !important;
}

/* Reduce font size for Table Headers in Firebird (Target th directly and inner div) */
[class*="fbdl-"] th,
[class*="fbdl-"] th div,
.fbdl-table-header,
.fbdl-table-header div,
.fbdl-table-first-header, 
.fbdl-table-first-header div, 
.fbdl-table-last-header,
.fbdl-table-last-header div {
    font-size: 0.8rem !important;
}

/* Reduce font size for Table Body/Rows in Firebird (Target td and list-item-title elements) */
[class*="fbdl-"] td,
.fbdl-table-body .fbdl-table-row td,
.fbdl-list-item-title,
.fbdl-list-item-title div,
.fbdl-list-item-title a {
    font-size: 0.8rem !important;
}

/* --- OVERRIDE LEARNDASH BUTTONS TO MATCH KADENCE THEME BUTTONS --- */

/* Target Log In and Register submit buttons in LearnDash forms */
.learndash-wrapper #loginform input[type="submit"]#wp-submit,
.learndash-wrapper #learndash_registerform input[type="submit"]#wp-submit-register,
.learndash-wrapper .ld-login-modal input[type="submit"]#wp-submit,
#loginform #wp-submit,
#wp-submit-register {
    background-color: #ff664b !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    font-family: var(--global-body-font-family, 'Nunito Sans', sans-serif) !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 6px 24px !important;
    border: none !important;
    height: auto !important;
    line-height: 1.5 !important;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
    box-shadow: 0px 0px 0px -7px rgba(0,0,0,0) !important;
    cursor: pointer !important;
	text-decoration: none;
}

/* Hover and active focus states to match Kadence theme hover */
.learndash-wrapper #loginform input[type="submit"]#wp-submit:hover,
.learndash-wrapper #learndash_registerform input[type="submit"]#wp-submit-register:hover,
.learndash-wrapper .ld-login-modal input[type="submit"]#wp-submit:hover,
#loginform #wp-submit:hover,
#wp-submit-register:hover,
.learndash-wrapper #loginform input[type="submit"]#wp-submit:focus,
.learndash-wrapper #learndash_registerform input[type="submit"]#wp-submit-register:focus,
.learndash-wrapper .ld-login-modal input[type="submit"]#wp-submit:focus,
#loginform #wp-submit:focus,
#wp-submit-register:focus {
    background-color: var(--global-palette2, #215387) !important;
    color: #ffffff !important;
    box-shadow: 0px 15px 25px -7px rgba(0,0,0,0.1) !important;
}

/* Target the LearnDash header/wrapper LOGIN & LOGOUT text links/buttons, as well as custom Kadence logout links */
.learndash-wrapper a.ld-login.ld-login-button.ld-button,
a.ld-login.ld-login-button.ld-button,
.learndash-wrapper a.ld-logout.ld-logout-button.ld-button,
a.ld-logout.ld-logout-button.ld-button,
a[href*="action=logout"],
a.kb-button[href*="action=logout"] {
    background-color: #ff664b !important;
    background-image: none !important; /* Force override any Kadence button gradients */
    border: none !important; /* Remove any Kadence button borders that alter the red perception */
    opacity: 1 !important; /* Prevent any opacity differences from shifting the red tone */
    color: #ffffff !important;
    border-radius: 4px !important;
    font-family: var(--global-heading-font-family, inherit) !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 6px 24px !important;
    display: inline-block !important;
    line-height: 1.5 !important;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
    box-shadow: 0px 0px 0px -7px rgba(0,0,0,0) !important;
    cursor: pointer !important;
	text-decoration: none;
}

/* Hover and focus states for the LOGIN, LOGOUT, & Custom Kadence logout buttons */
.learndash-wrapper a.ld-login.ld-login-button.ld-button:hover,
a.ld-login.ld-login-button.ld-button:hover,
.learndash-wrapper a.ld-login.ld-login-button.ld-button:focus,
a.ld-login.ld-login-button.ld-button:focus,
.learndash-wrapper a.ld-logout.ld-logout-button.ld-button:hover,
a.ld-logout.ld-logout-button.ld-button:hover,
.learndash-wrapper a.ld-logout.ld-logout-button.ld-button:focus,
a.ld-logout.ld-logout-button.ld-button:focus,
a[href*="action=logout"]:hover,
a[href*="action=logout"]:focus,
a.kb-button[href*="action=logout"]:hover,
a.kb-button[href*="action=logout"]:focus {
    background-color: var(--global-palette2, #215387) !important;
    background-image: none !important;
    border: none !important;
    opacity: 1 !important;
    color: #ffffff !important;
    box-shadow: 0px 15px 25px -7px rgba(0,0,0,0.1) !important;
    text-decoration: none !important;
}

/* --- RESOURCE TABS OVERRIDES & UNIFICATION --- */

/* Reduce padding within Kadence resource tab containers to 1px */
.tabbed-resources-layout .kt-tabs-content-wrap,
.tabbed-resources-layout .kt-tab-inner-content-inner,
.tabbed-resources-layout .kt-inside-inner-col {
    padding: 1px !important;
}

/* Hide first tab (Standards) on single Topic pages */
.single-topics-template .kt-tabs-title-list li:first-child,
.single-topics-template .kt-tabs-content-wrap > div:first-child,
.single-topics-template #tab-standards,
.single-topics-template .kt-inner-tab-1 {
    display: none !important;
}


