/* ==========================================================================
   Components: buttons, forms, modal, accordion, slider, cards, post cards.
   ========================================================================== */

/* Buttons ------------------------------------------------------------------ */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-3);
	min-height: 3rem;
	padding: var(--sp-3) var(--sp-4);
	color: var(--white);
	font-size: var(--fs-base);
	font-weight: 600;
	line-height: 1.1;
	text-align: center;
	background: var(--teal);
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.btn:hover {
	color: var(--white);
	background: var(--teal-900);
}

.btn svg {
	flex: 0 0 auto;
}

.btn--sm {
	min-height: 2.5rem;
	padding-block: var(--sp-2);
	font-size: var(--fs-sm);
}

.btn--lg {
	justify-content: space-between;
	gap: var(--sp-6);
	min-width: min(100%, 21rem);
	min-height: 4.5rem;
	padding: var(--sp-4) var(--sp-5);
	font-size: var(--fs-lg);
	font-weight: 500;
}

.btn--lg svg {
	width: 2rem;
	height: 2rem;
}

.btn--block {
	width: 100%;
}

.btn--soft {
	color: var(--teal);
	background: rgb(0 119 117 / 0.1);
	border-color: var(--white);
}

.btn--soft:hover {
	color: var(--teal-900);
	background: var(--white);
	border-color: var(--teal-900);
}

.btn--light {
	color: var(--teal);
	background: var(--white);
}

.btn--light:hover {
	color: var(--teal-900);
	background: var(--teal-50);
}

.btn--accent {
	color: var(--ink);
	background: var(--orange);
}

.btn--accent:hover {
	color: var(--ink);
	background: var(--orange-500);
}

.btn--ghost {
	color: var(--teal);
	background: transparent;
	border-color: var(--teal);
}

.btn--ghost:hover {
	color: var(--white);
	background: var(--teal);
}

/* Link with trailing chevron (view all / read more) */
.link-more {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-1);
	color: var(--orange);
	font-size: var(--fs-sm);
	font-weight: 700;
}

.link-more:hover {
	color: var(--teal);
}

/* Forms -------------------------------------------------------------------- */

.dr-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.dr-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--sp-4);
}

.dr-field {
	display: flex;
	flex-direction: column;
	gap: var(--sp-1);
	grid-column: 1 / -1;
}

.dr-field--half {
	grid-column: span 1;
}

@media (max-width: 539px) {
	.dr-field--half {
		grid-column: 1 / -1;
	}
}

.dr-field label {
	font-size: var(--fs-sm);
	font-weight: 600;
	color: var(--ink);
}

.dr-req {
	color: var(--error);
}

.dr-field.is-invalid input,
.dr-field.is-invalid select,
.dr-field.is-invalid textarea {
	background: rgb(235 4 4 / 0.06);
	border-color: rgb(235 4 4 / 0.5);
}

.dr-field__error {
	min-height: 0;
	color: var(--error);
	font-size: var(--fs-sm);
}

.dr-form__privacy {
	margin: var(--sp-4) 0;
	font-size: var(--fs-sm);
	color: var(--text);
}

.dr-form .btn {
	margin-top: var(--sp-4);
}

.dr-form__status {
	margin: var(--sp-3) 0 0;
	font-size: var(--fs-sm);
	font-weight: 600;
}

.dr-form__status.is-success { color: var(--success); }
.dr-form__status.is-error { color: var(--error); }
.dr-form.is-loading .btn { opacity: 0.6; pointer-events: none; }

.form-card {
	padding: var(--sp-5);
	background: var(--white);
	border-radius: var(--radius);
}

.search-form {
	position: relative;
	width: 100%;
	max-width: 34rem;
}

.search-form input {
	padding-right: 3rem;
}

.search-form button {
	position: absolute;
	top: 0;
	right: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	color: var(--teal);
	background: none;
	border: 0;
}

/* Modal (native <dialog>) ---------------------------------------------------- */

.modal {
	width: min(40rem, calc(100vw - 2rem));
	max-height: calc(100dvh - 2rem);
	padding: 0;
	overflow: auto;
	color: var(--text);
	background: var(--white);
	border: 0;
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
}

.modal::backdrop {
	background: rgb(0 0 0 / 0.55);
}

.modal__body {
	padding: var(--sp-6) var(--sp-5) var(--sp-5);
}

.modal__close {
	position: absolute;
	top: var(--sp-3);
	right: var(--sp-3);
	z-index: 2;
	display: inline-flex;
	padding: var(--sp-2);
	color: var(--teal);
	background: var(--white);
	border: 0;
	border-radius: 50%;
}

.modal--member {
	width: min(60rem, calc(100vw - 2rem));
}

/* Accordion ----------------------------------------------------------------- */

.accordion {
	display: flex;
	flex-direction: column;
	gap: var(--sp-4);
}

.accordion__item {
	background: var(--white);
	border: 1px solid var(--teal);
	border-radius: 4px;
	box-shadow: var(--shadow);
}

.accordion__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-4);
	padding: var(--sp-4);
	color: var(--teal);
	font-size: var(--fs-base);
	font-weight: 500;
	line-height: var(--lh-snug);
	cursor: pointer;
	list-style: none;
}

.accordion__q::-webkit-details-marker {
	display: none;
}

.accordion__q svg {
	flex: 0 0 auto;
	color: var(--teal);
	transition: transform var(--ease);
}

.accordion__item[open] .accordion__q svg {
	color: var(--white);
	background: var(--teal);
	border-radius: 4px;
	transform: rotate(180deg);
}

.accordion__a {
	margin: 0 var(--sp-2) var(--sp-2);
	padding: var(--sp-4);
	font-size: var(--fs-sm);
	font-weight: 400;
	background: var(--soft);
	border-radius: 4px;
}

/* Slider (scroll-snap, controlled by main.js) -------------------------------- */

.slider {
	position: relative;
}

.slider__track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.slider__track::-webkit-scrollbar {
	display: none;
}

.slider__slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
}

.slider__dots {
	display: flex;
	justify-content: center;
	gap: var(--sp-2);
	margin-top: var(--sp-4);
}

.slider__dot {
	width: 0.75rem;
	height: 0.75rem;
	padding: 0;
	background: var(--line);
	border: 2px solid transparent;
	border-radius: 50%;
	transition: background var(--ease), border-color var(--ease);
}

.slider__dot[aria-selected="true"] {
	background: var(--teal);
}

.slider__dot:hover {
	background: var(--white);
	border-color: var(--teal);
}

/* Chips & meta --------------------------------------------------------------- */

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2);
	margin: 0 0 var(--sp-3);
	padding: 0;
	list-style: none;
}

.chips a {
	display: inline-block;
	padding: 2px var(--sp-2);
	color: var(--teal);
	font-size: var(--fs-xs);
	background: var(--soft);
	border-radius: 4px;
}

.meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2) var(--sp-5);
	margin: 0 0 var(--sp-3);
	padding: 0;
	list-style: none;
	color: var(--muted);
	font-size: var(--fs-sm);
	font-weight: 600;
}

.meta li {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-1);
	color: var(--muted);
}

/* Post cards ------------------------------------------------------------------ */

.post-grid {
	display: grid;
	gap: var(--sp-6) var(--gap);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}

.post-card {
	display: flex;
	flex-direction: column;
	gap: var(--sp-4);
	padding: var(--sp-3);
	background: var(--white);
	border: 1px solid #e0e0e0;
	border-radius: var(--radius);
	box-shadow: 0 1px 6px rgb(0 0 0 / 0.08);
}

.post-card__media {
	display: block;
	aspect-ratio: 16 / 11;
	overflow: hidden;
	background: var(--teal-50);
	border-radius: var(--radius-sm);
}

.post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--ease);
}

.post-card:hover .post-card__media img {
	transform: scale(1.04);
}

.post-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 0 var(--sp-2) var(--sp-2);
}

.post-card__title {
	margin-bottom: var(--sp-2);
	font-size: var(--fs-h4);
	font-weight: 700;
	line-height: var(--lh-snug);
}

.post-card__title a {
	color: var(--orange);
}

.post-card--teal .post-card__title a {
	color: var(--teal);
}

.post-card__date {
	display: flex;
	align-items: center;
	gap: var(--sp-1);
	margin-bottom: var(--sp-3);
	color: var(--muted);
	font-size: var(--fs-xs);
	font-weight: 600;
}

.post-card .link-more {
	margin-top: auto;
}

.post-grid--list {
	grid-template-columns: 1fr;
}

.post-grid--list .post-card {
	padding: var(--sp-4);
}

.post-grid--list .post-card__media {
	aspect-ratio: 16 / 7;
}

/* Pagination -------------------------------------------------------------------- */

.pagination,
.navigation.pagination {
	margin-top: var(--sp-7);
}

.nav-links,
.pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--sp-2);
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding-inline: var(--sp-2);
	color: var(--teal);
	font-weight: 600;
	border: 1px solid var(--teal);
	border-radius: var(--radius-sm);
}

.page-numbers.current,
a.page-numbers:hover {
	color: var(--white);
	background: var(--teal);
}

.page-numbers.dots {
	border-color: transparent;
}

/* Section head (title + link) ---------------------------------------------------- */

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--sp-4);
	margin-bottom: var(--sp-5);
}

.section-head__title {
	margin: 0;
	font-size: var(--fs-h2);
	color: var(--orange);
}

.posts--teal .section-head__title,
.section-head__title.hl {
	color: var(--teal);
}

.empty {
	padding-block: var(--sp-6);
	color: var(--muted);
	text-align: center;
}

/* Outline button for dark backgrounds: white border, no fill */
.btn--outline-light,
.btn--outline-light:hover {
	color: var(--white);
	background: transparent;
	border-color: var(--white);
}

.btn--outline-light:hover {
	color: var(--teal);
	background: var(--white);
}

/* Slider: grab cursor and no snapping while a mouse drag is in progress */
.slider__track {
	cursor: grab;
}

.slider__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
	scroll-behavior: auto;
	user-select: none;
}
