/* =========================================================
   Plugin compatibility — loaded after plugin styles.
   Targets: 12 Step Meeting List (TSML), The Events Calendar,
   GiveWP. Kept light: re-skin, don't fight plugin layout.
   ========================================================= */

/* ---------- 12 Step Meeting List (TSML) ---------- */

/* Legacy UI + TSML UI (React) share these hooks */
#tsml,
#tsml-ui,
.tsml-ui {
	font-family: var(--font-body);
	--tsml-primary: var(--navy-700);
}

#tsml .btn-primary,
#tsml-ui button[class*="btn-primary"],
.tsml-ui .btn-primary {
	background: var(--bronze-600) !important;
	border-color: var(--bronze-600) !important;
	border-radius: 999px;
}

#tsml a,
#tsml-ui a,
.tsml-ui a {
	color: var(--navy-500);
}

#tsml a:hover,
#tsml-ui a:hover,
.tsml-ui a:hover {
	color: var(--bronze-600);
}

#tsml .list-group-item,
#tsml table td,
#tsml table th {
	border-color: var(--navy-100);
}

#tsml .table-striped > tbody > tr:nth-of-type(odd),
#tsml-ui [class*="striped"] {
	background-color: rgba(227, 236, 243, 0.45);
}

#tsml input.form-control,
#tsml select.form-control,
#tsml-ui input,
#tsml-ui select {
	border-radius: 8px;
	border-color: var(--navy-100);
	font-family: var(--font-body);
}

/* Homepage "meetings today" shortcode output */
.meetings-today__list ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 12px 24px;
}
.meetings-today__list li {
	background: var(--white);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 14px 18px;
}
.meetings-today__list a {
	font-weight: 600;
	text-decoration: none;
}
.meetings-today__list time,
.meetings-today__list small {
	color: var(--ink-soft);
	font-size: 0.9rem;
}

/* ---------- The Events Calendar ---------- */

/* Modern TEC versions expose design tokens — override them at the root. */
:root {
	--tec-color-accent-primary: #1b3a55;
	--tec-color-accent-primary-hover: #2d5273;
	--tec-color-accent-primary-active: #122b40;
	--tec-color-button-primary: #a4772f;
	--tec-color-button-primary-hover: #b8893c;
	--tec-color-button-primary-active: #a4772f;
	--tec-color-link-primary: #1b3a55;
	--tec-color-link-accent: #a4772f;
	--tec-color-link-accent-hover: #b8893c;
	--tec-color-text-events-title: #1b3a55;
	--tec-color-text-event-title: #1b3a55;
	--tec-font-family-sans-serif: "Public Sans", -apple-system, "Segoe UI", sans-serif;
	--tec-font-family-base: "Public Sans", -apple-system, "Segoe UI", sans-serif;
	--tec-color-background-events: transparent;
}

.tribe-events,
.tribe-common {
	font-family: var(--font-body) !important;
}

/* Headings — TEC titles use h1 through h8 utility classes depending on view/breakpoint */
.tribe-common .tribe-common-h1,
.tribe-common .tribe-common-h2,
.tribe-common .tribe-common-h3,
.tribe-common .tribe-common-h4,
.tribe-common .tribe-common-h5,
.tribe-common .tribe-common-h6,
.tribe-common .tribe-common-h7,
.tribe-common .tribe-common-h8 {
	font-family: var(--font-display) !important;
	color: var(--navy-700);
}

/* Event title links */
.tribe-events .tribe-events-calendar-list__event-title-link,
.tribe-events .tribe-events-calendar-day__event-title-link,
.tribe-events .tribe-events-calendar-month__calendar-event-title-link,
.tribe-common a.tribe-common-anchor-thin {
	color: var(--navy-700);
	text-decoration: none;
}
.tribe-events .tribe-events-calendar-list__event-title-link:hover,
.tribe-events .tribe-events-calendar-day__event-title-link:hover,
.tribe-events .tribe-events-calendar-month__calendar-event-title-link:hover,
.tribe-common a.tribe-common-anchor-thin:hover {
	color: var(--bronze-600);
}

/* Find Events button — belt and suspenders on top of the tokens */
.tribe-common .tribe-common-c-btn,
.tribe-common a.tribe-common-c-btn,
.tribe-events .tribe-events-c-search__button {
	background-color: var(--bronze-600) !important;
	border-radius: 999px !important;
	font-family: var(--font-body) !important;
	font-weight: 600;
}
.tribe-common .tribe-common-c-btn:hover,
.tribe-common a.tribe-common-c-btn:hover,
.tribe-events .tribe-events-c-search__button:hover {
	background-color: var(--bronze-500) !important;
}

/* Date markers (the stacked SEP / 19 boxes) */
.tribe-events .tribe-events-calendar-list__event-date-tag-datetime {
	background: var(--navy-100);
	border-radius: var(--radius);
	padding: 8px 6px;
}
.tribe-events .tribe-events-calendar-list__event-date-tag-month {
	color: var(--bronze-600);
	font-weight: 700;
	letter-spacing: 0.08em;
}
.tribe-events .tribe-events-calendar-list__event-date-tag-daynum {
	font-family: var(--font-display) !important;
	color: var(--navy-700);
}

/* Search input + view switcher */
.tribe-common .tribe-common-form-control-text__input,
.tribe-events .tribe-events-c-search__input {
	font-family: var(--font-body) !important;
	border-radius: 8px;
}
.tribe-events .tribe-events-c-view-selector__list-item--active .tribe-events-c-view-selector__list-item-link,
.tribe-events .tribe-events-header__events-bar {
	border-color: var(--navy-100);
}

/* Month view: today highlight + featured dots pick up the accent token automatically */
.tribe-events .datepicker .day.current,
.tribe-events .datepicker .day.current:hover {
	background: var(--navy-700);
}

/* Single event view */
.tribe-events-single .tribe-events-schedule,
.tribe-events-single-event-title {
	font-family: var(--font-display) !important;
	color: var(--navy-700);
}

/* ---------- GiveWP ---------- */

.give-form .give-btn,
.give-btn {
	background: var(--bronze-600) !important;
	border-color: var(--bronze-600) !important;
	border-radius: 999px !important;
	font-family: var(--font-body) !important;
	font-weight: 600;
}
.give-form .give-btn:hover,
.give-btn:hover {
	background: var(--bronze-500) !important;
	border-color: var(--bronze-500) !important;
}
.give-form input[type="text"],
.give-form input[type="email"],
.give-form input[type="tel"],
.give-form select {
	border-radius: 8px;
	border-color: var(--navy-100);
	font-family: var(--font-body);
}
.give-form legend,
.give-form .give-title {
	font-family: var(--font-display);
	color: var(--navy-700);
}

/* [tsml_next_meetings] renders a table — style rows as cards */
.meetings-today__list table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0 10px;
	margin: 0;
}
.meetings-today__list thead th {
	background: transparent;
	border: 0;
	padding: 0 18px 2px;
	text-align: left;
	font-family: var(--font-body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--bronze-600);
}
.meetings-today__list tbody tr {
	background: var(--white);
	box-shadow: var(--shadow);
}
.meetings-today__list tbody td {
	padding: 15px 18px;
	border: 0;
	vertical-align: middle;
	color: var(--ink-soft);
}
.meetings-today__list tbody td:first-child {
	border-radius: var(--radius) 0 0 var(--radius);
	white-space: nowrap;
	font-weight: 600;
	color: var(--bronze-600);
	width: 1%;
}
.meetings-today__list tbody td:last-child {
	border-radius: 0 var(--radius) var(--radius) 0;
}
.meetings-today__list tbody a {
	font-weight: 600;
	text-decoration: none;
	color: var(--navy-700);
}
.meetings-today__list tbody a:hover { color: var(--bronze-600); }

@media (max-width: 640px) {
	.meetings-today__list thead { display: none; }
	.meetings-today__list tbody td { display: block; padding: 3px 18px; }
	.meetings-today__list tbody td:empty { display: none; }
	.meetings-today__list tbody td:first-child { padding-top: 14px; border-radius: var(--radius) var(--radius) 0 0; width: auto; }
	.meetings-today__list tbody td:last-child { padding-bottom: 14px; border-radius: 0 0 var(--radius) var(--radius); }
}

/* ---------- Jetpack Blog Subscriptions widget ---------- */
/* Jetpack wraps the field and button in their own <p> tags — flatten that. */

.newsletter__signup .jetpack_subscription_widget form,
.newsletter__signup .wp-block-jetpack-subscriptions form {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: stretch;
}
.newsletter__signup .jetpack_subscription_widget form p,
.newsletter__signup .jetpack_subscription_widget #subscribe-email,
.newsletter__signup .jetpack_subscription_widget #subscribe-submit {
	margin: 0;
	padding: 0;
}
.newsletter__signup .jetpack_subscription_widget #subscribe-email {
	flex: 1 1 220px;
	min-width: 0;
}
.newsletter__signup .jetpack_subscription_widget #subscribe-email input,
.newsletter__signup .wp-block-jetpack-subscriptions input[type="email"] {
	width: 100% !important;
	font: inherit;
	padding: 11px 16px !important;
	border: 1.5px solid rgba(27, 58, 85, 0.25) !important;
	border-radius: 999px !important;
	background: var(--white);
	color: var(--ink);
	box-sizing: border-box;
}
.newsletter__signup .jetpack_subscription_widget #subscribe-email input:focus {
	border-color: var(--navy-500) !important;
	outline: none;
}
.newsletter__signup .jetpack_subscription_widget button[type="submit"],
.newsletter__signup .jetpack_subscription_widget input[type="submit"],
.newsletter__signup .wp-block-jetpack-subscriptions button {
	font-family: var(--font-body) !important;
	font-weight: 600;
	font-size: 1rem !important;
	padding: 11px 24px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--bronze-600) !important;
	color: var(--white) !important;
	cursor: pointer;
}
.newsletter__signup .jetpack_subscription_widget button[type="submit"]:hover,
.newsletter__signup .jetpack_subscription_widget input[type="submit"]:hover {
	background: var(--bronze-500) !important;
}

/* Intro text ("Enter your email address…") */
.newsletter__signup .jetpack_subscription_widget #subscribe-text p {
	margin: 0 0 12px;
	font-size: 0.95rem;
	color: var(--ink-soft);
}

/* Success / error notices */
.newsletter__signup .jetpack_subscription_widget .success,
.newsletter__signup .jetpack_subscription_widget #subscribe-blog .success {
	background: var(--navy-100);
	border-left: 3px solid var(--bronze-500);
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: 12px 16px;
	font-size: 0.95rem;
	color: var(--ink);
}
.newsletter__signup .jetpack_subscription_widget .error {
	background: #fbeeee;
	border-left: 3px solid #b23a3a;
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: 12px 16px;
	font-size: 0.95rem;
}
