/* ==========================================================================
   CoachLanding.com — Brand Overrides & Custom Styles
   Works alongside Tailwind CSS via CDN
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
  --color-charcoal: #2D2D2D;
  --color-cream: #FAF7F2;
  --color-sage: #7C9070;
  --color-sage-dark: #5F7355;
  --color-sage-light: #9AB08F;
  --color-warm-brown: #8B7355;
  --color-warm-brown-dark: #756044;
  --color-cream-dark: #F0EBE3;
  --color-white: #FFFFFF;
  --color-danger: #DC2626;
  --color-danger-dark: #B91C1C;
  --color-warning: #D97706;
  --color-info: #2563EB;

  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.10);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ---------- Base / Reset Additions ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- Selection Color ---------- */
::selection {
  background-color: rgba(124, 144, 112, 0.2);
  color: #2D2D2D;
}

/* ---------- Focus Ring for Accessibility ---------- */
*:focus-visible {
  outline: 2px solid #7C9070;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Smooth transitions on interactive elements ---------- */
a, button {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Line clamp utility (blog previews) ---------- */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Buttons (legacy support) ---------- */
.btn,
button[type="submit"],
input[type="submit"] {
  transition: background-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
}

.btn-primary {
  background-color: var(--color-sage);
  color: var(--color-white);
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--color-sage-dark);
}

.btn-secondary {
  background-color: var(--color-warm-brown);
  color: var(--color-white);
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
}

.btn-secondary:hover {
  background-color: var(--color-warm-brown-dark);
}

.btn-danger {
  background-color: var(--color-danger);
  color: var(--color-white);
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
}

.btn-danger:hover {
  background-color: var(--color-danger-dark);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-sage);
  border: 2px solid var(--color-sage);
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
}

.btn-outline:hover {
  background-color: var(--color-sage);
  color: var(--color-white);
}

/* ---------- Form Input Placeholder Styling ---------- */
input::placeholder,
textarea::placeholder {
  color: rgba(45, 45, 45, 0.35);
}

/* ---------- Honeypot Field (spam prevention) ---------- */
.honeypot-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
}

/* ---------- Flash Messages (legacy CSS-based) ---------- */
.flash-messages {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 28rem;
}

.flash-message {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  line-height: 1.4;
  box-shadow: var(--shadow-md);
  animation: flashSlideIn 0.3s ease forwards;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.flash-message.flash-dismiss {
  animation: flashSlideOut 0.3s ease forwards;
}

.flash-message .flash-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.flash-message .flash-close:hover {
  opacity: 1;
}

.flash-success {
  background-color: #ECFDF5;
  color: #065F46;
  border-left: 4px solid #10B981;
}

.flash-error {
  background-color: #FEF2F2;
  color: #991B1B;
  border-left: 4px solid #EF4444;
}

.flash-warning {
  background-color: #FFFBEB;
  color: #92400E;
  border-left: 4px solid #F59E0B;
}

.flash-info {
  background-color: #EFF6FF;
  color: #1E40AF;
  border-left: 4px solid #3B82F6;
}

@keyframes flashSlideIn {
  from {
    opacity: 0;
    transform: translateX(1rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes flashSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(1rem);
  }
}

/* ---------- Cards (legacy support) ---------- */
.card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: box-shadow var(--transition-base),
    transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-charcoal);
}

.card-body {
  font-size: 0.9375rem;
  color: #4B5563;
  line-height: 1.6;
}

/* ---------- Scroll-to-Top Button ---------- */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background-color: var(--color-sage);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity var(--transition-base),
    visibility var(--transition-base),
    transform var(--transition-base),
    background-color var(--transition-fast);
  z-index: 900;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background-color: var(--color-sage-dark);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: 2rem 0;
  list-style: none;
  padding: 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-charcoal);
  transition: background-color var(--transition-fast),
    color var(--transition-fast);
}

.pagination a:hover {
  background-color: #E5E7EB;
}

.pagination .active {
  background-color: var(--color-sage);
  color: var(--color-white);
}

.pagination .disabled {
  color: #9CA3AF;
  pointer-events: none;
}

/* ---------- Status Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-published {
  background-color: #D1FAE5;
  color: #065F46;
}

.badge-draft {
  background-color: #FEF3C7;
  color: #92400E;
}

.badge-revoked {
  background-color: #FEE2E2;
  color: #991B1B;
}

/* ---------- Prose / Article Content (Markdown blog posts) ---------- */
.prose {
  max-width: 72ch;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-charcoal);
}

.prose h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.2;
  color: var(--color-charcoal);
}

.prose h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: var(--color-charcoal);
}

.prose h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  color: var(--color-charcoal);
}

.prose h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--color-charcoal);
}

.prose p {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.prose a {
  color: var(--color-sage);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover {
  color: var(--color-sage-dark);
}

.prose strong {
  font-weight: 700;
}

.prose ul,
.prose ol {
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding-left: 1.75rem;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-bottom: 0.375rem;
}

.prose li > ul,
.prose li > ol {
  margin-top: 0.375rem;
  margin-bottom: 0;
}

.prose blockquote {
  border-left: 4px solid var(--color-sage);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background-color: rgba(124, 144, 112, 0.06);
  color: #4B5563;
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular,
    "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background-color: #F3F4F6;
  padding: 0.15em 0.35em;
  border-radius: var(--radius-sm);
  color: #B45309;
}

.prose pre {
  background-color: var(--color-charcoal);
  color: #E5E7EB;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.6;
  font-size: 0.875rem;
}

.prose pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}

.prose img {
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.prose figure {
  margin: 1.5rem 0;
}

.prose figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: #6B7280;
  margin-top: 0.5rem;
}

.prose hr {
  border: none;
  border-top: 1px solid #E5E7EB;
  margin: 2rem 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.prose thead th {
  background-color: #F9FAFB;
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 2px solid #E5E7EB;
}

.prose tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #E5E7EB;
}

.prose tbody tr:hover {
  background-color: #F9FAFB;
}

/* ---------- Utility Classes ---------- */
.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Custom Scrollbar (subtle) ---------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #FAF7F2;
}

::-webkit-scrollbar-thumb {
  background: #8B7355;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7C9070;
}

/* ---------- Responsive Typography ---------- */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  nav, footer, .no-print {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
}
