/*
 * Krasner Team theme for Grav (child of Quark 2)
 * ------------------------------------------------------------------
 * This file loads last, so it wins over Quark 2 without !important.
 * Palette family follows the Mission Loans brand colors. Logos, photos,
 * icon artwork and wording are the Krasner Team's own.
 *
 * Contents
 *   1. Brand tokens
 *   2. Base type
 *   3. Header, logo and navigation
 *   4. Buttons
 *   5. Hero and gradient band
 *   6. Headings and rules
 *   7. Blog cards and tags
 *   8. Article body
 *   9. Call-to-action band and footer
 *  10. Focus, motion and small screens
 */

/* ---------- 1. Brand tokens ---------- */

:root,
:root[data-theme='light'],
:root[data-theme='dark'] {
  --kt-navy: #2e466e;
  --kt-navy-deep: #1a263a;
  --kt-navy-band: #243352;
  --kt-indigo: #241f55;
  --kt-sky: #41add5;
  --kt-sky-deep: #1f7fa3; /* text-safe blue, about 4.5:1 on white */
  --kt-sky-wash: rgba(65, 173, 213, 0.16);
  --kt-orange: #fc833c;
  --kt-orange-press: #ea6f22;
  --kt-gray: #f4f4f4;
  --kt-ink: #2f3a4c;
  --kt-ink-soft: #566173;
  --kt-gradient: linear-gradient(120deg, #28789d 0%, #2e466e 46%, #241f55 100%);

  color-scheme: light;

  /* Quark 2 tokens re-pointed at the brand */
  --q2-bg: #ffffff;
  --q2-bg-elev: #ffffff;
  --q2-bg-muted: var(--kt-gray);
  --q2-bg-inverse: var(--kt-navy-deep);
  --q2-text: var(--kt-ink);
  --q2-text-strong: var(--kt-navy);
  --q2-text-muted: var(--kt-ink-soft);
  --q2-text-inverse: #ffffff;

  --q2-border-ring: rgba(46, 70, 110, 0.12);
  --q2-border-strong: rgba(46, 70, 110, 0.24);
  --q2-divider: rgba(46, 70, 110, 0.14);

  --q2-shadow-card:
    rgba(26, 38, 58, 0.06) 0 1px 2px, rgba(26, 38, 58, 0.12) 0 8px 22px -10px;
  --q2-shadow-raised:
    rgba(26, 38, 58, 0.08) 0 1px 2px, rgba(26, 38, 58, 0.18) 0 14px 30px -12px;
  --q2-shadow-hl: none;

  --q2-radius: 10px;
  --q2-radius-md: 16px;
  --q2-radius-lg: 24px;

  --q2-nav-bg: rgba(255, 255, 255, 0.96);
  --q2-nav-border: rgba(46, 70, 110, 0.14);
  --q2-header-height: 84px;

  --q2-accent: var(--kt-navy);
  --q2-accent-contrast: #ffffff;
  --q2-link: var(--kt-sky-deep);
  --q2-focus-ring: rgba(65, 173, 213, 0.6);

  --pico-font-family-display:
    'Poppins', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --pico-font-family-sans-serif:
    'Open Sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --pico-primary: var(--kt-navy);
  --pico-primary-hover: var(--kt-navy-deep);
  --pico-primary-background: var(--kt-navy);
  --pico-primary-border: var(--kt-navy);
  --pico-contrast: var(--kt-navy);
  --pico-contrast-hover: var(--kt-navy-deep);
}

/* ---------- 2. Base type ---------- */

html:root {
  font-size: 17px;
}
body {
  font-family: var(--pico-font-family-sans-serif);
  color: var(--q2-text);
  background: #ffffff;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--pico-font-family-display);
  color: var(--kt-navy);
}
h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
}
h3 {
  font-weight: 600;
}
h4,
h5,
h6 {
  font-weight: 600;
}
p,
li {
  line-height: 1.75;
}
.lead {
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--kt-ink-soft);
  letter-spacing: 0;
}
strong,
b {
  font-weight: 700;
}

/* ---------- 3. Header, logo and navigation ---------- */

#header {
  background: var(--q2-nav-bg);
  border-bottom: 1px solid var(--q2-nav-border);
}
.navbar-brand svg,
.navbar-brand svg * {
  fill: var(--kt-navy);
}
.navbar-brand img,
.navbar-brand svg {
  height: 64px;
  width: auto;
  transition: height 0.2s ease;
}
.header-animated.scrolled .navbar-brand svg,
.header-animated.scrolled .navbar-brand img {
  height: 52px;
}

.dropmenu a {
  font-family: var(--pico-font-family-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--kt-navy);
  border-radius: 0;
  letter-spacing: 0;
}
.dropmenu a:hover {
  background: var(--kt-gray);
  color: var(--kt-navy);
}
.dropmenu a.active,
.dropmenu a.active:hover {
  background: transparent;
  color: var(--kt-navy);
  box-shadow: inset 0 -3px 0 var(--kt-orange);
}

.mobile-logo svg,
.mobile-logo svg * {
  fill: var(--kt-navy);
}
.mobile-logo svg,
.mobile-logo img {
  height: 84px;
  width: auto;
}

/* ---------- 4. Buttons ---------- */

.btn,
a.btn,
button.btn,
button:not([role='button']).btn,
[type='submit'].btn,
.button-wrapper button,
.button-wrapper [type='submit'] {
  font-family: var(--pico-font-family-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.8rem 1.65rem;
  border-radius: var(--q2-radius-pill, 9999px);
  color: #ffffff;
  background: var(--kt-navy);
  box-shadow: none;
}
.btn:hover,
a.btn:hover,
.button-wrapper button:hover,
.button-wrapper [type='submit']:hover {
  opacity: 1;
  background: var(--kt-navy-deep);
  color: #ffffff;
}
.btn.btn-cta {
  background: var(--kt-orange);
  color: var(--kt-navy-deep);
}
.btn.btn-cta:hover {
  background: var(--kt-orange-press);
  color: var(--kt-navy-deep);
}
.btn.btn-ghost,
.btn.btn-outline {
  background: #ffffff;
  color: var(--kt-navy);
  box-shadow: inset 0 0 0 2px var(--kt-navy);
}
.btn.btn-ghost:hover,
.btn.btn-outline:hover {
  background: var(--kt-navy);
  color: #ffffff;
}

/* ---------- 5. Hero and gradient band ---------- */

.hero {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  background-color: var(--kt-navy);
  background-image: var(--kt-gradient);
  color: #ffffff;
}
.hero h1,
.hero h2,
.hero h3,
.hero p {
  color: #ffffff;
}
.hero .lead {
  color: rgba(255, 255, 255, 0.9);
}
.hero .btn {
  background: var(--kt-orange);
  color: var(--kt-navy-deep);
}
.hero .btn:hover {
  background: var(--kt-orange-press);
  color: var(--kt-navy-deep);
}
.hero #to-start {
  color: #ffffff;
}

/* Marker-pen underline. Use once per page at most:
   <span class="swipe">key words</span> */
.swipe {
  background: linear-gradient(
    transparent 62%,
    rgba(65, 173, 213, 0.5) 62% 90%,
    transparent 90%
  );
  padding-inline: 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- 6. Headings and rules ---------- */

/* Replace Quark's small bar above h2 with a short orange rule below it */
h2::before {
  display: none;
}
h2::after {
  content: '';
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 0.65rem;
  border-radius: 2px;
  background: var(--kt-orange);
}
.text-center h2::after,
.hero h2::after,
.kt-cta h2::after {
  margin-inline: auto;
}
.card-title h2::after,
.card-title h3::after,
.kt-footer-heading::after {
  display: none;
}
h1 + h2 {
  color: var(--kt-sky-deep);
}

/* ---------- 7. Blog cards and tags ---------- */

.card {
  border: 1px solid var(--q2-border-ring);
  border-radius: var(--q2-radius-md);
  box-shadow: var(--q2-shadow-card);
  transition: border-color 0.15s ease;
}
.card:hover {
  transform: none;
  border-color: var(--kt-sky);
  box-shadow: var(--q2-shadow-card);
}
.card-title :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--pico-font-family-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--kt-navy);
}
.card-title a:hover {
  color: var(--kt-sky-deep);
}
.card-subtitle {
  color: var(--kt-ink-soft);
}
.card-subtitle .blog-date i {
  color: var(--kt-orange);
  opacity: 1;
}

.label,
a.label {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  margin: 0 0.35rem 0.35rem 0;
  border-radius: 9999px;
  background: var(--kt-sky-wash);
  color: var(--kt-navy);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
a.label:hover {
  background: var(--kt-navy);
  color: #ffffff;
}

/* ---------- 8. Article body ---------- */

.content-title,
.e-content,
.prev-next {
  max-width: 44rem;
  margin-inline: auto;
}
.content-title {
  padding: 0;
}
.content-title.text-center {
  text-align: left;
}
.content-title h1 {
  font-size: clamp(2rem, 2.4vw + 1rem, 2.85rem);
  margin-bottom: 0.75rem;
}
.content-title .blog-date {
  margin-right: 0.85rem;
  color: var(--kt-ink-soft);
  font-size: 0.9rem;
}
.content-title .blog-date i {
  color: var(--kt-orange);
}
.e-content a {
  text-decoration-color: var(--kt-sky);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.e-content a:hover {
  color: var(--kt-navy);
  text-decoration-color: var(--kt-orange);
}

/* Blockquotes double as "key takeaway" boxes */
blockquote {
  margin: 1.75rem 0;
  padding: 1.1rem 1.4rem;
  background: var(--kt-gray);
  border-left: 5px solid var(--kt-orange);
  border-radius: 0 var(--q2-radius) var(--q2-radius) 0;
  font-family: var(--pico-font-family-sans-serif);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--kt-ink);
}
blockquote p:last-child {
  margin-bottom: 0;
}

.markdown-alert {
  border-radius: var(--q2-radius);
}

table {
  font-size: 0.95rem;
}
th {
  font-family: var(--pico-font-family-display);
  color: var(--kt-navy);
}

input,
select,
textarea {
  border-radius: var(--q2-radius);
}

/* ---------- 9. Call-to-action band and footer ---------- */

.kt-cta {
  background-color: var(--kt-navy);
  background-image: var(--kt-gradient);
  color: #ffffff;
  text-align: center;
  padding-block: clamp(3rem, 7vw, 5rem);
}
.kt-cta h2 {
  color: #ffffff;
  margin-top: 0;
}
.kt-cta .lead {
  max-width: 46ch;
  margin-inline: auto;
  color: rgba(255, 255, 255, 0.92);
}
.kt-cta .btn {
  margin-top: 0.75rem;
}

#footer.kt-footer {
  padding: 0;
  background: var(--kt-navy-deep);
  color: #dbe3ef;
  border-top: 0;
  text-align: left;
  font-size: 0.92rem;
}
.kt-footer p,
.kt-footer li {
  color: inherit;
  font-size: inherit;
  line-height: 1.7;
}
#footer.kt-footer a {
  color: #ffffff;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 3px;
}
#footer.kt-footer a:hover {
  text-decoration-color: var(--kt-orange);
}
.kt-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-block: 3rem;
}
.kt-footer-logo {
  display: inline-block;
  margin-bottom: 1rem;
}
.kt-footer-logo svg,
.kt-footer-logo svg * {
  fill: #ffffff;
}
.kt-footer-logo svg {
  height: 96px;
  width: auto;
  display: block;
}
.kt-footer-heading {
  margin: 0 0 0.75rem;
  font-family: var(--pico-font-family-display);
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}
.kt-footer-heading::before {
  display: none;
}
.kt-footer-links ul {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
}
.kt-footer-links li {
  display: block;
  margin: 0 0 0.4rem;
  padding: 0;
}
.kt-footer-links a {
  display: inline;
  margin: 0;
  padding: 0;
}

.kt-legal {
  background: var(--kt-navy-band);
  color: #c9d3e3;
  padding-block: 1.5rem;
  font-size: 0.82rem;
  line-height: 1.6;
}
.kt-legal .container {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.kt-legal p {
  margin: 0;
  font-size: inherit;
  color: inherit;
}
.kt-eho {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
}

/* ---------- 10. Focus, motion and small screens ---------- */

:focus-visible {
  outline: 3px solid var(--kt-sky-deep);
  outline-offset: 2px;
}
.kt-cta :focus-visible,
.hero :focus-visible,
.kt-footer :focus-visible {
  outline-color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 720px) {
  .kt-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-block: 2.25rem;
  }
  .navbar-brand svg,
  .navbar-brand img {
    height: 52px;
  }
  .kt-legal .container {
    flex-direction: column;
  }
}
