/*
 * Public styles for the Data Culture Dataset shortcode.
 */

/* Keeps the shortcode layout readable inside normal WordPress page content. */
.dataculture-dataset-public {
	display: grid;
	gap: 20px;
}

/* Aligns public search controls while reusing theme search classes. */
.dataculture-dataset-search {
	display: flex;
	gap: 8px;
}

/* Lets the search box take available width. */
.dataculture-dataset-search input {
	flex: 1;
}

/* Lays out dataset result cards while deferring card styling to the theme. */
.dataculture-dataset-list {
	display: grid;
	gap: 16px;
}

/* Keeps taxonomy metadata visually secondary when no theme link markup exists. */
.dataculture-dataset-taxonomy {
	color: #475569;
	font-weight: 600;
	margin: 0 0 8px;
}

/* Groups tag chips with wrapping support. */
.dataculture-dataset-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 8px 0;
}

/* Formats detail metadata as a compact two-column list where space allows. */
.dataculture-dataset-details {
	display: grid;
	gap: 8px 16px;
	grid-template-columns: max-content 1fr;
}

/* Keeps detail labels visually distinct. */
.dataculture-dataset-details dt {
	font-weight: 700;
}

/* Removes default definition-list margin. */
.dataculture-dataset-details dd {
	margin: 0;
}

/* Groups public action links. */
.dataculture-dataset-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Keeps the suggestion container visually light while subsection boxes carry structure. */
.ps-panel {
	background: transparent;
	border: 0;
	padding: 0;
}

/* Frames each public suggestion subsection separately. */
.ps-fieldset {
	background: #fafafa;
	border: 1px solid #ddd;
	border-radius: 6px;
	margin: 1rem 0;
	padding: 1rem 1.25rem;
}

/* Keeps the notes/contact fieldsets aligned with the main suggestion sections. */
.ps-fieldset .ps-legend {
	padding: 0 0.25rem;
}

/* Gives public validation messages a visible error treatment. */
.dataculture-public-form-error {
	background: #fff5f5;
	border: 1px solid #d63638;
	border-radius: 4px;
	color: #8a2424;
	margin: 0 0 1rem;
	padding: 0.6rem 0.75rem;
}

/* Separates dynamically added public author rows. */
.dataculture-author-row {
	display: grid;
	gap: 0.5rem;
	grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
	margin-bottom: 0.5rem;
}

/* Matches suggestion author role dropdowns to existing suggestion inputs. */
.dataculture-author-role {
	border: 1px solid #ccc;
	border-radius: 4px;
	box-sizing: border-box;
	color: #222;
	font-family: inherit;
	font-size: 0.88rem;
	padding: 0.4em 0.6em;
	width: 100%;
}

/* Anchors the custom public tag dropdown under the input. */
.dataculture-tag-editor {
	position: relative;
}

/* Styles filtered official tag suggestions as a dropdown menu. */
.dataculture-tag-dropdown {
	background: #fff;
	border: 1px solid #8c8f94;
	border-radius: 0;
	box-shadow: none;
	box-sizing: border-box;
	left: 0;
	list-style: none;
	margin: 0;
	max-height: 220px;
	overflow-y: auto;
	padding: 0;
	position: absolute;
	right: auto;
	z-index: 20;
}

/* Keeps hidden dropdowns from occupying space. */
.dataculture-tag-dropdown[hidden] {
	display: none;
}

/* Styles each selectable official tag option. */
.dataculture-tag-dropdown-option {
	background: #fff;
	border: 0;
	box-sizing: border-box;
	color: #222;
	cursor: pointer;
	display: block;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.4;
	min-height: 24px;
	padding: 3px 12px;
	text-align: left;
	width: 100%;
}

/* Gives the add-new-tag option a distinct review-state color. */
.dataculture-tag-dropdown-option-new {
	background: #f6f7f7;
	color: #50575e;
	font-weight: 400;
}

/* Highlights dropdown options on hover. */
.dataculture-tag-dropdown-option:hover,
.dataculture-tag-dropdown-option-active {
	background: #3b65d8;
	color: #fff;
}

/* Keeps the add-new-tag hover distinct from official suggestions. */
.dataculture-tag-dropdown-option-new:hover,
.dataculture-tag-dropdown-option-new.dataculture-tag-dropdown-option-active {
	background: #597ee7;
	color: #fff;
}

/* Overrides theme list/button styles inside public tag dropdowns. */
.ps-panel .dataculture-tag-dropdown,
.sd-modal .dataculture-tag-dropdown {
	list-style: none;
	margin-left: 0;
	padding-left: 0;
}

/* Keeps dropdown rows visually aligned with native select options. */
.ps-panel .dataculture-tag-dropdown-option,
.sd-modal .dataculture-tag-dropdown-option {
	border-radius: 0;
	box-shadow: none;
	text-transform: none;
	text-decoration: none;
}

@media (max-width: 600px) {
	/* Stacks repeatable public author rows on narrow screens. */
	.dataculture-author-row {
		grid-template-columns: 1fr;
	}
}
