/*!
Theme Name: Kadence Child
Theme URI: https://www.kadencewp.com/kadence-theme/
Template: kadence
Author: Kadence WP
Author URI: https://www.kadencewp.com/
Description: A child theme for the Kadence Theme.
Version: 1.0.0
License: GNU General Public License v3.0 (or later)
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: kadence-child
*/

/* Styling for the main grid container (DESKTOP/DEFAULT) */
.planda-taxonomy-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	
	gap: 15px 20px; 
	
	max-width: 700px; 
	margin-left: auto;
	margin-right: auto;
	margin-top: 30px; 
	margin-bottom: 30px; 
	background-color: #f9f9f9; 
	border: 1px solid #e0e0e0; 
	border-radius: 6px;
	
	padding: 10px 15px; 
	
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
	font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	font-size: 0.9em; 
	color: #333; 
}

/* -------------------------------------------------------------------------------- */
/* HIERARCHY LINE (Ord - Fine - Géineas) Styling - OUTSIDE the main grid */
/* -------------------------------------------------------------------------------- */
.planda-hierarchy-line {
    max-width: 700px; 
	margin: 0 auto 15px auto; /* 15px gap above calendar bar */
	padding: 8px 15px;
	text-align: center;
	font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	font-size: 0.95em;
	color: #444;
	background-color: #f0f8ff; /* Light blue background for emphasis */
	border: 1px solid #d0e0ff;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
	line-height: 1.6;
}

.planda-hierarchy-line .h-label {
    font-weight: 700;
    color: #0073aa; /* Highlight the label */
    margin-right: 2px;
}

.planda-hierarchy-line .h-separator {
    color: #999;
    font-weight: 300;
    margin: 0 8px; /* Spacing for the em-dash */
}

/* Style the terms within the hierarchy line using a lighter pill style */
.planda-hierarchy-line .planda-term-pill {
	color: #333; 
	background-color: #e6f7ff; 
	padding: 1px 5px; 
	border-radius: 3px; 
	margin-right: 3px; 
	display: inline-block; 
	font-size: 0.95em; 
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.planda-hierarchy-line .planda-term-pill:hover {
	background-color: #00568c;
	color: #ffffff;
}

/* -------------------------------------------------------------------------------- */
/* ADJUSTMENTS TO MAIN TAXONOMY GRID */
/* -------------------------------------------------------------------------------- */

/* FIX: Ensure the taxonomy grid does not have the old full-width row CSS from before */
.planda-taxonomy-grid .full-width-row {
    grid-column: auto !important;
}

/* Styling for each individual taxonomy item (The "Rows") */
.planda-taxonomy-box {
	padding-top: 0px; 
	padding-bottom: 0px; 
	margin-bottom: 5px; 
	
	border-bottom: 1px dashed #e9e9e9; 
}

/* Column Divider (for the two-column layout) */
.planda-taxonomy-grid .planda-taxonomy-box:nth-child(odd) {
	border-right: 1px solid #e0e0e0; 
	padding-right: 20px; 
}

/* Cleanup for the last row(s) in the grid */
.planda-taxonomy-grid .planda-taxonomy-box:last-child,
.planda-taxonomy-grid .planda-taxonomy-box:nth-last-child(2) {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}


/* Styling for the LABEL (strong tag) and ICON */
.planda-taxonomy-box strong {
	color: #555; 
	font-weight: 600; 
	margin-right: 4px; 
	display: inline-block;
	min-width: 0px; 
}

/* Style the icon specifically (for spacing and color) */
.planda-taxonomy-box strong i {
	color: #4a90e2; /* Icon color */
	margin-right: 4px; /* Space between icon and text */
}

/* Styling for the TERM links (Pill shape) */
.planda-taxonomy-box a.planda-term {
	color: #0073aa; 
	background-color: #e6f7ff; 
	padding: 1px 5px; 
	border-radius: 3px; 
	margin-right: 3px; 
	margin-bottom: 3px; 
	display: inline-block; 
	font-size: 0.9em; 
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover effect for term links */
.planda-taxonomy-box a.planda-term:hover {
	color: #ffffff; /* White text on hover */
	background-color: #00568c; /* Darker blue background on hover */
	text-decoration: none;
}


/* -------------------------------------------------------------------------------- */
/* OVERLAID CLICKABLE BAR CALENDAR STYLING (New Gradient Style) */
/* -------------------------------------------------------------------------------- */

/* Use a new wrapper class to avoid conflicts with old styles */
.cpt-month-bar-wrapper {
	max-width: 700px; /* Matching your existing grid width */
	margin: 10px auto 25px auto;
	font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; /* Matching your existing font */
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: visible;
	background-color: transparent;
}

/* Container for the gradient and months to overlap */
.bar-container {
	position: relative;
	width: 100%;
	height: 30px;
	border: 1px solid #ccc;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
	background-color: #f0f0f0; /* Default non-active color */
}

.bar-gradient-background {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

.month-overlay-grid {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	z-index: 2;
}

.month-overlay-grid .month-cell {
	display: flex;
	justify-content: center;
	align-items: center;
	text-decoration: none;

	background-color: transparent;
	border-right: 1px solid rgba(0, 0, 0, 0.1); /* Separator lines */

	color: #222; /* Default text color (inactive) */
	font-size: 0.8em;
	font-weight: 600;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.month-overlay-grid .month-cell:last-child {
	border-right: none;
}

.month-overlay-grid .month-cell:hover {
	background-color: rgba(255, 255, 255, 0.3);
	color: #0073aa; /* Use your theme's primary link color for hover */
}

/* Title Styling */
.bar-title {
	display: block !important;
	font-size: 1.1em !important; /* Slightly larger title */
	color: #444 !important;
	font-weight: 600;
	text-align: center; /* Centered title like before */
	margin: 0 0 8px 0;
	padding-left: 0;
}


/* TEXT CONTRAST LOGIC (Crucial for visibility) */

.light-text .active-month-text {
	color: #fff !important;
	text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

.dark-text .active-month-text {
	color: #222 !important; /* Forces dark text over light background */
}

/* COLOR AND GRADIENT APPLICATION */

/* Define the main color (Bright Yellow/Gold: #FFD700) */
:root {
	--main-bar-color: #FFD700; 
	--main-bar-rgb: 255, 215, 0; /* RGB equivalent for transparent fade */
}

/* Apply the Gradient to the 'flowering-bar-wrapper' (as used in the PHP) */
.flowering-bar-wrapper .bar-gradient-background {
	background: linear-gradient(
		to right,
		rgba(var(--main-bar-rgb), 0) var(--bar-start),
		var(--main-bar-color) var(--bar-peak-start),
		var(--main-bar-color) var(--bar-peak-end),
		rgba(var(--main-bar-rgb), 0) var(--bar-end)
	);
}


/* -------------------------------------------------------------------------------- */
/* MOBILE VIEW (COMPACT STYLING) */
/* -------------------------------------------------------------------------------- */
@media (max-width: 768px) {
    
    /* Mobile Hierarchy Line */
    .planda-hierarchy-line {
        max-width: 100%;
        margin: 0 auto 10px auto;
        padding: 5px 10px;
        font-size: 0.8em; /* Reduced font size for better fit */
        text-align: left; /* Aligns content to the left */
    }
    .planda-hierarchy-line .h-separator {
        color: #999;
        font-weight: 300;
        margin: 0 4px; /* Reduced spacing */
        display: inline; /* Ensure separator shows */
    }
    .planda-hierarchy-line .h-label {
        display: inline; /* Crucial change: Make label inline with text to fit on one line */
        text-align: initial;
    }
    .planda-hierarchy-line .planda-term-pill {
        font-size: 1em; /* Keep term pills readable */
        padding: 0 3px;
    }
    
	.planda-taxonomy-grid {
		grid-template-columns: 1fr; /* Single column stack */
		gap: 8px; 
		padding: 8px 10px; 
		margin-top: 15px;
		max-width: 100%;
		font-size: 1em; 
	}
	
	/* Remove the vertical border when stacked in a single column */
	.planda-taxonomy-grid .planda-taxonomy-box:nth-child(odd) {
		border-right: none;
		padding-right: 0;
	}

	/* Make rows even tighter on mobile */
	.planda-taxonomy-box {
		margin-bottom: 5px; 
		padding-bottom: 3px; 
		padding-top: 3px;
	}

    /* Mobile Month Bar Overrides */
    .cpt-month-bar-wrapper {
        margin: 10px 0 25px 0;
        max-width: 100%;
    }

	/* Ensure title is visible on mobile */
	.bar-title {
		font-size: 0.9em !important;
		margin: 0 0 5px 0;
		text-align: left;
		padding-left: 10px; /* Give it some margin from the edge */
	}
	
	.month-overlay-grid .month-cell {
		font-size: 0.65em;
	}

    /* No specific color override is needed here, as the desktop .dark-text rule applies to mobile too. */

}
