/* Shared controls for the main site. Existing sizes and actions stay in the page templates. */
body .btn,
body .donate-red-nav,
body .donate-floating,
body .back-to-top {
  --action-bg: #13794f;
  --action-hover: #075436;
  --action-shadow: #07543636;
  background: var(--action-bg) !important;
  border: 1px solid transparent !important;
  color: #fff !important;
  box-shadow: 0 3px 9px var(--action-shadow);
  transition: background-color .2s ease, box-shadow .22s ease, transform .22s ease;
}

body .btn.alt {
  --action-bg: #b54708;
  --action-hover: #843000;
  --action-shadow: #84300042;
}

body a.btn.campaign-cta {
  --action-bg: #1558a6;
  --action-hover: #103b75;
  --action-shadow: #103b7540;
  background: var(--action-bg) !important;
  color: #fff !important;
  border-color: transparent !important;
}

body .btn.donate-primary,
body .donate-red-nav,
body .donate-floating,
body .hero .heroaction .hero-donate {
  --action-bg: #c60027;
  --action-hover: #8c0022;
  --action-shadow: #8c002244;
  background: var(--action-bg) !important;
  color: #fff !important;
  border-color: transparent !important;
}

body :is(.btn, .donate-red-nav, .donate-floating, .back-to-top):is(:hover, :focus-visible),
body a.btn.campaign-cta:is(:hover, :focus-visible),
body .hero .heroaction .hero-donate:is(:hover, :focus-visible) {
  background: var(--action-hover) !important;
  color: #fff !important;
  box-shadow: 0 9px 20px var(--action-shadow);
}

@media (hover: hover) and (pointer: fine) {
  body :is(.btn, .donate-red-nav, .donate-floating, .back-to-top):not(:disabled):hover {
    transform: translateY(-3px);
  }
}

body :is(.btn, .donate-red-nav, .donate-floating, .back-to-top):not(:disabled):active {
  transform: scale(.97);
  box-shadow: 0 2px 4px var(--action-shadow);
}

body :is(.btn, .donate-red-nav, .donate-floating, .back-to-top, .nav-dropdown-toggle, .menu, summary, .pagination a):focus-visible {
  outline: 2px solid #146457;
  outline-offset: 4px;
}

@media screen {
  .hero .heroaction {
    background: radial-gradient(ellipse at 12% 20%, #d8f1e4, transparent 58%),
                radial-gradient(ellipse at 90% 85%, #e0edff, transparent 56%), #f6fbf8;
  }

  .hero .heroaction .actions a.btn { border-radius: 14px; }
  .intro h2 { text-wrap: balance; }
  .pagetitle h1 { text-wrap: balance; }

  .cards .item,
  .partner-card,
  .dari-about-content-card,
  .dari-contact-item,
  .faq details {
    transition: box-shadow .24s ease, border-color .24s ease, transform .24s ease;
  }

  .cards .item > a:first-child img { transition: filter .24s ease; }

  .cards .item:focus-within,
  .partner-card:focus-within,
  .faq details[open] {
    border-color: #81bca1;
    box-shadow: 0 9px 26px #10472c20;
  }

  .formcard {
    background: linear-gradient(155deg, #f7fcf9, #fff 65%);
    box-shadow: 0 10px 30px #10472c0d;
  }

  :is(.formcard, .filters) :is(input, select, textarea) {
    transition: border-color .18s ease, box-shadow .18s ease;
  }

  :is(.formcard, .filters) :is(input, select, textarea):focus-visible {
    border-color: #167452;
    outline: 2px solid transparent;
    box-shadow: 0 0 0 3px #16865d40;
  }

  header nav a,
  header nav .nav-dropdown-toggle,
  .pagination a,
  .faq summary {
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  }

  header .nav-dropdown-toggle[aria-expanded="true"] { background-color: #dcefe6; }
  .pagination a:hover, .faq summary:hover { color: #075436; background-color: #e8f6ed; }
}

@media (hover: hover) and (pointer: fine) {
  :is(.cards .item, .partner-card, .dari-about-content-card, .dari-contact-item):hover {
    transform: translateY(-4px);
    border-color: #81bca1;
    box-shadow: 0 12px 32px #10472c23;
  }

  .cards .item:hover > a:first-child img { filter: brightness(1.04); }
}

@keyframes dari-intro-in {
  from { opacity: .72; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@media screen and (prefers-reduced-motion: no-preference) {
  .hero .heroaction > :is(h1, p), .pagetitle h1 {
    animation: dari-intro-in .38s ease-out both;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body :is(.btn, .donate-red-nav, .donate-floating, .back-to-top, header nav a, .nav-dropdown-toggle, .pagination a, .faq details, .faq summary, .cards .item, .cards .item img, .partner-card, .dari-about-content-card, .dari-contact-item) {
    transition: none !important;
    transform: none !important;
  }
}
