/**
 * Sarkari Yojana Pro — Beauty Effects
 * ---------------------------------------------------------------------------
 * This file only loads when at least one effect is enabled in
 * Appearance → Customize → Design: Font & Size → ✨ Beauty Effects
 *
 * Every rule is scoped to a `body.sy-fx-*` class, so switching an effect off
 * in the Customizer switches its CSS off too — nothing leaks between effects.
 * All motion is disabled automatically for visitors who ask their OS for
 * reduced motion.
 */

/* ==========================================================================
   Shared tokens
   ========================================================================== */
:root {
  --sy-grad-from: #e65100;
  --sy-grad-to: #1b5e20;
  --sy-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sy-ring-pct: 0;
}

/* ==========================================================================
   1. Soft layered shadows
   ========================================================================== */
body.sy-fx-shadows {
  --sy-shadow:
    0 1px 2px rgba(17, 24, 39, 0.04),
    0 2px 6px rgba(17, 24, 39, 0.05),
    0 6px 16px rgba(17, 24, 39, 0.045);
  --sy-shadow-lg:
    0 2px 4px rgba(17, 24, 39, 0.05),
    0 8px 20px rgba(17, 24, 39, 0.07),
    0 20px 44px rgba(17, 24, 39, 0.09);
}

body.sy-fx-shadows.sy-dark {
  --sy-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.35);
  --sy-shadow-lg:
    0 4px 12px rgba(0, 0, 0, 0.5),
    0 18px 40px rgba(0, 0, 0, 0.45);
}

body.sy-fx-shadows .sy-card,
body.sy-fx-shadows .sy-widget,
body.sy-fx-shadows .sy-article,
body.sy-fx-shadows .sy-row {
  border-color: color-mix(in srgb, var(--sy-border) 70%, transparent);
}

/* ==========================================================================
   2. Hover animations
   ========================================================================== */
body.sy-fx-hover .sy-card {
  transition: transform 0.35s var(--sy-ease), box-shadow 0.35s var(--sy-ease),
    border-color 0.35s var(--sy-ease);
}
body.sy-fx-hover .sy-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--sy-shadow-lg);
  border-color: color-mix(in srgb, var(--sy-primary) 40%, var(--sy-border));
}

/* Thumbnail zoom inside cards */
body.sy-fx-hover .sy-card > a,
body.sy-fx-hover .sy-card > figure,
body.sy-fx-hover .sy-card .sy-thumb-link {
  overflow: hidden;
  display: block;
}
body.sy-fx-hover .sy-card img,
body.sy-fx-hover .sy-card .sy-auto-thumb {
  transition: transform 0.55s var(--sy-ease);
}
body.sy-fx-hover .sy-card:hover img,
body.sy-fx-hover .sy-card:hover .sy-auto-thumb {
  transform: scale(1.055);
}

/* Card title colour wipe */
body.sy-fx-hover .sy-card-title a {
  background-image: linear-gradient(var(--sy-primary), var(--sy-primary));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.35s var(--sy-ease), color 0.25s ease;
}
body.sy-fx-hover .sy-card-title a:hover {
  background-size: 100% 2px;
}

/* Animated underline on content links */
body.sy-fx-hover .sy-entry-content a:not(.sy-btn) {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s var(--sy-ease);
}
body.sy-fx-hover .sy-entry-content a:not(.sy-btn):hover {
  background-size: 0% 1px;
  text-decoration: none;
}

/* Menu underline slide */
body.sy-fx-hover .sy-nav > .sy-container > ul > li > a {
  position: relative;
}
body.sy-fx-hover .sy-nav > .sy-container > ul > li > a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 4px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  opacity: 0;
  transition: left 0.3s var(--sy-ease), right 0.3s var(--sy-ease), opacity 0.2s ease;
}
body.sy-fx-hover .sy-nav > .sy-container > ul > li > a:hover::after,
body.sy-fx-hover .sy-nav > .sy-container > ul > li.current-menu-item > a::after {
  left: 14%;
  right: 14%;
  opacity: 1;
}

/* Buttons */
body.sy-fx-hover .sy-btn {
  transition: transform 0.25s var(--sy-ease), box-shadow 0.25s var(--sy-ease),
    background 0.25s ease;
}
body.sy-fx-hover .sy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--sy-primary) 38%, transparent);
}
body.sy-fx-hover .sy-btn:active {
  transform: translateY(0);
}

/* Widget list items nudge */
body.sy-fx-hover .sy-widget li a,
body.sy-fx-hover .sy-tags a {
  transition: transform 0.25s var(--sy-ease), color 0.2s ease, border-color 0.2s ease;
  display: inline-block;
}
body.sy-fx-hover .sy-widget li a:hover {
  transform: translateX(4px);
}
body.sy-fx-hover .sy-tags a:hover {
  transform: translateY(-2px);
}

/* Post nav cards */
body.sy-fx-hover .sy-post-nav a {
  transition: transform 0.28s var(--sy-ease), border-color 0.28s ease, box-shadow 0.28s ease;
}
body.sy-fx-hover .sy-post-nav a:hover {
  transform: translateY(-3px);
  box-shadow: var(--sy-shadow);
}

/* ==========================================================================
   3. Gradient headings
   ========================================================================== */
body.sy-fx-gradient .sy-entry-title,
body.sy-fx-gradient .sy-section-title,
body.sy-fx-gradient .sy-empty h1 {
  background: linear-gradient(95deg, var(--sy-grad-from), var(--sy-grad-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Keep the little bar before section titles solid */
body.sy-fx-gradient .sy-section-title::before {
  background: linear-gradient(180deg, var(--sy-grad-from), var(--sy-grad-to));
  -webkit-text-fill-color: initial;
}

body.sy-fx-gradient .sy-site-title a {
  background: linear-gradient(95deg, var(--sy-grad-from), var(--sy-grad-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Gradient accent on the H2 blocks inside articles */
body.sy-fx-gradient .sy-entry-content h2 {
  border-left-color: transparent;
  border-image: linear-gradient(180deg, var(--sy-grad-from), var(--sy-grad-to)) 1;
  border-left-width: 4px;
  border-left-style: solid;
}

body.sy-fx-gradient .sy-widget-title {
  border-bottom-color: transparent;
  border-image: linear-gradient(90deg, var(--sy-grad-from), var(--sy-grad-to)) 1;
}

/* ==========================================================================
   4. Sticky glass header
   ========================================================================== */
body.sy-fx-sticky .sy-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}
body.sy-fx-sticky.admin-bar .sy-nav {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.sy-fx-sticky.admin-bar .sy-nav {
    top: 46px;
  }
}

body.sy-fx-sticky.sy-stuck .sy-nav {
  background: color-mix(in srgb, var(--sy-primary) 88%, transparent);
  box-shadow: 0 4px 20px rgba(17, 24, 39, 0.18);
}

@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  body.sy-fx-sticky.sy-stuck .sy-nav {
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
  }
}

/* Anchor targets must clear the sticky bar */
body.sy-fx-sticky {
  scroll-padding-top: 4.5rem;
}
body.sy-fx-sticky .sy-entry-content :is(h2, h3, h4, h5, h6)[id] {
  scroll-margin-top: 4.5rem;
}

/* ==========================================================================
   5. Reading progress bar
   ========================================================================== */
.sy-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  background: transparent;
  pointer-events: none;
}
body.admin-bar .sy-progress {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .sy-progress {
    top: 46px;
  }
}
.sy-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sy-grad-from), var(--sy-grad-to));
  border-radius: 0 3px 3px 0;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px color-mix(in srgb, var(--sy-grad-from) 60%, transparent);
}

/* ==========================================================================
   6. Scroll reveal
   ========================================================================== */
body.sy-fx-reveal .sy-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--sy-ease), transform 0.6s var(--sy-ease);
  will-change: opacity, transform;
}
body.sy-fx-reveal .sy-reveal.sy-in {
  opacity: 1;
  transform: none;
}

/* Stagger cards inside a grid */
body.sy-fx-reveal .sy-grid > .sy-reveal:nth-child(2) { transition-delay: 0.06s; }
body.sy-fx-reveal .sy-grid > .sy-reveal:nth-child(3) { transition-delay: 0.12s; }
body.sy-fx-reveal .sy-grid > .sy-reveal:nth-child(4) { transition-delay: 0.18s; }
body.sy-fx-reveal .sy-grid > .sy-reveal:nth-child(5) { transition-delay: 0.24s; }
body.sy-fx-reveal .sy-grid > .sy-reveal:nth-child(6) { transition-delay: 0.3s; }

/* ==========================================================================
   7. TOC scrollspy
   ========================================================================== */
body.sy-fx-scrollspy .sy-toc li {
  position: relative;
  transition: color 0.25s ease;
}
body.sy-fx-scrollspy .sy-toc a {
  transition: color 0.25s ease, font-weight 0.25s ease;
}
body.sy-fx-scrollspy .sy-toc li.sy-active > a {
  color: var(--sy-primary);
  font-weight: 800;
}
body.sy-fx-scrollspy .sy-toc li.sy-active::before {
  content: "";
  position: absolute;
  left: -1.05rem;
  top: 0.35em;
  bottom: 0.35em;
  width: 3px;
  border-radius: 3px;
  background: var(--sy-primary);
}

/* ==========================================================================
   8. Sticky sidebar
   ========================================================================== */
@media (min-width: 961px) {
  body.sy-fx-stickyside .sy-sidebar {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    scrollbar-width: thin;
  }
  body.sy-fx-stickyside.sy-fx-sticky .sy-sidebar {
    top: 4.5rem;
    max-height: calc(100vh - 5.5rem);
  }
  body.sy-fx-stickyside.admin-bar .sy-sidebar {
    top: calc(1rem + 32px);
  }
  body.sy-fx-stickyside .sy-sidebar::-webkit-scrollbar {
    width: 6px;
  }
  body.sy-fx-stickyside .sy-sidebar::-webkit-scrollbar-thumb {
    background: var(--sy-border);
    border-radius: 3px;
  }
}

/* ==========================================================================
   9. Button ripple
   ========================================================================== */
body.sy-fx-ripple .sy-btn,
body.sy-fx-ripple .comment-form .submit,
body.sy-fx-ripple .sy-search-form button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.sy-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  animation: sy-ripple-anim 0.6s var(--sy-ease) forwards;
  z-index: 0;
}
@keyframes sy-ripple-anim {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* ==========================================================================
   10. Smooth image fade-in
   ========================================================================== */
/* Images stay hidden only while JS is available to reveal them again —
   html.sy-js is set in <head> by inc/beauty.php. */
html.sy-js body.sy-fx-blurup img:not(.sy-loaded):not([src^="data:"]) {
  opacity: 0;
}
body.sy-fx-blurup img.sy-loaded {
  animation: sy-fade-in 0.65s var(--sy-ease) both;
}
@keyframes sy-fade-in {
  from {
    opacity: 0;
    transform: scale(1.015);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ==========================================================================
   11. Back-to-top progress ring
   ========================================================================== */
body.sy-fx-ring .sy-top-btn {
  background: var(--sy-primary);
  position: fixed;
}
body.sy-fx-ring .sy-top-btn::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    var(--sy-grad-to) calc(var(--sy-ring-pct) * 1%),
    color-mix(in srgb, var(--sy-text-muted) 25%, transparent) 0
  );
  z-index: -1;
}
body.sy-fx-ring .sy-top-btn {
  isolation: isolate;
  z-index: 90;
}

/* ==========================================================================
   12. Extra polish that rides along with any effect
   ========================================================================== */
.sy-ticker-label {
  background: linear-gradient(135deg, var(--sy-grad-from), var(--sy-grad-to));
}

body.sy-fx-shadows .sy-infobox {
  box-shadow: var(--sy-shadow);
}

body.sy-fx-hover .sy-pagination a.page-numbers {
  transition: transform 0.2s var(--sy-ease), background 0.2s ease, color 0.2s ease;
}
body.sy-fx-hover .sy-pagination a.page-numbers:hover {
  transform: translateY(-2px);
  background: var(--sy-primary);
  color: #fff;
}

body.sy-fx-hover .sy-dark-toggle {
  transition: transform 0.3s var(--sy-ease), border-color 0.2s ease;
}
body.sy-fx-hover .sy-dark-toggle:hover {
  transform: rotate(-18deg) scale(1.08);
  border-color: var(--sy-primary);
}

body.sy-fx-hover .sy-share a {
  transition: transform 0.22s var(--sy-ease), opacity 0.2s ease;
}
body.sy-fx-hover .sy-share a:hover {
  transform: translateY(-3px);
}

/* ==========================================================================
   13. Fallbacks — old browsers without color-mix()
   ========================================================================== */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  body.sy-fx-sticky.sy-stuck .sy-nav {
    background: var(--sy-primary);
  }
  body.sy-fx-hover .sy-btn:hover {
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.25);
  }
  body.sy-fx-hover .sy-card:hover {
    border-color: var(--sy-primary);
  }
  body.sy-fx-ring .sy-top-btn::before {
    background: conic-gradient(
      var(--sy-grad-to) calc(var(--sy-ring-pct) * 1%),
      rgba(128, 128, 128, 0.28) 0
    );
  }
}

/* ==========================================================================
   14. Respect "reduce motion"
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  body.sy-fx-reveal .sy-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  body.sy-fx-hover .sy-card:hover,
  body.sy-fx-hover .sy-btn:hover,
  body.sy-fx-hover .sy-post-nav a:hover,
  body.sy-fx-hover .sy-share a:hover,
  body.sy-fx-hover .sy-tags a:hover,
  body.sy-fx-hover .sy-pagination a.page-numbers:hover,
  body.sy-fx-hover .sy-widget li a:hover,
  body.sy-fx-hover .sy-dark-toggle:hover {
    transform: none;
  }
  body.sy-fx-hover .sy-card:hover img,
  body.sy-fx-hover .sy-card:hover .sy-auto-thumb {
    transform: none;
  }
  body.sy-fx-blurup img.sy-loaded {
    animation: none;
    opacity: 1;
  }
  .sy-ripple {
    display: none;
  }
  .sy-progress-bar {
    transition: none;
  }
}
