/*
Theme Name: OSP — قواتنا الناعمة
Theme URI: https://osp.com.sa
Author: OSP
Description: WordPress block theme for OSP (قواتنا الناعمة) — Saudi soft-power / cultural-media platform. RTL Arabic. Built from the approved Figma design.
Version: 2.0.0
Requires at least: 6.5
Tested up to: 6.6
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: osp
Tags: rtl-language-support, block-templates, full-site-editing, custom-colors, custom-fonts
*/

/* ============================================================
   OSP — global resets
   ============================================================ */
html { direction: rtl; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.wp-site-blocks > footer { margin-block-start: 0; }
.wp-site-blocks > * { margin-block-start: 0; }

/* Kashida-extended display headings */
h1.wp-block-heading,
h2.wp-block-heading,
.osp-display {
  font-feature-settings: "kern" 1, "liga" 1;
  letter-spacing: 0.012em;
}

/* ============================================================
   OSP — header
   ============================================================ */
.osp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #EAEAEA;
  padding: 14px 28px;
}
.osp-header .osp-nav a {
  color: #14140F;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.osp-header .osp-nav a:hover {
  background: #EAF7BE;
  color: #286131;
}
.osp-header .osp-logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.osp-header .osp-cta a {
  background: #99BD3E !important;
  color: #14140F !important;
  border-radius: 999px;
  padding: 10px 22px !important;
  font-weight: 600;
}
.osp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #F4F4F4;
  color: #14140F;
  text-decoration: none;
  font-size: 1.1rem;
}
.osp-icon-btn:hover { background: #EAF7BE; }

/* ============================================================
   OSP — hero / cover blocks
   ============================================================ */
.osp-hero {
  min-height: 70vh;
}
.osp-hero h1 {
  color: #ffffff !important;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.osp-hero p {
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.osp-hero-band {
  min-height: 38vh;
}
.osp-hero-band h1 { color: #ffffff !important; }

/* ============================================================
   OSP — section rhythm
   ============================================================ */
.osp-section {
  padding: clamp(4rem, 9vw, 8rem) clamp(1.25rem, 4vw, 3rem);
}
.osp-section-tight {
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
}
.osp-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #286131;
  background: #EAF7BE;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 1rem;
}

/* ============================================================
   OSP — cards
   ============================================================ */
.osp-card {
  background: #FAFAF9;
  border: 1px solid #DEDEDE;
  border-radius: 28px;
  padding: 1.75rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  height: 100%;
}
.osp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(20, 20, 15, 0.08);
  border-color: #99BD3E;
}
.osp-card img,
.osp-card .wp-block-image img {
  border-radius: 18px;
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.osp-card.osp-card-dark {
  background: #033F32;
  border-color: #033F32;
  color: #ffffff;
}
.osp-card.osp-card-dark h3,
.osp-card.osp-card-dark h4 { color: #ffffff !important; }
.osp-card.osp-card-dark p { color: #E8FF9C !important; }

.osp-stat {
  background: #FAFAF9;
  border: 1px solid #DEDEDE;
  border-radius: 28px;
  padding: 2rem 1.5rem;
  text-align: center;
}
.osp-stat .osp-stat-num {
  display: block;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: #286131;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.osp-stat .osp-stat-label {
  color: #14140F;
  font-weight: 600;
  margin-top: 0.5rem;
}
.osp-stat .osp-stat-sub {
  color: #7F7F80;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* Equal cards row */
.equal-cards > .wp-block-column {
  display: flex;
  flex-direction: column;
  flex-grow: 0;
}
.equal-cards > .wp-block-column > .wp-block-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.equal-cards .cta-bottom {
  margin-top: auto;
  justify-content: center;
}

/* ============================================================
   OSP — vertical progress rails (3px green)
   ============================================================ */
.osp-rail {
  position: relative;
  padding-inline-start: 1.5rem;
}
.osp-rail::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 3px;
  background: linear-gradient(180deg, #99BD3E 0%, #286131 100%);
  border-radius: 999px;
}

/* ============================================================
   OSP — newsletter card
   ============================================================ */
.osp-newsletter {
  background: linear-gradient(135deg, #286131 0%, #033F32 100%);
  border-radius: 28px;
  padding: clamp(2rem, 4vw, 3.5rem);
  color: #ffffff;
}
.osp-newsletter h2,
.osp-newsletter h3 { color: #ffffff !important; }
.osp-newsletter p { color: #E8FF9C !important; }
.osp-newsletter .osp-field {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 6px;
  gap: 6px;
}
.osp-newsletter .osp-field .osp-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: #ffffff;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}
.osp-newsletter .osp-field .osp-input::placeholder { color: rgba(255,255,255,0.65); }
.osp-newsletter .osp-field .wp-block-button__link,
.osp-newsletter .osp-field .osp-submit {
  background: #99BD3E;
  color: #14140F;
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 600;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

/* ============================================================
   OSP — marquee (auto-scrolling carousel)
   ============================================================ */
.osp-marquee {
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.osp-marquee .osp-marquee-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: osp-scroll 36s linear infinite;
}
.osp-marquee:hover .osp-marquee-track { animation-play-state: paused; }
@keyframes osp-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(50%); }
}
.osp-marquee-card {
  width: 360px;
  flex-shrink: 0;
  background: #FAFAF9;
  border: 1px solid #DEDEDE;
  border-radius: 28px;
  overflow: hidden;
}
.osp-marquee-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.osp-marquee-card .osp-marquee-body { padding: 1.25rem 1.5rem; }
.osp-marquee-card h4 { margin: 0 0 0.5rem 0; color: #286131; }
.osp-marquee-card p  { margin: 0; color: #14140F; font-size: 0.95rem; }

/* RTL marquee — scroll right-to-left feels natural in LTR; for RTL we keep it */
[dir="rtl"] .osp-marquee .osp-marquee-track { animation-direction: reverse; }

/* ============================================================
   OSP — footer
   ============================================================ */
.osp-footer {
  min-height: 36vh;
  color: #ffffff;
}
.osp-footer h2, .osp-footer h3, .osp-footer h4 { color: #ffffff !important; }
.osp-footer p, .osp-footer li, .osp-footer a { color: #E8FF9C !important; }
.osp-footer a { text-decoration: none; }
.osp-footer a:hover { color: #D5FF45 !important; }
.osp-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.osp-footer ul li { padding: 6px 0; }
.osp-footer .osp-social a {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  margin-inline-end: 6px;
}
.osp-footer .osp-social a:hover {
  background: #99BD3E;
  color: #14140F !important;
}
.osp-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.25rem;
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

/* ============================================================
   OSP — podcast episode card
   ============================================================ */
.osp-podcast-card {
  background: #033F32;
  color: #ffffff;
  border-radius: 28px;
  padding: 1.25rem;
  height: 100%;
}
.osp-podcast-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 1rem;
}
.osp-podcast-card h4 { color: #ffffff !important; margin: 0 0 0.5rem; font-size: 1.05rem; }
.osp-podcast-card p  { color: #E8FF9C !important; font-size: 0.9rem; margin: 0; }
.osp-podcast-card .osp-duration {
  display: inline-block;
  background: #99BD3E;
  color: #14140F;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* ============================================================
   OSP — pillar card (vertical photo card with overlay label)
   ============================================================ */
.osp-pillar {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  min-height: 320px;
  background: #033F32;
}
.osp-pillar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.osp-pillar .osp-pillar-label {
  position: relative;
  z-index: 2;
  margin: auto 1rem 1rem;
  padding: 1rem 1.25rem;
  background: rgba(3, 63, 50, 0.85);
  color: #ffffff;
  border-radius: 18px;
  text-align: center;
  font-weight: 600;
  font-size: 1.05rem;
  align-self: flex-end;
}
.osp-pillar-inner {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   OSP — partnership type card
   ============================================================ */
.osp-partner-card {
  background: #FAFAF9;
  border: 1px solid #DEDEDE;
  border-radius: 24px;
  padding: 1.5rem;
  height: 100%;
}
.osp-partner-card h4 { color: #286131 !important; margin-top: 0; }

/* ============================================================
   OSP — form
   ============================================================ */
.osp-form-field {
  display: block;
  margin-bottom: 1rem;
}
.osp-form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #14140F;
}
.osp-form-field input,
.osp-form-field textarea,
.osp-form-field select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #DEDEDE;
  border-radius: 14px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  color: #14140F;
}
.osp-form-field textarea { min-height: 140px; }
.osp-form-field input:focus,
.osp-form-field textarea:focus,
.osp-form-field select:focus {
  outline: none;
  border-color: #99BD3E;
  box-shadow: 0 0 0 3px #EAF7BE;
}

/* ============================================================
   OSP — animations
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  animation: ospFadeUp 0.7s ease forwards;
}
@keyframes ospFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hover-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(20, 20, 15, 0.10);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  animation: ospFadeUp 0.55s ease forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.55s; }

/* ============================================================
   OSP — accessibility
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll,
  .fade-up,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
  }
  .osp-marquee .osp-marquee-track {
    animation: none !important;
  }
}

/* Keep animated content visible in the block editor */
.editor-styles-wrapper .fade-up,
.editor-styles-wrapper .animate-on-scroll,
.editor-styles-wrapper .stagger-children > * {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

/* ============================================================
   OSP — small utility helpers
   ============================================================ */
.osp-divider {
  border: 0;
  height: 1px;
  background: #DEDEDE;
  margin: 2rem 0;
}
.osp-text-lime  { color: #99BD3E !important; }
.osp-text-forest { color: #286131 !important; }
.osp-bg-surface { background: #F4F4F4; }
.osp-bg-lime-wash { background: #EAF7BE; }
.osp-bg-forest-deep { background: #033F32; color: #ffffff; }

.osp-bookend {
  background: linear-gradient(135deg, #033F32 0%, #286131 100%);
  color: #ffffff;
  border-radius: 0;
  padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
}
.osp-bookend h2 { color: #ffffff !important; }
.osp-bookend p  { color: #E8FF9C !important; }

/* Image-text split (vision blocks) */
.osp-split-media img {
  border-radius: 24px;
  width: 100%;
  height: auto;
  display: block;
}
