/**
 * Keeply Theme — App CSS
 * Custom properties, base resets, and utility overrides.
 * Tailwind Play CDN handles utility classes.
 */

/* ── Custom properties ─────────────────────────── */
:root {
  --color-accent:       #22c55e;
  --color-accent-hover: #16a34a;
  --font-sans:          "Inter", ui-sans-serif, system-ui, sans-serif;
  --radius-card:        1rem;
  --transition-base:    150ms ease;
}

/* ── Base ──────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus visible ring */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Header scroll shadow ──────────────────────── */
.header-scrolled {
  box-shadow: 0 1px 20px rgba(0,0,0,.07);
}

/* ── Stretched link utility ────────────────────── */
.stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ── Scroll animations ─────────────────────────── */
.keeply-fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: keeplyFadeIn 0.55s ease forwards;
}
.keeply-delay-1 { animation-delay: 0.10s; }
.keeply-delay-2 { animation-delay: 0.22s; }
.keeply-delay-3 { animation-delay: 0.34s; }
.keeply-delay-4 { animation-delay: 0.50s; }

@keyframes keeplyFadeIn {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Intersection observer based reveal */
.keeply-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.keeply-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Prose overrides ───────────────────────────── */
.keeply-prose {
  color: #374151; /* gray-700 */
}

.keeply-prose h2 {
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
}

.keeply-prose h3 {
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
}

.keeply-prose p {
  margin-bottom: 1.25em;
  line-height: 1.8;
}

.keeply-prose a {
  color: var(--color-accent);
  text-decoration: none;
}
.keeply-prose a:hover {
  text-decoration: underline;
}

.keeply-prose blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: #6b7280;
  font-style: normal;
}

.keeply-prose ul,
.keeply-prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25em;
}
.keeply-prose li {
  line-height: 1.7;
  margin-bottom: 0.35em;
}

.keeply-prose img {
  border-radius: 12px;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  display: block;
}

.keeply-prose pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 1.5rem 0;
}

.keeply-prose code:not(pre code) {
  background: #f0fdf4;
  color: #15803d;
  padding: 0.15em 0.45em;
  border-radius: 5px;
  font-size: 0.875em;
}

/* ── Pagination ─────────────────────────────────── */
.keeply-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.keeply-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  border: 1px solid #e5e7eb;
  background: white;
  text-decoration: none;
  transition: border-color var(--transition-base), color var(--transition-base), background var(--transition-base);
}

.keeply-pagination .page-numbers:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.keeply-pagination .page-numbers.current {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.keeply-pagination .page-numbers.dots {
  border: none;
  background: none;
}

/* ── Search form ─────────────────────────────────── */
.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form .search-field {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #374151;
  background: white;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  font-family: var(--font-sans);
}

.search-form .search-field:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

.search-form .search-submit {
  padding: 0.625rem 1.25rem;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-base);
  font-family: var(--font-sans);
}

.search-form .search-submit:hover {
  background: var(--color-accent-hover);
}

/* ── WordPress alignment classes ──────────────────── */
.alignleft  { float: left;  margin-right: 1.5rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left:  1.5rem; margin-bottom: 1rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.alignwide { width: calc(100% + 4rem); margin-left: -2rem; }

/* ── WP block styles overrides ────────────────────── */
.wp-block-image img { border-radius: 12px; }
.wp-block-quote { border-left: 3px solid var(--color-accent); padding-left: 1.25rem; }
.wp-block-button__link {
  background: var(--color-accent) !important;
  border-radius: 12px !important;
  font-weight: 600;
  transition: background var(--transition-base);
}
.wp-block-button__link:hover { background: var(--color-accent-hover) !important; }

/* ── Utility ─────────────────────────────────────── */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Scrollbar (webkit) ──────────────────────────── */
::-webkit-scrollbar { width: 8px; background: #f9fafb; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
