/*
Theme Name: Ritmo
Theme URI: https://ritmo.parsports.ly
Author: Ritmo
Description: قالب ريتمو — موقع اشتراك الصالات والأنشطة الرياضية. قالب بلوكات (Block Theme) بهوية تطبيق ريتمو، قابل للتعديل بالكامل من محرر الموقع، مع أقسام جاهزة وتصميم مخصص للهاتف.
Version: 1.2.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ritmo
Tags: rtl-language-support, full-site-editing, block-patterns, one-column, custom-colors
*/

/* =========================================================
   Base
   ========================================================= */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.wp-site-blocks > * + * { margin-block-start: 0; }
.ritmo-main > * { margin-block-start: 0 !important; }
img { max-width: 100%; height: auto; }
:target { scroll-margin-top: 90px; }
.ritmo-red { color: var(--wp--preset--color--red); }

.ritmo-section { padding-top: 96px; padding-bottom: 96px; }
.ritmo-section.is-tight { padding-top: 0; }

.is-style-stripes {
	background-image: repeating-linear-gradient(-55deg, transparent 0 34px, rgba(255, 255, 255, 0.045) 34px 68px);
}

/* Outline buttons (app-style secondary) */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent !important; border: 1.5px solid currentColor; color: inherit;
	padding-top: 13.5px; padding-bottom: 13.5px;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: rgba(127, 127, 127, 0.08) !important; }

/* =========================================================
   Header (sticky)
   ========================================================= */
header.wp-block-template-part { position: sticky; top: 0; z-index: 50; }
.admin-bar header.wp-block-template-part { top: 32px; }
.ritmo-header-bar {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding-top: 12px; padding-bottom: 12px;
	background: rgba(255, 255, 255, 0.96) !important;
	backdrop-filter: saturate(160%) blur(10px);
}
.ritmo-logo img { width: 140px; display: block; }
.ritmo-logo, .ritmo-logo figure { margin: 0; }
.ritmo-header-bar .wp-block-navigation { font-weight: 500; gap: 26px; }
.ritmo-header-bar .wp-block-navigation a:hover { color: var(--wp--preset--color--red); }

.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--navy) !important;
	color: #fff !important; padding: 28px 24px !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 24px; font-weight: 700; padding: 10px 0 !important; color: #fff !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 6px !important; align-items: flex-start !important; }
.wp-block-navigation__responsive-container-close svg, .wp-block-navigation__responsive-container-open svg { width: 30px; height: 30px; }

/* =========================================================
   Text helpers
   ========================================================= */
.ritmo-eyebrow {
	font-family: var(--wp--preset--font-family--inter);
	font-size: 13px; letter-spacing: 0.3em; color: var(--wp--preset--color--mist);
	direction: ltr; unicode-bidi: isolate;
}
[dir="rtl"] .ritmo-eyebrow { text-align: right; }

.ritmo-kicker { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--wp--preset--color--red); }
.ritmo-kicker::before { content: ""; width: 28px; height: 3px; background: currentColor; flex: none; }

.ritmo-lead { font-size: 19px; max-width: 580px; }
.has-white-color .ritmo-lead { color: var(--wp--preset--color--mist); }
.ritmo-muted { color: var(--wp--preset--color--muted); font-size: 18px; }

/* =========================================================
   Hero — dark, photo-led (like the app splash)
   ========================================================= */
.ritmo-hero { padding-top: 72px; padding-bottom: 88px; overflow: hidden; position: relative; }
.ritmo-hero h1 { margin-top: 10px; }
.ritmo-stats {
	display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 24px; margin-top: 32px !important; max-width: 540px;
}
.ritmo-stats > * { margin: 0 !important; }
.ritmo-stats p { margin: 0; }
.ritmo-stat-num { font-weight: 700; font-size: 28px; line-height: 1.3; font-family: var(--wp--preset--font-family--inter), var(--wp--preset--font-family--plex); }
.ritmo-stat-label { color: #9AA2AC; font-size: 14px; }

.ritmo-hero-visual { position: relative; }
.ritmo-hero-visual::before {
	content: ""; position: absolute; width: 90px; top: -4%; bottom: -4%; inset-inline-start: 4%;
	background: var(--wp--preset--color--red); transform: skewX(-20deg); z-index: 0;
}
.ritmo-hero-photo { position: relative; z-index: 1; margin: 0 !important; }
.ritmo-hero-photo img {
	width: 100%; aspect-ratio: 4 / 4.6; object-fit: cover; object-position: center 20%;
	border-radius: 28px; box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55); display: block;
}
.ritmo-hero-badge {
	position: absolute; z-index: 2; bottom: 28px; inset-inline-end: -14px;
	background: #fff; color: var(--wp--preset--color--navy);
	border-radius: 16px; padding: 14px 18px; font-size: 14px; line-height: 1.5;
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35); margin: 0 !important;
	border-inline-start: 4px solid var(--wp--preset--color--red);
}
.ritmo-hero-badge strong { font-size: 16px; }

/* =========================================================
   Activities
   ========================================================= */
.ritmo-sports { gap: 18px !important; margin-top: 36px !important; }
.ritmo-sport {
	background: #fff; border: 1px solid var(--wp--preset--color--line);
	border-radius: 20px; overflow: hidden; padding-bottom: 18px;
	transition: transform .25s ease, box-shadow .25s ease;
}
.ritmo-sport:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(11, 16, 20, 0.12); }
.ritmo-sport > * { margin-inline: 18px !important; }
.ritmo-sport .wp-block-image { margin: 0 0 14px !important; }
.ritmo-sport .wp-block-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.ritmo-sport h3 { margin-top: 0; margin-bottom: 4px; font-size: 19px; }
.ritmo-sport p { margin-top: 0; color: var(--wp--preset--color--muted); font-size: 14px; }

.ritmo-more { margin-top: 16px !important; gap: 14px !important; }
.ritmo-card { background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 18px; padding: 20px; }
.ritmo-card > * { margin: 0 0 6px !important; }
.ritmo-card h3 { font-size: 18px; }
.ritmo-card p:last-child { color: var(--wp--preset--color--muted); font-size: 14px; margin: 0 !important; }
.ritmo-num { font-family: var(--wp--preset--font-family--inter); font-weight: 700; font-size: 13px; color: var(--wp--preset--color--red); }

/* =========================================================
   How it works
   ========================================================= */
.ritmo-steps { display: flex; flex-direction: column; gap: 14px; margin-top: 28px !important; }
.ritmo-steps > * { margin: 0 !important; }
.ritmo-step { position: relative; padding: 22px; padding-inline-start: 86px; background: var(--wp--preset--color--offwhite); border-radius: 20px; border: 1px solid var(--wp--preset--color--line); }
.ritmo-step > * { margin: 0 !important; }
.ritmo-step h3 { font-size: 20px; margin-bottom: 4px !important; }
.ritmo-step p:not(.ritmo-step-num) { color: var(--wp--preset--color--muted); }
.ritmo-step-num {
	position: absolute; inset-inline-start: 22px; top: 22px; width: 46px; height: 46px; border-radius: 14px;
	background: var(--wp--preset--color--navy); color: #fff; display: flex; align-items: center; justify-content: center;
	font-family: var(--wp--preset--font-family--inter); font-weight: 700; font-size: 20px;
}
.ritmo-step:last-child .ritmo-step-num { background: var(--wp--preset--color--red); }
.ritmo-photo { margin: 0 !important; }
.ritmo-photo img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; border-radius: 28px; display: block; box-shadow: 0 30px 60px rgba(11, 16, 20, 0.22); }

/* =========================================================
   App screens gallery
   ========================================================= */
.ritmo-app { overflow: hidden; }
.ritmo-screens {
	display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory;
	margin-top: 40px !important; padding-bottom: 12px;
	scrollbar-width: thin; scrollbar-color: #3A4048 transparent;
}
.ritmo-screen { flex: 0 0 240px; scroll-snap-align: start; margin: 0 !important; }
.ritmo-screen > * { margin: 0 !important; }
.ritmo-screen h3 { margin-top: 18px !important; font-size: 18px; }
.ritmo-screen p { color: #9AA2AC; font-size: 14px; }
.ritmo-phone { margin: 0 !important; }
.ritmo-phone img {
	display: block; width: 100%; background: #fff;
	border: 8px solid #1E242B; border-radius: 34px;
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

/* =========================================================
   Plans (app style)
   ========================================================= */
.ritmo-plans { align-items: stretch !important; margin-top: 36px !important; }
.ritmo-plan {
	border-radius: 22px; padding: 32px; height: 100%;
	display: flex; flex-direction: column; border: 1px solid var(--wp--preset--color--line);
}
.ritmo-plan.is-featured-plan { background: var(--wp--preset--color--red-tint); border: 1.5px solid var(--wp--preset--color--red); }
.ritmo-plan h3 { margin: 0; font-size: 24px; }
.ritmo-plan-desc { color: var(--wp--preset--color--muted); margin-top: 4px !important; }
.ritmo-badge {
	align-self: flex-start; background: #FBE3E7; color: var(--wp--preset--color--red);
	font-size: 13px; font-weight: 700; padding: 4px 14px; border-radius: 999px; margin: 0 0 6px !important;
}
.ritmo-price { font-family: var(--wp--preset--font-family--inter); font-weight: 700; font-size: 52px; line-height: 1.1; margin: 8px 0 !important; padding-bottom: 18px; border-bottom: 1px solid var(--wp--preset--color--line); }
.ritmo-plan.is-featured-plan .ritmo-price { color: var(--wp--preset--color--red); }
.ritmo-price span { font-family: var(--wp--preset--font-family--plex); font-size: 16px; font-weight: 400; color: var(--wp--preset--color--muted); }
.ritmo-plan .wp-block-buttons { margin-top: auto !important; padding-top: 8px; }
.ritmo-plan .wp-block-button, .ritmo-plan .wp-block-button__link { width: 100%; text-align: center; box-sizing: border-box; }
.ritmo-plan .is-style-outline .wp-block-button__link { color: var(--wp--preset--color--navy); border-color: #B9BEC4; }

.ritmo-checks { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 12px; }
.ritmo-checks li { position: relative; padding-inline-start: 30px; }
.ritmo-checks li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--wp--preset--color--red); font-weight: 700; }

/* =========================================================
   Tripoli / panels / values
   ========================================================= */
.ritmo-chip { margin: 0 !important; padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 17px; border: 1px solid #343B44; color: var(--wp--preset--color--mist); }
.ritmo-chip.is-live { background: var(--wp--preset--color--red); border-color: transparent; color: #fff; }

.ritmo-panel { border-radius: 26px; padding: 48px; height: 100%; display: flex; flex-direction: column; }
.ritmo-panel .wp-block-buttons { margin-top: auto !important; padding-top: 12px; }
.ritmo-panel.has-white-background-color { border: 1px solid var(--wp--preset--color--line); }

.ritmo-value { display: flex; align-items: center; gap: 16px; padding: 24px; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 18px; }
.ritmo-value svg { flex: none; stroke: var(--wp--preset--color--red); }
.ritmo-value p { margin: 0; font-weight: 700; font-size: 20px; }

/* =========================================================
   FAQ
   ========================================================= */
.ritmo-faq .wp-block-details { border-bottom: 1px solid var(--wp--preset--color--line); padding: 20px 0; margin: 0 !important; }
.ritmo-faq summary { font-weight: 700; font-size: 19px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; min-height: 44px; align-items: center; }
.ritmo-faq summary::-webkit-details-marker { display: none; }
.ritmo-faq summary::after { content: "+"; color: var(--wp--preset--color--red); font-size: 26px; line-height: 1; flex: none; }
.ritmo-faq details[open] summary::after { content: "−"; }
.ritmo-faq details p { color: var(--wp--preset--color--muted); font-size: 17px; margin-top: 12px; }

/* =========================================================
   Download CTA / Footer
   ========================================================= */
.ritmo-cta { border-radius: 32px; padding: 0; overflow: hidden; }
.ritmo-cta > .wp-block-columns { gap: 0 !important; margin: 0; align-items: stretch !important; }
.ritmo-cta > .wp-block-columns > .wp-block-column:first-child { padding: 64px 48px; align-self: center; }
.ritmo-cta-photo { margin: 0 !important; height: 100%; }
.ritmo-cta-photo img { width: 100%; height: 100%; min-height: 380px; object-fit: cover; object-position: center 25%; display: block; }

.ritmo-footer { padding-top: 56px; padding-bottom: 32px; color: var(--wp--preset--color--mist); }
.ritmo-footer a { color: var(--wp--preset--color--mist); text-decoration: none; }
.ritmo-footer a:hover { color: #fff; }
.ritmo-footer h4 { color: #fff; font-size: 17px; margin-bottom: 8px; }
.ritmo-footer p { margin: 4px 0; }
.ritmo-footer .ritmo-logo img { width: 140px; }
.ritmo-footer-bottom { border-top: 1px solid #1C2229; padding-top: 20px; margin-top: 32px !important; font-size: 14px; color: #8A929C; }

.ritmo-sticky { display: none !important; }

/* =========================================================
   Tablet
   ========================================================= */
@media (max-width: 1024px) {
	.ritmo-hero-badge { inset-inline-end: 8px; }
	.ritmo-sports { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
	.ritmo-more { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* =========================================================
   Phone — app-like layout
   ========================================================= */
@media (max-width: 781px) {
	body { font-size: 16px; padding-bottom: 84px; }
	.ritmo-section { padding-top: 56px; padding-bottom: 56px; }
	h2.wp-block-heading { font-size: 30px !important; line-height: 1.3; }
	.ritmo-muted { font-size: 16px; }

	.ritmo-header-bar { padding-top: 10px; padding-bottom: 10px; }
	.ritmo-logo img { width: 112px; }
	.ritmo-header-bar .wp-block-buttons { display: none; }

	/* Hero: full-bleed photo with text over it, like the app splash */
	.ritmo-hero { padding-top: 0; padding-bottom: 0; min-height: calc(100svh - 60px); display: flex; align-items: flex-end; }
	.ritmo-hero > .wp-block-columns { position: static; width: 100%; }
	.ritmo-hero-visual { position: absolute !important; inset: 0; margin: 0 !important; z-index: 0; }
	.ritmo-hero-visual::before, .ritmo-hero-badge { display: none !important; }
	.ritmo-hero-photo, .ritmo-hero-photo img { height: 100%; width: 100%; }
	.ritmo-hero-photo img { aspect-ratio: auto; border-radius: 0; box-shadow: none; object-position: 35% 15%; }
	.ritmo-hero::after {
		content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
		background: linear-gradient(to bottom, rgba(5, 8, 10, 0.05) 10%, rgba(5, 8, 10, 0.7) 45%, #05080A 72%);
	}
	.ritmo-hero-text { position: relative; z-index: 1; padding-top: 38svh; padding-bottom: 36px; text-align: center; }
	.ritmo-hero .ritmo-eyebrow { text-align: center; font-size: 11px; letter-spacing: 0.22em; }
	.ritmo-hero h1 { font-size: 42px !important; }
	.ritmo-hero .ritmo-lead { font-size: 16px; margin-inline: auto; }
	.ritmo-store-buttons { flex-direction: column; gap: 12px !important; }
	.ritmo-store-buttons .wp-block-button, .ritmo-store-buttons .wp-block-button__link { width: 100%; text-align: center; box-sizing: border-box; }
	.ritmo-store-buttons .wp-block-button__link { padding-top: 17px; padding-bottom: 17px; font-size: 17px; border-radius: 14px; }
	.ritmo-stats { gap: 8px; margin-inline: auto; text-align: center; }
	.ritmo-stat-num { font-size: 20px; }
	.ritmo-stat-label { font-size: 12px; }

	/* Swipeable carousels */
	.ritmo-scroller {
		display: flex !important; flex-wrap: nowrap !important;
		overflow-x: auto; overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
		gap: 14px !important; margin-inline: -24px !important; padding-inline: 24px !important; padding-bottom: 8px;
		scrollbar-width: none;
	}
	.ritmo-scroller::-webkit-scrollbar { display: none; }
	.ritmo-scroller > * { scroll-snap-align: center; margin: 0 !important; }
	.ritmo-sports > * { flex: 0 0 74% !important; }
	.ritmo-more > * { flex: 0 0 44% !important; }
	.ritmo-sport:hover { transform: none; box-shadow: none; }

	.ritmo-screens { gap: 16px; margin-inline: -24px !important; padding-inline: 24px !important; scrollbar-width: none; }
	.ritmo-screens::-webkit-scrollbar { display: none; }
	.ritmo-screen { flex: 0 0 62%; scroll-snap-align: center; }

	.wp-block-columns.ritmo-plans { flex-wrap: nowrap !important; }
	.ritmo-plans > .wp-block-column { flex: 0 0 86% !important; }
	.ritmo-plans > .wp-block-column.is-featured { order: -1; }
	.ritmo-plan { padding: 26px; }
	.ritmo-price { font-size: 44px; }

	.ritmo-photo img { aspect-ratio: 4 / 3.4; border-radius: 22px; }
	.ritmo-step { padding: 18px; padding-inline-start: 74px; }
	.ritmo-step-num { width: 40px; height: 40px; font-size: 18px; inset-inline-start: 18px; top: 18px; }
	.ritmo-step h3 { font-size: 18px; }

	.ritmo-panel { padding: 28px; border-radius: 22px; }
	.ritmo-chip { font-size: 15px; padding: 10px 16px; }
	.ritmo-cta { border-radius: 24px; }
	.ritmo-cta > .wp-block-columns { flex-direction: column-reverse; }
	.ritmo-cta > .wp-block-columns > .wp-block-column:first-child { padding: 32px 24px 36px; }
	.ritmo-cta-photo img { min-height: 0; aspect-ratio: 4 / 3; }
	.ritmo-faq summary { font-size: 17px; }

	.ritmo-section.is-tight .wp-block-columns { flex-wrap: nowrap !important; gap: 10px !important; }
	.ritmo-section.is-tight .wp-block-column { flex: 1 1 0 !important; }
	.ritmo-value { flex-direction: column !important; text-align: center; gap: 8px; padding: 16px 8px; }
	.ritmo-value svg { width: 32px; height: 32px; }
	.ritmo-value p { font-size: 15px; }

	.ritmo-footer > .wp-block-columns { flex-wrap: wrap !important; }
	.ritmo-footer > .wp-block-columns > .wp-block-column:first-child { flex-basis: 100% !important; }
	.ritmo-footer > .wp-block-columns > .wp-block-column:not(:first-child) { flex: 1 1 40% !important; }
	.ritmo-footer-bottom { flex-direction: column; align-items: flex-start !important; gap: 6px !important; }

	/* Sticky app bar */
	.ritmo-sticky {
		display: flex !important; position: fixed; z-index: 60;
		left: 12px; right: 12px; bottom: 12px; margin: 0 !important;
		padding: 10px 16px; border-radius: 18px; align-items: center; gap: 12px;
		box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28); color: var(--wp--preset--color--navy);
		padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	}
	.ritmo-sticky p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--wp--preset--color--muted); }
	.ritmo-sticky p strong { color: var(--wp--preset--color--navy); font-size: 15px; }
	.ritmo-sticky .wp-block-buttons { margin: 0 !important; flex: none; }
	.ritmo-sticky .wp-block-button__link { padding: 12px 20px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.ritmo-sport { transition: none; }
}

@media (max-width: 781px) {
	.ritmo-cta .wp-block-buttons { flex-direction: column; }
	.ritmo-cta .wp-block-button, .ritmo-cta .wp-block-button__link { width: 100%; text-align: center; box-sizing: border-box; }
	.ritmo-footer .ritmo-eyebrow { font-size: 11px; letter-spacing: 0.18em; }
}
