/*
 Theme Name:   RSOCVIC Theme
 Theme URI:    https://rsocvic.com
 Description:  Child theme for the Ford Rallye Sport Owners Club of Victoria, built on Astra.
 Author:       RSOCVIC
 Author URI:   https://rsocvic.com
 Template:     astra
 Version:      1.1.2
 Text Domain:  rsocvic-theme
*/

/* ============================================
   RSOCVIC Custom Styles
   ============================================ */

:root {
	--rsocvic-primary: #0066B2;       /* Ford blue */
	--rsocvic-primary-dark: #004d87;  /* Ford blue hover */
	--rsocvic-secondary: #333333;     /* Charcoal */
	--rsocvic-accent: #ffffff;        /* White */
	--rsocvic-light-grey: #f3f4f6;   /* Alternating section backgrounds */
	--rsocvic-text-grey: #6b7280;    /* Secondary text */
}

/* ============================================
   Global Overrides — Astra + Starter Template
   ============================================ */

body {
	color: var(--rsocvic-secondary);
}

h1, h2, h3, h4, h5, h6 {
	color: var(--rsocvic-secondary);
}

a,
a:visited {
	color: var(--rsocvic-primary);
}

a:hover,
a:focus {
	color: var(--rsocvic-primary-dark);
}

/* ============================================
   Buttons — defaults only, Elementor overrides these
   ============================================ */

.wp-block-button__link,
.ast-button,
button[type="submit"] {
	background-color: var(--rsocvic-primary);
	color: var(--rsocvic-accent);
	border: none;
}

.wp-block-button__link:hover,
.ast-button:hover,
button[type="submit"]:hover {
	background-color: var(--rsocvic-primary-dark);
	color: var(--rsocvic-accent);
}

/* ============================================
   Header & Navigation — Ford Blue header
   ============================================ */

/* Solid Ford blue across all header states (normal, sticky, mobile) */
.ast-primary-header-bar,
.site-header,
#ast-fixed-header,
.ast-sticky-shrunk {
	background-color: var(--rsocvic-primary) !important;
}

/* Site title text colour (text-only logo fallback) */
.site-title a,
.site-title a:visited,
.site-title a:hover {
	color: var(--rsocvic-accent);
}

/* Nav links — white on blue */
.main-header-menu .menu-item a,
.main-header-menu .menu-item .menu-link,
.ast-header-break-point .main-navigation ul li a {
	color: var(--rsocvic-accent) !important;
}

.main-header-menu .menu-item a:hover,
.main-header-menu .menu-item .menu-link:hover,
.main-header-menu .menu-item.current-menu-item a,
.main-header-menu .menu-item.current-menu-item .menu-link {
	color: rgba(255, 255, 255, 0.72) !important;
}

/* Header CTA button — white outline on blue */
.ast-header-button-wrap a,
#ast-fixed-header .ast-header-button-wrap a {
	background-color: transparent !important;
	color: var(--rsocvic-accent) !important;
	border: 2px solid var(--rsocvic-accent) !important;
}

.ast-header-button-wrap a:hover,
#ast-fixed-header .ast-header-button-wrap a:hover {
	background-color: var(--rsocvic-accent) !important;
	color: var(--rsocvic-primary) !important;
}

/* Mobile hamburger toggle — white icon */
.ast-mobile-menu-buttons svg,
.ast-mobile-menu-buttons path {
	fill: var(--rsocvic-accent);
}
.menu-toggle,
.ast-mobile-menu-buttons {
	color: var(--rsocvic-accent);
}

/* ============================================
   Footer
   ============================================ */

.site-footer,
.site-above-footer-wrap {
	background-color: var(--rsocvic-secondary);
	color: var(--rsocvic-accent);
}

.site-footer a,
.site-above-footer-wrap a,
.site-above-footer-wrap a[href^="tel:"],
.site-above-footer-wrap a[href^="mailto:"] {
	color: var(--rsocvic-accent) !important;
}

.site-footer a:hover,
.site-above-footer-wrap a:hover {
	color: var(--rsocvic-primary) !important;
}

/* Above-footer 3-column layout spacing */
.site-above-footer-wrap .ast-builder-grid-row {
	gap: 2rem;
}

.site-above-footer-wrap .site-footer-focus-item {
	padding: 1.5rem 0;
	line-height: 1.8;
}

/* ============================================
   Hero Section — overlay, text readability, padding fix
   ============================================ */

/* Dark overlay for hero text readability */
[data-id="2cb5f4f"] {
	position: relative;
}

[data-id="2cb5f4f"]::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.45) 0%,
		rgba(0, 0, 0, 0.25) 100%
	);
	z-index: 1;
	pointer-events: none;
}

/* Elementor container 2cb5f4f is the hero. Its inner div has 270px top/bottom
   padding which leaves a large grey void below the background image.
   Reducing bottom padding to match the top keeps the hero vertically balanced. */
[data-id="2cb5f4f"] > .e-con-inner {
	padding-bottom: 60px;
	position: relative;
	z-index: 2;
}

[data-id="2cb5f4f"] h1,
[data-id="2cb5f4f"] h2,
[data-id="2cb5f4f"] p {
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Alternating Sections
   ============================================ */

.elementor-section:nth-child(even) {
	background-color: var(--rsocvic-light-grey);
}

/* ============================================
   Home Page — normalise section H2 scale

   Elementor section headings (About Our Club, Why Join Our Club?,
   etc.) were authored with different per-widget font sizes, giving a
   visually inconsistent hierarchy. Force a single scale site-wide for
   Elementor heading widgets at H2 level.
   ============================================ */

.elementor-widget-heading h2.elementor-heading-title,
h2.hfe-infocard-title {
	font-size: 2.5rem;
	line-height: 1.2;
}

@media (max-width: 768px) {
	.elementor-widget-heading h2.elementor-heading-title,
	h2.hfe-infocard-title {
		font-size: 1.875rem;
	}
}

/* ============================================
   Mobile grid stacking for inline-styled HTML widgets
   ============================================ */

/* Several Elementor HTML widgets (membership benefits, how-to-join,
   merch cards, CPS two-column) use inline grid-template-columns.
   Inline styles beat external CSS, so we override with !important on
   small viewports. Attribute-contains selector matches any widget with
   the pattern — safe because only these widgets use it. */
@media (max-width: 768px) {
	div[style*="grid-template-columns:repeat(3,1fr)"],
	div[style*="grid-template-columns:1fr 1.4fr"] {
		grid-template-columns: 1fr !important;
	}
}

/* ============================================
   The Events Calendar — Option A (Ford-blue hero + paper cards)
   Scoped to single event + events archive only.
   ============================================ */

:root {
	--rsocvic-events-bg: #f4f6f9;
	--rsocvic-events-card: #ffffff;
	--rsocvic-events-rule: #e3e8ef;
	--rsocvic-events-ink: #1a2332;
	--rsocvic-events-muted: #5c6775;
	--rsocvic-events-red: #d7252b;
	--rsocvic-events-shadow: 0 1px 2px rgba(10,20,40,.05), 0 8px 24px rgba(10,20,40,.06);
}

/* Page background: off-white instead of bright white behind grey Astra container */
body.single-tribe_events,
body.post-type-archive-tribe_events,
body.tribe_events-template,
body.events-archive {
	background-color: var(--rsocvic-events-bg) !important;
}

/* Kill the Astra "separate container" grey panel; make the content area
   sit directly on the off-white page so our cards are what the eye sees. */
body.single-tribe_events.ast-separate-container #primary,
body.post-type-archive-tribe_events.ast-separate-container #primary {
	background-color: transparent !important;
	padding-left: 0;
	padding-right: 0;
}

body.single-tribe_events.ast-separate-container .ast-article-single,
body.single-tribe_events.ast-separate-container .ast-article-post {
	background-color: var(--rsocvic-events-card) !important;
	border-radius: 4px;
	box-shadow: var(--rsocvic-events-shadow);
	padding: 40px 44px !important;
	border: none;
}

/* ---- Single event: Ford-blue hero banner ----
   TEC renders title + schedule + back-link inside #tribe-events-content.
   We pull them into a single hero band that bleeds to the card edges. */

body.single-tribe_events #tribe-events-content.tribe-events-single {
	position: relative;
	padding-top: 0;
	margin-top: 0;
}

body.single-tribe_events #tribe-events-content.tribe-events-single::before {
	content: "";
	display: block;
	position: absolute;
	top: 0;
	left: -44px;
	right: -44px;
	height: 220px;
	background: linear-gradient(135deg, var(--rsocvic-primary) 0%, var(--rsocvic-primary-dark) 100%);
	border-radius: 4px 4px 0 0;
	z-index: 0;
}

body.single-tribe_events #tribe-events-content.tribe-events-single::after {
	content: "";
	position: absolute;
	top: 0;
	right: -44px;
	width: 260px;
	height: 220px;
	background: var(--rsocvic-events-red);
	opacity: .10;
	transform: skewX(-14deg) translateX(60px);
	transform-origin: top right;
	z-index: 0;
	border-radius: 0 4px 0 0;
	pointer-events: none;
}

body.single-tribe_events .tribe-events-back,
body.single-tribe_events .tribe-events-single-event-title,
body.single-tribe_events .tribe-events-schedule,
body.single-tribe_events .tribe-events-event-image,
body.single-tribe_events .tribe-events-single-event-description,
body.single-tribe_events .tribe-events-single-section,
body.single-tribe_events .tribe-events-venue-map {
	position: relative;
	z-index: 2;
}

body.single-tribe_events .tribe-events-back {
	margin: 0 0 14px !important;
	padding-top: 28px;
}

body.single-tribe_events .tribe-events-back a {
	color: rgba(255,255,255,.85) !important;
	font-size: 12px;
	letter-spacing: 2px;
	text-transform: uppercase;
	font-weight: 700;
	text-decoration: none;
}

body.single-tribe_events .tribe-events-back a:hover {
	color: #fff !important;
}

body.single-tribe_events .tribe-events-single-event-title {
	color: #fff !important;
	font-size: 2.25rem !important;
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -0.5px;
	margin: 0 0 10px !important;
	max-width: 820px;
}

/* Schedule (date bar) beneath the title: lighter on the blue */
body.single-tribe_events .tribe-events-schedule {
	background: transparent !important;
	color: rgba(255,255,255,.92) !important;
	padding: 0 0 36px !important;
	margin: 0 !important;
	border: none !important;
}

body.single-tribe_events .tribe-events-schedule h2,
body.single-tribe_events .tribe-events-schedule .tribe-events-cost,
body.single-tribe_events .tribe-events-schedule span,
body.single-tribe_events .tribe-events-schedule div {
	color: rgba(255,255,255,.95) !important;
	font-size: 15px !important;
	font-weight: 500;
	margin: 0 !important;
	background: transparent !important;
}

/* TEC renders the cost inline with no separator — add a bullet spacer */
body.single-tribe_events .tribe-events-schedule .tribe-events-cost::before {
	content: " · ";
	margin: 0 6px 0 4px;
	opacity: .6;
}

body.single-tribe_events .tribe-events-event-image {
	margin-top: 24px !important;
}

/* ---- Featured image ---- */

body.single-tribe_events .tribe-events-event-image {
	margin: 0 0 24px;
	text-align: center;
	background: #fff;
	border: 1px solid var(--rsocvic-events-rule);
	padding: 12px;
	border-radius: 2px;
}

body.single-tribe_events .tribe-events-event-image img {
	max-width: 420px;
	width: 100%;
	height: auto;
	border-radius: 2px;
}

/* ---- Body content typography ---- */

body.single-tribe_events .tribe-events-single-event-description h2 {
	font-size: 1.65rem;
	margin: 36px 0 12px;
	padding-left: 14px;
	border-left: 4px solid var(--rsocvic-events-red);
	line-height: 1.2;
	color: var(--rsocvic-events-ink);
}

body.single-tribe_events .tribe-events-single-event-description h2:first-child {
	margin-top: 0;
}

body.single-tribe_events .tribe-events-single-event-description h3 {
	font-size: 1.125rem;
	margin: 22px 0 6px;
	color: var(--rsocvic-primary-dark);
	font-weight: 700;
}

body.single-tribe_events .tribe-events-single-event-description p,
body.single-tribe_events .tribe-events-single-event-description ul {
	color: var(--rsocvic-events-ink);
	line-height: 1.65;
}

/* PDF download button: ensure our Gutenberg button uses Ford blue and has weight */
body.single-tribe_events .wp-block-button__link {
	background-color: var(--rsocvic-primary) !important;
	color: #fff !important;
	padding: 14px 28px !important;
	border-radius: 2px !important;
	font-weight: 700;
	letter-spacing: .5px;
	box-shadow: 0 2px 0 var(--rsocvic-primary-dark);
	text-decoration: none;
}

body.single-tribe_events .wp-block-button__link:hover {
	background-color: var(--rsocvic-primary-dark) !important;
}

/* ---- Meta section (Details / Organisers / Venue) ---- */

body.single-tribe_events .tribe-events-single-section.tribe-events-event-meta {
	background: transparent !important;
	border: none !important;
	padding: 0 !important;
	margin-top: 40px !important;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
}

body.single-tribe_events .tribe-events-meta-group {
	background: var(--rsocvic-events-card);
	border: 1px solid var(--rsocvic-events-rule);
	border-top: 3px solid var(--rsocvic-events-red);
	padding: 22px 24px !important;
	border-radius: 2px;
	width: auto !important;
	float: none !important;
	margin: 0 !important;
	box-shadow: var(--rsocvic-events-shadow);
}

body.single-tribe_events .tribe-events-meta-group .tribe-events-single-section-title {
	font-size: 11px !important;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--rsocvic-events-muted) !important;
	margin: 0 0 12px !important;
	font-weight: 700;
	border: none !important;
	padding: 0 !important;
}

body.single-tribe_events .tribe-events-meta-group dt {
	font-weight: 700;
	color: var(--rsocvic-events-ink);
	font-size: 14px;
	margin-top: 10px;
}

body.single-tribe_events .tribe-events-meta-group dt:first-child {
	margin-top: 0;
}

body.single-tribe_events .tribe-events-meta-group dd {
	color: var(--rsocvic-events-muted);
	font-size: 14px;
	margin: 2px 0 0;
}

body.single-tribe_events .tribe-events-meta-group a {
	color: var(--rsocvic-primary);
	font-weight: 600;
	text-decoration: none;
}

body.single-tribe_events .tribe-events-meta-group a:hover {
	text-decoration: underline;
}

/* Venue map: push below the meta cards with a clear gap */
body.single-tribe_events .tribe-events-venue-map {
	margin-top: 24px !important;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: var(--rsocvic-events-shadow);
}

/* ---- Archive / list view: clean tiles on off-white ---- */

body.post-type-archive-tribe_events .tribe-events-calendar-list__event-row,
body.post-type-archive-tribe_events .tribe-events-calendar-list__event {
	background: var(--rsocvic-events-card) !important;
	border: 1px solid var(--rsocvic-events-rule) !important;
	border-radius: 4px;
	padding: 20px !important;
	margin-bottom: 18px !important;
	box-shadow: var(--rsocvic-events-shadow);
	transition: box-shadow .15s ease, transform .15s ease;
}

body.post-type-archive-tribe_events .tribe-events-calendar-list__event:hover {
	box-shadow: 0 1px 2px rgba(10,20,40,.06), 0 12px 32px rgba(10,20,40,.10);
	transform: translateY(-1px);
}

body.post-type-archive-tribe_events .tribe-events-calendar-list__event-date-tag {
	background: var(--rsocvic-primary) !important;
	color: #fff !important;
	border-radius: 4px !important;
	padding: 10px 14px !important;
}

body.post-type-archive-tribe_events .tribe-events-calendar-list__event-date-tag-datetime,
body.post-type-archive-tribe_events .tribe-events-calendar-list__event-date-tag span {
	color: #fff !important;
}

body.post-type-archive-tribe_events .tribe-events-calendar-list__event-title-link {
	color: var(--rsocvic-events-ink) !important;
	font-weight: 700;
}

body.post-type-archive-tribe_events .tribe-events-calendar-list__event-title-link:hover {
	color: var(--rsocvic-primary) !important;
}

body.post-type-archive-tribe_events .tribe-events-calendar-list__month-separator {
	color: var(--rsocvic-primary-dark) !important;
	font-weight: 700;
	border-bottom: 2px solid var(--rsocvic-events-rule);
	padding-bottom: 6px;
	margin-top: 24px;
}

/* ---- Mobile tuning ---- */

@media (max-width: 768px) {
	body.single-tribe_events.ast-separate-container .ast-article-single,
	body.single-tribe_events.ast-separate-container .ast-article-post {
		padding: 24px 18px !important;
	}
	body.single-tribe_events .entry-header {
		padding: 32px 18px 28px !important;
		margin: -24px -18px 24px !important;
	}
	body.single-tribe_events .entry-title {
		font-size: 1.65rem !important;
	}
	body.single-tribe_events .tribe-events-single-event-description h2 {
		font-size: 1.35rem;
	}
}

/* ============================================
   Gallery / album pages — clean off-white page,
   white content card, no Astra grey frame.
   Reuses the --rsocvic-events-* tokens so the
   look matches single-event pages.
   Scoped via :has() to FooGallery album/gallery pages only.
   ============================================ */

body:has(.foogallery-album-gallery-list),
body:has(.foogallery) {
	background-color: var(--rsocvic-events-bg) !important;
}

body:has(.foogallery-album-gallery-list).ast-separate-container #primary,
body:has(.foogallery).ast-separate-container #primary {
	background-color: transparent !important;
	padding-left: 0;
	padding-right: 0;
}

body:has(.foogallery-album-gallery-list).ast-separate-container .ast-article-single,
body:has(.foogallery-album-gallery-list).ast-separate-container .ast-article-post,
body:has(.foogallery).ast-separate-container .ast-article-single,
body:has(.foogallery).ast-separate-container .ast-article-post {
	background-color: var(--rsocvic-events-card) !important;
	border-radius: 4px;
	box-shadow: var(--rsocvic-events-shadow);
	padding: 40px 44px !important;
	border: none;
}

body:has(.foogallery-album-gallery-list) .entry-header,
body:has(.foogallery) .entry-header {
	border-bottom: 1px solid var(--rsocvic-events-rule);
	padding-bottom: 18px;
	margin-bottom: 28px;
}

body:has(.foogallery-album-gallery-list) .entry-title,
body:has(.foogallery) .entry-title {
	color: var(--rsocvic-events-ink);
	font-weight: 700;
	letter-spacing: -.01em;
}

@media (max-width: 768px) {
	body:has(.foogallery-album-gallery-list).ast-separate-container .ast-article-single,
	body:has(.foogallery-album-gallery-list).ast-separate-container .ast-article-post,
	body:has(.foogallery).ast-separate-container .ast-article-single,
	body:has(.foogallery).ast-separate-container .ast-article-post {
		padding: 24px 18px !important;
	}
}
