/* ==========================================================================
   SeedsVision — News (archive, single, organisation cabinet, editor)
   ========================================================================== */

/* --------------------------------- Breadcrumbs --------------------------- */
.breadcrumbs {
	margin: 28px 0 8px;
}
.breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--color-fg-muted);
}
.breadcrumbs__item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.breadcrumbs__link:hover {
	color: var(--color-green);
	text-decoration: none;
}
.breadcrumbs__sep {
	display: inline-flex;
	color: #b5b5b5;
}
.breadcrumbs__sep .icon--chevron {
	width: 13px;
	height: 13px;
}
.breadcrumbs__current {
	color: var(--color-fg-muted);
}

/* --------------------------------- Archive ------------------------------- */
.news-archive,
.news-single {
	padding: 8px 0 80px;
}
.news-archive__title {
	margin: 16px 0 28px;
	font-size: 34px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.news-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
}
.news-filters__search {
	flex: 1 1 360px;
	max-width: 460px;
}

/* search-field is defined for the header; restyle for the page context */
.news-filters .search-field {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 14px;
	height: 48px;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
}
.news-filters .search-field__icon {
	color: var(--color-fg-muted);
	flex-shrink: 0;
}
.news-filters .search-field__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	outline: none;
	font-family: inherit;
	font-size: 15px;
	background: transparent;
	color: var(--color-fg);
}

/* Filter selects (pill dropdowns) */
.news-select {
	display: inline-flex;
}
.news-select__control {
	appearance: none;
	-webkit-appearance: none;
	height: 48px;
	padding: 0 40px 0 16px;
	font-family: inherit;
	font-size: 15px;
	color: var(--color-fg);
	background-color: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%23111111' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
	transition: border-color var(--transition);
}
.news-select__control:hover {
	border-color: #c9c9c9;
}
.news-select__control:focus {
	outline: none;
	border-color: var(--color-yellow);
	box-shadow: 0 0 0 1px var(--color-yellow);
}
.news-select--ghost .news-select__control {
	border-color: transparent;
	background-color: transparent;
	padding-right: 28px;
	background-position: right 4px center;
}
.news-select__control--mini {
	height: 36px;
	padding: 0 32px 0 12px;
	font-size: 14px;
	background-position: right 10px center;
}

.news-archive__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	border-top: 1px solid var(--color-border);
	padding-top: 18px;
}
.news-archive__count {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}
.org-news .news-archive__count {
	margin: 18px 0 8px;
	border-top: 1px solid var(--color-border);
	padding-top: 18px;
}

.news-archive__list {
	display: flex;
	flex-direction: column;
}

/* --------------------------------- News card ----------------------------- */
.news-card {
	padding: 26px 0;
	border-top: 1px solid var(--color-border);
}
.news-card:first-child {
	border-top: 0;
}
.news-card__byline {
	display: flex;
	align-items: center;
	gap: 12px;
}
.news-card__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
}
.news-card__byline-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.news-card__org {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-fg);
}
.news-card__meta {
	font-size: 12px;
	color: var(--color-fg-muted);
}
.news-card__title {
	margin: 14px 0 0;
	font-size: 20px;
	line-height: 1.35;
	font-weight: 700;
}
.news-card__title a:hover {
	color: var(--color-green);
	text-decoration: none;
}
.news-card__excerpt {
	margin: 10px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--color-fg-muted);
}

/* --------------------------------- Pager --------------------------------- */
.news-pager {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 22px;
	margin-top: 28px;
	padding-top: 22px;
	font-size: 14px;
	color: var(--color-fg-muted);
}
.news-pager__per-page-label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.news-pager__range {
	font-weight: 500;
	color: var(--color-fg);
}
.news-pager__nav {
	display: inline-flex;
	gap: 6px;
}
.news-pager__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--radius-sm);
	color: var(--color-fg);
	border: 1px solid transparent;
	transition: background var(--transition);
}
.news-pager__arrow:hover {
	background: var(--color-hover);
	text-decoration: none;
}
.news-pager__arrow.is-disabled {
	color: #c4c4c4;
	cursor: default;
}

/* --------------------------------- Empty --------------------------------- */
.news-empty {
	text-align: center;
	padding: 64px 0;
}
.news-empty__title {
	margin: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
}
.news-empty__text {
	margin: 0 auto 22px;
	max-width: 440px;
	color: var(--color-fg-muted);
}

/* --------------------------------- Single -------------------------------- */
.news-single__container {
	max-width: 820px;
}
.news-single__title {
	margin: 14px 0 24px;
	font-size: 34px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -0.01em;
}
.news-single__byline {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 28px;
}
.news-single__avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
}
.news-single__org {
	display: block;
	font-size: 15px;
	font-weight: 600;
}
.news-single__meta {
	display: block;
	font-size: 13px;
	color: var(--color-fg-muted);
}
.news-single__media {
	margin: 0 0 28px;
}
.news-single__image {
	width: 100%;
	height: auto;
	border-radius: var(--radius-sm);
}
.news-single__body {
	font-size: 16px;
	line-height: 1.75;
	color: #2b2b2b;
}
.news-single__body p {
	margin: 0 0 18px;
}
.news-single__body h2,
.news-single__body h3 {
	margin: 28px 0 12px;
	line-height: 1.3;
}
.news-single__body ul,
.news-single__body ol {
	margin: 0 0 18px;
	padding-left: 24px;
	list-style: disc;
}
.news-single__body ol {
	list-style: decimal;
}
.news-single__body li {
	margin: 0 0 8px;
	list-style: inherit;
}
.news-single__body img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius-sm);
}
.news-single__body a {
	color: var(--color-green);
	text-decoration: underline;
}

/* Related */
.news-related {
	max-width: 820px;
	margin-top: 56px;
	padding-top: 8px;
}
.news-related__title {
	margin: 0 0 6px;
	font-size: 24px;
	font-weight: 700;
}
.news-related__list {
	display: flex;
	flex-direction: column;
}

/* ==========================================================================
   Organisation cabinet — news management
   ========================================================================== */
.org-news__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}
.org-news__notice {
	margin: 4px 0 18px;
	padding: 12px 16px;
	border-radius: var(--radius-sm);
	background: #eaf5ee;
	color: #1c5236;
	font-size: 14px;
}
.org-news__notice--error {
	background: #fdecec;
	color: #a12626;
}

.org-news__list {
	display: flex;
	flex-direction: column;
}
.org-news-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 22px 0;
	border-bottom: 1px solid var(--color-border);
}
.org-news-row__meta {
	font-size: 12px;
	color: var(--color-fg-muted);
}
.org-news-row__title {
	margin: 8px 0 14px;
	font-size: 18px;
	line-height: 1.35;
	font-weight: 700;
}
.org-news-row__title a:hover {
	color: var(--color-green);
	text-decoration: none;
}
.org-news-row__actions {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}
.org-news-row__inline {
	margin: 0;
}

/* Status badges */
.news-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
}
.news-status__icon {
	display: inline-flex;
}
.news-status--published {
	color: #1f7a45;
}
.news-status--published .news-status__icon {
	color: #2aa35a;
}
.news-status--pending {
	color: #2f6df0;
}
.news-status--pending .news-status__icon {
	color: #3b7bf5;
}
.news-status--rejected {
	color: #d23b3b;
}
.news-status--rejected .news-status__icon {
	color: #e23a3a;
}
.news-status--draft,
.news-status--hidden {
	color: var(--color-fg-muted);
}
.news-status--draft .news-status__icon,
.news-status--hidden .news-status__icon {
	color: #9a9a9a;
}

/* Action (⋯) menu */
.org-news-menu {
	position: relative;
}
.org-news-menu__toggle {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: #fff;
	color: var(--color-fg);
	transition: background var(--transition);
}
.org-news-menu__toggle:hover {
	background: var(--color-hover);
}
.org-news-menu__panel {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	min-width: 180px;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-pop);
	padding: 6px;
	z-index: 20;
}
.org-news-menu__panel form {
	margin: 0;
}
.org-news-menu__item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 9px 12px;
	font-size: 14px;
	font-family: inherit;
	color: var(--color-fg);
	background: none;
	border: 0;
	border-radius: var(--radius-sm);
	cursor: pointer;
}
.org-news-menu__item:hover {
	background: var(--color-hover);
	text-decoration: none;
}
.org-news-menu__item--danger {
	color: #d23b3b;
}

/* ==========================================================================
   News editor form
   ========================================================================== */
.news-form-page {
	padding-bottom: 80px;
}
.news-form__section {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 40px;
	padding: 32px 0;
	border-top: 1px solid var(--color-border);
}
.news-form__section:first-of-type {
	border-top: 0;
}
.news-form__section-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}
.news-form__fields {
	max-width: 880px;
}
.news-form__field {
	margin-bottom: 22px;
}
.news-form__field:last-child {
	margin-bottom: 0;
}
.news-form__label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 500;
	color: #3a3a3a;
}
.news-form__req {
	color: #e23a3a;
}
.news-form__control {
	width: 100%;
	height: 48px;
	padding: 0 16px;
	font-family: inherit;
	font-size: 15px;
	color: var(--color-fg);
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	transition: border-color var(--transition), box-shadow var(--transition);
}
select.news-form__control {
	cursor: pointer;
}
/* Textareas need auto height and vertical padding — the base rule's fixed
   height/zero top-padding pushed the placeholder to the very top of the box. */
textarea.news-form__control {
	height: auto;
	min-height: 112px;
	padding: 12px 16px;
	line-height: 1.6;
	resize: vertical;
}
.news-form__control:focus {
	outline: none;
	border-color: var(--color-yellow);
	box-shadow: 0 0 0 1px var(--color-yellow);
}
.news-form__control.has-error {
	border-color: #e23a3a;
}

.news-form__actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 28px;
}

/* Rich-text editor */
.rte {
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: #fff;
}
.rte.has-error {
	border-color: #e23a3a;
}
.rte__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	padding: 8px 12px;
	background: #f7f7f7;
	border-bottom: 1px solid var(--color-border);
}
.rte__group {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.rte__group + .rte__group {
	padding-left: 18px;
	border-left: 1px solid #e0e0e0;
}
.rte__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 6px;
	font-size: 15px;
	color: #444;
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	transition: background var(--transition);
}
.rte__btn:hover {
	background: #ececec;
}
.rte__btn.is-active {
	background: #e3e3e3;
	color: var(--color-fg);
}
.rte__editor {
	min-height: 180px;
	padding: 16px 18px;
	font-size: 15px;
	line-height: 1.7;
	color: var(--color-fg);
	outline: none;
}
.rte__editor:focus {
	box-shadow: inset 0 0 0 2px rgba(244, 180, 0, 0.35);
}
.rte__editor p {
	margin: 0 0 14px;
}
.rte__editor img {
	max-width: 100%;
	height: auto;
}
/* Глобальний ресет знімає маркери зі всіх ul — у редакторі та в тексті
   матеріалу їх треба повернути, інакше кнопка списку не дає видимого
   результату і виглядає непрацюючою. */
.rte__editor ul,
.rte__editor ol {
	margin: 0 0 14px;
	padding-left: 24px;
	list-style: disc;
}
.rte__editor ol {
	list-style: decimal;
}
.rte__editor li {
	margin: 0 0 6px;
	list-style: inherit;
}
.rte__status {
	margin-left: auto;
	font-size: 13px;
	color: #777;
}
.rte.is-uploading .rte__toolbar {
	opacity: 0.6;
	pointer-events: none;
}
.rte.is-dragover {
	border-color: var(--color-green);
	box-shadow: inset 0 0 0 2px rgba(244, 180, 0, 0.35);
}

/* --------------------------------- Responsive ---------------------------- */
@media (max-width: 900px) {
	.news-form__section {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}
@media (max-width: 720px) {
	.news-archive__title,
	.news-single__title {
		font-size: 26px;
	}
	.news-filters__search {
		flex-basis: 100%;
		max-width: none;
	}
	.news-select {
		flex: 1 1 auto;
	}
	.news-select__control {
		width: 100%;
	}
	.org-news-row {
		flex-direction: column;
	}
	.org-news-row__actions {
		align-self: flex-end;
	}
	.news-pager {
		justify-content: space-between;
	}
	.news-form__actions {
		flex-wrap: wrap;
	}
	.news-form__actions .btn {
		flex: 1 1 auto;
	}
}
