/*
 * ANIA – The Events Calendar V2 compatibility styles
 * ==================================================
 *
 * Reproduces the V1 visual design on top of V2 markup. Loaded only on
 * TEC pages by lib/tec-v2-compat.php (after the V2 base stylesheet so
 * these rules win).
 *
 * Sections:
 *   1. Subscribe-links: hide V2 dropdown chrome, style 3-button stack
 *   2. Month grid: pastel event blocks, coloured titles
 *   3. List view: V1 2-col card recreation
 *   4. Day view: same colour treatment
 *   5. Pro Week view: pastel event blocks
 *   6. Category legend (optional)
 *   7. Top-level archive layout (page title, prev/next nav, bar)
 *   8. Misc / overrides for built-in V2 category-color picker
 */


/* =====================================================================
 * 1. SUBSCRIBE LINKS — re-apply V1 theme design over TEC 6.x defaults
 * =====================================================================
 *
 * Two things changed in TEC 6.x that broke the legacy button design:
 *
 *   (a) V2 dropped the `<div id="tribe-events">` wrapper on single
 *       event pages. The theme's main stylesheet uses
 *       `#tribe-events .tribe-events-button { ... }` which depended
 *       on that wrapper — now those rules silently no-op.
 *
 *   (b) TEC 6.x ships its OWN rules for `.tribe-events-cal-links a`,
 *       including an inline data:image/svg+xml download icon and a
 *       `padding-left: var(--tec-spacer-7)` reset that overrides the
 *       theme's `padding-left: 30px`.
 *
 * To restore the V1 look without touching the theme or the plugin we
 * re-state the theme's rules here with:
 *   - Selectors that don't require the missing #tribe-events wrapper.
 *   - !important on the background+padding to win against TEC's
 *     class-selector rules.
 *
 * The PNG icon path (../img/download-copie-3.png) is relative to THIS
 * stylesheet's location (themes/ania/assets/css/tec-v2-compat.css), so
 * it resolves to themes/ania/assets/img/download-copie-3.png — the
 * same file the theme's main stylesheet uses.
 */

/* Hide the V2 dropdown chrome in case our override is bypassed. */
.tribe-events .tribe-events-c-subscribe-dropdown__container {
	display: none !important;
}

/* === Button visual (all variants) === */
.tribe-events-cal-links .tribe-events-button,
.tribe-events-cal-links a.tribe-events-button,
.tribe-events-cal-links a.tribe-events-ical,
.tribe-events-cal-links a.tribe-events-gcal {
	margin-bottom: 0;
	background: #193A84 url(../img/download-copie-3.png) no-repeat 5px 50% !important;
	padding: 10px 10px 10px 30px !important;
	border-radius: 5px;
	text-transform: none;
	font-family: 'omneslight', 'Source Sans Pro', sans-serif !important;
	font-size: 15px;
	font-style: normal;
	color: #ffffff !important;
	text-decoration: none !important;
	clear: both;
	margin-right: 10px;
	line-height: 1.2;
	border: 0;
}

.tribe-events-cal-links .tribe-events-button:hover,
.tribe-events-cal-links .tribe-events-button:focus,
.tribe-events-cal-links a.tribe-events-button:hover,
.tribe-events-cal-links a.tribe-events-button:focus,
.tribe-events-cal-links a.tribe-events-ical:hover,
.tribe-events-cal-links a.tribe-events-gcal:hover {
	background-color: #0055AF !important;
	background-image: url(../img/download-copie-3.png) !important;
	background-repeat: no-repeat !important;
	background-position: 5px 50% !important;
	color: #ffffff !important;
}

/* === Sidebar variant (.aside) — stack vertical, divider below === */
.single-tribe_events .aside .tribe-events-cal-links {
	padding-bottom: 25px;
	border-bottom: solid 1px #193A84;
	margin-bottom: 10px;
	text-align: left;
}

.single-tribe_events .aside .tribe-events-cal-links h2 {
	font-size: 14px;
	font-family: 'omnessemibold', 'Source Sans Pro', sans-serif !important;
	font-weight: 600;
	margin-top: -2px;
	margin-bottom: 18px;
	color: inherit;
	text-transform: none;
}

.single-tribe_events .aside .tribe-events-cal-links .tribe-events-button,
.single-tribe_events .aside .tribe-events-cal-links a.tribe-events-button {
	clear: both;
	float: none;
	display: table !important;
	margin-top: 11px;
}

/* === Right-content variant (in-article) — centered, bigger heading === */
.single-tribe_events .right-content .tribe-events-cal-links {
	text-align: center;
}

.single-tribe_events .right-content .tribe-events-cal-links h2 {
	font-size: 18px;
	color: #193A84;
	font-family: 'omnessemibold', 'Source Sans Pro', sans-serif !important;
	font-weight: 600;
	text-transform: none;
}

.single-tribe_events .right-content .tribe-events-cal-links .tribe-events-button,
.single-tribe_events .right-content .tribe-events-cal-links a.tribe-events-button {
	display: inline-block;
	margin-left: 4px;
	margin-right: 4px !important;
	margin-top: 7px;
	margin-bottom: 16px !important;
}

/* === Neutralise TEC 6.x competing rules ===
 * TEC 6.x adds:
 *   .tribe-events-cal-links a { background: url(data:image/svg+xml...); padding-left: var(--tec-spacer-7); ... }
 * Our !important rules above already win on background-image. Reset
 * the custom-property fallback for padding-left explicitly so any
 * future TEC update that scopes its rule differently still loses. */
.tribe-events-cal-links a.tribe-events-button {
	--tec-spacer-7: 30px;
}


/* =====================================================================
 * 1b. FOOTER NAV — restore side-by-side layout (prev | retour | next)
 * =====================================================================
 *
 * Old TEC core (tribe-events-skeleton.pcss) shipped:
 *
 *   #tribe-events-footer .tribe-events-sub-nav li {
 *       display: inline-block;
 *       float: left;
 *       vertical-align: middle;
 *   }
 *
 * The theme's CSS only set `width: 36%` / `28%` on each <li>, relying
 * on TEC's float to put them next to each other. TEC 6.x dropped those
 * rules entirely, so the <li>s collapse back to block-level and stack
 * vertically.
 *
 * Fix: make the <ul> a flex container. The theme's own `display: flex`
 * on each <li> (for vertical centering of inner content) is untouched.
 */
#tribe-events-footer ul.tribe-events-sub-nav,
.single-tribe_events #tribe-events-footer ul.tribe-events-sub-nav {
	display: -webkit-flex !important;
	display: flex !important;
	-webkit-flex-wrap: wrap;
	flex-wrap: wrap;
	-webkit-justify-content: center;
	justify-content: center;
	list-style: none !important;
	margin: 0 0 20px !important;
	padding: 0 !important;
	line-height: normal;
	overflow: visible;
}


/* =====================================================================
 * 2. MONTH GRID — pastel event blocks with category-coloured title
 * ===================================================================== */

/* Single-day event block (.tribe-events-calendar-month__calendar-event)
 * receives its background inline from the PHP override. Strip the V2
 * default border / padding so the colour reads cleanly. */
.tribe-events-calendar-month__calendar-event {
	border: 0 !important;
	border-radius: 3px;
	padding: 4px 8px;
	margin-bottom: 4px;
}

.tribe-events-calendar-month__calendar-event-title {
	margin: 0;
	font-size: 13px;
	line-height: 1.2;
	font-weight: 600;
}

.tribe-events-calendar-month__calendar-event-title-link {
	text-decoration: none !important;
}

.tribe-events-calendar-month__calendar-event-title-link:hover {
	text-decoration: underline !important;
}

/* V2 prints a "date" line above the title; in V1 it wasn't shown
 * (the title was the only content). Hide it inside the grid to match. */
.tribe-events-calendar-month__calendar-event-datetime-wrapper {
	display: none;
}

/* Multiday bar — keep the V2 bar geometry but apply our colour. */
.tribe-events-calendar-month__multiday-event-bar {
	border: 0 !important;
	border-radius: 3px;
	padding: 4px 8px;
}

.tribe-events-calendar-month__multiday-event-bar-title {
	font-size: 13px;
	font-weight: 600;
}

/* Day cell number — in V1 a single-event day got tinted. Reproduce
 * subtly via CSS for cells that contain exactly one event. */
.tribe-events-calendar-month__day--has-event .tribe-events-calendar-month__day-date {
	font-weight: 700;
}


/* =====================================================================
 * 3. LIST VIEW — V1 2-col card
 * ===================================================================== */

.ania-tec-list-event-row {
	margin-bottom: 1.5em;
}

.ania-tec-list-event-card {
	border-radius: 6px;
	padding: 1.5em;
	margin: 0;
}

.ania-tec-list-event-titlelink {
	text-decoration: none !important;
}

.ania-tec-list-event-card .title {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 0.4em;
}

.ania-tec-list-event-card .organizer {
	font-size: 14px;
	font-style: italic;
	margin: 0 0 0.4em;
	color: #444;
}

.ania-tec-list-event-card .date {
	font-size: 13px;
	color: #666;
	margin: 0 0 1em;
}

.ania-tec-list-event-card .row {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	margin: 0;
}

.ania-tec-list-event-card .col-sm-6 {
	flex: 1 1 calc(50% - 0.5em);
	min-width: 0;
}

.ania-tec-list-event-card .left-box .img {
	margin: 0;
}

.ania-tec-list-event-card .left-box .img img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 3px;
}

.ania-tec-list-event-card .desc-img {
	display: block;
	margin: 0.5em 0 0;
	padding: 0.35em 0.75em;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	border-radius: 3px;
}

.ania-tec-list-event-card .excerpt {
	font-size: 14px;
	line-height: 1.5;
	color: #333;
	margin-bottom: 1em;
}

.ania-tec-list-event-card .read-article-div {
	margin-top: 0.75em;
}

.ania-tec-list-event-card .btn-ania-default {
	display: inline-block;
	padding: 0.6em 1.2em;
	background: #193a84;
	color: #ffffff !important;
	border-radius: 3px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	transition: background-color .15s ease;
}

.ania-tec-list-event-card .btn-ania-default:hover,
.ania-tec-list-event-card .btn-ania-default:focus {
	background: #0f2860;
}

/* Hide V2's default "details" section so we don't duplicate content
 * (our override provides its own title/date/excerpt block). */
.tribe-events-calendar-list__event-details {
	display: none;
}

.tribe-events-calendar-list__event-featured-image-wrapper {
	display: none;
}

@media (max-width: 640px) {
	.ania-tec-list-event-card .col-sm-6 {
		flex: 1 1 100%;
	}
}


/* =====================================================================
 * 4. DAY VIEW — colour treatment only (layout from V2 default)
 * ===================================================================== */

.tribe-events-calendar-day__event {
	border-radius: 6px;
	padding: 1em 1.25em;
	margin-bottom: 1em;
	border: 0 !important;
}

.tribe-events-calendar-day__event-title a {
	text-decoration: none !important;
	font-weight: 700;
}


/* =====================================================================
 * 5. PRO WEEK VIEW — pastel event blocks
 * ===================================================================== */

.tribe-events-pro-week-grid__event {
	border: 0 !important;
	border-radius: 3px;
}

.tribe-events-pro-week-grid__event-link {
	text-decoration: none !important;
}

.tribe-events-pro-week-grid__event-title {
	font-size: 13px;
	font-weight: 700;
}


/* =====================================================================
 * 6. CATEGORY LEGEND (optional, opt-in via lib/tec-v2-compat.php)
 * ===================================================================== */

.ania-tec-v2-category-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	margin: 0 0 1.25em;
	padding: 0;
}

.ania-tec-v2-category-legend .item-term {
	margin: 0;
}

.ania-tec-v2-category-legend .inner-term {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-size: 13px;
}

.ania-tec-v2-category-legend .cat-color {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
}


/* =====================================================================
 * 7. TOP-LEVEL ARCHIVE LAYOUT
 * ===================================================================== */

.tribe-events-c-top-bar__nav-list-item--next,
.tribe-events-c-top-bar__nav-list-item--previous {
	font-weight: 600;
}

.tribe-events-header__title {
	font-size: 24px;
	font-weight: 700;
	color: #193a84;
}

/* Tighten the V2 events-bar so it doesn't tower over our content. */
.tribe-events-c-events-bar {
	margin-bottom: 1em;
}


/* =====================================================================
 * 8. HIDE V2 BUILT-IN CATEGORY-COLOR PICKER
 * =====================================================================
 *
 * TEC 6.x ships its own ACF-independent Category Colors feature. The
 * ANIA site already has a custom ACF-driven colour system. Hide the
 * built-in picker so the two systems don't show side-by-side.
 *
 * To USE the new built-in feature instead, comment this rule out and
 * remove the get_color_term-based PHP overrides. */

.tec-events-category-color-filter {
	display: none !important;
}


/* =====================================================================
 * 9. SINGLE EVENT PAGE — V1 layout is preserved by the (still working)
 *    tribe-events/single-event.php override, so we only patch the bits
 *    V2 still injects (the sidebar add-to-calendar block uses our
 *    overridden single-event-list.php from section 1 above).
 * ===================================================================== */

.tribe-events-single .ania-tec-subscribe {
	margin-top: 1.5em;
}
